/* ============================================================
   ناناشاپ — site stylesheet (handwritten, RTL, mobile-first)
   Palette: warm coral primary, teal secondary, soft cream bg
   Font: Vazirmatn (self-hosted, /assets/fonts)
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --coral:        #f2705b;
  --coral-dark:   #d95441;
  --coral-soft:   #fde6e1;
  --teal:         #2aa198;
  --teal-dark:    #1d7d76;
  --teal-soft:    #dff3f1;
  --yellow-soft:  #fff3d6;
  --ink:          #33383f;
  --ink-soft:     #6b7280;
  --bg:           #fffaf5;
  --card:         #ffffff;
  --line:         #f0e6dc;
  --ok:           #1e9e63;
  --bad:          #d64550;
  --radius:       18px;
  --radius-sm:    12px;
  --shadow:       0 6px 24px rgba(51, 40, 30, 0.07);
  --shadow-hover: 0 10px 32px rgba(51, 40, 30, 0.12);
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Vazirmatn', 'Tahoma', sans-serif;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--ink);
  background: var(--bg);
  text-align: right;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: var(--coral-dark); }
h1, h2, h3, h4 { line-height: 1.5; color: var(--ink); }
ul, ol { padding-right: 1.4rem; padding-left: 0; }

.container { width: min(1140px, 100% - 2rem); margin-inline: auto; }
.container-narrow { width: min(820px, 100% - 2rem); margin-inline: auto; }
.section { padding-block: 2.5rem; }

.skip-link {
  position: absolute; top: -100px; right: 1rem;
  background: var(--ink); color: #fff; padding: .5rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); z-index: 100;
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 250, 245, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px;
}
/* Logo + search travel together: under dir="rtl" the logo sits at the inline
   start (visually right) and the search box lands directly to its left. The
   search is deliberately NOT inside .nav-list -- keeping it out of the
   hamburger means it stays visible on mobile instead of hiding behind the
   menu button. */
.header-brand { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.logo { display: inline-flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
/* NAN-51 "Three dots" mark (src/logo.php): regular cut at 40px in the header;
   the footer's smaller mark uses the small cut. */
.logo-mark { width: 2.5rem; height: 2.5rem; flex: 0 0 auto; display: block; }
.logo-text {
  font-size: 1.5rem; font-weight: 800; color: var(--coral);
  letter-spacing: -.5px;
}
.logo:hover .logo-text { color: var(--coral-dark); }

.site-nav { position: relative; }
.nav-list {
  display: flex; align-items: center; gap: .25rem;
  list-style: none; margin: 0; padding: 0;
}
.nav-list a {
  display: block; padding: .45rem .85rem; border-radius: 999px;
  color: var(--ink); font-weight: 500; font-size: .95rem;
  transition: background .15s ease, color .15s ease;
}
.nav-list a:hover { background: var(--coral-soft); color: var(--coral-dark); }
.nav-list a[aria-current="page"] { background: var(--coral); color: #fff; }

.nav-search form {
  display: flex; align-items: center; gap: .25rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: .25rem .3rem .25rem .9rem;
}
.nav-search input[type="search"] {
  border: 0; background: transparent; font: inherit; color: var(--ink);
  width: 11rem; max-width: 40vw;
}
.nav-search input[type="search"]:focus { outline: none; }
.nav-search button {
  border: 0; background: var(--teal-soft); color: var(--teal-dark);
  width: 2rem; height: 2rem; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font-size: 1rem;
  transition: background .15s ease, color .15s ease;
}
.nav-search button:hover { background: var(--teal); color: #fff; }

/* Mobile nav (CSS-only hamburger, no JS) */
.nav-toggle { display: none; }
.nav-toggle-label { display: none; cursor: pointer; padding: .5rem; }
.nav-toggle-label span {
  display: block; width: 24px; height: 3px; margin: 5px 0;
  background: var(--ink); border-radius: 3px; transition: transform .2s ease;
}
@media (max-width: 760px) {
  .nav-toggle-label { display: block; }
  .nav-list {
    display: none; position: absolute; inset-inline: auto -1rem;
    left: -1rem; top: calc(100% + .75rem);
    flex-direction: column; align-items: stretch; gap: .15rem;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-hover);
    padding: .6rem; min-width: 220px;
  }
  .nav-toggle:checked ~ .nav-list { display: flex; }
  .nav-list a { padding: .6rem 1rem; }

  /* The search now shares the header bar with the logo and the hamburger
     rather than filling the dropdown, so it shrinks instead of stretching.
     min-width: 0 lets the flex item actually shrink below its content size. */
  .header-inner { gap: .5rem; }
  .header-brand { gap: .5rem; }
  .nav-search form { padding-inline-start: .6rem; min-width: 0; }
  .nav-search input[type="search"] { width: 5rem; max-width: 30vw; min-width: 0; }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1000px 400px at 85% -10%, var(--teal-soft), transparent 60%),
    radial-gradient(900px 420px at 10% 110%, var(--yellow-soft), transparent 55%),
    linear-gradient(180deg, #fff6ee, var(--bg));
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid; gap: 2rem; align-items: center;
  padding-block: 3rem;
}
.hero h1 {
  margin: 0; font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 800;
  color: var(--coral);
}
.hero-tagline {
  font-size: clamp(1.15rem, 3vw, 1.5rem); font-weight: 700;
  margin: .5rem 0 0;
}
.hero-sub { color: var(--ink-soft); max-width: 34rem; }
.hero-cats { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.hero-cat {
  background: var(--card); border: 2px solid var(--teal-soft);
  color: var(--teal-dark); font-weight: 700; font-size: .95rem;
  padding: .45rem 1.1rem; border-radius: 999px;
  transition: all .15s ease;
}
.hero-cat:hover { border-color: var(--teal); background: var(--teal); color: #fff; }
.hero-art > img { border-radius: var(--radius); box-shadow: var(--shadow); }
@media (min-width: 860px) {
  .hero-inner { grid-template-columns: 1.1fr .9fr; }
}

/* ---------- Hero slider (NAN-42) ---------- */
.hero-art { min-width: 0; }
.hero-slider { position: relative; padding-bottom: 2.25rem; }
.hero-slider-track {
  display: flex; gap: .75rem;
  padding-block: .4rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.hero-slider-track::-webkit-scrollbar { display: none; }
.hero-slide { flex: 0 0 88%; scroll-snap-align: start; }
.hero-slide-link { display: block; color: inherit; }
.hero-slide-media { display: block; border-radius: var(--radius); overflow: hidden; }
.hero-slide-media img { width: 100%; aspect-ratio: 8 / 5; object-fit: contain; }
.hero-slide-body { display: block; padding: .65rem .25rem 0; }
.hero-slide-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: .4rem; font-weight: 800; font-size: 1.05rem; line-height: 1.7;
}
.hero-slide .chip:hover { background: var(--teal-soft); color: var(--teal-dark); }

/* Injected by slider.js — absolutely positioned into the reserved strip */
.hero-slider-controls {
  position: absolute; inset-inline: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.hero-slider-dots { display: flex; gap: .35rem; }
.hero-slider-dot {
  width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer;
}
.hero-slider-dot::before {
  content: ""; display: block; margin: auto; width: 8px; height: 8px;
  border-radius: 999px; background: var(--line); transition: all .15s ease;
}
.hero-slider-dot[aria-current="true"]::before { width: 18px; background: var(--teal-dark); }
.hero-slider-arrow, .hero-slider-toggle {
  width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--teal-dark); font-size: 1.1rem; line-height: 1;
}

/* ---------- Section headings ---------- */
.section-head { margin-bottom: 1.5rem; }
.section-head h2 {
  margin: 0; font-size: 1.6rem; font-weight: 800;
  display: inline-block; position: relative; padding-bottom: .35rem;
}
.section-head h2::after {
  content: ''; position: absolute; right: 0; bottom: 0;
  width: 55%; height: 5px; border-radius: 4px;
  background: linear-gradient(-90deg, var(--coral), var(--yellow-soft));
}
.section-head p { margin: .4rem 0 0; color: var(--ink-soft); }

/* ---------- Post cards ---------- */
.post-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.post-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.post-card-media { background: #fdf3ec; }
.post-card-media img { aspect-ratio: 8 / 5; object-fit: contain; width: 100%; }
.post-card-body { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.post-card-meta {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  font-size: .82rem; color: var(--ink-soft);
}
.chip {
  display: inline-block; background: var(--teal-soft); color: var(--teal-dark);
  font-size: .8rem; font-weight: 700; padding: .15rem .75rem;
  border-radius: 999px; transition: all .15s ease;
}
.chip:hover { background: var(--teal); color: #fff; }
.post-card-title { margin: 0; font-size: 1.12rem; font-weight: 700; }
.post-card-title a { color: var(--ink); }
.post-card-title a:hover { color: var(--coral-dark); }
.post-card-desc {
  margin: 0; color: var(--ink-soft); font-size: .92rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-more {
  margin-top: auto; padding-top: .5rem;
  font-weight: 700; font-size: .9rem; color: var(--coral);
}
.post-card-more:hover { color: var(--coral-dark); }

/* ---------- Category tiles ---------- */
.cat-strip {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.cat-tile {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1rem;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease;
}
.cat-tile:hover { transform: translateY(-4px); border-color: var(--coral); }
.cat-tile-icon { font-size: 2.2rem; }
.cat-tile-name { font-weight: 700; color: var(--ink); }

/* ---------- Page head / breadcrumbs ---------- */
.page-head {
  background: linear-gradient(180deg, #fff6ee, var(--bg));
  border-bottom: 1px solid var(--line);
  padding-block: 2rem 1.5rem;
}
.page-head h1 { margin: .4rem 0 0; font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; }
.page-head-sub { color: var(--ink-soft); margin: .35rem 0 0; }
.breadcrumbs { font-size: .85rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: .4rem; }

.page-head-search {
  display: flex; gap: .5rem; margin-top: 1.1rem; max-width: 28rem;
}
.page-head-search input[type="search"] {
  flex: 1; border: 1px solid var(--line); border-radius: 999px;
  padding: .7rem 1.1rem; font: inherit; color: var(--ink); background: var(--card);
}
.page-head-search input[type="search"]:focus { outline: none; border-color: var(--teal); }
.page-head-search button {
  border: 0; background: var(--coral); color: #fff; font-weight: 700;
  border-radius: 999px; padding: .7rem 1.4rem; cursor: pointer;
  transition: background .15s ease;
}
.page-head-search button:hover { background: var(--coral-dark); }
.breadcrumbs span[aria-current] {
  color: var(--ink); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 60vw;
}

/* ---------- Post article ---------- */
.post-meta {
  display: flex; align-items: center; gap: 1rem; margin-top: .75rem;
  color: var(--ink-soft); font-size: .88rem;
}
.post-hero { margin: 1.75rem 0; background: #fdf3ec; border-radius: var(--radius); }
.post-hero .lightbox-trigger img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: contain;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.disclosure {
  background: var(--yellow-soft); border: 1px solid #f3e3b5;
  border-radius: var(--radius-sm); padding: .9rem 1.2rem;
  font-size: .9rem; margin-bottom: 1.5rem;
}
.post-intro p { margin: 0 0 1rem; }

/* Image lightbox (CSS-only, shared by hero + product images) */
.lightbox-toggle {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.lightbox-toggle:focus-visible + .lightbox-trigger {
  outline: 3px solid var(--coral); outline-offset: 2px;
}
.lightbox-trigger { display: block; cursor: zoom-in; }
.lightbox-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  align-items: center; justify-content: center; padding: 3rem 1.5rem;
  background: rgba(20, 14, 8, .88); cursor: zoom-out;
}
.lightbox-toggle:checked ~ .lightbox-overlay { display: flex; }
.lightbox-overlay img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; border-radius: var(--radius-sm); box-shadow: var(--shadow-hover);
}
.lightbox-close {
  position: absolute; top: 1.25rem; inset-inline-end: 1.5rem;
  width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  color: #fff; font-size: 1.4rem; line-height: 1;
  background: rgba(255, 255, 255, .15); border-radius: 50%;
}

/* Table of contents */
.toc {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  margin: 2rem 0; box-shadow: var(--shadow);
}
.toc h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.toc ol { margin: 0; display: grid; gap: .25rem; }
.toc a { color: var(--teal-dark); font-size: .95rem; }
.toc a:hover { color: var(--coral-dark); }

/* ---------- Product cards ---------- */
.products { display: grid; gap: 1.75rem; margin-block: 2rem; }
.product-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: grid; scroll-margin-top: 90px;
}
.product-media { position: relative; background: #fdf3ec; }
.product-media .lightbox-trigger { height: 100%; }
.product-media .lightbox-trigger img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.product-rank {
  position: absolute; top: .9rem; right: .9rem;
  width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  background: var(--coral); color: #fff;
  font-weight: 800; font-size: 1.15rem;
  border-radius: 50%; box-shadow: var(--shadow); z-index: 1;
}
.product-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .6rem; }
.product-head { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.product-name { margin: 0; font-size: 1.2rem; font-weight: 700; }
.badge {
  background: var(--coral); color: #fff; font-size: .78rem; font-weight: 700;
  padding: .18rem .8rem; border-radius: 999px; white-space: nowrap;
}
.product-price { margin: 0; color: var(--teal-dark); font-weight: 800; font-size: 1.15rem; }
.product-desc { margin: 0; color: var(--ink-soft); font-size: .95rem; }

.pros-cons { display: grid; gap: .75rem; margin-top: .25rem; }
.pros, .cons {
  border-radius: var(--radius-sm); padding: .8rem 1rem;
  font-size: .88rem;
}
.pros { background: #eaf7f0; }
.cons { background: #fdeef0; }
.pros h4, .cons h4 { margin: 0 0 .3rem; font-size: .85rem; }
.pros h4 { color: var(--ok); }
.cons h4 { color: var(--bad); }
.pros ul, .cons ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .2rem; }
.icon-yes { color: var(--ok); font-weight: 800; margin-left: .3rem; }
.icon-no { color: var(--bad); font-weight: 800; margin-left: .3rem; }

.btn-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--coral); color: #fff !important;
  font-weight: 700; font-size: 1rem;
  padding: .8rem 1.6rem; border-radius: 999px;
  margin-top: .6rem; align-self: flex-start;
  box-shadow: 0 6px 18px rgba(242, 112, 91, .35);
  transition: background .15s ease, transform .15s ease;
}
.btn-cta:hover { background: var(--coral-dark); transform: translateY(-2px); }

@media (min-width: 700px) {
  .product-card { grid-template-columns: 300px 1fr; }
  .product-media .lightbox-trigger img { height: 100%; }
}

/* ---------- Search product results ---------- */
.search-product-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.search-product-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.search-product-media { display: block; background: #fdf3ec; }
.search-product-media img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.search-product-body { padding: 1rem 1.1rem 1.2rem; display: grid; gap: .3rem; }
.search-product-name { margin: 0; font-size: 1.02rem; font-weight: 700; }
.search-product-name a { color: var(--ink); }
.search-product-name a:hover { color: var(--coral-dark); }
.search-product-price { margin: 0; color: var(--teal-dark); font-weight: 800; font-size: .95rem; }
.search-product-source { font-size: .82rem; color: var(--ink-soft); }
.search-product-source:hover { color: var(--coral-dark); }

/* ---------- Buying guide ---------- */
.buying-guide {
  background: var(--teal-soft); border-radius: var(--radius);
  padding: 1.75rem 1.75rem 1.25rem; margin-block: 2.5rem;
}
.buying-guide h2 { margin: 0 0 .75rem; font-size: 1.35rem; color: var(--teal-dark); }
.buying-guide p { margin: 0 0 1rem; }

/* ---------- Prose pages (about/contact) ---------- */
.prose p { margin: 0 0 1.1rem; }
.prose h2 { font-size: 1.3rem; margin: 1.75rem 0 .6rem; }
.contact-list { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: .9rem; }
.contact-list li {
  display: flex; align-items: center; gap: 1rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 1rem 1.25rem; box-shadow: var(--shadow);
}
.contact-icon { font-size: 1.5rem; }
.contact-icon svg { width: 1.5rem; height: 1.5rem; color: var(--teal); vertical-align: middle; }
.contact-list strong { display: block; font-size: .9rem; }
.contact-note { font-size: .88rem; color: var(--ink-soft); }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding-block: 4rem; }
.notfound-code {
  font-size: clamp(4rem, 14vw, 7rem); font-weight: 800;
  color: var(--coral-soft); margin: 0; line-height: 1;
  text-shadow: 0 2px 0 var(--coral);
}
.notfound h1 { margin: .5rem 0; }
.notfound p { color: var(--ink-soft); max-width: 32rem; margin-inline: auto; }
.notfound-actions {
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.5rem;
}

.empty-state {
  text-align: center; color: var(--ink-soft);
  background: var(--card); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 2.5rem 1rem;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3rem; background: #4a3f3a; color: #f5ece4;
}
.footer-grid {
  display: grid; gap: 2rem; padding-block: 2.5rem;
  grid-template-columns: 1fr;
}
.footer-logo {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.4rem; font-weight: 800; color: #ffb4a4; margin-bottom: .5rem;
}
.footer-logo .logo-mark { width: 1.9rem; height: 1.9rem; }
.footer-about p { margin: 0; font-size: .9rem; color: #d9ccc2; }
.footer-links h2 { font-size: 1rem; margin: 0 0 .6rem; color: #fff; }
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.footer-links a { color: #d9ccc2; font-size: .92rem; }
.footer-links a:hover { color: #ffb4a4; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding-block: 1.1rem; font-size: .85rem; color: #bdafa4;
  display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between;
}
.footer-bottom p { margin: 0; }
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .pros-cons { grid-template-columns: 1fr 1fr; }
}

/* ---------- Misc ---------- */
::selection { background: var(--coral-soft); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

/* ---------- Live search suggestions (NAN-43) ---------- */
/* Built entirely by public/assets/search.js; nothing here renders without it.
   Positioned from JS (the element lives on <body>), so only the box model,
   colours and the mobile breakout are expressed here.

   No open/close transition, deliberately: the panel appears under a cursor
   that is mid-typing, where an animation delays the first result rather than
   softening it. That also means no prefers-reduced-motion override is needed
   here -- there is no motion to reduce. Do not add one without adding the
   media query too. */
.search-suggest {
  position: absolute; z-index: 60;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-hover);
  padding: .4rem;
  max-height: min(70vh, 30rem); overflow-y: auto;
  text-align: start;
}
.search-suggest[hidden] { display: none; }

.search-suggest-head {
  padding: .35rem .6rem .2rem;
  font-size: .78rem; font-weight: 700; color: var(--ink-soft);
}
.search-suggest-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .4rem .6rem; border-radius: var(--radius-sm);
  color: var(--ink);
}
.search-suggest-row:hover,
.search-suggest-row.is-active,
.search-suggest-all:hover,
.search-suggest-all.is-active {
  background: var(--coral-soft); color: var(--coral-dark);
}
.search-suggest-thumb {
  flex: 0 0 auto; width: 48px; height: 48px;
  border-radius: var(--radius-sm); overflow: hidden;
}
.search-suggest-thumb img { width: 100%; height: 100%; object-fit: contain; }
.search-suggest-text {
  min-width: 0; display: flex; flex-direction: column; gap: .1rem;
}
.search-suggest-title,
.search-suggest-meta {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.6;
}
.search-suggest-title { font-size: .95rem; font-weight: 600; }
.search-suggest-meta  { font-size: .8rem; color: var(--ink-soft); }
.search-suggest-empty {
  padding: .9rem .6rem; color: var(--ink-soft); font-size: .9rem;
}
.search-suggest-all {
  display: block; margin-top: .25rem; padding: .55rem .6rem;
  border-top: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--teal-dark); font-weight: 600; font-size: .9rem;
}

/* Announced to screen readers only — same clip pattern as .lightbox-toggle.
   Scoped rather than added as a global utility. */
.search-suggest-status {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Same breakpoint as the nav hamburger, so the panel and the dropdown can
   never disagree about where mobile starts. */
@media (max-width: 760px) {
  .search-suggest {
    border-radius: 0; border-inline: 0;
    max-height: 60vh;
  }
}
