/* A-Z Gifts — neo-brutalist gift guide theme */
:root {
  --cream: #FAF3E6;
  --paper: #FFFDF7;
  --ink: #2E2118;
  --text: #3B2E22;
  --muted: #75604A;   /* was #8A7660 — failed AA (3.93:1 on cream); now 5.39:1 */
  --orange: #C2410C;
  --orange-dark: #9A3412;
  --yellow: #F5A623;
  --yellow-soft: #FCD34D;
  --dot: #EADFC6;
  --radius: 20px;
  --border: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --font: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background-color: var(--cream);
  background-image: radial-gradient(var(--dot) 1.3px, transparent 1.4px);
  background-size: 24px 24px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: 1090px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header { background: var(--paper); border-bottom: 3px solid var(--ink); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; height: 68px; gap: 20px; }
.logo { font-size: 24px; font-weight: 900; color: var(--ink); white-space: nowrap; }
.logo em { font-style: normal; color: var(--orange); }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.main-nav a { font-weight: 800; font-size: 15px; color: var(--text); }
.main-nav a:hover { color: var(--orange); }
.search-fab {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--orange); border: 3px solid var(--ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 3px 3px 0 var(--ink); cursor: pointer; flex-shrink: 0;
  transition: transform .15s ease, background .15s ease;
}
.search-fab:hover { transform: translate(-1px, -1px); background: var(--orange-dark); }
.menu-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; background: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); cursor: pointer; align-items: center; justify-content: center; color: var(--ink); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 54px 0 6px; }
.hero h1 { font-size: 54px; font-weight: 900; color: var(--ink); line-height: 1.16; letter-spacing: -0.01em; max-width: 800px; margin: 0 auto; }
.hl { background: var(--yellow); padding: 1px 16px; border-radius: 10px; box-decoration-break: clone; -webkit-box-decoration-break: clone; white-space: nowrap; }
.hero .sub { color: var(--muted); max-width: 560px; margin: 16px auto 0; font-size: 17px; font-weight: 600; }
.searchbar {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: var(--border); border-radius: 999px;
  box-shadow: var(--shadow-sm); max-width: 640px; margin: 28px auto 0; padding: 6px 6px 6px 24px;
}
.searchbar input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 16px; font-weight: 600; background: transparent; color: var(--text); min-width: 0; }
.searchbar input::placeholder { color: #B49B7D; }
.btn-search {
  background: var(--orange); color: #fff; font: inherit; font-weight: 900; font-size: 16px;
  border: 3px solid var(--ink); border-radius: 999px; padding: 11px 36px;
  box-shadow: 3px 3px 0 var(--ink); cursor: pointer; transition: background .15s ease, transform .15s ease;
}
.btn-search:hover { background: var(--orange-dark); transform: translate(-1px, -1px); }

/* ---------- Ad slot ---------- */
.ad-slot {
  border: 2.5px dashed #B9A586; border-radius: 18px; text-align: center;
  padding: 30px 16px; color: #A68F6E; font-size: 12px; font-weight: 800;
  letter-spacing: 0.35em; margin: 38px 0; background: rgba(255,255,255,.4);
}

/* ---------- Sections ---------- */
.section { padding: 30px 0; }
.section-title { text-align: center; font-size: 30px; font-weight: 900; color: var(--ink); margin-bottom: 4px; }
.section-sub { text-align: center; color: var(--muted); font-size: 14px; max-width: 660px; margin: 0 auto 26px; font-weight: 600; }
.disclosure { font-style: italic; }

/* ---------- Letter grid ---------- */
.letter-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.letter-tile {
  width: 68px; height: 78px; background: #fff; border: var(--border); border-radius: 16px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; transition: transform .15s ease, box-shadow .15s ease; margin-bottom: 8px;
}
.letter-tile:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.letter-tile .l { font-size: 26px; font-weight: 900; color: var(--ink); line-height: 1.1; }
.letter-tile .c { font-size: 12px; color: var(--muted); font-weight: 700; }
.thin-badge {
  position: absolute; bottom: -10px; background: var(--orange); color: #fff;
  font-size: 9px; font-weight: 900; letter-spacing: 0.08em; padding: 2px 9px;
  border-radius: 999px; border: 2px solid var(--ink);
}

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step-card { background: #fff; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 20px; text-align: center; }
.step-num {
  width: 52px; height: 52px; border-radius: 50%; background: var(--orange); color: #fff;
  font-weight: 900; font-size: 22px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; border: 3px solid var(--ink);
}
.step-card h3 { font-size: 18px; font-weight: 900; color: var(--ink); }

/* ---------- Product cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.product-card {
  background: #fff; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease;
}
.product-card:hover { transform: translateY(-4px); }
.product-card.hidden { display: none; }
.product-img { aspect-ratio: 1 / 1; background: #F7ECD6; border-bottom: var(--border); overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-body h3 { font-size: 19px; font-weight: 900; color: var(--ink); }
.product-body p { font-size: 14.5px; color: var(--muted); font-weight: 600; }
.bestfor { font-size: 14.5px; color: var(--muted); font-weight: 600; }
.bestfor strong { color: var(--ink); font-weight: 900; }
.price-pill {
  align-self: flex-start; background: var(--yellow-soft); border: 2.5px solid var(--ink);
  border-radius: 999px; font-size: 12.5px; font-weight: 900; padding: 3px 13px; color: var(--ink);
}
.btn-amazon {
  display: block; text-align: center; background: var(--orange); color: #fff; font-weight: 900; font-size: 16px;
  border: 3px solid var(--ink); border-radius: 999px; padding: 11px; box-shadow: var(--shadow-sm);
  margin-top: 10px; transition: background .15s ease, transform .15s ease; cursor: pointer;
}
.btn-amazon:hover { background: var(--orange-dark); transform: translate(-1px, -1px); }
.no-results { text-align: center; color: var(--muted); font-weight: 700; padding: 20px; grid-column: 1 / -1; }

/* ---------- Christmas card ---------- */
.christmas-card { background: #fff; border: var(--border); border-radius: 24px; box-shadow: var(--shadow); padding: 38px 24px; text-align: center; }
.christmas-card h2 { font-size: 24px; font-weight: 900; color: var(--ink); line-height: 1.4; }
.chip-row { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.chip {
  width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink); font-weight: 900; font-size: 17px; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; transition: transform .15s ease;
}
.chip:hover { transform: translate(-2px, -2px); background: var(--yellow-soft); }

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 14px; }
.faq-item { background: #fff; border: var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 17px 22px; background: none; border: 0; font: inherit; font-weight: 800; font-size: 16px;
  color: var(--ink); cursor: pointer; text-align: left;
}
.faq-icon { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--orange); border: 2.5px solid var(--ink); flex-shrink: 0; }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; background: #fff; border-radius: 2px; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.faq-icon::before { width: 14px; height: 3px; }
.faq-icon::after { width: 3px; height: 14px; transition: transform .2s ease; }
.faq-item.open .faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .28s ease; }
.faq-a p { padding: 0 22px 20px; font-size: 15px; color: var(--muted); font-weight: 600; max-width: 800px; }
.faq-item.open .faq-a { max-height: 300px; }

/* ---------- Letter page ---------- */
.breadcrumb { font-size: 14px; font-weight: 700; color: var(--muted); padding-top: 26px; }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb .sep { margin: 0 6px; }
.updated { font-size: 13.5px; font-style: italic; color: var(--muted); font-weight: 600; margin-top: 4px; }
.hero-letter { text-align: center; padding: 18px 0 4px; }
.hero-letter h1 { font-size: 46px; font-weight: 900; color: var(--ink); line-height: 1.2; }
.lede { text-align: center; max-width: 720px; margin: 14px auto 0; font-size: 16px; color: var(--text); font-weight: 600; }
.filter-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 24px 0 6px; }
.filter-pill {
  background: #fff; border: 2.5px solid var(--ink); border-radius: 999px; padding: 8px 20px;
  font: inherit; font-weight: 800; font-size: 14px; color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink); cursor: pointer; transition: all .15s ease;
}
.filter-pill:hover { transform: translate(-1px, -1px); }
.filter-pill.active { background: var(--ink); color: #fff; }

/* ---------- At-a-glance table ---------- */
.table-card { background: #fff; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
thead th { background: #3A2A1C; color: #FFF8EC; text-align: left; padding: 14px 20px; font-weight: 900; font-size: 14.5px; }
tbody td { padding: 14px 20px; border-top: 2px solid #F0E6D2; font-weight: 600; }
tbody tr:first-child td { border-top: 0; }
tbody tr.hidden { display: none; }
td.gift-name { font-weight: 900; color: var(--ink); }
.link-amazon { color: var(--orange); font-weight: 800; text-decoration: underline; white-space: nowrap; }
.link-amazon:hover { color: var(--orange-dark); }

/* ---------- Gift idea cards ---------- */
.gift-card { display: flex; background: #fff; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }
.gift-card.hidden { display: none; }
.gift-img { width: 290px; flex-shrink: 0; background: #F7ECD6; border-right: var(--border); min-height: 240px; }
.gift-img img { width: 100%; height: 100%; object-fit: contain; padding: 16px; background: #fff; }
.gift-body { padding: 24px 28px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.gift-body h3 { font-size: 21px; font-weight: 900; color: var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag-badge { background: var(--orange); color: #fff; font-size: 10px; font-weight: 900; letter-spacing: 0.08em; padding: 3px 10px; border-radius: 999px; border: 2px solid var(--ink); }
.gift-body > p { font-size: 15px; color: var(--text); font-weight: 600; }
.gift-body .btn-amazon { margin-top: 6px; padding: 10px 34px; }
.no-data-note { background: #fff; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 28px; text-align: center; font-weight: 700; color: var(--muted); font-size: 17px; }

/* ---------- Mini list (For adults) ---------- */
.mini-list { background: #fff; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mini-row { display: flex; align-items: center; gap: 14px; padding: 16px 22px; border-top: 2px solid #F0E6D2; }
.mini-row:first-child { border-top: 0; }
.mini-row .name { font-weight: 900; color: var(--ink); font-size: 16px; }
.mini-row .spacer { flex: 1; }
.mini-row .link-amazon { font-size: 14.5px; }

/* ---------- More letters ---------- */
.letter-nav { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.letter-btn {
  flex: 1; max-width: 300px; background: #fff; border: var(--border); border-radius: 999px;
  box-shadow: var(--shadow-sm); padding: 12px; font-weight: 900; font-size: 16px; color: var(--ink);
  text-align: center; transition: transform .15s ease;
}
.letter-btn:hover { transform: translate(-2px, -2px); }
.letter-btn.next { margin-left: auto; }
.mini-grid { background: #fff; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 18px 14px; }
.mini-grid .letter-grid { gap: 9px; }
.mini-tile {
  width: 46px; height: 46px; background: #FFFDF7; border: 2.5px solid var(--ink); border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink); font-weight: 900; font-size: 16px; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; transition: transform .15s ease;
}
.mini-tile:hover { transform: translate(-2px, -2px); }
.mini-tile.current { background: var(--orange); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: #241A12; color: #EDE0CB; margin-top: 56px; padding: 42px 0 26px; }
.footer-letters { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.footer-letter-row { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; font-weight: 800; font-size: 15px; }
.footer-letters a:hover { color: var(--yellow-soft); }
.footer-links { display: flex; gap: 28px; justify-content: center; margin: 28px 0 14px; font-weight: 700; font-size: 14.5px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--yellow-soft); }
.copyright { text-align: center; color: #A68F6E; font-size: 13px; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 46px; }
}
@media (max-width: 860px) {
  .main-nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--paper);
    flex-direction: column; align-items: stretch; gap: 0; border-bottom: 3px solid var(--ink); margin: 0; z-index: 60;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 24px; border-top: 2px solid #F0E6D2; }
  .menu-toggle { display: inline-flex; }
  .header-inner .search-fab { margin-left: auto; }
  .steps { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; }
  .gift-card { flex-direction: column; }
  .gift-img { width: 100%; border-right: 0; border-bottom: var(--border); aspect-ratio: 16 / 9; min-height: 0; }
  .hero-letter h1 { font-size: 36px; }
}
@media (max-width: 600px) {
  .container { padding: 0 18px; }
  .hero { padding: 38px 0 4px; }
  .hero h1 { font-size: 36px; }
  .hero .sub { font-size: 15px; }
  .searchbar { flex-wrap: wrap; border-radius: 24px; padding: 10px; }
  .searchbar input { flex: 1 1 100%; padding: 10px 8px; }
  .btn-search { flex: 1 1 100%; }
  .product-grid { grid-template-columns: 1fr; }
  .letter-tile { width: 60px; height: 70px; }
  .letter-nav { flex-direction: column; }
  .letter-btn { max-width: none; }
  .letter-btn.next { margin-left: 0; }
  .section-title { font-size: 26px; }
  .faq-q { font-size: 15px; padding: 15px 18px; }
  .mini-row { flex-wrap: wrap; }
  /* At-a-glance table: stack into labelled rows instead of scrolling sideways.
     min-width:640px on the table was pushing 250px of it off the screen at 390px. */
  .table-scroll { overflow-x: visible; }
  #glanceTable { min-width: 0; font-size: 14.5px; }
  #glanceTable, #glanceTable thead, #glanceTable tbody, #glanceTable tr, #glanceTable th, #glanceTable td { display: block; width: 100%; }
  #glanceTable thead { display: none; }
  #glanceTable tbody tr { border-top: 3px solid var(--ink); padding: 14px 18px; }
  #glanceTable tbody tr:first-child { border-top: 0; }
  #glanceTable tbody tr.hidden { display: none; }
  #glanceTable td { border: 0; padding: 2px 0; }
  #glanceTable td.gift-name { font-size: 16.5px; margin-bottom: 4px; }
  #glanceTable td[data-label]::before { content: attr(data-label) ": "; font-weight: 900; color: var(--muted); }
}


/* ---- build overrides (longer real content than the design mock) ---- */
.faq-item.open .faq-a { max-height: 900px; }
.gift-body .gdesc { font-size: 15px; color: var(--text); font-weight: 600; }
.gift-body .bestfor span.gbf { font-weight: 700; color: var(--ink); }

/* The at-a-glance table runs to 36 rows; on a phone that pushed the first product card 6000px down
   the page. Collapse it to the first 8 rows on narrow screens behind one button (the full table stays
   in the DOM, so crawlers still see every row), and never collapse while a filter is active. */
@media (min-width: 701px) { .table-toggle { display: none; } }
@media (max-width: 700px) {
  #glanceSection:not(.expanded):not(.filtering) #glanceTable tbody tr:nth-child(n+9) { display: none; }
  .table-toggle { display: block; width: 100%; margin-top: 14px; padding: 12px; font: inherit;
    font-size: 15px; font-weight: 900; color: var(--ink); background: #fff; border: var(--border);
    border-radius: 14px; box-shadow: var(--shadow-sm); cursor: pointer; }
  .table-toggle:hover { background: var(--bg); }
}
