/* Our office (version 9). Loaded after site.css and before modern.css, so a rule that changes a shared component is
   scoped with a page class (.office-head, .office-why, ...) to win. Tokens only; light theme only. Layout after the
   ApexCare about page: a centered header with the photo and glass cards straddling its bottom edge, a sticky split for the
   reasons, an orbit-framed photo, Dentrist cards for the technology, stacked rounded hours rows. */

/* ---------- 1. Header, centered, with room below for the stage that overlaps it ---------- */
.pagehead.office-head { padding-bottom: 132px; }
.office-head__text { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 12px; }
.pagehead.office-head h1 { max-width: 15ch; margin-inline: auto; }
.pagehead.office-head .lede { margin-inline: auto; max-width: 58ch; }
.office-head .pagehead__actions { justify-content: center; }
.office-head .btn--ghost { background: var(--glass); border-color: rgba(255, 255, 255, 0.95); }
@media (min-width: 768px) { .pagehead.office-head { padding-bottom: 190px; } .office-head__text { padding-top: 24px; } }
@media (min-width: 1024px) { .pagehead.office-head { padding-bottom: 230px; } }

/* ---------- 2. The stage: the front desk photo and three glass cards over the header's bottom edge ---------- */
.office-stage { position: relative; z-index: 1; margin: -92px var(--panel-inset) 0; }
.office-stage__grid { display: grid; gap: 14px; }
.office-stage__photo { position: relative; min-width: 0; }
.office-stage__photo > .photo { border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.office-stage__label { position: absolute; z-index: 2; left: 14px; bottom: 14px; max-width: calc(100% - 28px); }
.office-stage .seal--office { position: absolute; z-index: 3; right: 10px; top: -46px; width: 96px; height: 96px; }
.office-stage .seal--office .seal__mark { width: 30px; height: 30px; }

.office-stage__cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.office-glance {
  display: flex; align-items: flex-start; gap: 14px; min-width: 0; padding: 18px 20px 18px 18px; border-radius: var(--r-card);
  background: var(--glass); border: 1px solid rgba(255, 255, 255, 0.9); box-shadow: var(--shadow-float);
}
.office-glance > div { min-width: 0; }
.office-glance__icon { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--mint); color: var(--ink); }
.office-glance__icon--ink { background: var(--ink); color: #fff; }
.office-glance__icon .icon { width: 22px; height: 22px; }
.office-glance .office-glance__title { font-size: 1.0625rem; font-weight: 650; line-height: 1.35; letter-spacing: -0.01em; }
.office-glance p { margin-top: 4px; font-size: 0.9375rem; line-height: 1.5; color: var(--muted); }
.office-glance .link-arrow { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: -10px; font-size: 0.9375rem; }
.office-glance .link-arrow .icon { width: 18px; height: 18px; }
.office-glance--rating { align-items: center; }
.office-glance__faces { display: flex; flex: none; }
.office-glance__faces span { display: grid; place-items: center; width: 42px; height: 42px; margin-left: -12px; border-radius: 50%; border: 3px solid #fff; font-weight: 700; font-size: 0.9375rem; color: var(--ink); background: var(--mint); }
.office-glance__faces span:first-child { margin-left: 0; }
.office-glance__faces span:nth-child(2) { background: var(--tint-2); }
.office-glance__faces span:nth-child(3) { background: var(--ink); color: #fff; }
.office-glance p.office-glance__big { margin-top: 0; display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.625rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.office-glance__big .stars { color: var(--star); display: inline-flex; gap: 1px; }
.office-glance__big .stars .icon { width: 15px; height: 15px; }
.office-glance p.office-glance__status { margin-top: 0; margin-bottom: 4px; font-weight: 700; color: var(--ink); }
.office-glance--hours p + p { margin-top: 0; }

@media (min-width: 640px) {
  .office-stage { margin-top: -130px; }
  .office-stage__label { left: 20px; bottom: 20px; }
  .office-stage .seal--office { right: 28px; top: -58px; width: 120px; height: 120px; }
  .office-stage .seal--office .seal__mark { width: 36px; height: 36px; }
}
@media (min-width: 768px) and (max-width: 1023.98px) {
  .office-stage__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .office-glance { flex-direction: column; }
}
@media (min-width: 1024px) {
  .office-stage { margin-top: -170px; }
  .office-stage__grid { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 20px; align-items: stretch; }
  .office-stage__photo > .photo { height: 100%; }
  .office-stage__cards { grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .office-glance { align-items: center; padding: 20px 22px; }
  .office-stage .seal--office { right: auto; left: -52px; top: 34%; }
}
/* Below 1280 the photo starts close to the viewport edge, so the seal tucks in rather than being cut off. */
@media (min-width: 1024px) and (max-width: 1279.98px) { .office-stage .seal--office { left: -20px; } }

/* ---------- 3. The numbers ---------- */
.office-stats.section { margin-top: var(--panel-inset); }

/* ---------- 4. Why patients choose us: the sticky split ---------- */
.office-why__grid { display: grid; gap: 32px; }
.office-why__side .head { margin-bottom: 28px; }
.office-why__side .link-arrow { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.office-why__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; counter-reset: why; }
.office-why__item { counter-increment: why; position: relative; overflow: hidden; min-width: 0; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow); }
.office-why__body { position: relative; padding: 28px 24px 30px; }
/* The number: large, pale and decorative, from a CSS counter so it is not read twice. */
.office-why__body::before {
  content: counter(why, decimal-leading-zero); position: absolute; right: 22px; top: 24px;
  font-family: var(--display); font-size: 2.5rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--tint-2);
}
.office-why__icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 22px; border-radius: 50%; background: var(--tint); color: var(--accent); }
.office-why__icon .icon { width: 26px; height: 26px; }
.office-why__item h3 { font-size: 1.25rem; font-weight: 650; padding-right: 72px; }
.office-why__item p { margin-top: 10px; font-size: 1rem; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.office-why__item .link-arrow { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 8px; margin-bottom: -10px; }
.office-why__item--photo .office-why__photo { border-radius: 0; box-shadow: none; }
.office-why__item--photo .office-why__photo img { object-position: 22% 6%; }
.office-why__stage .anim-stage { width: 100%; max-width: none; aspect-ratio: 16 / 9; border-radius: 0; box-shadow: none; }
/* Absolute so the height resolves against the stage (a percentage height on a grid item fell back to the width). */
.office-why__stage .anim-stage .anim { position: absolute; inset: 10% 0; width: auto; height: 80%; margin: auto; }
.office-why__stage .anim-stage__orbit { inset: 5% auto; left: 50%; height: 90%; aspect-ratio: 1; translate: -50% 0; }
@media (min-width: 640px) {
  .office-why__body { padding: 34px 34px 36px; }
  .office-why__item--stage { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); align-items: stretch; }
  .office-why__stage .anim-stage { aspect-ratio: auto; height: 100%; min-height: 260px; }
  .office-why__stage .anim-stage__orbit { height: auto; width: 86%; inset: auto; left: 50%; top: 50%; translate: -50% -50%; }
}
/* From 1024 to 1200 the card column is too narrow for the stage beside the text, so the stage sits on top again. */
@media (min-width: 1024px) and (max-width: 1199.98px) {
  .office-why__item--stage { display: block; }
  .office-why__stage .anim-stage { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
  .office-why__stage .anim-stage__orbit { inset: 5% auto; left: 50%; width: auto; height: 90%; translate: -50% 0; }
}
@media (min-width: 1024px) {
  .office-why__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; align-items: start; }
  .office-why__side { position: sticky; top: calc(var(--header-h) + 40px); }
  .office-why__list { gap: 24px; }
  .office-why__body::before { font-size: 2.75rem; right: 30px; top: 28px; }
}

/* ---------- 5. Technology and comfort ---------- */
.office-tech .office-tech__orbit > .photo { width: min(62%, 350px); margin-inline: auto; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.office-tech .office-tech__orbit .orbit-photo__ring { width: 100%; aspect-ratio: 0.94; }
.office-tech .office-tech__orbit .orbit-photo__node:nth-child(1) { left: 70%; top: 4.5%; }
.office-tech .office-tech__orbit .orbit-photo__node:nth-child(2) { left: 30%; top: 95.5%; }
.office-tech__orbit { max-width: 560px; margin-inline: auto; }
.office-tech__card { right: 0; bottom: 16%; }
.office-tech__text .head { margin-bottom: 28px; }
.office-tech__list li { font-size: 1rem; }
@media (min-width: 768px) { .office-tech__list li { font-size: 1.0625rem; } }
@media (min-width: 1024px) { .office-tech__card { right: -2%; } }

.office-tech .office-tech__cards { margin-top: 56px; }
@media (min-width: 640px) and (max-width: 1199.98px) { .office-tech .office-tech__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .office-tech .office-tech__cards { margin-top: 80px; } }
@media (min-width: 1200px) { .office-tech .office-tech__cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* On phones the shared compact card clamps its line at three; these lines are the office facts, so they print whole. */
@media (max-width: 639.98px) { .office-tech__cards .svc-card__text { display: block; -webkit-line-clamp: unset; overflow: visible; } }

/* ---------- 6. The team: the small team photo in a white frame, never wider than its 430 px ---------- */
.office-team__visual { position: relative; isolation: isolate; display: grid; place-items: center; padding: 28px 0; }
.office-team__ring { position: absolute; z-index: -1; left: 50%; top: 50%; width: min(118%, 600px); aspect-ratio: 1.25; translate: -50% -50%; pointer-events: none; }
.office-team__ring::before, .office-team__ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--rule-ink); }
.office-team__ring::before { transform: rotate(-12deg); }
.office-team__ring::after { transform: rotate(10deg) scale(0.9); border-style: dashed; border-color: rgba(14, 42, 58, 0.14); }
.office-team__frame { position: relative; width: 100%; max-width: 466px; margin: 0; padding: 18px 18px 14px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-lg); }
.office-team__frame > .photo { max-width: 430px; border-radius: 14px; box-shadow: none; }
.office-team__caption { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 0.875rem; line-height: 1.4; color: var(--muted); }
.office-team__caption .icon { color: var(--accent); flex: none; }
.office-team__text .head { margin-bottom: 0; }
.office-team__note { margin-top: 20px; font-weight: 600; color: var(--ink); }
.office-team__label { margin-top: 24px; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.office-team__chips { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.office-team__chips li { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px 8px 12px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.office-team__chips .icon { color: var(--accent); flex: none; }

/* ---------- 7. Plan your visit ---------- */
.office-visit__grid { display: grid; gap: 20px; }
.office-map { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-radius: var(--r-lg); background: var(--offwhite); box-shadow: var(--shadow-sm); }
.office-map__art { position: relative; overflow: hidden; }
.office-map__art svg { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; }
.office-map__body { display: grid; gap: 6px 24px; padding: 24px; }
.office-map__body h3 { font-size: 1.125rem; }
.office-map__addr { font-size: 1.0625rem; line-height: 1.5; color: var(--text); }
.office-map__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 10px; }
.office-map .link-phone { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }

.office-hours { min-width: 0; padding: 26px 22px; border-radius: var(--r-lg); background: var(--surface); }
.office-hours__top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.office-hours__icon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; }
.office-hours__icon .icon { width: 22px; height: 22px; }
.office-hours h3 { font-size: 1.125rem; }
.office-hours__status { font-size: 0.9375rem; font-weight: 600; color: var(--accent); }
/* Hours as stacked rounded rows (Dentrist): day left, time right, today in mint. */
.office-hours .hours { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 0.9375rem; }
.office-hours .hours th, .office-hours .hours td { height: 44px; padding: 0 16px; border: 0; background: #fff; color: var(--text); }
.office-hours .hours th { border-radius: 12px 0 0 12px; font-weight: 600; color: var(--ink); }
.office-hours .hours td { border-radius: 0 12px 12px 0; }
.office-hours .hours th { white-space: nowrap; }
.office-hours .hours td { text-align: right; }
@media (max-width: 479.98px) {
  .office-hours { padding: 22px 16px; }
  .office-hours .hours th, .office-hours .hours td { padding: 0 12px; font-size: 0.875rem; }
  .office-hours .hours__today { margin-left: 6px; padding: 2px 7px; }
}
.office-hours .hours tr.is-today th, .office-hours .hours tr.is-today td { background: var(--mint); color: var(--ink); }
.office-hours .hours__today { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #fff; font-size: 0.75rem; font-weight: 700; color: var(--ink); }
.office-hours__note { margin-top: 10px; font-size: 0.875rem; line-height: 1.5; color: var(--muted); }

.office-visit .office-access > li { padding: 20px; }
.office-access a { color: var(--accent); text-underline-offset: 3px; }
@media (min-width: 640px) {
  .office-map__body { grid-template-columns: minmax(0, 1fr) auto; align-items: end; padding: 26px 28px 28px; }
  .office-map__body h3, .office-map__addr { grid-column: 1; }
  .office-map__actions { grid-column: 2; grid-row: 1 / span 2; justify-content: flex-end; margin-top: 0; }
  .office-hours { padding: 30px 28px; }
}
@media (min-width: 1024px) {
  .office-visit__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; }
  .office-access { grid-column: 1 / -1; }
  .office-visit .office-access { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .office-map__art svg { aspect-ratio: 2 / 1; }
  /* The drawn map fills whatever height the hours card beside it sets, so the card has no empty foot. */
  .office-map__art { flex: 1 1 auto; min-height: 240px; }
  .office-map__art svg { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
  /* The map is narrower here than on a tablet: the button and the call link stack, so the address keeps its width. */
  .office-map__actions { flex-direction: column; align-items: flex-end; gap: 4px; }
}

/* ---------- 8. Reviews about the office ---------- */
.office-reviews__side { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.office-reviews__side .link-arrow { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.office-reviews .review-card__text { font-size: 1rem; }

/* ---------- 9. Next steps ---------- */
.office-next__grid { list-style: none; margin: 0; padding: 0; }
.office-next__grid > li { display: flex; min-width: 0; }
.office-next__grid > li > .card { flex: 1; }
@media (min-width: 700px) and (max-width: 1023.98px) { .office-next .office-next__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } .office-next .office-next__card { padding: 24px 20px; } }
.office-next .office-next__card .card__title { display: block; font-size: 1.25rem; }
.office-next .office-next__card .card__text { display: block; text-wrap: pretty; }

/* ---------- Motion (gated like modern.css: html.motion inside no-preference) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* The stage arrives after the header text: the photo rises, the cards follow one by one, the seal scales in. */
  html.motion .office-stage__photo { animation: pw-rise 680ms var(--ease-apex) 180ms backwards; }
  html.motion .office-stage__photo > .photo img { animation: pw-zoom-out 1050ms var(--ease-apex) 180ms backwards; }
  html.motion .office-stage__cards > :nth-child(1) { --ld: 520ms; }
  html.motion .office-stage__cards > :nth-child(2) { --ld: 640ms; }
  html.motion .office-stage__cards > :nth-child(3) { --ld: 760ms; }
  html.motion .office-stage .seal--office { animation: pw-scale-in 520ms var(--ease-apex) 480ms backwards; }
  html.motion .office-stage__label { animation: pw-fade 520ms var(--ease-apex) 540ms backwards; }
  /* The map pin bobs and its halo breathes. */
  html.motion .office-map__pin path, html.motion .office-map__pin circle:last-child { transform-box: view-box; animation: office-bob 3.2s var(--ease-io) infinite alternate; }
  html.motion .office-map__pin circle:first-child { transform-box: fill-box; transform-origin: 50% 50%; animation: office-halo 3.2s var(--ease-io) infinite; }
  /* The team photo's rings scale in and sway slowly. */
  html.motion .office-team__ring { transition: opacity 700ms var(--ease-apex), scale 800ms var(--ease-apex); }
  html.motion .office-team__visual:not(.is-in) .office-team__ring { opacity: 0; scale: 0.8; }
  html.motion .office-team__ring::before { animation: pw-sway 16s ease-in-out infinite alternate; }
  html.motion .office-team__ring::after { animation: pw-sway 20s ease-in-out -8s infinite alternate-reverse; }
  @keyframes office-bob { from { transform: translateY(0); } to { transform: translateY(-6px); } }
  @keyframes office-halo { 0% { transform: scale(0.7); opacity: 0.9; } 70% { transform: scale(1.5); opacity: 0; } 100% { transform: scale(1.5); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  .office-team__ring::before, .office-team__ring::after, .office-map__pin * { animation: none !important; }
}
