/*
Theme Name: Age-Finder
Theme URI: https://agecalculatorbydateofbirth.com/
Author: Age-Finder Team
Author URI: https://agecalculatorbydateofbirth.com/
Description: Custom theme for Age-Finder. Requires the Age-Finder Calculators plugin for calculator pages. Light two-column hero homepage with the Age Calculator on the right, calculator family cards, calculator pages with the tool on top and the guide below, full-screen mobile menu with search, and the wireframe brand system (Deep Pine, Emerald, Antique Gold).
Version: 2.4.5
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: age-finder
Tags: custom-menu, featured-images, sticky-post, threaded-comments
*/

/* Self-hosted variable fonts (SIL Open Font License, see assets/fonts). */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/inter-latin-var.woff2") format("woff2");
}
@font-face {
  font-family: Fraunces;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/fraunces-latin-var.woff2") format("woff2");
}

/* Brand tokens: the 8 wireframe tokens (design spec v1.2.12). They replace
   the v1.2.2 tokens. No other colour may appear on the page. */
:root {
  --af-canvas: #f7f3ec;
  --af-surface: #ffffff;
  --af-ink: #1a2420;
  --af-ink-soft: #5c6f68;
  --af-deep: #0c2e29;
  --af-primary: #14705f;
  --af-primary-soft: #0e5a4c;
  --af-gold: #c5a253;
  --af-gold-deep: #8a6f24;
  --af-gold-soft: #f1e7c9;
  --af-gold-pale: #e9d9a8;
  --af-line: #dde3dc;
  --af-sage: #e6efea;
  --af-sage-border: #c9d6cc;
  --af-search: #25433f;
  --af-mist: #cfd8d3;
  --af-mist-dim: #9fb3ad;
  --af-error: #a63a32;
  --af-error-bg: #fbefec;
}

/* Base. Everything is scoped under body.af-site (added by functions.php). */
body.af-site {
  margin: 0;
  background: var(--af-canvas);
  color: var(--af-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.af-site img {
  max-width: 100%;
  height: auto;
}

.af-container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

.af-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--af-gold);
  color: var(--af-deep);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}

.af-skip-link:focus {
  left: 0;
}

/* Header: sticky, Deep Pine, with a thin gold rule directly under it.
   Logo mark plus two-tone site name. No tagline. */
.af-site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--af-deep);
  border-bottom: 2px solid var(--af-gold);
}

.af-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
  max-width: 1280px;
}

.af-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.af-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--af-gold);
  color: var(--af-deep);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}

.af-logo .custom-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.af-site-name {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 19px;
  line-height: 1.1;
  color: var(--af-canvas);
  white-space: nowrap;
}

.af-site-name .af-name-first {
  color: var(--af-canvas);
}

.af-site-name .af-name-gold {
  color: var(--af-gold);
}

/* Desktop nav: clean horizontal menu from wp_nav_menu, left after the logo. The mega menu panel drops from the header on hover/focus. */
.af-desktop-nav {
  flex-shrink: 0;
}

.af-desktop-nav .af-nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.af-desktop-nav .af-nav-list .menu-item {
  position: relative;
}

.af-desktop-nav .af-nav-list a {
  display: block;
  padding: 10px 14px;
  color: var(--af-canvas);
  text-decoration: none;
  font-size: 15px;
  border-radius: 8px;
  white-space: nowrap;
}

.af-desktop-nav .af-nav-list a:hover {
  color: var(--af-canvas);
  background: rgba(255, 255, 255, 0.06);
}

.af-desktop-nav .af-nav-list .current-menu-item > a, .af-desktop-nav .af-nav-list .current_page_item > a {
  color: var(--af-canvas);
  box-shadow: inset 0 -2px 0 var(--af-gold);
}

/* Mega menu (desktop, 1025px and up): a white panel under the header with
   one column per calculator family. Hidden by default; JavaScript shows
   it while the "All calculators" nav link or the panel itself is hovered
   or focused. Hidden entirely below 1025px (mobile menu takes over). */
.af-mega-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 55;
  background: var(--af-surface);
  border-bottom: 1px solid rgba(197, 162, 83, 0.35);
  box-shadow: 0 18px 32px rgba(12, 46, 41, 0.16);
}

.af-mega-menu[hidden] {
  display: none;
}

.af-mega-menu-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-top: 28px;
  padding-bottom: 24px;
}

.af-mega-label {
  margin: 0 0 10px;
  color: var(--af-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.af-mega-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.af-mega-list a {
  display: block;
  padding: 8px 0;
  color: var(--af-ink);
  font-size: 15px;
  text-decoration: none;
}

.af-mega-list a:hover {
  color: var(--af-gold);
  text-decoration: underline;
}

.af-mega-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--af-line);
}

.af-mega-all {
  color: var(--af-primary);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.af-mega-all:hover {
  color: var(--af-gold);
  text-decoration: underline;
}

.af-mega-count {
  color: var(--af-ink-soft);
  font-size: 14px;
}

/* "All calculators" is an anchor to the hub section on the homepage, so
   WordPress marks it current alongside the homepage item and it inherits
   the gold underline. It is a jump link, not a page, so it never carries
   the current-page underline. */
.af-desktop-nav .af-nav-list a[href*="#af-hub"] {
  box-shadow: none;
}

.af-desktop-nav .af-nav-list .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  list-style: none;
  margin: 0;
  padding: 8px;
  background: var(--af-deep);
  border: 1px solid rgba(197, 162, 83, 0.35);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(12, 46, 41, 0.35);
}

.af-desktop-nav .af-nav-list .menu-item:hover > .sub-menu, .af-desktop-nav .af-nav-list .menu-item:focus-within > .sub-menu {
  display: block;
}

/* Parent items show a gold chevron, as in the wireframe. */
.af-desktop-nav .af-nav-list .menu-item-has-children > a::after {
  content: "▾";
  margin-left: 6px;
  color: var(--af-gold);
  font-size: 11px;
}

/* Header actions: search box, pushed to the far right. (The gold "Age
   Calculator" pill was removed in v1.2.15 per the user's call: it
   duplicated the logo, which already links home to the Age Calculator.) */
.af-header-actions {
  display: none;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  min-width: 0;
}

.af-header-search {
  display: flex;
  flex-shrink: 1;
  min-width: 0;
}

.af-header-search-input {
  width: 200px;
  min-width: 120px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 14px;
  background: var(--af-search);
  border: 1px solid rgba(197, 162, 83, 0.5);
  border-radius: 12px;
  color: var(--af-canvas);
  font-family: inherit;
  font-size: 15px;
}

.af-header-search-input::placeholder {
  color: var(--af-mist-dim);
}

.af-header-search-input:focus {
  outline: 2px solid var(--af-gold);
  outline-offset: 2px;
}

/* Menu toggle: labelled button, visible on mobile only. */
.af-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-height: 44px;
  padding: 8px 14px;
  background: transparent;
  color: var(--af-canvas);
  border: 1px solid var(--af-gold);
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.af-menu-toggle-label {
  line-height: 1;
}

.af-menu-toggle-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}

.af-menu-toggle-icon span {
  display: block;
  height: 2px;
  background: var(--af-canvas);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.af-menu-toggle.af-active {
  background: var(--af-gold);
  color: var(--af-deep);
}

.af-menu-toggle.af-active .af-menu-toggle-icon span {
  background: var(--af-deep);
}

.af-menu-toggle.af-active .af-menu-toggle-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.af-menu-toggle.af-active .af-menu-toggle-icon span:nth-child(2) {
  opacity: 0;
}

.af-menu-toggle.af-active .af-menu-toggle-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile menu: full-screen Deep Pine overlay. */
.af-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--af-deep);
  color: #eef2ee;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.af-mobile-menu[hidden] {
  display: none;
}

.af-mobile-menu-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 8px;
}

.af-menu-search-wrap {
  flex: 1;
}

.af-menu-search {
  width: 100%;
  min-height: 52px;
  box-sizing: border-box;
  padding: 12px 16px;
  background: var(--af-search);
  border: 1px solid rgba(197, 162, 83, 0.5);
  border-radius: 12px;
  color: var(--af-canvas);
  font-family: inherit;
  font-size: 16px;
}

.af-menu-search::placeholder {
  color: var(--af-mist-dim);
}

.af-menu-search:focus {
  outline: 2px solid var(--af-gold);
  outline-offset: 2px;
}

.af-menu-search-count {
  margin: 8px 2px 0;
  color: var(--af-mist-dim);
  font-size: 14px;
}

.af-menu-close {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--af-gold);
  background: transparent;
  color: var(--af-canvas);
  font-family: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.af-menu-shortcuts {
  padding: 12px 20px 4px;
}

.af-menu-shortcuts-title {
  margin: 0 0 10px;
  color: var(--af-gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.af-menu-shortcuts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.af-shortcut {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: var(--af-canvas);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.af-shortcut:hover {
  border-color: var(--af-gold);
  color: var(--af-gold);
}

.af-mobile-menu-nav {
  flex: 1;
  padding: 8px 20px 16px;
}

.af-menu-family {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.af-menu-family[hidden], .af-menu-item[hidden] {
  display: none;
}

.af-menu-family-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 0;
  background: transparent;
  border: 0;
  color: var(--af-canvas);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.af-menu-family-icon, .af-menu-item-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--af-gold-soft);
  color: var(--af-deep);
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  font-size: 16px;
}

.af-menu-family-name {
  flex: 1;
}

.af-menu-count {
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--af-canvas);
  font-size: 13px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
}

.af-menu-chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--af-gold);
  border-bottom: 2px solid var(--af-gold);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.af-menu-family.af-open .af-menu-chevron {
  transform: rotate(225deg);
}

.af-menu-family-items {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.af-menu-family-items[hidden] {
  display: none;
}

.af-menu-item {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.af-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 0;
  color: #eef2ee;
  text-decoration: none;
}

.af-menu-link:hover .af-menu-item-title {
  color: var(--af-gold);
}

.af-menu-item-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.af-menu-item-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.af-menu-item-desc {
  font-size: 13px;
  line-height: 1.35;
  color: var(--af-mist-dim);
}

.af-menu-empty {
  padding: 24px 20px;
  text-align: center;
}

.af-menu-empty[hidden] {
  display: none;
}

.af-menu-empty-text {
  margin: 0 0 12px;
  color: #eef2ee;
  font-size: 16px;
}

.af-menu-empty-link {
  color: var(--af-gold);
  font-weight: 700;
}

.af-menu-pinned {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--af-deep);
  border-top: 1px solid rgba(197, 162, 83, 0.35);
}

.af-menu-pinned-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 999px;
  background: var(--af-gold);
  color: var(--af-deep);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.af-menu-pinned-link.af-secondary {
  background: transparent;
  border: 1px solid var(--af-gold);
  color: var(--af-canvas);
}

/* Main layout. */
.af-main {
  display: block;
  min-height: 60vh;
}

/* Hero: Warm Paper, two columns. Headline left (~55%), calculator card right (~45%). */
.af-hero {
  background: var(--af-canvas);
  padding: 36px 0 48px;
}

.af-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

.af-hero-kicker {
  margin: 0 0 16px;
  color: var(--af-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.af-hero-title {
  margin: 0 0 20px;
  color: var(--af-ink);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1.08;
  font-weight: 700;
}

.af-hero-accent {
  color: var(--af-primary);
}

.af-hero-underline {
  border-bottom: 6px solid var(--af-gold-pale);
  padding-bottom: 2px;
}

.af-hero-sub {
  margin: 0 0 20px;
  color: var(--af-ink-soft);
  font-size: 18px;
  line-height: 1.55;
}

.af-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  color: var(--af-ink);
  font-size: 15px;
  font-weight: 600;
}

.af-hero-points li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.af-hero-points li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--af-gold);
  flex-shrink: 0;
}

.af-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.af-hero-cta-primary, .af-hero-cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
  line-height: 1.5;
}

.af-hero-cta-primary {
  background: var(--af-primary);
  border: 1px solid var(--af-primary);
  color: #ffffff;
}

.af-hero-cta-primary:hover {
  background: var(--af-primary-soft);
  border-color: var(--af-primary-soft);
  color: #ffffff;
}

.af-hero-cta-secondary {
  background: var(--af-surface);
  border: 1px solid var(--af-primary);
  color: var(--af-primary);
}

.af-hero-cta-secondary:hover {
  border-color: var(--af-gold);
  color: var(--af-gold-deep);
}

.af-hero-stats {
  display: flex;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid rgba(197, 162, 83, 0.35);
}

.af-hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.af-hero-stat + .af-hero-stat {
  padding-left: 20px;
  border-left: 1px solid rgba(197, 162, 83, 0.35);
}

.af-hero-stat-num {
  color: var(--af-ink);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
}

.af-hero-stat-label {
  color: var(--af-ink-soft);
  font-size: 13px;
  line-height: 1.4;
}

/* Hero calculator card: white card with a dark-pine header strip holding the title and pill. */
.af-hero-calc {
  position: relative;
  padding: 20px;
  background: var(--af-surface);
  border: 1px solid var(--af-line);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(26, 36, 32, 0.08);
}

.af-hero-calc-pill {
  position: static;
  top: 20px;
  right: 20px;
  z-index: 2;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--af-gold);
  color: var(--af-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* The calculator header strip inside the hero card: the strip bleeds to
   the card edges with negative margins equal to the card padding. The
   head text keeps right padding so it never runs under the MOST USED pill.
   Strip padding is 12px top / 12px bottom, the same as the internal
   card strip, so both strips are ~82px tall (the homepage strip was
   16px/14px = 88px, 4px taller than the internal strip's 84px). */
.af-hero-calc .af-calc-head {
  margin: -20px -20px 0;
  padding: 14px 20px 12px;
  background: var(--af-deep);
  border-radius: 20px 20px 0 0;
}

.af-hero-calc .af-calc-head-text {
  padding-right: 0;
}

.af-hero-calc .af-calc-title {
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--af-canvas);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.af-hero-calc .af-calc-sub {
  margin: 2px 0 0;
  padding: 0;
  background: transparent;
  color: var(--af-mist);
  font-size: 15px;
  line-height: 1.45;
}

.af-hero-calc .af-hero-calc-note {
  margin: 18px 0 0;
  color: var(--af-ink-soft);
  font-size: 14px;
}

/* Hub: family cards with live search and filters. */
.af-hub {
  padding: 32px 0 64px;
}

.af-hub-title {
  margin: 0 0 8px;
  color: var(--af-ink);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1.2;
}

.af-hub-intro {
  margin: 0 0 20px;
  color: var(--af-ink-soft);
  font-size: 17px;
}

.af-hub-tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.af-hub-search-row {
  display: flex;
  gap: 8px;
}

.af-hub-search {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  box-sizing: border-box;
  padding: 12px 16px;
  background: var(--af-surface);
  border: 1px solid var(--af-line);
  border-radius: 12px;
  color: var(--af-ink);
  font-family: inherit;
  font-size: 16px;
}

.af-hub-search:focus {
  outline: 2px solid var(--af-gold);
  outline-offset: 2px;
  border-color: var(--af-gold);
}

.af-hub-search-btn {
  flex-shrink: 0;
  min-height: 52px;
  padding: 12px 22px;
  background: var(--af-primary);
  border: 1px solid var(--af-primary);
  border-radius: 12px;
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.af-hub-search-btn:hover {
  background: var(--af-primary-soft);
  border-color: var(--af-primary-soft);
}

.af-hub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.af-hub-filter {
  min-height: 44px;
  padding: 8px 16px;
  background: var(--af-surface);
  border: 1px solid var(--af-line);
  border-radius: 999px;
  color: var(--af-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.af-hub-filter:hover {
  border-color: var(--af-gold);
}

.af-hub-filter.af-active {
  background: var(--af-primary);
  border-color: var(--af-primary);
  color: var(--af-canvas);
}

.af-hub-count {
  margin: 8px 0 20px;
  color: var(--af-ink-soft);
  font-size: 14px;
}

.af-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.af-card {
  position: relative;
}

.af-card[hidden] {
  display: none;
}

.af-card-link {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  height: 100%;
  box-sizing: border-box;
  padding: 18px;
  background: var(--af-surface);
  border: 1px solid var(--af-line);
  border-radius: 16px;
  text-decoration: none;
}

.af-card-link:hover {
  border-color: var(--af-primary);
  box-shadow: 0 8px 24px rgba(12, 46, 41, 0.12);
}

.af-card-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--af-gold-soft);
  color: var(--af-deep);
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  font-size: 19px;
}

.af-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.af-card-title {
  color: var(--af-ink);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.af-card-desc {
  color: var(--af-ink-soft);
  font-size: 14px;
  line-height: 1.45;
}

.af-card-open {
  margin-top: 6px;
  color: var(--af-primary);
  font-size: 14px;
  font-weight: 700;
}

.af-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--af-gold);
  color: var(--af-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}

/* Cards carrying a Popular badge: the badge sits at the top-right corner
   over the card body, so the title needs right clearance or its end runs
   under the badge ("Age Difference Calcul…"). Only badged cards get the
   extra padding; unbadged cards keep the full title width. */
.af-card:has(.af-card-badge) .af-card-body {
  padding-right: 72px;
}

.af-hub-empty {
  margin: 24px 0;
  padding: 24px;
  background: var(--af-surface);
  border: 1px solid var(--af-line);
  border-radius: 16px;
  text-align: center;
  color: var(--af-ink-soft);
}

.af-hub-empty[hidden] {
  display: none;
}

/* Guide article below the hub: the rest of the front page content. */
.af-guide {
  padding: 8px 0 64px;
}

.af-guide-content {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* Breadcrumb. */
.af-breadcrumb {
  padding: 24px 0 0;
  color: var(--af-ink-soft);
  font-size: 14px;
}

.af-breadcrumb-link {
  color: var(--af-primary-soft);
  text-decoration: none;
}

.af-breadcrumb-link:hover {
  color: var(--af-gold-deep);
  text-decoration: underline;
}

.af-breadcrumb-sep {
  margin: 0 8px;
  color: var(--af-ink-soft);
}

.af-breadcrumb-current {
  color: var(--af-ink);
  font-weight: 600;
}

/* Internal calculator page: two-column layout. Main column ~670px
   (calculator card on top, guide below), sidebar ~320px on the right.
   The sidebar is NOT sticky; it scrolls away in normal flow.
   The grid is centred in the 1200px container: at wide viewports the
   tracks total 670 + 32 + 320 = 1022px, so justify-content centres
   them instead of leaving the spare width on the right. */
.af-page-container {
  max-width: 1200px;
}

.af-page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  justify-content: center;
  align-items: start;
  padding-top: 16px;
}

.af-page-main {
  min-width: 0;
}

.af-page-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.af-side-card {
  background: var(--af-surface);
  border: 1px solid var(--af-line);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 4px 14px rgba(26, 36, 32, 0.05);
}

.af-side-title {
  margin: 0 0 12px;
  color: var(--af-deep);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

.af-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.af-side-list li {
  margin: 0;
  padding: 7px 0;
  border-top: 1px solid var(--af-line);
}

.af-side-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.af-side-list a {
  color: var(--af-primary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

.af-side-list a:hover {
  color: var(--af-gold-deep);
  text-decoration: underline;
}

.af-side-text {
  margin: 0 0 14px;
  color: var(--af-ink-soft);
  font-size: 15px;
  line-height: 1.55;
}

.af-side-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
}

.af-side-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 6px 0;
  color: var(--af-ink);
  font-size: 15px;
  line-height: 1.5;
}

.af-side-bullets li::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--af-gold);
  flex-shrink: 0;
}

.af-side-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 24px;
  border-radius: 10px;
  background: var(--af-primary);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}

.af-side-btn:hover {
  background: var(--af-primary-soft);
  color: #ffffff;
}

/* Guide header block inside the left column, below the calculator. */
.af-guide-head {
  margin: 0 0 20px;
}

.af-guide-eyebrow {
  margin: 0 0 8px;
  color: var(--af-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.af-guide-title {
  margin: 0 0 8px;
  color: var(--af-ink);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}

.af-guide-meta {
  margin: 0;
  color: var(--af-ink-soft);
  font-size: 14px;
}

/* "In this guide" numbered box: the guide's own H2s, first six. */
.af-guide-box {
  margin: 0 0 28px;
  padding: 18px 20px;
  background: var(--af-surface);
  border: 1px solid var(--af-line);
  border-radius: 12px;
}

.af-guide-box-title {
  margin: 0 0 8px;
  color: var(--af-gold-deep);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.af-guide-box-list {
  margin: 0;
  padding-left: 22px;
}

.af-guide-box-list li {
  padding: 3px 0;
}

.af-guide-box-list a {
  color: var(--af-primary-soft);
  text-decoration: none;
  font-size: 15px;
}

.af-guide-box-list a:hover {
  color: var(--af-gold-deep);
  text-decoration: underline;
}

/* Article page: title, reading time, contents list. Used by plain pages. */
.af-article {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  padding: 16px 0 8px;
}

.af-page-title {
  margin: 0 0 8px;
  color: var(--af-ink);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.2;
}

.af-reading-time {
  margin: 0 0 20px;
  color: var(--af-ink-soft);
  font-size: 14px;
}

/*
  Article body.
  Every element selector here is a DIRECT CHILD of .af-entry-content.
  The calculator block (.pac-cal) is a direct child itself, but its inputs,
  buttons, paragraphs and result box live deeper inside it, so no theme
  rule below can reach them. The calculator keeps its own look untouched.
*/
.af-entry-content > h1 {
  margin: 32px 0 12px;
  color: var(--af-ink);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.3;
  scroll-margin-top: 84px;
}

.af-entry-content > h2 {
  margin: 32px 0 12px;
  color: var(--af-ink);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.3;
  scroll-margin-top: 84px;
}

.af-entry-content > h3 {
  margin: 28px 0 10px;
  color: var(--af-ink);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.35;
  scroll-margin-top: 84px;
}

.af-entry-content > p {
  margin: 0 0 16px;
}

.af-entry-content > p a, .af-entry-content > ul a, .af-entry-content > ol a {
  color: var(--af-primary-soft);
  text-decoration-color: var(--af-gold);
  text-underline-offset: 3px;
}

.af-entry-content > p a:hover, .af-entry-content > ul a:hover, .af-entry-content > ol a:hover {
  color: var(--af-gold-deep);
}

.af-entry-content > ul, .af-entry-content > ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.af-entry-content > ul li, .af-entry-content > ol li {
  margin-bottom: 6px;
}

.af-entry-content > blockquote {
  margin: 0 0 16px;
  padding: 14px 18px;
  background: var(--af-gold-soft);
  border-left: 3px solid var(--af-gold);
  border-radius: 0 12px 12px 0;
}

.af-entry-content > blockquote p {
  margin: 0;
}

.af-entry-content > figure {
  margin: 0 0 16px;
}

.af-entry-content > figure img {
  border-radius: 12px;
}

/* FAQ: details and summary blocks. */
.af-entry-content > details {
  margin: 0 0 12px;
  padding: 14px 18px;
  background: var(--af-surface);
  border: 1px solid var(--af-line);
  border-radius: 12px;
}

.af-entry-content > details summary {
  font-weight: 700;
  color: var(--af-ink);
  cursor: pointer;
}

.af-entry-content > details p {
  margin: 10px 0 0;
}

/* Tables: Deep Pine header, zebra rows, right aligned numbers, gold total row. */
.af-entry-content > table, .af-entry-content > figure table {
  width: 100%;
  margin: 0 0 20px;
  border-collapse: collapse;
  background: var(--af-surface);
  font-size: 14px;
  line-height: 1.45;
}

.af-entry-content > table th, .af-entry-content > table td, .af-entry-content > figure table th, .af-entry-content > figure table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--af-line);
  text-align: left;
  vertical-align: top;
}

.af-entry-content > table th, .af-entry-content > figure table th {
  background: var(--af-deep);
  color: var(--af-canvas);
  font-weight: 700;
}

.af-entry-content > table tbody tr:nth-child(even), .af-entry-content > figure table tbody tr:nth-child(even) {
  background: var(--af-canvas);
}

.af-entry-content > table tfoot th, .af-entry-content > table tfoot td, .af-entry-content > figure table tfoot th, .af-entry-content > figure table tfoot td, .af-entry-content > table tr.af-total-row th, .af-entry-content > table tr.af-total-row td, .af-entry-content > figure table tr.af-total-row th, .af-entry-content > figure table tr.af-total-row td {
  background: var(--af-gold-soft);
  font-weight: 700;
  color: var(--af-deep);
}

.af-entry-content > table td.af-num, .af-entry-content > table th.af-num, .af-entry-content > figure table td.af-num, .af-entry-content > figure table th.af-num {
  text-align: right;
}

/* Table captions: left-aligned, full width, bold. Without this the caption
   renders at its shrink-to-fit width once the table becomes display:block
   on phones, so long captions wrap into a narrow column and clip. */
.af-entry-content > table caption, .af-entry-content > figure table caption {
  caption-side: top;
  padding: 0 0 10px;
  color: var(--af-ink-soft);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

/* Status pills for milestone tables. Authors add these spans in table cells. */
.af-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.af-pill-reached {
  background: var(--af-sage);
  color: var(--af-deep);
}

.af-pill-soon {
  background: var(--af-gold-soft);
  color: var(--af-gold-deep);
}

/* Related calculators. */
.af-related {
  max-width: 1120px;
  margin: 32px auto 64px;
}

.af-related-title {
  margin: 0 0 16px;
  color: var(--af-ink);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.3;
}

/* Blog list and single posts. */
.af-post-list {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 0 64px;
}

.af-post-item {
  margin: 0 0 16px;
  padding: 20px;
  background: var(--af-surface);
  border: 1px solid var(--af-line);
  border-radius: 16px;
}

.af-post-title {
  margin: 0 0 6px;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.3;
}

.af-post-title-link {
  color: var(--af-ink);
  text-decoration: none;
}

.af-post-title-link:hover {
  color: var(--af-gold-deep);
}

.af-post-meta {
  margin: 0 0 8px;
  color: var(--af-ink-soft);
  font-size: 14px;
}

.af-post-excerpt {
  margin: 0;
  color: var(--af-ink);
}

.af-post-nav {
  margin-top: 24px;
  text-align: center;
}

.af-post-nav a {
  color: var(--af-primary-soft);
  font-weight: 700;
}

/* 404 page. */
.af-not-found {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 0;
  text-align: center;
}

.af-not-found-title {
  margin: 0 0 12px;
  color: var(--af-ink);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 34px;
}

.af-not-found-text {
  margin: 0 0 20px;
  color: var(--af-ink-soft);
}

.af-search-form {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto 20px;
}

.af-search-input {
  flex: 1;
  min-height: 52px;
  box-sizing: border-box;
  padding: 12px 16px;
  background: var(--af-surface);
  border: 1px solid var(--af-line);
  border-radius: 12px;
  color: var(--af-ink);
  font-family: inherit;
  font-size: 16px;
}

.af-search-submit {
  min-height: 52px;
  padding: 12px 22px;
  background: var(--af-primary);
  border: 1px solid var(--af-primary);
  border-radius: 12px;
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.af-search-submit:hover {
  background: var(--af-primary-soft);
}

.af-not-found-link {
  color: var(--af-primary-soft);
  font-weight: 700;
}

/* Footer: Deep Pine with a thin gold rule above it, four columns. */
.af-site-footer {
  background: var(--af-deep);
  border-top: 2px solid var(--af-gold);
  color: var(--af-mist);
}

.af-footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-top: 36px;
  padding-bottom: 36px;
}

.af-footer-brand {
  min-width: 0;
}

.af-footer-tagline {
  margin: 12px 0 0;
  color: var(--af-mist);
  font-size: 15px;
  line-height: 1.55;
}

.af-footer-col-title {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.af-footer-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.af-footer-col-list li {
  margin: 0;
  padding: 4px 0;
}

.af-footer-col-list a {
  color: var(--af-mist);
  text-decoration: none;
  font-size: 15px;
}

.af-footer-col-list a:hover {
  color: var(--af-gold);
}

.af-footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 8px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(197, 162, 83, 0.25);
}

.af-footer-copy {
  margin: 0;
  color: var(--af-mist-dim);
  font-size: 14px;
}

.af-footer-legal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.af-footer-legal-list a {
  color: var(--af-mist);
  font-size: 14px;
  text-decoration: none;
}

.af-footer-legal-list a:hover, .af-footer-legal-list a:focus-visible {
  color: var(--af-gold);
  text-decoration: underline;
}

/* Responsive (mobile-first): phones use the base rules above; these add the larger-screen layout. */
@media (min-width: 641px) {
  .af-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .af-entry-content > h1 {
    font-size: 26px;
  }

  .af-entry-content > h2 {
    font-size: 26px;
  }

  .af-entry-content > table th, .af-entry-content > table td, .af-entry-content > figure table th, .af-entry-content > figure table td {
    padding: 12px 14px;
  }

  .af-entry-content > table, .af-entry-content > figure table {
    font-size: 15px;
  }

  .af-footer-bottom {
    align-items: center;
  }

  .af-footer-inner {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }

  .af-hero {
    padding: 56px 0 64px;
  }

  .af-hero-calc {
    padding: 24px;
  }

  .af-hero-calc .af-calc-head {
    margin: -24px -24px 0;
    padding: 12px 24px 12px;
  }

  .af-hero-calc .af-calc-head-text {
    padding-right: 104px;
  }

  .af-hero-calc .af-calc-title {
    font-size: 26px;
  }

  .af-hero-calc-pill {
    position: absolute;
  }

  .af-hero-stat + .af-hero-stat {
    padding-left: 32px;
  }

  .af-hero-stats {
    gap: 32px;
  }

  .af-hero-title {
    font-size: 40px;
  }

  .af-hub-title {
    font-size: 30px;
  }

  .af-page-title {
    font-size: 34px;
  }

  .af-site-name {
    font-size: 22px;
  }

  body.af-site {
    font-size: 17px;
  }
}

@media (min-width: 901px) {
  .af-hero-grid {
    gap: 48px;
    grid-template-columns: 1.22fr 1fr;
  }

  .af-hero-title {
    font-size: 52px;
  }

  .af-page-layout {
    grid-template-columns: minmax(0, 670px) 320px;
  }
}

@media (min-width: 1025px) {
  .af-header-actions {
    display: flex;
  }

  .af-menu-toggle {
    display: none;
  }
}

@media (max-width: 640px) {
  .af-footer-bottom {
    flex-direction: column;
  }
}

.af-back-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--af-gold);
  background: var(--af-gold);
  color: var(--af-deep);
  font-family: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(12, 46, 41, 0.3);
}

.af-back-top.af-visible {
  display: flex;
}

/* Responsive: nav switch at the theme breakpoint. */
@media (max-width: 1024px) {
  .af-desktop-nav, .af-mega-menu {
    display: none;
  }
}

/* Responsive: hero stacks and the internal page goes single column below 900px. */

/* Responsive: phones. Tables stay real tables and scroll sideways. */
@media (max-width: 640px) {
  .af-hero-calc-pill {
    display: inline-block;
    margin-bottom: 12px;
  }
  .af-entry-content > table, .af-entry-content > figure table {
    display: block;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .af-entry-content > table caption, .af-entry-content > figure table caption {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .af-entry-content > table th, .af-entry-content > table td, .af-entry-content > figure table th, .af-entry-content > figure table td {
    min-width: 160px;
  }
}

/* ==========================================================================
   v2.0 additions. Written mobile-first: base rules target phones, min-width
   queries add the larger-screen layout.
   ========================================================================== */

/* Calculator cards use the theme tokens, so the site has one palette. */
.af-site {
  --pac-primary: var(--af-primary);
  --pac-primary-hover: var(--af-primary-soft);
  --pac-primary-soft: var(--af-sage);
  --pac-surface: var(--af-surface);
  --pac-surface-muted: var(--af-canvas);
  --pac-border: var(--af-line);
  --pac-border-strong: var(--af-sage-border);
  --pac-text: var(--af-ink);
  --pac-text-secondary: var(--af-ink-soft);
  --pac-text-muted: var(--af-ink-soft);
}

/* Hero card: the calculator sits directly on the white hero card. */
.af-hero-calc .pac-cal:not(.pac-cal--standalone) {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

/* Accessibility helpers. */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.af-site a:focus-visible, .af-site button:focus-visible, .af-site summary:focus-visible, .af-site input:focus-visible, .af-site select:focus-visible {
  outline: 3px solid var(--af-gold);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .af-site *,
  .af-site *::before,
  .af-site *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* SVG icons (Lucide) in cards, menus and the sidebar. */
.af-card-icon svg {
  width: 22px;
  height: 22px;
}
.af-menu-family-icon svg, .af-menu-item-icon svg {
  width: 18px;
  height: 18px;
}
.af-card-title {
  margin: 0;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
}

/* Breadcrumb as a list. */
.af-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.af-breadcrumb-list li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--af-mist-dim);
}

/* Under the calculator: answer-first summary and page meta. */
.af-intro {
  margin: 24px 0 8px;
  color: var(--af-ink);
  font-size: 18px;
  line-height: 1.6;
}
.af-guide-meta {
  margin: 0 0 16px;
  color: var(--af-ink-soft);
  font-size: 14px;
}
.af-guide-meta a {
  color: var(--af-primary-soft);
  text-decoration-color: var(--af-gold);
  text-underline-offset: 3px;
}

/* "In this guide": collapsible, so phones can fold it away. */
.af-guide-details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}
.af-guide-details > summary::-webkit-details-marker {
  display: none;
}
.af-guide-details > summary::after {
  content: "+";
  font-size: 20px;
  color: var(--af-gold-deep);
}
.af-guide-details[open] > summary::after {
  content: "−";
}

/* Sidebar. The "On this page" card only shows where the sidebar sits beside the guide. */
.af-side-toc {
  display: none;
}
.af-side-links {
  margin: 0;
  padding: 0;
  list-style: none;
}
.af-side-links li + li {
  margin-top: 4px;
}
.af-side-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--af-ink);
  text-decoration: none;
}
.af-side-links a:hover {
  color: var(--af-primary-soft);
}
.af-side-icon {
  display: inline-flex;
  color: var(--af-primary);
}
.af-side-icon svg {
  width: 18px;
  height: 18px;
}
.af-side-more {
  display: inline-block;
  margin-top: 12px;
  color: var(--af-primary-soft);
  font-weight: 600;
  text-decoration: none;
}
.af-side-more:hover {
  text-decoration: underline;
}

/* Family links (hub, family pages, 404). */
.af-hub-families {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.af-hub-families a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--af-sage-border);
  border-radius: 999px;
  background: var(--af-surface);
  color: var(--af-deep);
  font-weight: 600;
  text-decoration: none;
}
.af-hub-families a:hover {
  border-color: var(--af-primary);
  color: var(--af-primary);
}
.af-family-head {
  padding: 8px 0 24px;
}
.af-family-desc {
  max-width: 680px;
  color: var(--af-ink-soft);
  font-size: 18px;
}
.af-family-count {
  margin: 8px 0 0;
  color: var(--af-gold-deep);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.af-family-others {
  padding: 40px 0 56px;
}

/* Menus. */
.af-mega-label a {
  color: inherit;
  text-decoration: none;
}
.af-mega-label a:hover {
  color: var(--af-primary);
}
.af-mega-more {
  display: inline-block;
  margin-top: 8px;
  color: var(--af-primary-soft);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.af-footer-all {
  font-weight: 600;
}

/* Search results. */
.af-search-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.af-search-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--af-line);
}
.af-search-list a {
  color: var(--af-primary-soft);
  font-weight: 600;
}
.af-search-list p {
  margin: 4px 0 0;
  color: var(--af-ink-soft);
}

/* Guide building blocks (block patterns). */
.af-entry-content > .af-box {
  margin: 24px 0;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--af-sage-border);
  background: var(--af-sage);
}
.af-entry-content > .af-box > :first-child {
  margin-top: 0;
}
.af-entry-content > .af-box > :last-child {
  margin-bottom: 0;
}
.af-entry-content > .af-box--fact {
  border-color: var(--af-gold-pale);
  background: var(--af-gold-soft);
}
.af-entry-content > .af-box--example {
  background: var(--af-surface);
}
.af-box-label {
  margin: 0 0 4px;
  color: var(--af-gold-deep);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Table block styles: same look as the guide tables, scrolling on phones. */
.af-entry-content > .wp-block-table {
  margin: 24px 0;
  overflow-x: auto;
}
.af-entry-content > .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.af-entry-content > .wp-block-table th, .af-entry-content > .wp-block-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--af-line);
  text-align: left;
  vertical-align: top;
}
.af-entry-content > .wp-block-table thead th {
  background: var(--af-deep);
  color: #ffffff;
}
.af-entry-content > .wp-block-table.is-style-af-data tbody tr:nth-child(even) {
  background: var(--af-canvas);
}
.af-entry-content > .wp-block-table.is-style-af-comparison td:first-child, .af-entry-content > .wp-block-table.is-style-af-comparison th:first-child {
  position: sticky;
  left: 0;
  background: var(--af-surface);
  font-weight: 600;
}
.af-entry-content > .wp-block-table figcaption {
  margin-top: 8px;
  color: var(--af-ink-soft);
  font-size: 14px;
}

/* Touch targets: at least 44px tall on phones. */
.af-footer-col-list a, .af-footer-legal-list a, .af-guide-box-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (min-width: 901px) {
  .af-side-toc { display: block; }
  .af-footer-col-list a,
  .af-footer-legal-list a,
  .af-guide-box-list a { min-height: 0; }
}


/* ==========================================================================
   v2.1 homepage: category hub. Mobile-first.
   ========================================================================== */
.af-home .af-hero { padding: 28px 0 24px; background: #ffffff; border-bottom: 1px solid var(--af-line); }
.af-home .af-hero-grid { display: flex; flex-direction: column; gap: 24px; }
.af-home .af-hero-copy { min-width: 0; }
.af-home .af-hero-title { margin: 0 0 12px; font-size: clamp(30px, 6vw, 52px); line-height: 1.1; }
.af-home .af-hero-sub { margin: 0 0 20px; color: var(--af-ink-soft); font-size: 16px; line-height: 1.6; max-width: 560px; }
.af-home .af-hero-calc { width: 100%; max-width: 480px; min-width: 0; padding: 0; margin: 0; background: none; border: 0; box-shadow: none; }
.af-home-search { margin: 0; max-width: 600px; }
.af-home-search-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 15px; }
.af-home-search-row { position: relative; display: flex; gap: 8px; }
.af-home-search-input { flex: 1 1 auto; min-width: 0; min-height: 52px; padding: 0 16px; border: 2px solid var(--af-primary); border-radius: 12px; background: #ffffff; color: var(--af-ink); font-size: 16px; font-family: inherit; }
.af-home-search-btn { min-height: 52px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--af-primary); color: #ffffff; font-weight: 700; font-size: 16px; font-family: inherit; cursor: pointer; }
.af-home-search-btn:hover { background: var(--af-primary-soft); }
.af-home-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.af-home-chips-label { color: var(--af-ink-soft); font-size: 14px; }
.af-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--af-sage-border); border-radius: 999px; background: var(--af-sage); color: var(--af-deep); font-size: 14px; text-decoration: none; }
.af-chip:hover { border-color: var(--af-primary); color: var(--af-primary); }

.af-home-section { padding: 36px 0 0; }
.af-home-h2 { margin: 0 0 6px; font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 26px; line-height: 1.2; color: var(--af-ink); }
.af-home-lead { margin: 0 0 18px; color: var(--af-ink-soft); font-size: 15px; }
#most-used .af-home-h2, #new .af-home-h2 { margin-bottom: 16px; }

/* Most used: swipe row on phones, grid on larger screens. */
.af-tile-row { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 8px; scroll-snap-type: x mandatory; }
.af-mini { flex: 0 0 150px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; min-height: 124px; padding: 14px; box-sizing: border-box; background: #ffffff; border: 1px solid var(--af-line); border-radius: 14px; color: var(--af-ink); text-decoration: none; }
.af-mini:hover, .af-recent-item:hover { border-color: var(--af-primary); }
.af-mini-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; background: var(--af-gold-soft); color: var(--af-deep); }
.af-mini-icon svg { width: 19px; height: 19px; }
.af-mini-title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.af-mini-desc { color: var(--af-ink-soft); font-size: 13px; line-height: 1.4; }

/* Category tiles. */
.af-family-tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.af-family-tile { display: flex; flex-direction: column; background: #ffffff; border: 1px solid var(--af-line); border-radius: 16px; overflow: hidden; }
.af-family-tile-head { display: flex; gap: 14px; align-items: flex-start; padding: 18px 18px 10px; }
.af-family-tile-icon { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: var(--af-sage); color: var(--af-primary); }
.af-family-tile-icon svg { width: 23px; height: 23px; }
.af-family-tile-title { margin: 0; font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 20px; line-height: 1.25; }
.af-family-tile-title a { color: var(--af-ink); text-decoration: none; }
.af-family-tile-title a:hover { color: var(--af-primary); }
.af-family-tile-count { margin: 4px 0 0; color: var(--af-gold-deep); font-size: 13px; font-weight: 700; }
.af-family-tile-desc { margin: 0; padding: 0 18px 10px; color: var(--af-ink-soft); font-size: 14px; line-height: 1.5; }
.af-family-tile-list { flex: 1 1 auto; margin: 0; padding: 0 18px; list-style: none; }
.af-family-tile-list li { border-top: 1px solid #eef1ed; }
.af-family-tile-list a { display: flex; align-items: center; min-height: 44px; color: var(--af-ink); font-size: 15px; text-decoration: none; }
.af-family-tile-list a:hover { color: var(--af-primary); }
.af-family-tile-all { display: flex; justify-content: space-between; align-items: center; min-height: 52px; margin-top: 8px; padding: 0 18px; background: var(--af-canvas); border-top: 1px solid var(--af-line); color: var(--af-primary-soft); font-weight: 700; font-size: 15px; text-decoration: none; }
.af-family-tile-all:hover { color: var(--af-gold-deep); }

/* Recently added. */
.af-recent { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.af-recent-item { display: flex; gap: 12px; align-items: center; min-height: 72px; padding: 12px 14px; box-sizing: border-box; background: #ffffff; border: 1px solid var(--af-line); border-radius: 14px; color: var(--af-ink); text-decoration: none; }
.af-recent-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* Homepage guide. */
.af-home-guide { margin-top: 40px; padding: 32px 0; background: #ffffff; border-top: 1px solid var(--af-line); border-bottom: 1px solid var(--af-line); }
.af-home-guide-grid { display: flex; flex-direction: column; gap: 20px; }
.af-home-toc { padding: 4px 16px 8px; background: var(--af-canvas); border: 1px solid var(--af-line); border-radius: 14px; }
.af-home-article { min-width: 0; max-width: 760px; }

/* Trust strip. */
.af-home-trust-wrap { padding-bottom: 48px; }
.af-home-trust { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 22px; background: var(--af-sage); border: 1px solid var(--af-sage-border); border-radius: 16px; }
.af-home-trust h2 { margin: 0 0 4px; font-size: 16px; font-weight: 700; font-family: inherit; }
.af-home-trust p { margin: 0; font-size: 14px; line-height: 1.55; }

/* Search suggestions. */
.af-ta { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; right: 0; max-height: 70vh; overflow-y: auto; background: #ffffff; border: 1px solid var(--af-line); border-radius: 12px; box-shadow: 0 12px 32px rgba(12, 46, 41, 0.16); }
.af-ta-item { display: flex; flex-direction: column; gap: 2px; min-height: 56px; justify-content: center; padding: 8px 16px; border-bottom: 1px solid #eef1ed; color: var(--af-ink); text-decoration: none; }
.af-ta-item:hover, .af-ta-item.is-active { background: var(--af-sage); }
.af-ta-title { font-weight: 700; font-size: 15px; }
.af-ta-family { color: var(--af-ink-soft); font-size: 13px; }
.af-ta-none { margin: 0; padding: 14px 16px; color: var(--af-ink-soft); font-size: 14px; }
.af-ta-all { display: flex; align-items: center; min-height: 48px; padding: 0 16px; color: var(--af-primary-soft); font-weight: 700; font-size: 14px; text-decoration: none; }
.af-header-search { position: relative; }

@media (min-width: 641px) {
  .af-tile-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; overflow: visible; }
  .af-family-tiles, .af-recent { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .af-home-trust { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 901px) {
  .af-home .af-hero { padding: 56px 0 64px; }
  .af-home .af-hero-grid { flex-direction: row; align-items: flex-start; gap: 48px; }
  .af-home .af-hero-copy { flex: 1 1 auto; }
  .af-home .af-hero-calc { flex: 0 0 440px; }
  .af-home .af-hero-sub { font-size: 18px; }
  .af-home-section { padding-top: 56px; }
  .af-home-h2 { font-size: 30px; }
  .af-home-guide { margin-top: 56px; padding: 56px 0; }
  .af-home-guide-grid { flex-direction: row; align-items: flex-start; gap: 48px; }
  .af-home-toc { flex: 0 0 260px; position: sticky; top: 96px; }
}
@media (min-width: 1025px) {
  .af-tile-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .af-family-tiles, .af-recent { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Guide images with captions. */
.af-entry-content .af-guide-image { margin: 24px 0; }
.af-entry-content .af-guide-image img { display: block; width: 100%; max-width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--af-line); }
.af-entry-content .af-guide-image figcaption { margin-top: 8px; color: var(--af-ink-soft); font-size: 14px; line-height: 1.5; }

/* v2.3 hero calculator card: header text uses the full width beside the
   badge, one title size, and space between the header and the form. */
.af-home .af-hero-calc .pac-cal .af-calc-head-text { padding-right: 0; }
.af-home .af-hero-calc .pac-cal .af-calc-title { font-size: 24px; line-height: 1.2; }
.af-home .af-hero-calc .pac-cal .af-calc-sub { font-size: 15px; }
.af-home .af-hero-calc .pac-cal .af-calc-head { margin-bottom: 20px; gap: 12px; }
@media (max-width: 480px) {
  .af-home .af-hero-calc .pac-cal .af-calc-pill { display: none; }
  .af-home .af-hero-calc .pac-cal .af-calc-title { font-size: 22px; }
}

/* v2.3.1 mobile fix: the hero never grows wider than the screen.
   A text input has a built-in default width (about 20 characters); in the
   hero search row that forced the column to 357px, wider than 360px phones
   once page padding is counted, so the page scrolled sideways. The input
   may now shrink to the space left by the Search button, and both hero
   columns take exactly the available width. */
.af-home .af-hero-grid { align-items: stretch; }
.af-home .af-hero-copy,
.af-home .af-hero-calc { width: 100%; max-width: 100%; min-width: 0; }
.af-home-search-row { min-width: 0; }
.af-home-search-input { flex: 1 1 0; width: 0; min-width: 0; }
.af-home-search-btn { flex: 0 0 auto; }
.af-home .af-hero-title { overflow-wrap: break-word; }
.af-home .af-hero-calc .pac-cal { min-width: 0; max-width: 100%; }
@media (max-width: 359px) {
  .af-home-search-btn { padding: 0 14px; }
}
@media (min-width: 901px) {
  /* Desktop keeps its original sizing: copy flexes, card is 440px. */
  .af-home .af-hero-grid { align-items: flex-start; }
  .af-home .af-hero-copy { width: auto; }
  .af-home .af-hero-calc { width: auto; max-width: 480px; }
}

/* Same fix for the search page and the 404 page search boxes. */
.af-search-form { display: flex; gap: 8px; max-width: 600px; min-width: 0; margin: 0 0 24px; }
.af-search-form .af-search-input,
.af-search-form input[type="search"] { flex: 1 1 0; width: 0; min-width: 0; min-height: 48px; padding: 0 14px; border: 2px solid var(--af-primary); border-radius: 12px; font-size: 16px; font-family: inherit; }
.af-search-form .af-search-submit,
.af-search-form button { flex: 0 0 auto; min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--af-primary); color: #ffffff; font-weight: 700; font-size: 16px; font-family: inherit; cursor: pointer; }

/* ==========================================================================
   v2.4: Guides, article pages, calculator page redesign. Mobile-first.
   ========================================================================== */
.af-anchor { display: block; position: relative; top: -80px; }

/* Quick answer box (calculator summary and "Quick answer:" paragraphs). */
.af-quick { margin: 24px 0 16px; padding: 18px 20px; background: #ffffff; border: 1px solid var(--af-line); border-left: 5px solid var(--af-gold); border-radius: 14px; }
.af-quick p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--af-ink); }
.af-quick .af-quick-label { margin-bottom: 4px; color: var(--af-gold-deep); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* Tap-to-open FAQ. */
.af-faq-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 24px; }
.af-faq { background: #ffffff; border: 1px solid var(--af-line); border-radius: 14px; }
.af-faq-q { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 56px; padding: 6px 18px; cursor: pointer; list-style: none; }
.af-faq-q::-webkit-details-marker { display: none; }
.af-entry-content .af-faq-title { margin: 0; font-family: Inter, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 17px; font-weight: 700; line-height: 1.4; }
.af-faq-icon { flex-shrink: 0; position: relative; width: 30px; height: 30px; border-radius: 999px; background: var(--af-sage); }
.af-faq-icon::before, .af-faq-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; background: var(--af-primary); transition: transform 0.2s; }
.af-faq-icon::after { transform: rotate(90deg); }
.af-faq[open] .af-faq-icon::after { transform: rotate(0deg); }
.af-faq-a { padding: 0 18px 16px; }
.af-faq-a > :first-child { margin-top: 0; }
.af-faq-a > :last-child { margin-bottom: 0; }

/* Tables: scroll on small screens; two-column tables stack into labelled rows. */
.af-table-wrap { margin: 20px 0; overflow-x: auto; border: 1px solid var(--af-line); border-radius: 14px; background: #ffffff; }
.af-table-wrap table { width: 100%; margin: 0; border: 0; }
@media (max-width: 640px) {
  .af-table-wrap.is-stacked { overflow: visible; border: 0; background: transparent; }
  .af-table-wrap.is-stacked table, .af-table-wrap.is-stacked tbody, .af-table-wrap.is-stacked tr, .af-table-wrap.is-stacked td, .af-table-wrap.is-stacked th { display: block; width: auto; }
  .af-table-wrap.is-stacked thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .af-table-wrap.is-stacked caption { display: block; padding: 0 0 8px; text-align: left; }
  .af-table-wrap.is-stacked tr { margin-bottom: 8px; padding: 10px 14px; background: #ffffff; border: 1px solid var(--af-line); border-radius: 12px; }
  .af-table-wrap.is-stacked th, .af-table-wrap.is-stacked td { padding: 2px 0; border: 0; background: transparent; color: var(--af-ink); text-align: left; }
  .af-table-wrap.is-stacked tbody th { font-weight: 700; }
  .af-table-wrap.is-stacked td[data-label]::before { content: attr(data-label) ": "; color: var(--af-ink-soft); font-weight: 600; }
}

/* Ordered lists in guides read as numbered step cards. */
.af-entry-content > ol { list-style: none; padding: 0; counter-reset: af-step; display: flex; flex-direction: column; gap: 10px; }
.af-entry-content > ol > li { position: relative; counter-increment: af-step; padding: 12px 14px 12px 54px; background: #ffffff; border: 1px solid var(--af-line); border-radius: 12px; }
.af-entry-content > ol > li::before { content: counter(af-step); position: absolute; left: 14px; top: 12px; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 999px; background: var(--af-primary); color: #ffffff; font-size: 13px; font-weight: 700; }

/* Calculator pages: one contents list. Inline on phones, sidebar on desktop. */
.af-inline-toc { margin-top: 12px; }
.af-back-tool { display: flex; align-items: center; gap: 8px; min-height: 42px; margin-bottom: 6px; padding: 0 12px; border-radius: 10px; background: var(--af-primary); color: #ffffff; font-weight: 700; font-size: 15px; text-decoration: none; }
.af-back-tool:hover { background: var(--af-primary-soft); color: #ffffff; }
.af-spy-list { margin: 0; padding: 0; list-style: none; border-left: 2px solid #eef1ed; }
.af-spy-list a { display: block; margin-left: -2px; padding: 7px 12px; border-left: 2px solid transparent; color: var(--af-ink-soft); font-size: 15px; line-height: 1.4; text-decoration: none; }
.af-spy-list a:hover { color: var(--af-primary); }
.af-spy-list a.is-current { border-left-color: var(--af-primary); color: var(--af-deep); font-weight: 700; }
.af-related-guides { margin-top: 36px; }

/* Post cards and grids. */
.af-post-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.af-post-card { min-width: 0; }
.af-post-card-link { display: flex; flex-direction: column; gap: 8px; height: 100%; box-sizing: border-box; padding: 18px; background: #ffffff; border: 1px solid var(--af-line); border-radius: 16px; color: var(--af-ink); text-decoration: none; }
.af-post-card-link:hover { border-color: var(--af-primary); }
.af-post-card-cat { color: var(--af-gold-deep); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.af-post-card-title { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 19px; font-weight: 700; line-height: 1.3; color: var(--af-ink); }
.af-post-card-desc { color: var(--af-ink-soft); font-size: 15px; line-height: 1.55; }
.af-post-card-meta { margin-top: auto; color: var(--af-ink-soft); font-size: 13px; }
.af-guides-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.af-section-more { color: var(--af-primary-soft); font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
.af-section-more:hover { text-decoration: underline; }

/* Guides index and categories. */
.af-guides-hero { padding: 28px 0 24px; background: #ffffff; border-bottom: 1px solid var(--af-line); }
.af-guides-hero-inner { display: flex; flex-direction: column; gap: 18px; }
.af-guides-title { margin: 0 0 8px; font-family: Fraunces, Georgia, serif; font-size: clamp(30px, 6vw, 46px); font-weight: 700; line-height: 1.12; }
.af-guides-intro { margin: 0; max-width: 640px; color: var(--af-ink-soft); font-size: 17px; line-height: 1.6; }
.af-guides-search { margin: 0; }
.af-guides-body { padding-top: 22px; padding-bottom: 56px; }
.af-guide-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 24px; padding: 0 16px 4px; }
.af-guide-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 16px; border: 1px solid var(--af-sage-border); border-radius: 999px; background: #ffffff; color: var(--af-ink); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.af-guide-chip span { font-size: 13px; opacity: 0.75; }
.af-guide-chip.is-active { border-color: var(--af-primary); background: var(--af-primary); color: #ffffff; }
.af-guides-section { margin-bottom: 36px; }
.af-feature { margin-bottom: 36px; }
.af-feature-link { display: flex; flex-direction: column; overflow: hidden; background: #ffffff; border: 1px solid var(--af-line); border-radius: 20px; color: var(--af-ink); text-decoration: none; }
.af-feature-link:hover { border-color: var(--af-primary); }
.af-feature-art { position: relative; display: flex; align-items: center; justify-content: center; min-height: 170px; overflow: hidden; background: var(--af-deep); }
.af-feature-ring { position: absolute; right: -90px; top: -100px; width: 280px; height: 280px; border: 40px solid var(--af-primary); border-radius: 999px; }
.af-feature-mark { position: relative; display: inline-flex; color: var(--af-gold); }
.af-feature-mark svg { width: 72px; height: 72px; }
.af-feature-body { display: flex; flex-direction: column; gap: 10px; padding: 22px; }
.af-feature-title { font-family: Fraunces, Georgia, serif; font-size: clamp(22px, 4vw, 32px); font-weight: 700; line-height: 1.2; }
.af-feature-desc { color: var(--af-ink-soft); font-size: 16px; line-height: 1.6; }
.af-feature-cta { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 18px; border-radius: 12px; background: var(--af-primary); color: #ffffff; font-weight: 700; }

/* Article page. */
.af-article-head { padding: 18px 0 28px; background: #ffffff; border-bottom: 1px solid var(--af-line); }
.af-article-head-text { max-width: 820px; }
.af-article-kicker { margin: 14px 0 8px; color: var(--af-gold-deep); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.af-article-title { margin: 0 0 12px; font-family: Fraunces, Georgia, serif; font-size: clamp(30px, 6vw, 46px); font-weight: 700; line-height: 1.12; overflow-wrap: break-word; }
.af-article-dek { margin: 0 0 14px; color: #3f504a; font-size: clamp(17px, 2.4vw, 20px); line-height: 1.55; }
.af-article-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; color: var(--af-ink-soft); font-size: 14px; }
.af-article-meta a { color: var(--af-primary-soft); }
.af-article-layout { display: flex; flex-direction: column; gap: 28px; padding-top: 24px; padding-bottom: 48px; }
.af-article { min-width: 0; max-width: 760px; }
.af-article-content { font-size: 18px; line-height: 1.75; }
.af-calc-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 18px; padding: 16px 18px; background: var(--af-deep); border-radius: 16px; color: #ffffff; }
.af-calc-cta-icon { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: var(--af-gold); color: var(--af-deep); }
.af-calc-cta-icon svg { width: 22px; height: 22px; }
.af-calc-cta-text { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; }
.af-calc-cta-title { font-family: Fraunces, Georgia, serif; font-size: 19px; font-weight: 700; }
.af-calc-cta-desc { color: #cfd8d3; font-size: 15px; line-height: 1.45; }
.af-calc-cta-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 16px; border-radius: 12px; background: var(--af-gold); color: var(--af-deep); font-weight: 700; text-decoration: none; }
.af-calc-cta-btn:hover { background: #d4b46a; color: var(--af-deep); }
.af-article-side { display: none; }
.af-side-tool { padding: 18px; background: var(--af-deep); border-radius: 16px; color: #ffffff; }
.af-side-tool-label { margin: 0 0 4px; color: var(--af-gold); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.af-side-tool-title { margin: 0 0 12px; font-family: Fraunces, Georgia, serif; font-size: 20px; font-weight: 700; }
.af-side-tool-btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; border-radius: 12px; background: var(--af-gold); color: var(--af-deep); font-weight: 700; text-decoration: none; }
.af-side-posts { margin: 0; padding: 0; list-style: none; }
.af-side-posts li + li { border-top: 1px solid #eef1ed; }
.af-side-posts a { display: block; padding: 10px 0; color: var(--af-ink); font-size: 15px; line-height: 1.4; text-decoration: none; }
.af-side-posts a:hover { color: var(--af-primary); }
.af-keep-reading { padding: 36px 0 48px; background: #ffffff; border-top: 1px solid var(--af-line); }

/* Phone sticky bar: back to the tool, and the contents. */
.af-sticky-bar { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; padding: 8px; background: var(--af-deep); border-radius: 16px; box-shadow: 0 10px 30px rgba(12, 46, 41, 0.35); }
.af-sticky-bar[hidden] { display: none; }
.af-sticky-tool, .af-sticky-toc { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 10px; font-weight: 700; font-size: 15px; font-family: inherit; text-decoration: none; cursor: pointer; }
.af-sticky-tool { background: var(--af-gold); color: var(--af-deep); }
.af-sticky-toc { border: 1px solid rgba(207, 216, 211, 0.4); background: transparent; color: #ffffff; }
body.has-sticky-bar .af-back-top { bottom: 92px; }

@media (min-width: 641px) {
  .af-post-grid, .af-post-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .af-guide-chips { flex-wrap: wrap; overflow: visible; margin: 0 0 28px; padding: 0; }
  .af-feature-link { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .af-feature-art { min-height: 300px; }
  .af-feature-body { justify-content: center; padding: 32px; }
}
@media (min-width: 901px) {
  .af-inline-toc { display: none; }
  .af-sticky-bar { display: none !important; }
  .af-guides-hero { padding: 40px 0 36px; }
  .af-guides-hero-inner { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 32px; }
  .af-guides-search { flex: 0 1 420px; }
  .af-article-head { padding: 22px 0 36px; }
  .af-article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 48px; padding-top: 32px; }
  .af-article-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 90px; }
  .af-page-sidebar { position: sticky; top: 90px; }
  .af-post-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1025px) {
  .af-post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .af-post-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .af-post-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* v2.4.1: table styling inside the phone-friendly wrapper, and spacing
   under the calculator header on calculator pages. */
.af-site .pac-cal.pac-cal--standalone .af-calc-head { margin-bottom: clamp(18px, 3vw, 24px); }

.af-entry-content .af-table-wrap table { width: 100%; margin: 0; border-collapse: collapse; background: var(--af-surface); font-size: 15px; line-height: 1.5; }
.af-entry-content .af-table-wrap caption { caption-side: top; padding: 12px 16px; background: var(--af-canvas); border-bottom: 1px solid var(--af-line); color: var(--af-ink-soft); font-size: 14px; font-weight: 700; text-align: left; }
.af-entry-content .af-table-wrap th,
.af-entry-content .af-table-wrap td { padding: 11px 16px; border-top: 1px solid var(--af-line); background: transparent; color: var(--af-ink); text-align: left; vertical-align: top; }
.af-entry-content .af-table-wrap thead th { border-top: 0; background: var(--af-deep); color: #ffffff; font-weight: 700; }
.af-entry-content .af-table-wrap tbody th { font-weight: 700; }
.af-entry-content .af-table-wrap tbody tr:nth-child(even) { background: var(--af-canvas); }
.af-entry-content .af-table-wrap tfoot th,
.af-entry-content .af-table-wrap tfoot td,
.af-entry-content .af-table-wrap tr.af-total-row th,
.af-entry-content .af-table-wrap tr.af-total-row td { background: var(--af-gold-soft); color: var(--af-deep); font-weight: 700; }
.af-entry-content .af-table-wrap .af-num { text-align: right; }

@media (max-width: 640px) {
  /* Tables with 4+ columns scroll sideways inside their frame instead of squashing. */
  .af-entry-content .af-table-wrap:not(.is-stacked) table { min-width: 560px; }
  .af-entry-content .af-table-wrap:not(.is-stacked) th,
  .af-entry-content .af-table-wrap:not(.is-stacked) td { padding: 10px 12px; }
  /* Two- and three-column tables become labelled cards. */
  .af-entry-content .af-table-wrap.is-stacked table { background: transparent; }
  .af-entry-content .af-table-wrap.is-stacked caption { padding: 0 0 8px; background: transparent; border: 0; }
  .af-entry-content .af-table-wrap.is-stacked tr { margin-bottom: 8px; padding: 10px 14px; background: #ffffff; border: 1px solid var(--af-line); border-radius: 12px; }
  .af-entry-content .af-table-wrap.is-stacked tbody tr:nth-child(even) { background: #ffffff; }
  .af-entry-content .af-table-wrap.is-stacked th,
  .af-entry-content .af-table-wrap.is-stacked td { padding: 2px 0; border: 0; }
}

/* v2.4.2: calculator cards (related calculators, family pages, search, 404).
   The icon and the Popular badge share a top row, so the badge never
   squeezes the text; title and description always use the full width;
   "Open calculator" sits on one line at the bottom, aligned across a row. */
.af-site .af-card-link { flex-direction: column; align-items: stretch; gap: 12px; padding: 20px; }
.af-site .af-card:has(.af-card-badge) .af-card-body { padding-right: 0; }
.af-site .af-card-badge { top: 26px; right: 20px; }
.af-site .af-card-body { flex: 1 1 auto; gap: 6px; }
.af-site .af-card-title { font-size: 19px; line-height: 1.3; }
.af-site .af-card-desc { font-size: 15px; line-height: 1.5; }
.af-site .af-card-open { margin-top: auto; padding-top: 10px; white-space: nowrap; }
.af-site .af-card-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 641px) {
  .af-site .af-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1025px) {
  .af-site .af-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* v2.4.3: nothing in an article or guide may be wider than the screen.
   The article column is locked to the available width; code blocks scroll
   inside themselves; long formulas and links wrap; tables and FAQ answers
   stay inside the column. */
.af-article-layout > .af-article,
.af-article-layout > .af-article-side { width: 100%; max-width: 100%; min-width: 0; }
@media (min-width: 901px) { .af-article-layout > .af-article { max-width: 760px; } .af-article-layout > .af-article-side { width: auto; } }
.af-entry-content, .af-entry-content > *, .af-faq, .af-faq-a, .af-faq-list, .af-calc-cta, .af-guide-box { min-width: 0; max-width: 100%; }
.af-entry-content pre { max-width: 100%; overflow-x: auto; white-space: pre; -webkit-overflow-scrolling: touch; }
.af-entry-content code { overflow-wrap: anywhere; word-break: break-word; }
.af-entry-content pre code { overflow-wrap: normal; word-break: normal; }
.af-entry-content a, .af-entry-content p, .af-entry-content li { overflow-wrap: anywhere; }
.af-entry-content .af-table-wrap { max-width: 100%; }
.af-entry-content img, .af-entry-content figure, .af-entry-content iframe, .af-entry-content video { max-width: 100%; height: auto; }
.af-entry-content figure { margin-left: 0; margin-right: 0; }

/* v2.4.4: every table is a scrollable table on phones (no stacked cards).
   Columns keep a readable width; narrow tables still fit without scrolling. */
.af-entry-content .af-table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.af-entry-content .af-table-wrap:focus-visible { outline: 3px solid var(--af-gold); outline-offset: 2px; }
@media (max-width: 640px) {
  .af-entry-content .af-table-wrap table,
  .af-entry-content .af-table-wrap:not(.is-stacked) table { width: max-content; min-width: 100%; }
  .af-entry-content .af-table-wrap th,
  .af-entry-content .af-table-wrap td { min-width: 120px; max-width: 260px; padding: 10px 12px; overflow-wrap: break-word; }
  .af-entry-content .af-table-wrap caption { position: sticky; left: 0; text-align: left; }
  /* Undo the earlier stacked-card layout everywhere. */
  .af-entry-content .af-table-wrap.is-stacked { overflow-x: auto; border: 1px solid var(--af-line); background: var(--af-surface); }
  .af-entry-content .af-table-wrap.is-stacked table { display: table; }
  .af-entry-content .af-table-wrap.is-stacked thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; display: table-header-group; }
  .af-entry-content .af-table-wrap.is-stacked tbody { display: table-row-group; }
  .af-entry-content .af-table-wrap.is-stacked tr { display: table-row; margin: 0; padding: 0; border: 0; border-radius: 0; }
  .af-entry-content .af-table-wrap.is-stacked th,
  .af-entry-content .af-table-wrap.is-stacked td { display: table-cell; padding: 10px 12px; border-top: 1px solid var(--af-line); }
  .af-entry-content .af-table-wrap.is-stacked td[data-label]::before { content: none; }
}

/* Scroll shell: fades on the edges that have more to see, and a caption title
   that stays readable on phones while the table scrolls. */
.af-entry-content .af-table-shell { position: relative; margin: 20px 0; }
.af-entry-content .af-table-shell > .af-table-wrap { margin: 0; }
.af-entry-content .af-table-fade { position: absolute; bottom: 1px; width: 28px; pointer-events: none; opacity: 0; transition: opacity 0.2s; z-index: 2; }
.af-entry-content .af-table-fade-r { right: 1px; border-radius: 0 14px 14px 0; background: linear-gradient(to right, rgba(12, 46, 41, 0), rgba(12, 46, 41, 0.22)); }
.af-entry-content .af-table-fade-l { left: 1px; border-radius: 14px 0 0 14px; background: linear-gradient(to left, rgba(12, 46, 41, 0), rgba(12, 46, 41, 0.16)); }
.af-entry-content .af-table-shell.has-more .af-table-fade-r,
.af-entry-content .af-table-shell.is-scrolled .af-table-fade-l { opacity: 1; }
.af-entry-content .af-table-title { display: none; }
@media (max-width: 640px) {
  .af-entry-content .af-table-title { display: block; margin: 0 0 8px; color: var(--af-ink-soft); font-size: 14px; font-weight: 700; line-height: 1.4; }
  .af-entry-content .af-table-shell .af-table-wrap caption { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
}

/* v2.4.5: tables never squeeze words apart, on any screen. Cells wrap only
   between words; a table wider than the column scrolls inside its frame
   (with the edge fade) on desktop as well as phones. Tables that fit stay
   full width. The caption shows as a title above the table at every size. */
.af-entry-content .af-table-wrap table { width: max-content; min-width: 100%; max-width: none; table-layout: auto; }
.af-entry-content .af-table-wrap th,
.af-entry-content .af-table-wrap td { min-width: 110px; max-width: 300px; overflow-wrap: break-word; word-break: normal; hyphens: manual; }
.af-entry-content .af-table-wrap th { white-space: normal; }
.af-entry-content .af-table-title { display: block; margin: 0 0 8px; color: var(--af-ink-soft); font-size: 14px; font-weight: 700; line-height: 1.4; }
.af-entry-content .af-table-shell .af-table-wrap caption { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (min-width: 641px) {
  /* Desktop and tablet: fill the column and wrap between words; scroll only
     when the columns cannot fit at their readable minimum width. */
  .af-entry-content .af-table-wrap table { width: 100%; }
}
.af-entry-content .af-table-wrap th,
.af-entry-content .af-table-wrap td { border-left: 0; border-right: 0; }
/* Formulas and code inside tables stay on one line; the table scrolls instead. */
.af-entry-content .af-table-wrap code { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
/* Keep Korean, Chinese and Japanese words whole inside table cells. */
.af-entry-content .af-table-wrap th, .af-entry-content .af-table-wrap td { word-break: keep-all; }
