/* ===========================================================================
   AL-SAEED ECONOMIC GROUP  —  pages/p-faqs.css
   ---------------------------------------------------------------------------
   Frequently asked questions. The twentieth distinct visual key:
     Home             teal filled eyebrow, expanding six-panel strip
     About            gold filled eyebrow, timeline on one rule
     Chairman         gold-on-dark eyebrow, letter on the dark ground
     Leadership       outlined eyebrow, portrait grid with no card boxes
     Sectors          rule-and-label eyebrow, alternating full-width rows
     Sector detail    dark filled eyebrow pill, one page as a tab set
     Companies        underlined eyebrow, filterable directory of crest cards
     Projects         vertical bar eyebrow, staggered grid, caption plates
     Project detail   bracketed eyebrow, long-form copy beside a sticky rail
     Global Presence  flanking rules, two-column evidence comparison
     Sustainability   diamond marker, quadrant and an empty report table
     News             highlighter band, front page and a date-first archive
     News detail      corner ticks, no banner, a measured column with breakouts
     Gallery          2x2 dot grid glyph, albums drawn as stacks of prints
     Gallery album    three-sided frame, a mosaic with a 2x2 lead tile
     Contact          trailing rule that fills the line, floating-label form
     Careers          chevron tag cut with clip-path, sideways spine labels
     Careers-apply    label banded between two hairlines, form in three parts
     Videos           diagonal plate in logical corners, a sprocketed filmstrip
     FAQs             a SPEECH BUBBLE - the first eyebrow with a TAIL. Every
                      earlier mark stayed inside its own box; this one points
                      out of it, down and towards the leading edge, which is
                      the only mark on the site that leaves its own outline.

   The tail is a border triangle - and borders, like radii, HAVE logical
   longhands. Declaring the filled edge as `border-top` and the transparent
   one as `border-inline-end` makes the triangle lean away from the leading
   edge and flip itself in Arabic and Kurdish, with no [dir] rule at all. Only
   `clip-path` and `transform` (Careers, and the play arrows on Videos) have
   no logical form and must be written twice.

   THE PAGE'S DEVICE IS TWO REGISTERS OF QUESTION. The first set is answered
   here, from the design and from the site itself - the city, the seven
   sectors, the six companies, the four telephone lines, the one clip. The
   second set is the questions NOTHING can answer yet, and their answers are
   drawn as EMPTY FIELDS: the founding year the design gives three times over,
   the country it gives twice, the chairman with no name, the twenty unfilled
   sector leads, the seven unlabelled names in the gold ribbon, the opening
   hours. That second register is this project's open-questions list turned
   into a page a client can read.

   ACCORDION MECHANICS. The panels ship OPEN and js/accordion.js closes them,
   so a reader without JavaScript gets every answer. The height is animated
   from `grid-template-rows:0fr` to `1fr` - no measured pixel heights, so
   reflowing copy cannot break it - and `visibility` rides along, because a
   collapsed region of zero height is still in the accessibility tree until
   something takes it out.
   =========================================================================== */

.page-faqs{
  --eyebrow-bg:var(--ink);
  --eyebrow-fg:var(--cream);
  --page-bg:var(--white);

  --tail:.4375rem;      /* how far the bubble's tail hangs */
  --measure:44rem;      /* the answer column */
}

/* ---------------------------------------------------------------------------
   THE TWENTIETH EYEBROW — a speech bubble with a tail
   --------------------------------------------------------------------------- */
.page-faqs .eyebrow{
  position:relative;
  margin-bottom:calc(var(--s-3) + var(--tail));
}
.page-faqs .eyebrow::after{
  content:"";position:absolute;top:100%;
  inset-inline-start:1.125rem;
  width:0;height:0;
  /* One filled edge and one transparent one make the triangle. Both are
     named logically, so the lean mirrors itself. */
  border-top:var(--tail) solid var(--eyebrow-bg);
  border-inline-end:var(--tail) solid transparent;
}
.page-faqs .eyebrow--onDark{
  background:rgba(255,255,255,.14);
  color:var(--white);
  border:0;
}
.page-faqs .eyebrow--onDark::after{border-top-color:rgba(255,255,255,.14)}

/* ---------------------------------------------------------------------------
   THE TWO REGISTERS
   --------------------------------------------------------------------------- */
.answered{background:var(--white)}
.unanswered{background:var(--cream)}

.qset{
  list-style:none;margin:clamp(1.75rem,1.25rem + 1.5vw,2.5rem) 0 0;padding:0;
  max-width:min(58rem,100%);
}
.qset > li{border-top:.0625rem solid var(--line)}
.qset > li:last-child{border-bottom:.0625rem solid var(--line)}

/* --- the question ------------------------------------------------------- */
.faq__q{margin:0;font-size:inherit;font-weight:inherit}
.faq__q button{
  display:flex;align-items:flex-start;gap:var(--s-2);
  width:100%;padding:clamp(1rem,.875rem + .5vw,1.375rem) 0;
  border:0;background:none;cursor:pointer;
  font:inherit;text-align:start;
  font-family:var(--ff-head, inherit);font-weight:600;
  font-size:var(--fs-h4);line-height:1.35;color:var(--ink);
  transition:color var(--dur-fast) var(--ease);
}
.faq__q button:hover{color:var(--gold-dk)}
.faq__q button:focus-visible{
  outline:.1875rem solid var(--gold);outline-offset:.125rem;border-radius:var(--r-sm);
}
.faq__text{flex:1 1 auto;min-width:0}

/* the marker: a plus that becomes a minus. Two bars, one of them rotated,
   and rotation has no logical axis - but a vertical bar turning into nothing
   looks the same in both directions, so this one needs no override. */
.faq__mark{
  flex:0 0 auto;position:relative;
  width:1.5rem;height:1.5rem;margin-top:.125rem;
  border-radius:50%;
  background:var(--gold-tint);
  transition:background var(--dur-fast) var(--ease);
}
.faq__mark::before,
.faq__mark::after{
  content:"";position:absolute;top:50%;left:50%;
  width:.6875rem;height:.125rem;
  margin:-.0625rem 0 0 -.34375rem;
  background:var(--gold-dk);
  transition:transform var(--dur) var(--ease);
}
.faq__mark::after{transform:rotate(90deg)}
.faq.is-open .faq__mark{background:var(--teal-tint)}
.faq.is-open .faq__mark::before,
.faq.is-open .faq__mark::after{background:var(--teal-dp)}
.faq.is-open .faq__mark::after{transform:rotate(0deg)}

/* --- the answer --------------------------------------------------------- */
/* Open is the DEFAULT, so a no-JS reader sees every answer. The `.js` class
   main.js puts on <html> is what licenses the collapse. */
.faq__a{
  display:grid;grid-template-rows:1fr;
  overflow:hidden;visibility:visible;
}
.js .faq:not(.is-open) .faq__a{
  grid-template-rows:0fr;
  visibility:hidden;
}
.js .faq__a{
  transition:grid-template-rows var(--dur) var(--ease), visibility var(--dur);
}
/* The inner element is what the row measures, and it must be able to reach
   ZERO. min-height:0 licenses that - but PADDING NEVER COMPRESSES, so a
   padding-bottom here floors the collapsed row at its own value: measured, it
   left a 21px sliver under all fourteen questions, about 300px of dead space
   on the page. The breathing room goes on a block pseudo-element instead,
   which the row clips like any other content. */
.faq__inner{min-height:0}
.faq__inner::after{
  content:"";display:block;
  height:clamp(1rem,.875rem + .5vw,1.5rem);
}
.faq__inner > *{margin:0;max-width:var(--measure)}
.faq__inner > * + *{margin-top:var(--s-2)}
.faq__inner p{color:var(--muted);font-size:var(--fs-sm);line-height:1.75}
.faq__inner a{color:var(--gold-dk);text-decoration:underline}
.faq__inner ul{padding-inline-start:1.125rem;color:var(--muted);font-size:var(--fs-sm)}
.faq__inner li + li{margin-top:.25rem}

/* the empty answer, for the questions nothing can answer yet */
.faq__await{
  display:flex;flex-wrap:wrap;align-items:center;gap:.625rem var(--s-2);
}
.faq__await .slot{flex:0 0 auto}
.faq__await span:not(.slot){font-size:var(--fs-xs);color:var(--gold-dk)}

/* what the design actually says, quoted under an unanswerable question */
/* the quote plate needs to lift off whatever ground it sits on, and the two
   registers have different grounds */
.answered .says{background:var(--cream)}
.says{
  margin:0;padding:var(--s-2) var(--s-3);
  background:var(--white);
  border-inline-start:.1875rem solid var(--gold);
  border-radius:0 var(--r-sm) var(--r-sm) 0;
  font-size:var(--fs-sm);color:var(--ink-2);
}
[dir="rtl"] .says{border-radius:var(--r-sm) 0 0 var(--r-sm)}
.says dt{
  font-size:var(--fs-xs);letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);margin-bottom:.375rem;
}
.says dd{margin:0}
.says dd + dt{margin-top:var(--s-2)}
.says q{quotes:"\201C" "\201D" "\2018" "\2019"}
[dir="rtl"] .says q{quotes:"\00AB" "\00BB" "\2039" "\203A"}
/* Every quotation in this block is of the ENGLISH design document, so in the
   Arabic and Kurdish editions it stays English and carries dir="ltr". Such a
   run keeps English quote marks and its own alignment: guillemets around a
   Latin sentence read as though the quotation had been translated, which it
   has not. Same rule as the citations on Global Presence. */
[dir="rtl"] .says q[dir="ltr"]{
  quotes:"\201C" "\201D" "\2018" "\2019";
  display:inline-block;text-align:left;
}

/* --- the open-all control ----------------------------------------------- */
/* the same measure as the list, so the control lines up with the right
   edge of the questions instead of floating off at the section edge */
.qhead{
  /* stacked while the heading needs the whole width, side by side once there
     is room - the control beside a two-line title reads as an afterthought */
  display:grid;gap:var(--s-2);justify-items:start;
  max-width:min(58rem,100%);
}
@media (min-width:40rem){
  .qhead{
    display:flex;flex-wrap:wrap;align-items:baseline;
    justify-content:space-between;gap:var(--s-2) var(--s-3);
  }
}
.qall{
  border:0;background:none;cursor:pointer;font:inherit;
  font-size:var(--fs-sm);font-weight:600;color:var(--teal-dp);
  padding:.25rem .125rem;border-radius:var(--r-sm);
  background-image:linear-gradient(var(--teal),var(--teal));
  background-size:100% .0625rem;background-position:0 100%;background-repeat:no-repeat;
  transition:color var(--dur-fast) var(--ease);
}
[dir="rtl"] .qall{background-position:100% 100%}
.qall:hover{color:var(--ink)}

/* ---------------------------------------------------------------------------
   REDUCED MOTION
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion:reduce){
  .js .faq__a{transition:none}
  .faq__mark,.faq__mark::before,.faq__mark::after,.faq__q button{transition:none}
}
