/* =============================================
   HowOldToday.net — Design System
   Light / Dark Theme Toggle
   ============================================= */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Serif+Display:ital@0;1&display=swap');

/* ---- CSS Variables: Light Theme (default) ---- */
:root {
  --bg-primary: #F7F8FC;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-tool: #F0F2FA;
  --border: #E2E6F0;
  --border-focus: #4A6CF7;

  --text-primary: #0F1524;
  --text-secondary: #4B5470;
  --text-muted: #8892AA;

  --accent: #4A6CF7;
  --accent-hover: #3558E8;
  --accent-light: #EEF1FE;
  --accent-gradient: linear-gradient(135deg, #4A6CF7 0%, #7B8FF7 100%);

  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;

  --shadow-sm: 0 1px 3px rgba(15,21,36,0.08);
  --shadow-md: 0 4px 16px rgba(15,21,36,0.10);
  --shadow-lg: 0 12px 40px rgba(15,21,36,0.13);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  --nav-bg: rgba(247,248,252,0.92);
  --hero-bg: linear-gradient(145deg, #EEF1FE 0%, #F7F8FC 60%, #E8F4FF 100%);
  --footer-bg: #0F1524;
  --footer-text: #8892AA;
}

/* ---- Dark Theme ---- */
[data-theme="dark"] {
  --bg-primary: #0C0F1A;
  --bg-secondary: #131726;
  --bg-card: #161B2E;
  --bg-tool: #1A2035;
  --border: #252D45;
  --border-focus: #4A6CF7;

  --text-primary: #EDF0F8;
  --text-secondary: #8892AA;
  --text-muted: #555E78;

  --accent: #5B7BFF;
  --accent-hover: #4A6CF7;
  --accent-light: #1A2035;
  --accent-gradient: linear-gradient(135deg, #4A6CF7 0%, #7B8FF7 100%);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.45);

  --nav-bg: rgba(12,15,26,0.95);
  --hero-bg: linear-gradient(145deg, #131726 0%, #0C0F1A 60%, #101525 100%);
  --footer-bg: #080A12;
  --footer-text: #555E78;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.25; color: var(--text-primary); }
.display { font-family: 'DM Serif Display', serif; font-style: italic; }
.section-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* ---- Layout ---- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 8px;
  flex-wrap: nowrap;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-logo-icon {
  width: 36px; height: 36px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
  background: var(--accent-light);
}

.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tool);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px;
  cursor: pointer;
}

.theme-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.2s;
  border: none;
  background: transparent;
  cursor: pointer;
}

.theme-btn.active {
  background: var(--bg-secondary);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: var(--bg-tool);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ---- Mobile Menu ---- */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.mobile-menu a:hover { color: var(--accent); background: var(--accent-light); }

/* ---- Hero ---- */
.hero {
  background: var(--hero-bg);
  padding: 90px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(74,108,247,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(74,108,247,0.2);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  margin-bottom: 20px;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 .display {
  color: var(--accent);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  margin-top: 48px;
}

.hero-stat-item { text-align: center; }
.hero-stat-item .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'DM Serif Display', serif;
}
.hero-stat-item .lbl {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 18px rgba(74,108,247,0.32);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(74,108,247,0.42); }

.btn-secondary {
  background: var(--bg-tool);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: white; }

.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ---- Tool Cards ---- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.25s;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.2s;
}

.tool-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: rgba(74,108,247,0.25);
}

.tool-card:hover::before { opacity: 1; }

.tool-icon {
  width: 52px; height: 52px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
  transition: background 0.2s;
}

.tool-card:hover .tool-icon { background: var(--accent-gradient); }
.tool-card:hover .tool-icon span { filter: brightness(0) invert(1); }

.tool-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.tool-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.tool-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-light);
  color: var(--accent);
  letter-spacing: 0.03em;
}

/* ---- Tool Page Layout ---- */
.tool-page { padding: 48px 0 80px; }

.tool-header {
  text-align: center;
  margin-bottom: 40px;
}
.tool-header h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 12px; }
.tool-header p { color: var(--text-secondary); max-width: 540px; margin: 0 auto; }

.tool-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
  max-width: 680px;
  margin: 0 auto 40px;
}

/* ---- Form Elements ---- */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tool);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(74,108,247,0.12);
  background: var(--bg-secondary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---- Result Box ---- */
.result-box {
  background: var(--bg-tool);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-top: 28px;
  display: none;
}

.result-box.show { display: block; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.result-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.result-item .val {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  font-family: 'DM Serif Display', serif;
  line-height: 1;
}

.result-item .unit {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

.result-fact {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.result-fact strong { color: var(--accent); }

/* ---- Features / How It Works ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.feature-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 14px;
}

.feature-item h3 { font-size: 1rem; margin-bottom: 8px; }
.feature-item p { font-size: 0.875rem; color: var(--text-secondary); }

/* ---- FAQ ---- */
.faq-list { max-width: 760px; margin: 0 auto; }

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  text-align: left;
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  gap: 16px;
  transition: color 0.2s;
}

.faq-question:hover { color: var(--accent); }

.faq-icon {
  width: 28px; height: 28px;
  background: var(--bg-tool);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all 0.2s;
  color: var(--text-muted);
}

.faq-item.open .faq-icon {
  background: var(--accent);
  color: white;
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 0 0 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.faq-item.open .faq-answer { display: block; }

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.breadcrumb a { color: var(--text-muted); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-secondary); font-weight: 500; }
.breadcrumb .sep { color: var(--border); }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-tool);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 5px;
  margin-bottom: 28px;
}

.tab-btn {
  flex: 1;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
  text-align: center;
  border: none;
  background: transparent;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--bg-secondary);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* ---- Footer ---- */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand h3 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.7;
  max-width: 260px;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-col ul { display: flex; flex-direction: column; gap: 10px; }

.footer-col a {
  font-size: 0.875rem;
  color: var(--footer-text);
  transition: color 0.2s;
}
.footer-col a:hover { color: #5B7BFF; }

.footer-bottom {
  border-top: 1px solid #1E2435;
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-legal { display: flex; gap: 24px; }
.footer-legal a { color: var(--footer-text); transition: color 0.2s; }
.footer-legal a:hover { color: #5B7BFF; }

/* ---- Info Pages ---- */
.page-hero {
  background: var(--hero-bg);
  padding: 64px 0 48px;
  text-align: center;
}
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 14px; }
.page-hero p { color: var(--text-secondary); max-width: 560px; margin: 0 auto; }

.content-section { padding: 64px 0; }

.prose {
  max-width: 760px;
  margin: 0 auto;
  font-size: 0.97rem;
  color: var(--text-secondary);
  line-height: 1.85;
}

.prose h2 {
  font-size: 1.45rem;
  color: var(--text-primary);
  margin: 40px 0 16px;
  padding-top: 8px;
}

.prose h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 28px 0 10px;
}

.prose p { margin-bottom: 16px; }
.prose ul { margin: 12px 0 20px 20px; list-style: disc; }
.prose ul li { margin-bottom: 8px; }
.prose strong { color: var(--text-primary); font-weight: 600; }

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

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 900px;
  margin: 0 auto;
}

.contact-form-group { margin-bottom: 20px; }
.contact-form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.contact-form-group input,
.contact-form-group textarea,
.contact-form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tool);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  resize: vertical;
}
.contact-form-group input:focus,
.contact-form-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(74,108,247,0.12);
}

.contact-info-item {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
}
.contact-info-icon {
  width: 44px; height: 44px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.contact-info-text h4 { font-size: 0.9rem; margin-bottom: 3px; }
.contact-info-text p { font-size: 0.85rem; color: var(--text-secondary); }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); pointer-events: all; }
.toast-icon { font-size: 1.2rem; }

/* ---- Progress / Timeline ---- */
.timeline {
  position: relative;
  padding-left: 32px;
  margin: 24px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -27px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-item h4 { font-size: 0.95rem; margin-bottom: 4px; }
.timeline-item p { font-size: 0.85rem; color: var(--text-secondary); }

/* ---- Sitemap ---- */
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 32px;
}

.sitemap-col h3 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.sitemap-col ul { display: flex; flex-direction: column; gap: 8px; }
.sitemap-col a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.2s;
  display: flex; align-items: center; gap: 6px;
}
.sitemap-col a:hover { color: var(--accent); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 60px 0 50px; }
  .hero-stats { gap: 28px; }
  .tools-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .form-row { grid-template-columns: 1fr; }
  .tool-box { padding: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 56px 0; }
}

/* ---- Accessibility ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.5s ease forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ---- AdSense Placeholder ---- */
.ad-slot {
  background: var(--bg-tool);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  min-height: 90px;
  margin: 32px 0;
}

.ad-banner { min-height: 90px; }
.ad-rect { min-height: 250px; max-width: 300px; }

/* ---- CSP-safe inline SVG icon helper ---- */
.icon { display: inline-flex; align-items: center; }

/* =============================================
   HowOldToday.net — Language Selector & Updates
   ============================================= */

/* Language Selector */
.lang-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-tool);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  padding: 6px 28px 6px 10px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238892AA' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  min-width: 110px;
  max-width: 140px;
}

.lang-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(74,108,247,0.12);
}

.lang-select:hover { border-color: var(--accent); }

[data-theme="dark"] .lang-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235B7BFF' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

/* RTL Support */
[dir="rtl"] .nav-inner { flex-direction: row-reverse; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .footer-grid { direction: rtl; }
[dir="rtl"] .breadcrumb { flex-direction: row-reverse; }
[dir="rtl"] .tool-card { text-align: right; }
[dir="rtl"] .result-fact { text-align: right; }
[dir="rtl"] .lang-select {
  padding: 6px 10px 6px 28px;
  background-position: left 8px center;
}
[dir="rtl"] .form-group label { text-align: right; }
[dir="rtl"] .contact-info-item { flex-direction: row-reverse; }
[dir="rtl"] .timeline { padding-left: 0; padding-right: 32px; }
[dir="rtl"] .timeline::before { left: auto; right: 9px; }
[dir="rtl"] .timeline-item::before { left: auto; right: -27px; }

/* Mobile nav updated for lang selector */
@media (max-width: 640px) {
  .lang-select { font-size: 0.78rem; min-width: 90px; padding: 5px 22px 5px 8px; }
  .nav-right { gap: 8px; }
}

/* Favicon link in head — handled via HTML */
/* Mobile-first improvements */
@media (max-width: 480px) {
  .hero h1 { font-size: 1.9rem; }
  .hero-stats { gap: 20px; }
  .hero-stat-item .num { font-size: 1.6rem; }
  .tools-grid { grid-template-columns: 1fr; gap: 16px; }
  .tool-box { padding: 20px 16px; }
  .result-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .result-item .val { font-size: 1.5rem; }
  .countdown-live { grid-template-columns: repeat(2,1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .btn-lg { padding: 12px 20px; font-size: 0.92rem; }
  .section { padding: 44px 0; }
  .container { padding: 0 16px; }
  .faq-question { font-size: 0.9rem; }
  .prose { font-size: 0.93rem; }
  .blog-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .sitemap-grid { grid-template-columns: 1fr 1fr; }
}

/* Touch targets — minimum 44px for mobile */
@media (max-width: 768px) {
  .btn { min-height: 44px; }
  .faq-question { min-height: 44px; }
  .nav-links a { min-height: 44px; display: flex; align-items: center; }
  .theme-btn { width: 36px; height: 36px; }
  input[type="date"], input[type="text"], input[type="email"], select, textarea {
    font-size: 16px !important; /* Prevents iOS zoom */
    min-height: 44px;
  }
}
