/* Questions · ATHAR — page layout. Logical properties only.
   Oct 2026 polish: the hero is a deck content slide (two-tone headline · the three parts of the page as the
   deck's numbered list · the Print-grey fingerprint bleeding off the corner). Below it the eleven questions
   read in three numbered groups, each answer opening smoothly (faq.js), beside the tag photo in an arched
   window and the shared "Find your tree" form. One next step ends the page. */

/* =========================================================
   Hero
   ========================================================= */
.faq-hero { padding-block-end: clamp(2.5rem, 5vw, 4.5rem); }
/* as on the deck's content slides: only the fingerprint's whorls show, cropped by the top corner. Sized and lifted
   so it ends above the index's Brown rule (the rule and the counts never sit on the pattern) */
.faq-wm { inset-block-start: 0; inset-inline-end: -4%; width: clamp(240px, 25vw, 440px); opacity: .5; transform: translateY(-58%); }
.faq-hero-grid { align-items: end; }
.faq-hero-copy .label { margin-block-end: 1.1rem; }
.faq-hero-copy .lead { max-width: 34ch; text-wrap: balance; }
/* Arabic: two set lines (the question, then «سواء…» whole); where that is too long it breaks only between its two
   clauses, so «الشجرة لك،» and «أو لمن تحب» are never split */
html[lang="ar"] .faq-hero-copy .lead { max-width: 46ch; text-wrap: wrap; }
.faq-hero-copy .lead .ln { display: block; text-wrap: balance; }
.faq-hero-copy .lead .nw { white-space: nowrap; }

/* the page's three parts, as the deck's numbered list: big Brown numerals between Brown hairlines */
.faq-index-list { border-block-start: 2px solid var(--athar-brown); }
.faq-index-list a {
  display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto auto; align-items: center; column-gap: 1rem;
  min-height: 72px; padding-block: .9rem; border-block-end: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.faq-index-list .n { font-family: var(--font-num); font-weight: 700; font-size: clamp(1.75rem, 2.4vw, 2.375rem); line-height: 1; color: var(--athar-brown); font-variant-numeric: lining-nums tabular-nums; }
.faq-index-list .t { font-weight: 800; font-size: clamp(1.125rem, 1.45vw, 1.3125rem); line-height: 1.25; color: var(--athar-green); }
html[lang="ar"] .faq-index-list .t { font-family: var(--font-arabic-display); font-weight: 700; line-height: 1.5; }
.faq-index-list .c { font-size: .875rem; color: var(--muted); white-space: nowrap; }
html[lang="ar"] .faq-index-list .c { font-size: .9375rem; }
.faq-index-list .go { font-size: 1.25rem; color: var(--athar-brown); transition: transform .3s var(--ease); }
.faq-index-list a:hover .t { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.faq-index-list a:hover .go { transform: translateY(4px); }
.faq-index-list a:focus-visible { outline-offset: -3px; }
.faq-index-list li:nth-child(2) { --d: .08s; }
.faq-index-list li:nth-child(3) { --d: .16s; }

/* =========================================================
   The questions, in three numbered groups, beside the tag
   ========================================================= */
.faq-body { padding-block-start: clamp(3rem, 6vw, 5rem); }
.faq-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: clamp(3rem, 7vw, 7.5rem); align-items: start; }
/* the aside comes first in the source (on phones and tablets it sits under the hero); here it goes beside the answers */
.faq-layout > .faq-groups { grid-column: 1; grid-row: 1; }
.faq-layout > .faq-aside { grid-column: 2; grid-row: 1; }
/* (deep links land under the header through the shared scroll-padding-top on <html>) */
.faq-groups { display: grid; gap: clamp(3rem, 5.5vw, 4.75rem); max-width: 820px; }

/* group head: numeral (Brown) · title (Green), on the deck's 2px Brown rule */
.faq-group-head { display: flex; align-items: baseline; gap: .9rem; margin-block-end: .9rem; }
.faq-group-head .n { font-family: var(--font-num); font-weight: 700; font-size: clamp(1.5rem, 2vw, 1.875rem); line-height: 1; color: var(--athar-brown); font-variant-numeric: lining-nums tabular-nums; }
.faq-group-head .t { font-weight: 800; font-size: clamp(1.375rem, 2vw, 1.75rem); line-height: 1.2; letter-spacing: -0.01em; color: var(--athar-green); }
html[lang="ar"] .faq-group-head { align-items: center; }
html[lang="ar"] .faq-group-head .t { font-family: var(--font-arabic-display); font-weight: 700; letter-spacing: 0; line-height: 1.5; }

/* the accordion: the shared .faq, with a round toggle that turns Brown when open */
.faq-list { border-top: 2px solid var(--athar-brown); }
.faq-list summary { padding-block: 1.3rem; gap: 1.5rem; line-height: 1.35; font-size: clamp(1.125rem, 1.45vw, 1.3125rem); transition: color .25s; }
html[lang="ar"] .faq-list summary { font-family: var(--font-arabic-display); font-weight: 700; line-height: 1.6; }
.faq-list summary .q { flex: 1; text-wrap: balance; }
.faq-list summary:hover { color: var(--athar-brown); }
.faq-list summary:focus-visible { outline-offset: 2px; }
.faq-list .tg {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--athar-brown) 35%, transparent); color: var(--athar-brown);
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.faq-list summary .tg .ms { font-size: 1.375rem; color: inherit; transition: transform .35s var(--ease); }
.faq-list summary:hover .tg { border-color: var(--athar-brown); }
.faq-list details[open]:not(.is-closing) .tg { background: var(--athar-brown); border-color: var(--athar-brown); color: var(--athar-cream); }
/* the shared rule rotates every .ms in an open summary; here only the toggle turns (+ becomes ×) */
.faq-list details[open] summary .ms { transform: none; }
.faq-list details[open]:not(.is-closing) summary .tg .ms { transform: rotate(45deg); }

.faq-list .answer { max-width: 64ch; padding-block: 0; padding-inline-end: calc(40px + 1.5rem); line-height: 1.7; font-size: 1.0625rem; }
/* the space under an answer is a spacer, not padding, so the height animation can run all the way to 0 */
.faq-list .answer::after { content: ""; display: block; height: 1.75rem; }
html[lang="ar"] .faq-list .answer { font-size: 1.125rem; line-height: 1.9; }
.faq-list .answer > * + * { margin-block-start: .9rem; }
.faq-list .answer p { text-wrap: pretty; }
.faq-list .answer a:not(.link) { color: var(--athar-green); font-weight: 700; }
.faq-list details.is-anim .answer { overflow: hidden; }
.faq-list .more { --cluster: 1.5rem; }
.faq-list .more .link { min-height: 44px; }
.faq-list details.is-target > summary { animation: faq-flash 1.8s var(--ease) 1; }
@keyframes faq-flash { 0% { background: var(--athar-sage); } 100% { background: transparent; } }

/* ---------- the aside: the tag on its tree in an arched window, then "Find your tree" ---------- */
/* it stays in view while the answers open and close */
.faq-aside { position: sticky; inset-block-start: calc(var(--header-h) + 1.75rem); display: grid; gap: 1.75rem; }
/* the arch: a semicircular top on a 4:5 photo (vertical radius = half the width = 40% of the height),
   with a Tan hairline echoing it 12px outside, as in the home page's tap scene */
.faq-arch { position: relative; padding: 12px; }
.faq-arch::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid var(--athar-tan); opacity: .8;
  border-radius: 50% 50% 32px 32px / 40.6% 40.6% 32px 32px;
}
.faq-arch-photo {
  display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--athar-sand);
  border-radius: 50% 50% 22px 22px / 40% 40% 22px 22px;
}
.faq-arch-photo > img { width: 100%; height: 100%; object-fit: cover; object-position: 54% 40%; transition: transform 1.4s var(--ease); }
.faq-arch:hover .faq-arch-photo > img { transform: scale(1.03); }
.faq-find-card { display: grid; gap: .75rem; padding-inline: 12px; }
.faq-find { max-width: none; }
.faq-find-note { font-size: .875rem; color: var(--muted); line-height: 1.5; }
html[lang="ar"] .faq-find-note { font-size: .9375rem; line-height: 1.7; }

/* ---------- the next step ---------- */
.faq-next { margin-block-start: clamp(3.5rem, 7vw, 5.5rem); }

/* =========================================================
   Narrower screens
   ========================================================= */
@media (max-width: 1080px) {
  .faq-layout { grid-template-columns: 1fr; gap: clamp(3rem, 7vw, 4.5rem); }
  .faq-layout > :is(.faq-groups, .faq-aside) { grid-column: auto; grid-row: auto; }
  /* under the hero, before the answers: the arch beside the ID form */
  .faq-aside { position: static; grid-template-columns: minmax(0, 230px) minmax(0, 1fr); align-items: center; gap: clamp(1.5rem, 5vw, 3rem); max-width: 820px; }
}
@media (max-width: 960px) {
  .faq-hero-grid { gap: clamp(2rem, 6vw, 3rem); }
  .faq-hero-copy .lead { max-width: 40ch; }
}
@media (max-width: 620px) {
  .faq-index-list a { grid-template-columns: 2.6rem minmax(0, 1fr) auto; min-height: 64px; column-gap: .75rem; }
  .faq-index-list .c { display: none; }
  .faq-group-head { margin-block-end: .6rem; }
  .faq-list summary { font-size: 1.0625rem; padding-block: 1.1rem; gap: 1rem; }
  .faq-list .tg { width: 36px; height: 36px; }
  .faq-list .answer { padding-inline-end: 0; font-size: 1rem; }
  html[lang="ar"] .faq-list .answer { font-size: 1.0625rem; }
  /* phones: a wider arch (5:4, top radius = half the width = 62.5% of the height), then the form */
  .faq-aside { grid-template-columns: 1fr; gap: 1.25rem; }
  .faq-arch::before { border-radius: 50% 50% 30px 30px / 61.5% 61.5% 30px 30px; }
  .faq-arch-photo { aspect-ratio: 5 / 4; border-radius: 50% 50% 20px 20px / 62.5% 62.5% 20px 20px; }
  .faq-arch-photo > img { object-position: 50% 34%; }
  .faq-find-card { padding-inline: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .faq-arch:hover .faq-arch-photo > img { transform: none; }
}
