/* QuickAges shared design system: light, Google-search-inspired */
/* Font: Geist (Vercel, SIL OFL), self-hosted as a variable font so every weight comes from one file with no external font CDN dependency. */

@font-face {
  font-family: 'Geist';
  src: url('fonts/geist-variable.woff2') format('woff2-variations'), url('fonts/geist-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --text: #202124;
  --text-secondary: #5f6368;
  --text-muted: #80868b;
  --border: #dadce0;
  --border-light: #e8eaed;
  --accent: #1a73e8;
  --accent-hover: #1765cc;
  --accent-light: #e8f0fe;
  --accent-text: #174ea6;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(60, 64, 67, .12), 0 1px 3px 1px rgba(60, 64, 67, .08);
  --shadow-md: 0 1px 3px rgba(32, 33, 36, .1), 0 4px 12px rgba(32, 33, 36, .08);
  --shadow-hover: 0 2px 6px rgba(32, 33, 36, .12), 0 8px 24px rgba(32, 33, 36, .12);
  --max-width: 1080px;
  --font: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ---------- Menu button + nav drawer (all pages) ---------- */
.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.menu-btn:hover { background: var(--accent-light); border-color: transparent; }
.menu-btn svg { width: 20px; height: 20px; }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 90;
}

.nav-overlay.visible { opacity: 1; pointer-events: auto; }

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  width: min(340px, 88vw);
  background: var(--bg);
  box-shadow: -8px 0 30px rgba(32, 33, 36, .15);
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 91;
  display: flex;
  flex-direction: column;
}

.nav-drawer.open { transform: translateX(0); }

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.nav-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
}

.nav-close:hover { background: var(--bg-alt); }
.nav-close svg { width: 18px; height: 18px; }

.nav-drawer-body {
  padding: 10px 22px 30px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-drawer-section { padding: 18px 0; border-bottom: 1px solid var(--border-light); }
.nav-drawer-section:last-child { border-bottom: none; }

.nav-drawer-section h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.nav-drawer-section ul { list-style: none; }
.nav-drawer-section li { margin-bottom: 4px; }

.nav-drawer-section a {
  display: block;
  padding: 8px 4px;
  color: var(--text);
  border-radius: 6px;
}

.nav-drawer-section a:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }

.nav-drawer-section.muted p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* ---------- Search autocomplete dropdown ---------- */
.search-suggest {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  max-height: 340px;
  overflow-y: auto;
  z-index: 60;
  padding: 6px;
}

.search-suggest.visible { display: block; }

.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
}

.search-suggest-item:hover,
.search-suggest-item.active {
  background: var(--accent-light);
  text-decoration: none;
}

.search-suggest-item .icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-suggest-item .icon svg { width: 18px; height: 18px; }

.search-suggest-item .text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-suggest-item .title {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-suggest-item .cat {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo:hover { text-decoration: none; }

.logo span { color: var(--accent); }

.header-search {
  position: relative;
  flex: 1;
  max-width: 480px;
  margin-left: auto;
}

.header-search form {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 9px 18px;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.header-search form:focus-within {
  box-shadow: var(--shadow-sm);
  border-color: transparent;
}

.header-search input {
  border: none;
  outline: none;
  flex: 1;
  font-family: var(--font);
  font-size: 0.9rem;
  background: transparent;
  color: var(--text);
}

.header-search svg { flex-shrink: 0; color: var(--text-muted); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.header-nav a { color: var(--text-secondary); }
.header-nav a:hover { color: var(--text); text-decoration: none; }

@media (max-width: 640px) {
  .header-inner { gap: 12px; padding: 12px 16px; }
  .header-nav { display: none; }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 24px 0 8px;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Page hero (calculator pages) ---------- */
.page-hero { padding: 8px 0 28px; }

.page-hero h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.page-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 640px;
}

.updated-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.category-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-light);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 14px;
}

/* ---------- Calculator card ---------- */
.calculator-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 32px;
  margin-bottom: 28px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 560px) {
  .input-row { grid-template-columns: 1fr; }
}

.input-group { margin-bottom: 22px; }
.input-group:last-of-type { margin-bottom: 0; }

label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--text);
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

input[type="date"],
input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font);
  font-size: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
  margin-top: 8px;
}

.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { background: #185abc; }

.btn-secondary {
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--accent-light); }

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.btn-row .btn { margin-top: 0; flex: 1; }

@media (max-width: 480px) {
  .btn-row { flex-direction: column; }
}

/* ---------- Range slider ---------- */
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.slider-header label { margin-bottom: 0; }

.slider-value {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-text);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 100px;
  background: var(--border-light);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 100px;
  background: var(--border-light);
}

/* ---------- Status pill ---------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 12px;
}

.status-pill.status-green { background: #e6f4ea; color: #1e8e3e; }
.status-pill.status-yellow { background: #fef7e0; color: #b06000; }
.status-pill.status-red { background: #fce8e6; color: #c5221f; }

/* ---------- Dot grid visualization ---------- */
.dot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 18px;
  max-height: 220px;
  overflow: hidden;
}

.dot-grid .dot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  opacity: .75;
  flex-shrink: 0;
}

/* ---------- Results ---------- */
.results {
  display: none;
  margin-top: 24px;
  padding: 24px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
}

.results.visible { display: block; animation: fadeIn .35s ease-out; }

.result-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(26, 115, 232, .15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.result-item:last-child { border-bottom: none; }

.result-label { font-size: 0.9rem; color: var(--text-secondary); }

.result-value {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--accent-text);
  text-align: right;
}

.big-number {
  font-weight: 800;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  text-align: center;
  margin-bottom: 16px;
  color: var(--accent-text);
  letter-spacing: -0.01em;
}

/* ---------- Quick links / chips ---------- */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 8px;
}

.quick-link {
  padding: 9px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all .15s ease;
}

.quick-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ---------- Article / content sections ---------- */
.content-section {
  padding: 32px 0;
  border-top: 1px solid var(--border-light);
}

.content-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.content-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 20px 0 8px;
}

.content-section p, .content-section li {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.75;
}

.content-section p { margin-bottom: 14px; }
.content-section ul, .content-section ol { padding-left: 22px; margin-bottom: 14px; }
.content-section li { margin-bottom: 6px; }

.faq-item { margin-bottom: 20px; }
.faq-item:last-child { margin-bottom: 0; }
.faq-item h3 { color: var(--text); }

.source-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: -4px;
}

/* ---------- Shared "for fun" disclaimer, joke calculators only ---------- */
.disclaimer-note {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
}

/* ---------- Related calculators grid ---------- */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.calc-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}

.calc-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: transparent;
  text-decoration: none;
  transform: translateY(-2px);
}

.calc-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.calc-card .icon svg { width: 22px; height: 22px; }

.calc-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.calc-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---------- Blog ---------- */
.blog-hero { padding: 8px 0 28px; }

.blog-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.blog-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 640px;
}

.blog-grid {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.blog-card {
  display: block;
  padding: 24px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}

.blog-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: transparent;
  text-decoration: none;
  transform: translateY(-2px);
}

.blog-card .blog-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.blog-card .blog-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-light);
  padding: 3px 10px;
  border-radius: 100px;
}

.blog-card .blog-date { font-size: 0.8rem; color: var(--text-muted); }

.blog-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.blog-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.callout-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  margin: 8px 0 24px;
}

.callout-box p { margin: 0; color: var(--text); font-size: 0.98rem; }
.callout-box a { font-weight: 700; }

/* ---------- Ad slots ---------- */
.ad-slot {
  margin: 28px 0;
  text-align: center;
  min-height: 0;
}

.ad-slot ins.adsbygoogle { display: block; }

/* ---------- Footer ---------- */
footer.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  background: var(--bg-alt);
  padding: 48px 0 32px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr repeat(5, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

@media (max-width: 900px) {
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
}

.footer-cols h4 {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-light);
}

.footer-cols ul { list-style: none; }
.footer-cols li { margin-bottom: 10px; }
.footer-cols a { color: var(--text-secondary); font-size: 0.9rem; }
.footer-cols a:hover { color: var(--accent); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
