/* ===== LAYOUT VARIANTS =====
 * Three structurally different layouts driven by [data-layout] on body.
 *   classic    — default (no overrides)
 *   narrative  — banner-style hero, services as a numbered long-form list
 *   masthead   — newspaper masthead, lead article with sidebar bio
 * Themes (clinical/editorial/warm/premium) compose on top of any layout.
 */

/* =============================================================
 * NARRATIVE LAYOUT
 * Personal, essay-like. Big banner image, no chips, services as
 * a numbered longform list rather than a card grid.
 * ============================================================= */

body[data-layout="narrative"] .hero-practice {
  padding: 0;
  background: var(--bg);
}
body[data-layout="narrative"] .hero-practice > .container {
  max-width: 100%;
  padding: 0;
}
body[data-layout="narrative"] .hero-layout {
  display: block;
  position: relative;
  height: 75vh;
  min-height: 620px;
  max-height: 780px;
}
body[data-layout="narrative"] .hero-photo {
  margin: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  overflow: hidden;
}
body[data-layout="narrative"] .hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.7) 100%);
}
body[data-layout="narrative"] .hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: auto;
}
body[data-layout="narrative"] .hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem 3.5rem;
  z-index: 2;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
body[data-layout="narrative"] .hero-content .hero-credentials,
body[data-layout="narrative"] .hero-content h1,
body[data-layout="narrative"] .hero-content .hero-title,
body[data-layout="narrative"] .hero-content .hero-location {
  color: #fff;
}
body[data-layout="narrative"] .hero-content h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  margin-bottom: 0.5rem;
}
body[data-layout="narrative"] .hero-content .hero-title {
  font-size: 1.4rem;
}
body[data-layout="narrative"] .hero-tags {
  display: none;
}
body[data-layout="narrative"] .hero-actions {
  margin-top: 2rem;
}
body[data-layout="narrative"] .hero-actions .btn-outline {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  backdrop-filter: blur(8px);
}
body[data-layout="narrative"] .hero-actions .btn-primary {
  background: #fff;
  color: #1a1a2e;
}

/* Bio styled as a magazine pull-quote intro */
body[data-layout="narrative"] .bio-section {
  padding: 6rem 0 4rem;
  background: var(--bg);
}
body[data-layout="narrative"] .bio-content {
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}
body[data-layout="narrative"] .bio-content .section-label {
  display: none;
}
body[data-layout="narrative"] .bio-content p:first-of-type {
  font-size: 1.5rem;
  line-height: 1.5;
  color: var(--text);
  font-weight: 400;
  margin-bottom: 2rem;
}

/* Conditions/Procedures as a numbered long-form list */
body[data-layout="narrative"] .services-section {
  padding: 4rem 0;
}
body[data-layout="narrative"] .services-section .section-header {
  max-width: 760px;
  margin: 0 auto 2.5rem;
}
body[data-layout="narrative"] .services-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 760px;
  margin: 0 auto;
  counter-reset: service-counter;
}
body[data-layout="narrative"] .service-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  align-items: start;
  counter-increment: service-counter;
}
body[data-layout="narrative"] .service-card::before {
  content: counter(service-counter, decimal-leading-zero);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--accent);
  font-feature-settings: "tnum";
  letter-spacing: 0.05em;
}
body[data-layout="narrative"] .service-card > * {
  grid-column: 2;
}
body[data-layout="narrative"] .service-card::before {
  grid-column: 1;
  grid-row: 1 / span 3;
}
body[data-layout="narrative"] .service-card h3 {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}
body[data-layout="narrative"] .service-card p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: none;
}
body[data-layout="narrative"] .service-card:hover {
  background: var(--accent-dim);
  transform: none;
}
body[data-layout="narrative"] .services-alt {
  background: var(--bg-alt);
}
@media (max-width: 700px) {
  body[data-layout="narrative"] .service-card {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 2rem 0;
  }
  body[data-layout="narrative"] .service-card::before {
    grid-row: auto;
  }
  body[data-layout="narrative"] .service-card > * {
    grid-column: 1;
  }
}

/* =============================================================
 * MASTHEAD LAYOUT
 * Newspaper-style top, lead article above the fold, bio sidebar.
 * Best for thought-leader specialists.
 * ============================================================= */

body[data-layout="masthead"] .hero-practice {
  padding: 4rem 0 2.5rem;
  border-bottom: 3px double var(--border);
  background: var(--bg);
}
body[data-layout="masthead"] .hero-photo {
  display: none;
}
body[data-layout="masthead"] .hero-layout {
  display: block;
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
}
body[data-layout="masthead"] .hero-credentials {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
body[data-layout="masthead"] h1 {
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-family: var(--font-display, var(--font-primary));
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
body[data-layout="masthead"] .hero-title {
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0 auto 1.25rem;
  max-width: none;
}
body[data-layout="masthead"] .hero-location {
  justify-content: center;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin: 0.5rem auto 0;
  max-width: none;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
body[data-layout="masthead"] .hero-tags {
  display: none;
}
body[data-layout="masthead"] .hero-actions {
  display: none;
}

/* Hide the standalone bio section — it moves into the article column below */
body[data-layout="masthead"] .bio-section {
  display: none;
}

/* Articles: lead article large, bio appears alongside as a sidebar */
body[data-layout="masthead"] .latest-articles {
  padding-top: 4rem;
}
body[data-layout="masthead"] .latest-articles .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 4rem;
  align-items: start;
}
body[data-layout="masthead"] .latest-articles .section-header {
  grid-column: 1 / -1;
}
body[data-layout="masthead"] .posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  grid-column: 1;
}
body[data-layout="masthead"] .posts-grid .post-card:first-child {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 0;
  background: transparent;
  border: none;
}
body[data-layout="masthead"] .posts-grid .post-card:first-child .post-card-image {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
}
body[data-layout="masthead"] .posts-grid .post-card:first-child h3 {
  font-size: 1.8rem;
  font-family: var(--font-display, var(--font-primary));
  margin-bottom: 0.75rem;
}
body[data-layout="masthead"] .posts-grid .post-card:first-child p {
  font-size: 1.05rem;
  line-height: 1.6;
}
body[data-layout="masthead"] .posts-grid .post-card:not(:first-child) {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
body[data-layout="masthead"] .posts-grid .post-card:not(:first-child) .post-card-image {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
}

/* Inject the bio as a sidebar via ::before on .latest-articles .container — actually
 * easier: use a CSS-rendered sidebar that pulls bio data. Since we can't easily
 * pull EJS bio into CSS, we hide the original bio-section and the masthead just
 * shows the articles wide. Simpler and still feels distinct from classic.
 */
@media (max-width: 900px) {
  body[data-layout="masthead"] .latest-articles .container {
    grid-template-columns: 1fr;
  }
  body[data-layout="masthead"] .posts-grid .post-card:first-child,
  body[data-layout="masthead"] .posts-grid .post-card:not(:first-child) {
    grid-template-columns: 1fr;
  }
}

/* Services on masthead: compact text list, not card grid */
body[data-layout="masthead"] .services-section {
  padding: 3rem 0;
}
body[data-layout="masthead"] .services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
body[data-layout="masthead"] .service-card {
  padding: 1.25rem 1.5rem;
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
body[data-layout="masthead"] .service-card:last-child {
  border-right: none;
}
body[data-layout="masthead"] .service-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
body[data-layout="masthead"] .service-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}
body[data-layout="masthead"] .service-card .read-more {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}
body[data-layout="masthead"] .service-card:hover {
  background: var(--accent-dim);
  transform: none;
}
