/* cb-serve.css: /cross-border-divorce/ section 6 (src/components/cross-border/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, cb-serve.js sets [data-cb-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 (cb-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 */

.cb-serve .cb-acc-copy .lead { max-width: 36em; }
/* FIX 1 R8: the cut-out file itself now ends at the figure's feet (cb-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 cb-serve.js arms it ---- */
.cb-serve .cb-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%; }
.cb-serve[data-cb-acc-armed] .cb-acc-tabs { display: flex; }
.cb-serve .cb-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; }
.cb-serve .cb-acc-tab[aria-selected="true"] { background: var(--paper); color: var(--green); }
.cb-serve .cb-acc-tab:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---- panels: stacked with their own titles by default (no JS) ---- */
.cb-serve .cb-acc-panels { margin-top: 20px; }
.cb-serve .cb-acc-panel + .cb-acc-panel { margin-top: 28px; }
.cb-serve .cb-acc-ptitle { margin: 0 0 10px; font-family: var(--serif); font-size: 20px; font-weight: 500; color: var(--paper); }
.cb-serve[data-cb-acc-armed] .cb-acc-ptitle { display: none; }
.cb-serve[data-cb-acc-armed] .cb-acc-panel + .cb-acc-panel { margin-top: 0; }
.cb-serve[data-cb-acc-armed] .cb-acc-panel:not(.is-on) { display: none; }
@media (min-width: 1024px) {
  .cb-serve[data-cb-acc-armed] .cb-acc-panels { display: grid; }
  .cb-serve[data-cb-acc-armed] .cb-acc-panel { grid-area: 1 / 1; }
  .cb-serve[data-cb-acc-armed] .cb-acc-panel:not(.is-on) { display: block; visibility: hidden; }
}
.cb-serve .cb-acc-panel.is-on { animation: cb-acc-in .35s cubic-bezier(.22, 1, .36, 1); }
@keyframes cb-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 */
.cb-serve .cb-acc-boxes { margin-top: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cb-serve .cb-acc-boxes article { padding: 14px 16px; }
.cb-serve .cb-acc-boxes h3 { font-size: 15px; font-family: var(--sans); font-weight: 500; letter-spacing: .06em; color: var(--amber); }
.cb-serve .cb-acc-boxes p { margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--paper); }


/* ---- the 3-fact strip + the close ---- */
.cb-serve .cb-acc-strip { margin-top: 22px; padding-top: 16px; }
.cb-serve .cb-acc-end { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px; }
.cb-serve .cb-acc-end .dpc-cta { margin-top: 0; }
.cb-serve .cb-acc-foot { margin: 0; font-size: 14px; color: var(--mute-d); }
.cb-serve .cb-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) {
  .cb-serve .dpc-grid { --dpc-top-pad: calc(var(--nav-h) + 32px); }
  .cb-serve .dpc-copy { padding-bottom: 40px; }
  .cb-serve .dpc-cards { margin-bottom: 0; }
  .cb-serve .cb-acc-copy .lead { margin-top: 12px; }
  .cb-serve .cb-acc-tabs { margin-top: 18px; }
  .cb-serve .cb-acc-panels { margin-top: 14px; }
  .cb-serve .cb-acc-boxes article { padding: 12px 14px; }
  .cb-serve .cb-acc-boxes p { margin-top: 4px; line-height: 1.55; }
  .cb-serve .cb-acc-strip { margin-top: auto; padding-top: 14px; }
  .cb-serve .cb-acc-end { margin-top: 16px; }
  /* not pinned (taller than the viewport, cb-serve.js): plain flow, no runway, no cover overlap */
  .dpc-runway.cb-serve-runway[data-cb-acc-unpinned] { min-height: 0; margin-bottom: 0; }
  .dpc-runway.cb-serve-runway[data-cb-acc-unpinned] > .dpc-section.cb-serve { position: relative; top: auto; }
}
/* short desktop screens: the same column, tighter (FIX 1 R2) */
@media (min-width: 1024px) and (max-height: 800px) {
  .cb-serve .dpc-grid { --dpc-top-pad: calc(var(--nav-h) + 12px); }
  .cb-serve .dpc-copy { padding-bottom: 28px; }
  .cb-serve .cb-acc-copy .h2 { margin-bottom: 0; }
  .cb-serve .cb-acc-copy .lead { margin-top: 8px; line-height: 1.6; }
  .cb-serve .cb-acc-tabs { margin-top: 12px; }
  .cb-serve .cb-acc-panels { margin-top: 10px; }
  .cb-serve .cb-acc-strip { padding-top: 10px; gap: 10px; }
  .cb-serve .dpc-strip span { font-size: 12.5px; line-height: 1.5; }
  .cb-serve .cb-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) {
  .cb-serve .cb-acc-boxes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .cb-serve .cb-acc-tabs { margin-inline: auto; }
  .cb-serve .cb-acc-copy { text-align: left; }
  .cb-serve .cb-acc-copy > .eyebrow, .cb-serve .cb-acc-copy > .h2, .cb-serve .cb-acc-copy > .lead { text-align: center; }
  .cb-serve .cb-acc-copy > .lead { margin-inline: auto; }
  .cb-serve .cb-acc-end { justify-content: center; text-align: center; }
}
@media (max-width: 420px) {
  .cb-serve .cb-acc-tabs { width: 100%; }
  .cb-serve .cb-acc-tab { flex: 1 1 0; padding: 0 8px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .cb-serve .cb-acc-panel.is-on { animation: none; }
  .cb-serve .cb-acc-tab { transition: none; }
}

/* #84 row 4 (2026-09-26): the staff photo cb-serve-staff.webp (1520x2018) carries ~14% transparent margin each side
   (its figure is 71% of the file width), so at the shared dp-consultant.css size she filled 70% of the column
   (dp-consultant-cut on /divorce-procedure/ fills 97%). 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 7.5px out of 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, at file row ~1811 of 2018, below the fingertips (hands end at ~1762) and through the envelope. 80% of the
   column would need a crop through the fingers or the head raised above the eyebrow line. */
@media (min-width: 1024px) {
  .cb-serve .dpc-person img { width: 110%; max-width: none; margin-inline: 0; object-fit: cover; object-position: 50% 0; }
}
