/* ===========================================================================
 * contact.css — the Contact page, and only the Contact page.
 *
 * Loaded by `app/Views/partials/head.php` for the route key `contact` alone
 * (`assets/css/marketing/<route>.css`). Nothing else may import it and nothing
 * here may be relied upon by another page.
 *
 * ── why every rule below is a real class ───────────────────────────────────
 *
 * `tools/build-css.php` emits only the Tailwind utilities it can already find
 * somewhere in the tree, so an arbitrary utility written for the first time
 * compiles to nothing at all: no error, no warning, markup that reads
 * correctly and renders wrong. Layout, type scale and spacing therefore live
 * here as named classes rather than in the markup as utilities.
 *
 * ── no new colours ─────────────────────────────────────────────────────────
 *
 * Every value is a token from `ros.css`. That is not tidiness: `ros.css` flips
 * the whole palette under `:root[data-skin="light"]`, so a literal hex here
 * would be correct on the noir skin and wrong on the ivory one. The only
 * literals are geometry.
 * ========================================================================= */

/* ---------------------------------------------------------------- the page */

/*
 * One container width for the whole surface, matching the nav shell and the
 * footer in `_identity.php` (`max-w-[1180px] mx-auto px-5`). If this number
 * and that number disagree the page reads as two pages stacked.
 */
/*
 * `width: 100%` is load-bearing. `layouts/blank.php` wraps the page in
 * `.stage`, which carries `flex flex-col`, so a wrapper at the top level of
 * the page is a FLEX ITEM in a column container -- and auto margins on the
 * cross axis cancel the default stretch, leaving the item sized by its own
 * content. Measured on the About page before this line existed: a 1180px
 * wrapper rendered at 870px and 722px. No error, nothing in the console, just
 * two blocks narrower than the rest of the page.
 */
.cx-wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 20px;
}

/*
 * `pt-32` on the old markup, kept as a real value: the nav is fixed, 64px
 * tall, offset 12px from the top, so anything above ~100px sits underneath it.
 */
.cx-hero  { padding-top: 8rem; padding-bottom: 3.5rem; }
.cx-body  { padding-bottom: 6rem; }

.cx-eyebrow { margin-bottom: 1.25rem; }

/*
 * The headline. `clamp()` in a real stylesheet rather than
 * `text-[clamp(...)]` in the markup — see the note at the top of the file.
 */
.cx-h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  margin-bottom: 1.5rem;
}

.cx-hero .lede {
  color: var(--warm-500);
  max-width: 60ch;
}

/* --------------------------------------------------------- the two columns */

/*
 * Single column first, two columns from 1024px.
 *
 * The left rail is narrower than the right because what it carries is
 * reference — an address, a registration number — and reference reads better
 * narrow. The right column carries the prose and the controls.
 *
 * `minmax(0, …)` on both tracks, not `0.82fr 1fr`: a grid track defaults to
 * `min-width: auto`, and one long unbroken string (an email address, a GSTIN)
 * in a card is enough to push a track past its share and give the whole page a
 * horizontal scrollbar on a phone.
 */
.cx-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .cx-split { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: 4rem; }

  /*
   * The reference column follows the reader down on a tall screen, and only
   * there. Sticky on a 390px viewport would pin a third of the display to show
   * an address nobody is reading yet.
   */
  .cx-aside { position: sticky; top: 6rem; }
}

/*
 * `min-width: 0` on both columns, for the reason the grid tracks carry it: a
 * grid item's automatic minimum is its content, so one long unbreakable string
 * anywhere inside would widen the column rather than wrap.
 */
.cx-aside, .cx-main { min-width: 0; }

/* A column is a stack of panels with one rhythm, set once. */
.cx-stack { display: flex; flex-direction: column; gap: 1.75rem; min-width: 0; }

/* ------------------------------------------------------------- the panels */

/*
 * `.card` from `ros.css` is the base for most of these. `.cx-panel` is the
 * padding and the internal rhythm, so that a card used here cannot drift from
 * a card used three sections down.
 */
.cx-panel { padding: 1.75rem; }

@media (max-width: 640px) {
  .cx-panel { padding: 1.25rem; }
}

/* The panel header: an icon in a tinted square, a serif title, both baselined. */
.cx-panel-head {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

/*
 * The icon chip.
 *
 * `icon()` is called with an explicit `w-[17px] h-[17px]`-free class here, so
 * the svg is sized by this rule instead — and the rule is stated because an
 * inline svg with no width is 300px wide by specification, which would blow
 * the panel apart rather than merely look wrong.
 */
.cx-ico {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-gold);
  background: rgba(216, 190, 134, .07);
  color: var(--accent);
}
.cx-ico svg { width: 18px; height: 18px; display: block; }

.cx-h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--warm-100);
  margin: 0;
}

/* ---------------------------------------------------------------- the prose */

.cx-p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--warm-300);
  max-width: 68ch;
}
.cx-p + .cx-p { margin-top: 0.875rem; }

.cx-p-sm {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--warm-500);
  max-width: 68ch;
}
.cx-p-sm + .cx-p-sm,
.cx-p + .cx-p-sm { margin-top: 0.75rem; }

.cx-p strong, .cx-p-sm strong { color: var(--warm-300); font-weight: 500; }

/*
 * A short named set for the handful of one-off gaps this page needs.
 *
 * Named rather than written as `style="margin-top:1rem"` in the markup: the
 * CSP permits inline style attributes today, and a page that leans on them is
 * a page that breaks the day somebody tightens `style-src`. Named rather than
 * invented as Tailwind utilities for the reason at the top of this file.
 */
.cx-gap-intro { margin-bottom: 1.25rem; }
.cx-gap-lede  { margin-bottom: 1.5rem; }
.cx-gap-block { margin-bottom: 1.75rem; }
.cx-gap-label { margin-bottom: 0.5rem; }
.cx-gap-after { margin-top: 1rem; }
.cx-gap-note  { margin-top: 1.25rem; }

/* The grievance address sits directly under its own rows, with no second rule. */
.cx-method-flush { border-top: 0; padding-top: 0; }

/* An absence stated in the colour this product reserves for "this is wrong". */
.cx-warn { color: var(--rose-400); }

/* -------------------------------------------------------------- the links */

/*
 * An inline link in prose. Underlined, because colour alone is the one way to
 * mark a link that a colour-blind reader cannot see (WCAG 1.4.1), and this
 * page is mostly prose with a link in nearly every paragraph.
 */
.cx-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--line-gold);
  text-underline-offset: 3px;
  transition: color var(--t-base) var(--ease-out),
              text-decoration-color var(--t-base) var(--ease-out);
}
.cx-link:hover {
  color: var(--warm-100);
  text-decoration-color: var(--gold-500);
}

/* ------------------------------------------------------ the contact methods */

/* One channel: its label, then the thing you act on. */
.cx-method + .cx-method {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.cx-method-label { margin-bottom: 0.5rem; }

/*
 * The address itself, at the largest size on the page that is not a heading.
 *
 * `overflow-wrap: anywhere` rather than `break-all`: an address only breaks
 * when it has to, and then anywhere, instead of being chopped at a fixed
 * column in the middle of the local part on every render.
 */
.cx-method-value {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 17px;
  line-height: 1.4;
  color: var(--warm-100);
  overflow-wrap: anywhere;
  min-height: 44px; /* a touch target, per docs/08 §8 */
}

a.cx-method-value {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--line-gold);
  text-underline-offset: 4px;
  transition: color var(--t-base) var(--ease-out),
              text-decoration-color var(--t-base) var(--ease-out);
}
a.cx-method-value:hover {
  color: var(--warm-100);
  text-decoration-color: var(--gold-500);
}

/* ------------------------------------------------------------- the actions */

.cx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/*
 * On a phone the primary action goes full width and the rest follow it. A row
 * of three 48%-wide buttons is three buttons nobody can read the label of.
 */
@media (max-width: 480px) {
  .cx-actions { flex-direction: column; align-items: stretch; }
  .cx-actions > .btn { width: 100%; justify-content: center; }
}

/* ------------------------------------------------- the first-response rows */

.cx-rows { margin-top: 0.25rem; }

.cx-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.cx-row:last-child { border-bottom: 0; }

.cx-row-code { font-size: 10px; text-transform: uppercase; }
.cx-row-name { font-size: 14px; color: var(--warm-100); }
.cx-row-time { font-size: 13px; color: var(--warm-500); margin-left: auto; }

/* ---------------------------------------------------- the registered facts */

/*
 * `ros_fact()` renders label-beside-value from `sm` up, with a 15rem floor on
 * the label at `md`. That is correct in the full-width column it was written
 * for; in this ~370px rail it leaves a GSTIN or a CIN — a single unbreakable
 * string — roughly 130px to sit in, and it overflowed the card.
 *
 * The helper is shared with four other legal pages, so it is overridden here
 * rather than edited there.
 *
 * ── `div.grid`, and why the `.grid` has to be in the selector ──────────────
 *
 * `utilities.css` emits `.grid.grid{display:grid}` — the class doubled, on
 * purpose, scoring (0,2,0). A plain `.cx-facts > div` is (0,1,1) and loses to
 * it however late in the cascade it is written, which is exactly what happened
 * on the first attempt: the row kept `display: grid` while the two rules under
 * it landed, and the result was a two-column grid with a different column
 * width on every row. `div.grid` is (0,2,1) and wins on specificity rather
 * than on file order.
 *
 * Stacked at every width, and not restored to two columns on a wide screen:
 * the rail is ~370px at 1024 and ~470px at 1920, never enough for a label and
 * a 21-character CIN side by side, so one layout everywhere beats a breakpoint
 * that only moves which width it is cramped at.
 */
.cx-facts > div.grid { display: block; overflow-wrap: anywhere; }

.cx-facts > div.grid > .eyebrow {
  display: block;
  min-width: 0;
  padding-top: 0;
  margin-bottom: 0.375rem;
}

/* The value, which is where the long unbreakable strings actually are. */
.cx-facts > div.grid > span:last-child { display: block; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ the FAQ */

/*
 * `<details>`/`<summary>`, and no JavaScript.
 *
 * The native element is focusable, toggles on Enter and Space, announces its
 * own expanded state to a screen reader and — importantly on a page a gateway
 * reviewer may print — opens for Ctrl+F and for print. A div with a click
 * handler gets none of that for free and this page has no script budget to
 * spend buying it back.
 */
.cx-faq { border-top: 1px solid var(--line); }

.cx-faq-item { border-bottom: 1px solid var(--line); }

.cx-faq-q {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding-block: 1.125rem;
  min-height: 44px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--warm-100);
  cursor: pointer;
  list-style: none;        /* Firefox */
  transition: color var(--t-base) var(--ease-out);
}
.cx-faq-q::-webkit-details-marker { display: none; }  /* Safari */
.cx-faq-q:hover { color: var(--accent); }

/*
 * The marker is `icon('chevron')`, which is `m14 6-6 6 6 6` — a chevron
 * pointing LEFT, because its home is a collapsing nav rail. A disclosure wants
 * down when closed and up when open, so it is turned rather than replaced:
 * there is no 'chevron-down' key in `icons.php` and inventing one renders
 * nothing at all.
 */
.cx-faq-mark {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--warm-500);
  transform: rotate(-90deg);
  transition: transform var(--t-base) var(--ease-out),
              color var(--t-base) var(--ease-out);
}
.cx-faq-mark svg { width: 16px; height: 16px; display: block; }

.cx-faq-item[open] > .cx-faq-q { color: var(--accent); }
.cx-faq-item[open] .cx-faq-mark { transform: rotate(90deg); color: var(--accent); }

.cx-faq-a { padding-bottom: 1.375rem; }

/* ----------------------------------------------------------- the refusals */

/*
 * The panels that say "there is nothing here".
 *
 * `tone-rose` supplies `--tone`, `--tone-bg` and `--tone-br`; this only puts
 * them to work, so the colour still comes from the one place that defines it
 * and still flips with the skin.
 */
.cx-refusal {
  border-color: var(--tone-br);
  background: var(--tone-bg);
}
.cx-refusal-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
  color: var(--tone);
}
.cx-refusal-head .eyebrow { color: var(--tone); }
.cx-refusal-head svg { width: 18px; height: 18px; display: block; flex: 0 0 auto; }

.cx-refusal .cx-p { color: var(--warm-100); font-size: 14px; }

.cx-mono {
  font-family: var(--mono);
  font-size: 0.95em;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------- the focus */

/*
 * `ros.css` already draws a 2px accent ring on every focusable element and
 * explains at length why it must never be removed. This does not restate it;
 * it only gives the two custom controls on this page — the FAQ summary and the
 * jump links — somewhere for that ring to sit without being clipped.
 */
.cx-faq-q:focus-visible,
.cx-jump a:focus-visible,
.cx-link:focus-visible,
.cx-method-value:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* --------------------------------------------------------- the jump links */

/*
 * The old "On this page" rail, kept because `terms.php` links to
 * `?r=contact#support` and four other anchors are published alongside it.
 * Flattened into a wrapping row above the content: at this page length a
 * 220px column spent on six links costs more than it returns.
 */
.cx-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
.cx-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: 13px;
  color: var(--warm-500);
  transition: color var(--t-base) var(--ease-out);
}
.cx-jump a:hover { color: var(--warm-100); }

/*
 * Every anchor on this page is a scroll target under a fixed 64px nav, so each
 * one needs the nav's height back or the heading lands behind it.
 */
.cx-anchor { scroll-margin-top: 7rem; }

/* ------------------------------------------------------------- the motion */

@media (prefers-reduced-motion: reduce) {
  .cx-link,
  a.cx-method-value,
  .cx-faq-q,
  .cx-faq-mark,
  .cx-jump a { transition: none; }
}
