/* Shared components for both alternatives: base, header, buttons, opening strip,
   service ledger mechanics, FAQ, form, dialog, training, footer.
   Composition (grids, scale, rhythm) lives in each alternative's own stylesheet. */
@import url('./tokens.css');

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; -webkit-text-size-adjust: 100%; }
body { background: var(--color-paper); color: var(--color-ink); font: 400 var(--text-base)/1.7 var(--font-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--color-blue); text-underline-offset: .22em; text-decoration-thickness: 1px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; }
h1, h2, h3 { color: var(--color-navy); font-weight: 600; text-wrap: balance; overflow-wrap: break-word; }
p { text-wrap: pretty; }
address, cite { font-style: normal; }
::selection { background: var(--color-blue); color: var(--color-accent-ink); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 4px; border-radius: 2px; }
[hidden] { display: none !important; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; z-index: 50; left: 1rem; top: .5rem; padding: .75rem 1rem; background: var(--color-paper); color: var(--color-navy); font-weight: 600; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* ---------- Header and navigation ---------- */
.site-header { position: relative; z-index: 20; background: var(--color-paper); border-bottom: 1px solid var(--color-rule); }
.header-inner { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; padding-block: .9rem; }
.brand { display: flex; align-items: center; min-height: 48px; }
.brand img { width: 172px; }
.mobile-actions { display: flex; align-items: center; gap: .5rem; }
.mobile-call { display: inline-flex; align-items: center; min-height: 44px; padding-inline: .6rem; font-size: var(--text-sm); font-weight: 600; }
.menu-toggle { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .4rem .85rem; border: 1px solid var(--color-rule-strong); border-radius: var(--radius-sm); background: var(--color-paper); color: var(--color-navy); font-size: var(--text-sm); font-weight: 600; }
.menu-toggle .bars { position: relative; width: 16px; height: 10px; }
.menu-toggle .bars::before, .menu-toggle .bars::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform var(--dur-short) var(--ease-out), top var(--dur-short) var(--ease-out); }
.menu-toggle .bars::before { top: 0; }
.menu-toggle .bars::after { top: 8px; }
.menu-toggle[aria-expanded="true"] .bars::before { top: 4px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars::after { top: 4px; transform: rotate(-45deg); }
.site-nav { display: none; flex-basis: 100%; flex-direction: column; padding-block: .5rem 1rem; }
.site-nav.is-open { display: flex; }
.site-nav > a, .nav-services > summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 48px; border-top: 1px solid var(--color-rule); color: var(--color-navy); font-size: var(--text-base); font-weight: 500; text-decoration: none; }
.nav-services > summary .chevron { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-short) var(--ease-out); }
.nav-services[open] > summary .chevron { transform: translateY(2px) rotate(-135deg); }
.nav-dropdown { display: flex; flex-direction: column; padding: 0 0 .5rem 1rem; }
.nav-dropdown a, .nav-dropdown button { display: flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--color-navy); font-size: var(--text-sm); font-weight: 500; text-align: left; text-decoration: none; }
.nav-dropdown .all-services { color: var(--color-blue); font-weight: 600; }
.site-nav > a.nav-call { justify-content: center; margin-top: .75rem; border-top: 1px solid var(--color-blue); color: var(--color-accent-ink); font-weight: 600; }

@media (min-width: 64rem) {
  .header-inner { flex-wrap: nowrap; padding-block: 1.1rem; }
  .brand img { width: 214px; }
  .mobile-actions { display: none; }
  .site-nav, .site-nav.is-open { display: flex; flex-direction: row; flex-basis: auto; align-items: center; gap: 2rem; padding: 0; }
  .site-nav > a, .nav-services > summary { border: 0; min-height: 44px; font-size: var(--text-sm); justify-content: flex-start; }
  .nav-services { position: relative; }
  .nav-dropdown { position: absolute; top: calc(100% + .6rem); left: -1.25rem; width: 19rem; padding: .75rem 1.25rem; background: var(--color-paper); border: 1px solid var(--color-rule); border-top: 2px solid var(--color-navy); box-shadow: 0 18px 40px -24px #0b2b4555; }
  .nav-dropdown a, .nav-dropdown button { border-bottom: 1px solid var(--color-rule); }
  .nav-dropdown > :last-child { border-bottom: 0; }
  .site-nav > a.nav-call { margin-top: 0; min-height: 48px; padding-inline: 1.25rem; }
}

@media (max-width: 29.99rem) {
  .brand img { width: 150px; }
  .mobile-call { padding-inline: .4rem; }
}
@media (max-width: 23.99rem) {
  .brand img { width: 136px; }
  .menu-toggle { padding-inline: .75rem; }
  .menu-toggle .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---------- Buttons and links ---------- */
.button { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: .75rem; min-height: 52px; max-width: 100%; padding: .8rem 1.35rem; border: 1px solid var(--color-blue); border-radius: var(--radius-sm); background: var(--color-blue); color: var(--color-accent-ink); font-size: var(--text-sm); font-weight: 600; line-height: 1.35; text-decoration: none; transition: transform var(--dur-micro) var(--ease-out), color var(--dur-short) var(--ease-out); }
.button::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--color-navy); transform: scaleX(0); transform-origin: left center; transition: transform var(--dur-short) var(--ease-out); }
.button:active:not(:disabled) { transform: scale(.98); }
.button:active:not(:disabled)::before { transform: scaleX(1); }
.button.secondary { background: var(--color-paper); color: var(--color-blue); }
.button.secondary::before { background: var(--color-soft-blue); }
.button:disabled { opacity: .55; cursor: not-allowed; }
.arrow { display: inline-block; flex-shrink: 0; transition: transform var(--dur-short) var(--ease-out); }
.text-link { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; font-size: var(--text-sm); font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .button:hover:not(:disabled)::before { transform: scaleX(1); }
  .button.secondary:hover .arrow, .text-link:hover .arrow { transform: translateX(4px); }
  .site-nav > a:not(.button):hover, .nav-services > summary:hover, .nav-dropdown a:hover, .nav-dropdown button:hover { color: var(--color-blue); }
}

/* ---------- Call action with integrated opening strip (two placements only) ---------- */
.call-action { display: flex; flex-direction: column; width: min(100%, 20rem); }
.call-action > .button { border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-size: var(--text-base); }
.opening-status { color: var(--color-muted); font-size: var(--text-meta); font-weight: 500; line-height: 1.5; }
.opening-strip { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; gap: .6rem; min-height: 40px; padding: .5rem 1rem; border: 1px solid var(--color-rule); border-top: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: var(--color-tint); }
.opening-dot { position: relative; z-index: 1; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.opening-label { position: relative; z-index: 1; min-width: 0; }
.opening-sweep { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 5%, color-mix(in srgb, currentColor 12%, transparent) 48%, transparent 85%); transform: translateX(-110%); pointer-events: none; }
.opening-detail { display: block; margin-top: .5rem; color: var(--color-muted); font-size: var(--text-meta); font-weight: 400; }
.opening-status:is([data-state="open"], [data-state="appointment"]) { color: var(--color-success); }
.opening-status:is([data-state="open"], [data-state="appointment"]) .opening-strip { background: var(--color-success-soft); border-color: var(--color-success-rule); }
.opening-status:is([data-state="open"], [data-state="appointment"]) .opening-dot { animation: status-breathe 2400ms ease-in-out infinite paused; }
.opening-status:is([data-state="open"], [data-state="appointment"]) .opening-sweep { animation: status-sweep 4800ms var(--ease-out) infinite paused; }
.opening-status.is-in-view .opening-dot, .opening-status.is-in-view .opening-sweep { animation-play-state: running; }
@keyframes status-breathe { 0%, 100% { opacity: .5; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes status-sweep { 0%, 10% { transform: translateX(-110%); } 58%, 100% { transform: translateX(110%); } }

/* ---------- Video ---------- */
.video-stage { position: relative; overflow: hidden; background: var(--color-navy); }
.video-stage > img { width: 100%; height: 100%; object-fit: cover; }
.video-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--color-navy); }
.video-stage iframe.video-pending { opacity: 0; pointer-events: none; }
.video-stage.is-playing > img { visibility: hidden; }
.video-button { position: absolute; display: flex; align-items: center; gap: .85rem; min-height: 60px; padding: .65rem 1.15rem .65rem .65rem; border: 0; border-radius: var(--radius-sm); background: var(--color-paper); color: var(--color-navy); font-size: var(--text-sm); font-weight: 600; line-height: 1.35; text-align: left; box-shadow: 0 10px 30px -18px #0b2b4580; }
.play-symbol { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; background: var(--color-blue); transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out); }
.play-symbol::before { content: ""; margin-left: 3px; border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent var(--color-accent-ink); }
.video-button small { display: block; color: var(--color-muted); font-size: var(--text-meta); font-weight: 500; }
.video-help { margin-top: .75rem; color: var(--color-muted); font-size: var(--text-meta); }
.video-help a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.video-stage.no-poster { background: var(--color-soft-blue); }
.video-stage.no-poster > img { display: none; }
@media (hover: hover) and (pointer: fine) {
  .video-button:hover .play-symbol { background: var(--color-blue-dark); transform: scale(1.06); }
}

/* ---------- Service ledger (white Fluid ledger, single open) ---------- */
.service-ledger { border-top: 2px solid var(--color-navy); }
.service-ledger > details { border-bottom: 1px solid var(--color-rule); scroll-margin-top: 1.5rem; }
.service-ledger summary { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) 2.75rem; align-items: start; gap: .75rem; padding-block: 1.35rem; }
.service-number { padding-top: .35em; color: var(--color-blue); font-size: var(--text-meta); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.service-name { display: block; color: var(--color-navy); font-size: clamp(1.15rem, 1rem + .9vw, 1.6rem); font-weight: 500; line-height: 1.3; letter-spacing: -.015em; }
.service-meta { display: block; margin-top: .3rem; color: var(--color-muted); font-size: var(--text-meta); line-height: 1.5; }
.toggle { position: relative; justify-self: end; width: 2.75rem; height: 2.75rem; margin-top: -.35rem; color: var(--color-blue); transition: transform var(--dur-short) var(--ease-out); }
.toggle::before, .toggle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 16px; height: 2px; margin: -1px 0 0 -8px; background: currentColor; }
.toggle::after { transform: rotate(90deg); }
details[open] > summary .toggle { transform: rotate(45deg); }
.service-ledger details[data-expanded="false"] > summary .toggle { transform: none; }
.service-ledger details[data-expanded="true"] > summary .toggle { transform: rotate(45deg); }
.service-panel { overflow: hidden; }
.service-body { padding: 0 0 1.75rem 3rem; }
.service-list { list-style: none; display: grid; gap: 1.1rem; margin-bottom: 1.5rem; }
.service-list li { padding-left: 1rem; border-left: 2px solid var(--color-soft-blue); }
.service-list strong { display: block; color: var(--color-ink); font-size: var(--text-base); font-weight: 600; line-height: 1.45; }
.service-list small { display: block; margin-top: .25rem; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.65; max-width: 62ch; }
@media (hover: hover) and (pointer: fine) {
  .service-ledger summary:hover .service-name { color: var(--color-blue); }
}
@media (max-width: 29.99rem) {
  .service-ledger summary { grid-template-columns: 1.75rem minmax(0, 1fr) 2.75rem; gap: .5rem; }
  .service-body { padding-left: 0; }
}

/* ---------- Client ledger reviews ---------- */
.review-ledger { border-top: 2px solid var(--color-navy); }
.review-row { display: grid; gap: .6rem; padding-block: 1.5rem; border-bottom: 1px solid var(--color-rule); }
.review-topic { color: var(--color-navy); font-size: var(--text-sm); font-weight: 600; }
.review-row cite { display: block; color: var(--color-muted); font-size: var(--text-meta); }
.review-row blockquote { color: var(--color-navy); font-size: clamp(1.05rem, .98rem + .35vw, 1.25rem); line-height: 1.6; letter-spacing: -.01em; }
.review-source { display: block; margin-top: .5rem; color: var(--color-muted); font-size: var(--text-meta); }

/* ---------- FAQ (independent disclosures) ---------- */
.faq-list details { border-bottom: 1px solid var(--color-rule); }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; padding-block: .9rem; color: var(--color-navy); font-size: var(--text-base); font-weight: 600; line-height: 1.45; }
.faq-list summary .toggle { flex: 0 0 2.75rem; margin: 0; }
.faq-list details p { padding: 0 3rem 1.35rem 0; color: var(--color-muted); font-size: var(--text-sm); }
@media (hover: hover) and (pointer: fine) { .faq-list summary:hover { color: var(--color-blue); } }

/* ---------- Timeline progress primitive (orientation set per alternative) ---------- */
.timeline { --progress: 1; position: relative; }
.timeline-rail, .timeline-fill { position: absolute; background: var(--color-rule); pointer-events: none; }
.timeline-fill { background: var(--color-blue); }

/* ---------- Form (demonstration only) ---------- */
.contact-form h3 { font-size: var(--text-lg); letter-spacing: -.015em; }
.form-notice { display: flex; gap: .5rem; align-items: flex-start; margin: .5rem 0 1.25rem; color: var(--color-muted); font-size: var(--text-meta); }
.form-notice::before { content: "i"; flex: 0 0 18px; display: grid; place-items: center; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--color-soft-blue); color: var(--color-blue); font-size: 11px; font-weight: 700; font-style: normal; }
.form-fields { display: grid; gap: 0 1rem; }
.field label { display: block; margin-bottom: .35rem; color: var(--color-ink); font-size: var(--text-sm); font-weight: 600; }
.field label span { color: var(--color-muted); font-weight: 400; }
.field input, .field textarea { display: block; width: 100%; min-height: 52px; padding: .7rem .85rem; border: 1px solid var(--color-input-rule); border-radius: var(--radius-sm); background: var(--color-paper); color: var(--color-ink); font-size: 1rem; transition: border-color var(--dur-short) var(--ease-out); }
.field textarea { min-height: 128px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 1px; border-color: var(--color-focus); }
.field [aria-invalid="true"] { border-color: var(--color-error); }
.field-error { display: block; min-height: 1.6rem; padding-top: .2rem; color: var(--color-error); font-size: var(--text-meta); line-height: 1.45; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.form-foot p { color: var(--color-muted); font-size: var(--text-meta); line-height: 1.5; }
.form-status { margin-top: 1rem; color: var(--color-success); font-size: var(--text-sm); font-weight: 500; }
.form-status:empty { display: none; }
@media (min-width: 40rem) {
  .form-fields { grid-template-columns: 1fr 1fr; }
  .field-full { grid-column: 1 / -1; }
}

/* ---------- Opening hours table (site content, published schedule) ---------- */
.hours { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; font-size: var(--text-sm); }
.hours dt { color: var(--color-navy); font-weight: 600; }
.hours dd { color: var(--color-muted); }
.hours dd small { display: block; font-size: var(--text-meta); line-height: 1.5; }

/* ---------- Training and footer ---------- */
.training { padding-block: 2rem; border-top: 1px solid var(--color-rule); background: var(--color-tint); }
.training .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.training h2 { font-size: var(--text-base); letter-spacing: -.01em; }
.training p { margin-top: .25rem; color: var(--color-muted); font-size: var(--text-sm); }
.site-footer { padding-block: 2.25rem 2rem; border-top: 1px solid var(--color-rule); }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.footer-logo { width: 190px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.footer-links a, .footer-links button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--color-muted); font-size: var(--text-meta); font-weight: 500; text-decoration: none; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1.5rem; margin-top: 1rem; color: var(--color-muted); font-size: var(--text-meta); }
.footer-bottom a { color: inherit; }
@media (hover: hover) and (pointer: fine) { .footer-links a:hover, .footer-links button:hover { color: var(--color-blue); } }

/* ---------- Dialog ---------- */
.site-dialog { width: min(36rem, calc(100% - 2rem)); max-height: 85dvh; padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid var(--color-rule); border-top: 3px solid var(--color-navy); border-radius: var(--radius-md); background: var(--color-paper); color: var(--color-ink); }
.site-dialog::backdrop { background: var(--color-backdrop); }
.site-dialog h2 { padding-right: 2.5rem; font-size: 1.4rem; letter-spacing: -.02em; }
.site-dialog p { margin-top: 1rem; color: var(--color-muted); font-size: var(--text-sm); }
.dialog-close { position: absolute; top: .5rem; right: .5rem; width: 44px; height: 44px; border: 0; background: none; color: var(--color-navy); font-size: 1.6rem; line-height: 1; }

/* ---------- Reduced motion: state changes stay, movement goes ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
  .button::before { transform: none; opacity: 0; }
  .button:active:not(:disabled)::before { opacity: 1; }
  .button:active:not(:disabled) { transform: none; }
}
@media (prefers-reduced-motion: reduce) and (hover: hover) and (pointer: fine) {
  .button:hover:not(:disabled)::before { transform: none; opacity: 1; }
  .button.secondary:hover .arrow, .text-link:hover .arrow { transform: none; }
}

/* Touch targets for inline links that stand alone */
.site-footer .footer-top > a { display: inline-flex; align-items: center; min-height: 48px; }
.footer-bottom a { display: inline-flex; align-items: center; min-height: 44px; }
.services-call a, .entry-aside a { display: inline-flex; align-items: center; min-height: 44px; }
