/* ─── AEO Answer Block (.hzo-answer) ────────────────────────────────────────
   The visible surface for W-004 (answer.php): ONE question as a real heading
   + a 40–60-word answer-first paragraph optimized for AI Overviews / featured
   snippets. Three display modes — inline (default, always-visible AEO shape),
   card (boxed), disclosure (native <details>). The FAQPage/QAPage JSON-LD is
   PHP-emitted and has no styling surface.

   Tokens only — no bare hex/px/ms, no z-index (this block never portals or
   stacks). schema="off" still renders the visible block; a schema-carrying
   block adds only an invisible <script>. */

.hzo-answer {
    max-width: var(--prose-max-width);
}

/* Question heading — a REAL heading; its size comes from the type-scale ladder
   (base.css), so level (h2/h3/h4) stays decoupled from visual weight. */
.hzo-answer__question {
    margin: 0 0 var(--space-sm);
    color: var(--text-heading);
}

/* Answer-first paragraph. */
.hzo-answer__text {
    margin: 0;
    color: var(--text-body);
    line-height: var(--body-line-height, 1.6);
}

/* Optional byline: <cite> author · <time> date. */
.hzo-answer__byline {
    margin: var(--space-md) 0 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    color: var(--text-muted);
    font-size: var(--fs-100, 14px);
}
.hzo-answer__author {
    font-style: normal;                 /* <cite> defaults italic; keep it plain */
    font-weight: var(--fw-medium, 500);
    color: var(--text-body);
}
.hzo-answer__byline-sep {
    color: var(--text-muted);
}

/* ── Card display: boxed, elevated ── */
.hzo-answer--card {
    padding: var(--space-lg);
    background: var(--surface);
    border: var(--border-1) solid var(--card-border, var(--border));
    border-radius: var(--radius-panel);
    box-shadow: var(--card-shadow);
}

/* ── Group: multiple Q&As sharing ONE FAQPage node ── */
.hzo-answer--group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}
.hzo-answer--group.hzo-answer--card {
    gap: var(--space-lg);               /* tighter when boxed as a single card */
}
.hzo-answer__item > .hzo-answer__question {
    margin: 0 0 var(--space-sm);
}
.hzo-answer__item > .hzo-answer__text {
    margin: 0;
}

/* ── Disclosure display: native <details> = APG Disclosure pattern ──
   The <summary> carries button semantics + Enter/Space + aria-expanded for
   free; the caret is our own (default marker hidden). */
.hzo-answer--disclosure {
    padding: 0 var(--space-lg);
    border: var(--border-1) solid var(--border);
    border-radius: var(--radius-panel);
}
.hzo-answer__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    min-height: 44px;                   /* ≥44×44 comfort tap target (§11.2) */
    padding-block: var(--space-md);
    cursor: pointer;
    list-style: none;                   /* hide default marker; use our caret */
}
.hzo-answer__summary::-webkit-details-marker {
    display: none;
}
.hzo-answer__summary > .hzo-answer__question {
    margin: 0;
}
/* Chevron caret (rotates on open). */
.hzo-answer__summary::after {
    content: "";
    flex-shrink: 0;
    width: 0.5em;
    height: 0.5em;
    border-right: var(--border-2) solid currentColor;
    border-bottom: var(--border-2) solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--dur-1) var(--ease-standard);
}
.hzo-answer--disclosure[open] > .hzo-answer__summary::after {
    transform: rotate(-135deg);
}
/* Real focus ring on the summary (WCAG 2.4.13) — outline (not shadow-only) so
   it survives forced-colors. */
.hzo-answer__summary:focus-visible {
    outline: var(--border-2) solid var(--focus-ring);
    outline-offset: 2px;
}
.hzo-answer__body {
    padding-bottom: var(--space-md);
}

/* ── Print: an AEO answer is exactly what customers print/PDF — force it fully
   visible. Open a collapsed <details>, reset an opt-in reveal, drop the caret
   and box shadow (G13 force-reveal). ── */
@media print {
    .hzo-answer.hzo-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
    .hzo-answer--card,
    .hzo-answer--disclosure {
        box-shadow: none;
        border-color: currentColor;
    }
    .hzo-answer--disclosure:not([open]) > .hzo-answer__body {
        display: block !important;      /* override the UA details-collapse rule */
    }
    .hzo-answer__summary::after {
        display: none;
    }
}

/* ── Forced-colors: never convey state through color/shadow alone — keep a
   system-color border, caret, and focus ring (§12.2). ── */
@media (forced-colors: active) {
    .hzo-answer--card,
    .hzo-answer--disclosure {
        border: var(--border-1) solid CanvasText;
    }
    .hzo-answer__summary::after {
        border-color: CanvasText;
    }
    .hzo-answer__summary:focus-visible {
        outline-color: CanvasText;
    }
}

/* ── Reduced-motion: kill the only animated affordance (the caret rotate).
   PRESERVE-5 — ambient motion stops; content stays visible. ── */
@media (prefers-reduced-motion: reduce) {
    .hzo-answer__summary::after {
        transition: none;
    }
}
