/* Section additions shared by every template. The original layout's count states use .layout-original. */
.layout-original h1, .layout-original h2, .layout-original h3, .layout-original p { overflow-wrap: anywhere; }
.layout-original .float-card span, .layout-original .collage__stat span { min-width: 0; overflow-wrap: anywhere; }
.layout-original .float-card--badge { max-width: 260px; }
.layout-original .collage__stat { max-width: 260px; }
.layout-original .stats > div { min-width: 0; overflow-wrap: anywhere; }
/* Full collections use the untouched four-column template. Smaller collections have
   explicit reviewed states, rather than blank card placeholders. */
.layout-original .template-services--0 { grid-template-columns: minmax(0, 540px); }
@media (min-width: 1101px) {
  .layout-original .template-services--1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-original .template-services--2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-original .template-services--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-original .template-services--0 .t-card--feature,
  .layout-original .template-services--1 .t-card--feature,
  .layout-original .template-services--2 .t-card--feature,
  .layout-original .template-services--3 .t-card--feature { grid-row: auto; min-height: 460px; }
  .layout-original .template-services--5 .t-card:last-child { grid-column: span 2; }
}
.template-image-required { aspect-ratio: 4 / 5; display: grid; place-items: center; padding: 2rem; border: 1px dashed var(--line); border-radius: var(--radius-lg); }
.template-feature-image { overflow: hidden; border-radius: var(--radius); }
.template-feature-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.template-service-list { display: grid; gap: 1.5rem; }
.template-service-list article { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); }
/* On two columns, an odd number of cards after the featured one ends with a full-width card instead of a lone half. */
@media (min-width: 621px) and (max-width: 1100px) {
  .layout-original :is(.template-services--1, .template-services--3, .template-services--5) .t-card:last-child { grid-column: span 2; }
}
/* Without the highlight strip, the hero sits on the same background as the first section: keep one gap, not two. */
.hero.layout-original + .section:not(.journey) { padding-top: clamp(24px, 4vw, 48px); }
@media (max-width: 600px) { .layout-original .float-card--badge { max-width: 75%; } }

@media (max-width: 620px) { .layout-original .t-card--feature { min-height: 500px; } }

/* Keep the arrow above the template’s stretched title link. */
.layout-original a.t-card__arrow { position: relative; z-index: 3; }

/* Team keeps the approved portrait/card composition while containing long identities. */
.website-team .dentist > *, .website-team .member > * { min-width: 0; }
.website-team h2, .website-team h3, .website-team p, .website-team blockquote, .website-team .cred { overflow-wrap: anywhere; }
.website-team .quote { white-space: pre-line; }
.website-team .cred { white-space: normal; }

/* Sections every template renders. Each composes from the shared styles and theme tokens, so any order works. */
.preview-notice { padding: 1rem; text-align: center; background: #fff3cd; color: #332700; }
.website-placeholder .container { padding: 28px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--ink-2); text-align: center; }
.website-placeholder { padding-block: 32px; }

/* Gallery: copy beside an optional before/after comparison, then the image grid. */
.gallery--grid-only { grid-template-columns: minmax(0, 760px); }
.ba__after, .ba__before { position: absolute; inset: 0; }
.ba__after img, .ba__before img { width: 100%; height: 100%; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: clamp(40px, 6vw, 64px) 0 0; padding: 0; list-style: none; }
.gallery-grid figure { margin: 0; }
.gallery-grid img { width: 100%; height: auto; border-radius: var(--radius); }
.gallery-grid figcaption { padding-top: 8px; color: var(--ink-2); font-size: 14px; }
@media (max-width: 1000px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: minmax(0, 1fr); } }
/* Up to four images fill their rows at every width. */
.gallery-grid--1 { grid-template-columns: minmax(0, 760px); }
.gallery-grid--2, .gallery-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1001px) { .gallery-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 561px) and (max-width: 1000px) { .gallery-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .gallery-grid[class*="gallery-grid--"] { grid-template-columns: minmax(0, 1fr); } }

/* Features: the column count follows the number of cards, so rows are filled and a lone card keeps a card's width. */
.t-grid--1 { grid-template-columns: minmax(0, 420px); }
.t-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 860px; }
.t-grid--3, .t-grid--5, .t-grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .t-grid--5, .t-grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-grid--3 .t-card { padding: 26px 22px 22px; }
}
@media (max-width: 620px) { .t-grid[class*="t-grid--"] { grid-template-columns: minmax(0, 1fr); max-width: none; } }

/* Team: one or two cards keep a portrait's width; four fill a row. The featured member is introduced above the grid. */
.section-head + .team { margin-top: 0; }
.team--1 { grid-template-columns: minmax(0, 360px); }
.team--2 { grid-template-columns: repeat(2, minmax(0, 360px)); }
.team--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .team--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .team[class*="team--"] { grid-template-columns: minmax(0, 1fr); }
  .member__photo { border-radius: calc(var(--radius-lg) * .8); }
}

/* Team details: the featured member's facts, and the same facts (with the biography) in each card's disclosure. */
.team-featured__details { margin-top: 28px; }
.team-details { display: grid; gap: 18px; margin: 0; }
.team-details > div { display: grid; gap: 8px; min-width: 0; }
.team-details dt { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.team-details dd { margin: 0; min-width: 0; color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; }
.team-details .creds { margin: 0; padding: 0; list-style: none; gap: 8px; }
.team-details .cred { padding: 6px 12px; font-size: 13px; }
.team-details__credentials, .team-details__services { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.team-details__credentials li { display: grid; gap: 2px; padding-left: 12px; border-left: 2px solid var(--accent); }
.team-details__credential { font-weight: 600; color: var(--ink); }
.team-details__services li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; }
.team-details__services li > :first-child { color: var(--ink); font-weight: 600; }
.team-details__services li > a:first-child { text-decoration: underline; text-underline-offset: 3px; }
.team-details .link-arrow { font-size: 14px; }
.member .team-details__bio { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; white-space: pre-line; }
.member__more { margin-top: 18px; border-top: 1px solid var(--line); }
.member__more > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; cursor: pointer; list-style: none; font-weight: 600; color: var(--brand); overflow-wrap: anywhere;
}
.member__more > summary::-webkit-details-marker { display: none; }
.member__more > summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s var(--ease);
}
.member__more[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.member__more-body { padding-bottom: 8px; }
@media (max-width: 760px) { .member__more { grid-column: 1 / -1; margin-top: 4px; } }

/* Fees: hidden cards leave a centred, narrower composition rather than gaps. */
.plans--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 860px; margin-inline: auto; }
.plans--1 { grid-template-columns: minmax(0, 1fr); max-width: 460px; margin-inline: auto; }
.plans--1 .plan--featured, .plans--2 .plan--featured { transform: none; }
.plan__price { overflow-wrap: anywhere; font-size: clamp(34px, 4vw, 60px); }

/* First visit: up to five steps fill the row. */
.steps--1 { grid-template-columns: minmax(0, 520px); }
.steps--2, .steps--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.steps--5 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (max-width: 900px) { .steps[class*="steps--"] { grid-template-columns: 1fr; } }

/* Headings on dark sections stay readable whatever the theme. */
.journey .section-title, .journey .step h3 { color: var(--brand-ink); }
.offer { padding-block: clamp(48px, 7vw, 88px); }
.offer__card h2, .offer__text { overflow-wrap: anywhere; }
[data-template] .journey .eyebrow, [data-template] .journey h2 em { color: var(--brand-ink); }
