/* da-serve.css: /divorce-agreement/ section 5 (src/components/agreement/Serve.astro), a copy of 撫養權's
   cu-access.css without its example week, on top of the UNCHANGED dp-consultant.css (the 離婚手續 consultant shell:
   deep green, the ground switch, the cut-out rise, the focus pin + cover runway). This file adds the right
   column's switch and panels, and decides the pin: the section pins (top 0, 2.3-screen runway, the next section
   covers it) ONLY when it fits the viewport; taller, da-serve.js sets [data-da-acc-unpinned] and it scrolls
   normally. The three panels share one grid cell at >= 1024 (the tallest reserves the height), so switching
   never changes the section height. The light switch into this section is on s5 (da-diff.css). */

/* the section BEFORE this one lets the ground show through (dp-consultant.css does this for
   離婚手續's .dpp-section), and its heading follows the light on the same class and clock */

.da-serve .da-acc-copy .lead { max-width: 36em; }
/* FIX 1 R8: the cut-out file itself now ends at the figure's feet (da-serve-a2.webp, floor cropped), so
   the image box bottom IS the painted bottom: no offset here, dp-consultant.css's bottom:0 lands it. */

/* ---- the 3-way switch (role=tablist), 44px targets; only shown once da-serve.js arms it ---- */
.da-serve .da-acc-tabs { display: none; gap: 6px; margin-top: 24px; padding: 4px; border-radius: 999px; background: rgba(242,243,238,.08); border: 1px solid rgba(242,243,238,.22); width: max-content; max-width: 100%; }
.da-serve[data-da-acc-armed] .da-acc-tabs { display: flex; }
.da-serve .da-acc-tab { min-height: 44px; min-width: 44px; padding: 0 18px; border-radius: 999px; color: var(--mute-d); font-size: 15px; font-weight: 500; white-space: nowrap; transition: background-color .25s ease, color .25s ease; }
.da-serve .da-acc-tab[aria-selected="true"] { background: var(--paper); color: var(--green); }
.da-serve .da-acc-tab:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---- panels: stacked with their own titles by default (no JS) ---- */
.da-serve .da-acc-panels { margin-top: 20px; }
.da-serve .da-acc-panel + .da-acc-panel { margin-top: 28px; }
.da-serve .da-acc-ptitle { margin: 0 0 10px; font-family: var(--serif); font-size: 20px; font-weight: 500; color: var(--paper); }
.da-serve[data-da-acc-armed] .da-acc-ptitle { display: none; }
.da-serve[data-da-acc-armed] .da-acc-panel + .da-acc-panel { margin-top: 0; }
.da-serve[data-da-acc-armed] .da-acc-panel:not(.is-on) { display: none; }
@media (min-width: 1024px) {
  .da-serve[data-da-acc-armed] .da-acc-panels { display: grid; }
  .da-serve[data-da-acc-armed] .da-acc-panel { grid-area: 1 / 1; }
  .da-serve[data-da-acc-armed] .da-acc-panel:not(.is-on) { display: block; visibility: hidden; }
}
.da-serve .da-acc-panel.is-on { animation: da-acc-in .35s cubic-bezier(.22, 1, .36, 1); }
@keyframes da-acc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* the three boxes, in the consultant's box style (dpc-cards), three across on desktop */
.da-serve .da-acc-boxes { margin-top: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.da-serve .da-acc-boxes article { padding: 14px 16px; }
.da-serve .da-acc-boxes h3 { font-size: 15px; font-family: var(--sans); font-weight: 500; letter-spacing: .06em; color: var(--amber); }
.da-serve .da-acc-boxes p { margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--paper); }


/* ---- the 3-fact strip + the close ---- */
.da-serve .da-acc-strip { margin-top: 22px; padding-top: 16px; }
.da-serve .da-acc-end { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px; }
.da-serve .da-acc-end .dpc-cta { margin-top: 0; }
.da-serve .da-acc-foot { margin: 0; font-size: 14px; color: var(--mute-d); }
.da-serve .da-acc-foot a { color: var(--paper); text-decoration: underline; text-underline-offset: 4px; }

/* ---- desktop: a tighter column than 離婚手續's (this one is taller) ---- */
@media (min-width: 1024px) {
  .da-serve .dpc-grid { --dpc-top-pad: calc(var(--nav-h) + 32px); }
  .da-serve .dpc-copy { padding-bottom: 40px; }
  .da-serve .dpc-cards { margin-bottom: 0; }
  .da-serve .da-acc-copy .lead { margin-top: 12px; }
  .da-serve .da-acc-tabs { margin-top: 18px; }
  .da-serve .da-acc-panels { margin-top: 14px; }
  .da-serve .da-acc-boxes article { padding: 12px 14px; }
  .da-serve .da-acc-boxes p { margin-top: 4px; line-height: 1.55; }
  .da-serve .da-acc-strip { margin-top: auto; padding-top: 14px; }
  .da-serve .da-acc-end { margin-top: 16px; }
  /* not pinned (taller than the viewport, da-serve.js): plain flow, no runway, no cover overlap */
  .dpc-runway.da-serve-runway[data-da-acc-unpinned] { min-height: 0; margin-bottom: 0; }
  .dpc-runway.da-serve-runway[data-da-acc-unpinned] > .dpc-section.da-serve { position: relative; top: auto; }
}
/* short desktop screens: the same column, tighter (FIX 1 R2) */
@media (min-width: 1024px) and (max-height: 800px) {
  .da-serve .dpc-grid { --dpc-top-pad: calc(var(--nav-h) + 12px); }
  .da-serve .dpc-copy { padding-bottom: 28px; }
  .da-serve .da-acc-copy .h2 { margin-bottom: 0; }
  .da-serve .da-acc-copy .lead { margin-top: 8px; line-height: 1.6; }
  .da-serve .da-acc-tabs { margin-top: 12px; }
  .da-serve .da-acc-panels { margin-top: 10px; }
  .da-serve .da-acc-strip { padding-top: 10px; gap: 10px; }
  .da-serve .dpc-strip span { font-size: 12.5px; line-height: 1.5; }
  .da-serve .da-acc-end { margin-top: 12px; }
}
/* the three boxes stay ONE row down to 1024 wide (FIX 1 R2); one column only on the stacked layout */
@media (max-width: 1023px) {
  .da-serve .da-acc-boxes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .da-serve .da-acc-tabs { margin-inline: auto; }
  .da-serve .da-acc-copy { text-align: left; }
  .da-serve .da-acc-copy > .eyebrow, .da-serve .da-acc-copy > .h2, .da-serve .da-acc-copy > .lead { text-align: center; }
  .da-serve .da-acc-copy > .lead { margin-inline: auto; }
  .da-serve .da-acc-end { justify-content: center; text-align: center; }
}
@media (max-width: 420px) {
  .da-serve .da-acc-tabs { width: 100%; }
  .da-serve .da-acc-tab { flex: 1 1 0; padding: 0 8px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .da-serve .da-acc-panel.is-on { animation: none; }
  .da-serve .da-acc-tab { transition: none; }
}

/* #84 row 4 (2026-09-26) / issue #119 (2026-09-29, the actual da-serve-staff.webp shipped here): the
   staff photo carries ~13.4% transparent margin each side (measured alpha bbox: figure is 73.2% of
   the 1520x2018 file's width - cb-serve-staff.webp on 中港離婚's identical section measures 71.3% by
   the same method, close enough that this rule (written against that reference shape, see
   docs/design/cross-border-art/README.md and src/components/agreement/art.ts) carries over
   unchanged), so at the shared dp-consultant.css size she would fill roughly 70-73% of the column
   (dp-consultant-cut on /divorce-procedure/ fills 97%, cb-serve-staff.webp on 中港離婚 uses this same
   110%/cover rule too - public/components/cb-serve.css:109 - this is the site's standard fix for a
   staff photo of this shape, not a da-only hack). Desktop only: the image box is 110% of the column,
   from the figure's left edge (the extra 10% runs right into the column gap, all transparent: a
   centred box would poke past the grid on the left, the probe's clip rule), and object-fit: cover
   (anchored top) scales the photo by the width, so the hair stays on the eyebrow line and the box
   still ends on the section floor (lab/probe-consultant-floor.mjs); the extra height is cropped flat
   at the floor, below the folder and both hands. Re-verified this round with
   lab/probe-consultant-floor.mjs --path /divorce-agreement/ --widths 1440,2000,390: person-bottom
   == section-bottom (delta 0.00px) and person-top == eyebrow-top (delta 0.00px) at all three, never
   clipped left/right, never upscaled - PASS, see the s5b stills. */
@media (min-width: 1024px) {
  .da-serve .dpc-person img { width: 110%; max-width: none; margin-inline: 0; object-fit: cover; object-position: 50% 0; }
}
