/* 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%;
}

/* ---------- 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 {
  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;
}

.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); }

/* ---------- 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); }

/* ---------- 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;
}

/* ---------- 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(4, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

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

.footer-cols h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.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;
}
