/*
 * Scenic Dermatology service-page system
 * Shared semantic layer for condition, diagnostic, treatment, procedure,
 * and care-pathway pages. Depends on the existing Astra global palette and
 * typography; introduces no fonts, imagery, or JavaScript.
 */

.sd-service-page,
.sd-service-hero,
.sd-service-section {
  --sd-service-shell: 1200px;
  --sd-service-reading: 760px;
  --sd-service-reading-wide: 920px;
  --sd-service-gutter: clamp(20px, 4vw, 48px);
  --sd-service-section-space: clamp(56px, 7vw, 104px);
  --sd-service-section-space-compact: clamp(36px, 4.5vw, 64px);
  --sd-service-gap: clamp(20px, 2.5vw, 40px);
  --sd-service-padding: clamp(20px, 2.5vw, 32px);
  --sd-service-brand: var(--ast-global-color-1, #01603f);
  --sd-service-brand-bright: var(--ast-global-color-0, #27a168);
  --sd-service-text: var(--ast-global-color-2, #000000);
  --sd-service-surface: var(--ast-global-color-5, #fefefe);
  --sd-service-surface-hero: #f1f7f4;
  --sd-service-surface-quiet: rgba(1, 96, 63, 0.05);
  --sd-service-border: rgba(1, 96, 63, 0.18);
  --sd-service-focus: #f0a629;
  --sd-service-focus-contrast: #173c30;
  --sd-service-radius: 14px;
  --sd-service-radius-feature: 22px;
}

.sd-service-page {
  color: var(--sd-service-text);
}

.sd-service-page,
.sd-service-page *,
.sd-service-page *::before,
.sd-service-page *::after {
  box-sizing: border-box;
}

.sd-service-page,
.sd-service-page > .alignfull {
  width: 100% !important;
  max-width: 100% !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

/*
 * Astra's normal content container is intentionally capped. Service pages add
 * a body class in the shared snippet so the main canvas can be full width while
 * every readable section remains constrained by the semantic shells below.
 */
.sd-service-site .site-content > .ast-container {
  width: 100%;
  max-width: none;
  padding-right: 0;
  padding-left: 0;
}

.sd-service-site .site-content > .ast-container > .content-area {
  width: 100%;
}

/*
 * Service pages already provide prominent request and telephone actions. Hide
 * the redundant global EZDERM launcher on Service-system pages. Full-page
 * integration scanning proves that its fixed footprint obscures governed page
 * content from 320px through 1440px; the page retains its header, telephone,
 * and three in-page appointment actions.
 */
.sd-service-site #customFloatingButton {
  display: none !important;
}

.sd-service-shell,
.sd-service-reading,
.sd-service-reading-wide {
  width: min(100%, var(--sd-service-shell));
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--sd-service-gutter);
  padding-left: var(--sd-service-gutter);
}

.sd-service-reading {
  width: min(100%, calc(var(--sd-service-reading) + (2 * var(--sd-service-gutter))));
}

.sd-service-reading-wide {
  width: min(100%, calc(var(--sd-service-reading-wide) + (2 * var(--sd-service-gutter))));
}

.sd-service-section {
  padding-top: var(--sd-service-section-space);
  padding-bottom: var(--sd-service-section-space);
}

.sd-service-section--compact {
  padding-top: var(--sd-service-section-space-compact);
  padding-bottom: var(--sd-service-section-space-compact);
}

.sd-service-surface--base {
  background: var(--sd-service-surface);
}

.sd-service-surface--quiet {
  background: var(--sd-service-surface-quiet);
}

.sd-service-surface--accent {
  color: var(--sd-service-surface);
  background: var(--sd-service-brand);
}

/*
 * Astra constrains the entry-content element to 1200px. Keep readable content
 * in that shell while allowing major service surfaces to reach both viewport
 * edges without 100vw sizing or negative-margin layout hacks.
 */
.sd-service-page > .sd-service-surface--base {
  box-shadow: 0 0 0 100vmax var(--sd-service-surface);
  clip-path: inset(0 -100vmax);
}

.sd-service-page > .sd-service-surface--quiet {
  box-shadow: 0 0 0 100vmax var(--sd-service-surface-quiet);
  clip-path: inset(0 -100vmax);
}

.sd-service-page > .sd-service-surface--accent {
  box-shadow: 0 0 0 100vmax var(--sd-service-brand);
  clip-path: inset(0 -100vmax);
}

.sd-service-surface--accent :is(h2, h3, h4, p, li),
.sd-service-page .sd-service-surface--accent a:not(.wp-block-button__link) {
  color: var(--sd-service-surface);
}

.sd-service-page :is(h1, h2, h3, h4) {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.sd-service-page h2 {
  margin-top: 0;
}

.sd-service-page :is(h2, h3)[id] {
  scroll-margin-top: 112px;
}

.sd-service-eyebrow {
  margin: 0 0 12px;
  color: var(--sd-service-brand);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sd-service-surface--accent .sd-service-eyebrow {
  color: #b9ead1;
}

.sd-service-lead {
  max-width: var(--sd-service-reading);
  font-size: clamp(1.0625rem, 1.5vw, 1.125rem);
  line-height: 1.65;
}

.sd-service-meta {
  font-size: 0.92rem;
}

/* Match Scenic's editorial-link interaction without affecting buttons. */
.sd-service-page a:not(.wp-block-button__link) {
  color: var(--sd-service-brand);
  text-decoration-line: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: color 160ms ease, text-decoration-thickness 160ms ease;
}

@media (hover: hover) {
  .sd-service-page a:not(.wp-block-button__link):hover {
    color: #00452f;
    text-decoration-thickness: 0.12em;
  }

  .sd-service-page .sd-service-surface--accent a:not(.wp-block-button__link):hover {
    color: #dff3e8;
  }
}

.sd-service-page a:not(.wp-block-button__link):focus-visible {
  color: #00452f;
  text-decoration-thickness: 0.12em;
}

.sd-service-page .sd-service-surface--accent a:not(.wp-block-button__link):focus-visible {
  color: #dff3e8;
}

/* Hero grammar: concern, process, and cosmetic variants share one shell. */
.sd-service-hero {
  padding-top: clamp(56px, 6vw, 88px);
  padding-bottom: clamp(56px, 6vw, 88px);
  background: linear-gradient(
    132deg,
    rgba(1, 96, 63, 0.12) 0%,
    var(--sd-service-surface) 58%,
    rgba(39, 161, 104, 0.12) 100%
  );
  box-shadow: 0 0 0 100vmax var(--sd-service-surface-hero);
  clip-path: inset(0 -100vmax);
}

.sd-service-hero--cosmetic {
  background: linear-gradient(
    132deg,
    rgba(216, 194, 164, 0.22) 0%,
    var(--sd-service-surface) 58%,
    rgba(1, 96, 63, 0.08) 100%
  );
}

.sd-service-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.sd-service-page .sd-service-hero__grid--top {
  align-items: start;
}

.sd-service-page .sd-service-hero__grid > * {
  margin-block-start: 0;
}

.sd-service-hero__copy {
  min-width: 0;
}

.sd-service-hero__grid--editorial {
  grid-template-columns: minmax(0, var(--sd-service-reading-wide));
}

.sd-service-hero__figure {
  margin: 0;
}

.sd-service-hero__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--sd-service-radius-feature);
}

.sd-service-hero__image--editorial {
  aspect-ratio: 5 / 4;
  object-fit: cover;
}

.sd-service-on-this-page {
  padding-block: clamp(16px, 2vw, 24px);
  background: var(--sd-service-surface);
  border-block: 1px solid var(--sd-service-border);
}

.sd-service-page > .sd-service-on-this-page {
  box-shadow: 0 0 0 100vmax var(--sd-service-surface);
  clip-path: inset(0 -100vmax);
}

.sd-service-on-this-page__nav {
  display: flex;
  align-items: baseline;
  gap: clamp(16px, 2.5vw, 32px);
}

.sd-service-on-this-page__label {
  flex: 0 0 auto;
  margin: 0;
  color: var(--sd-service-text);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sd-service-on-this-page ul {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px clamp(16px, 2.5vw, 28px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sd-service-on-this-page li {
  margin: 0;
  padding: 0;
}

.sd-service-on-this-page a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  line-height: 1.3;
  text-underline-offset: 0.22em;
}

.sd-service-on-this-page a:hover {
  color: #00452f;
}

.sd-service-hero__aside {
  min-width: 0;
  padding: clamp(26px, 3vw, 38px);
  background: rgba(254, 254, 254, 0.92);
  border: 1px solid var(--sd-service-border);
  border-top: 5px solid var(--sd-service-brand-bright);
  border-radius: var(--sd-service-radius-feature);
  box-shadow: 0 18px 42px rgba(23, 60, 48, 0.08);
}

.sd-service-hero__aside > :first-child {
  margin-top: 0;
}

.sd-service-hero__aside > :last-child {
  margin-bottom: 0;
}

.sd-service-hero__aside-title {
  margin: 0 0 16px;
  color: #173c30;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.35;
}

.sd-service-hero__aside ul {
  margin: 20px 0;
  padding-left: 1.25rem;
}

.sd-service-hero__aside li + li {
  margin-top: 10px;
}

.sd-service-hero__note,
.sd-service-logistics {
  padding: var(--sd-service-padding);
  background: var(--sd-service-surface-quiet);
  border: 1px solid var(--sd-service-border);
  border-radius: var(--sd-service-radius);
}

.sd-service-page .wp-block-buttons {
  gap: 14px;
}

.sd-service-page .wp-block-button__link {
  display: inline-flex;
  min-height: 48px;
  padding: 0 22px;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 8px;
  box-shadow: 0 2px 0 rgba(23, 60, 48, 0.14);
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease,
    box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.sd-service-button--primary .wp-block-button__link {
  color: var(--sd-service-surface) !important;
  background: var(--sd-service-brand) !important;
  border-color: var(--sd-service-brand) !important;
}

.sd-service-button--secondary .wp-block-button__link {
  color: var(--sd-service-brand) !important;
  background: var(--sd-service-surface) !important;
  border-color: var(--sd-service-brand) !important;
}

.sd-service-surface--accent .sd-service-button--secondary .wp-block-button__link {
  color: var(--sd-service-brand) !important;
  border-color: var(--sd-service-surface) !important;
}

@media (hover: hover) {
  .sd-service-button--primary .wp-block-button__link:hover {
    background: #00452f !important;
    border-color: #00452f !important;
    box-shadow: 0 4px 0 rgba(23, 60, 48, 0.16);
    transform: translateY(-1px);
  }

  .sd-service-button--secondary .wp-block-button__link:hover {
    color: #00452f !important;
    background: #eaf5ef !important;
    border-color: #00452f !important;
    box-shadow: 0 4px 0 rgba(23, 60, 48, 0.12);
    transform: translateY(-1px);
  }
}

.sd-service-page :is(a, button, summary, [tabindex="0"]):focus-visible {
  outline: 3px solid var(--sd-service-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--sd-service-focus-contrast);
}

/* SP-02: orientation / decision aid. */
.sd-service-decision,
.sd-service-note,
.sd-service-callout {
  padding: var(--sd-service-padding);
  background: var(--sd-service-surface);
  border: 1px solid var(--sd-service-border);
  border-left: 4px solid var(--sd-service-brand);
  border-radius: var(--sd-service-radius);
}

.sd-service-decision > :first-child,
.sd-service-note > :first-child,
.sd-service-callout > :first-child,
.sd-service-logistics > :first-child {
  margin-top: 0;
}

.sd-service-decision > :last-child,
.sd-service-note > :last-child,
.sd-service-callout > :last-child,
.sd-service-logistics > :last-child {
  margin-bottom: 0;
}

.sd-service-decision__items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.sd-service-decision__item {
  min-width: 0;
  padding: 22px 0 0;
  border-top: 4px solid var(--sd-service-brand-bright);
}

.sd-service-decision__item h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

/* SP-03: semantic comparison table with intentional narrow-screen overflow. */
.sd-service-comparison {
  width: 100%;
  margin: 28px 0;
  overflow-x: auto;
  background: var(--sd-service-surface);
  border: 1px solid var(--sd-service-border);
  border-radius: var(--sd-service-radius);
  -webkit-overflow-scrolling: touch;
}

.sd-service-comparison table {
  width: 100%;
  min-width: 720px;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.98rem;
  line-height: 1.55;
}

.sd-service-comparison caption {
  padding: 18px 20px;
  color: var(--sd-service-text);
  font-weight: 700;
  text-align: left;
}

.sd-service-comparison :is(th, td) {
  padding: 16px 18px;
  vertical-align: top;
  text-align: left;
  border-right: 1px solid rgba(1, 96, 63, 0.16);
  border-bottom: 1px solid rgba(1, 96, 63, 0.16);
}

.sd-service-comparison :is(th, td):last-child {
  border-right: 0;
}

.sd-service-comparison tr:last-child :is(th, td) {
  border-bottom: 0;
}

.sd-service-comparison thead th {
  color: var(--sd-service-surface);
  background: var(--sd-service-brand);
}

.sd-service-comparison tbody th {
  width: 32%;
  color: #173c30;
  background: rgba(1, 96, 63, 0.07);
}

/* SP-04: chronological process. */
.sd-service-process {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 30px;
  padding: 0;
  counter-reset: sd-service-step;
  list-style: none;
}

.sd-service-process li {
  position: relative;
  min-width: 0;
  padding: 58px 22px 24px;
  background: var(--sd-service-surface);
  border: 1px solid var(--sd-service-border);
  border-radius: var(--sd-service-radius);
  counter-increment: sd-service-step;
}

.sd-service-process li::before {
  position: absolute;
  top: 18px;
  left: 22px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--sd-service-surface);
  background: var(--sd-service-brand);
  border-radius: 50%;
  content: counter(sd-service-step);
  font-weight: 700;
}

.sd-service-process strong {
  display: block;
  margin-bottom: 6px;
  color: #173c30;
}

/* SP-05: unequal options remain a vertical editorial stack. */
.sd-service-options {
  display: grid;
  gap: 0;
  margin-top: 28px;
}

.sd-service-option {
  min-width: 0;
  padding: 30px 0;
  border-top: 1px solid var(--sd-service-border);
}

.sd-service-option:last-child {
  border-bottom: 1px solid var(--sd-service-border);
}

.sd-service-option > :first-child {
  margin-top: 0;
}

.sd-service-option > :last-child {
  margin-bottom: 0;
}

/* SP-07 and life-context compositions. */
.sd-service-media-split,
.sd-service-life-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sd-service-gap);
}

.sd-service-page .sd-service-media-split > *,
.sd-service-page .sd-service-life-context > *,
.sd-service-page .sd-service-trust > * {
  margin-block-start: 0;
}

.sd-service-life-context > * {
  min-width: 0;
  padding-top: 28px;
  border-top: 4px solid var(--sd-service-brand-bright);
}

.sd-service-results-list strong {
  color: #173c30;
}

.sd-service-editorial-stack {
  display: grid;
  gap: var(--sd-service-section-space-compact);
  width: min(100%, var(--sd-service-reading-wide));
  margin-top: 28px;
}

.sd-service-editorial-subsection {
  min-width: 0;
}

/* SP-08: a compact, single-use physician perspective. */
.sd-service-trust {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.55fr);
  gap: var(--sd-service-gap);
  align-items: center;
}

.sd-service-page .sd-service-trust--top {
  align-items: start;
}

/* SP-09: native Details, no custom script. */
.sd-service-faq__list {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.sd-service-faq__item {
  margin: 0;
  background: var(--sd-service-surface);
  border: 1px solid var(--sd-service-border);
  border-radius: 10px;
}

.sd-service-faq__item summary {
  position: relative;
  padding: 18px 54px 18px 20px;
  color: #173c30;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.45;
  list-style: none;
}

.sd-service-faq__item summary::-webkit-details-marker {
  display: none;
}

.sd-service-faq__item summary::after {
  position: absolute;
  top: 50%;
  right: 20px;
  content: "+";
  font-size: 1.45rem;
  font-weight: 500;
  transform: translateY(-50%);
}

.sd-service-faq__item[open] summary::after {
  content: "−";
}

.sd-service-faq__item > p {
  margin: 0;
  padding: 0 20px 20px;
}

/* SP-10 and SP-11. */
.sd-service-related {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sd-service-gap);
}

.sd-service-page .sd-service-related > * {
  min-width: 0;
  margin-block-start: 0;
  padding-top: 24px;
  border-top: 1px solid var(--sd-service-border);
}

.sd-service-final-cta {
  text-align: center;
}

.sd-service-final-cta .wp-block-buttons {
  justify-content: center;
}

.sd-service-final-cta .wp-block-button__link {
  width: 100%;
  justify-content: center;
}

@media (min-width: 768px) {
  .sd-service-final-cta .wp-block-button {
    flex: 0 1 340px;
  }
}

@media (max-width: 1023px) {
  .sd-service-hero__grid,
  .sd-service-trust {
    grid-template-columns: 1fr;
  }

  .sd-service-process,
  .sd-service-decision__items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sd-service-related {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .sd-service-shell,
  .sd-service-reading,
  .sd-service-reading-wide {
    padding-right: 20px;
    padding-left: 20px;
  }

  .sd-service-section {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .sd-service-hero {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .sd-service-hero__media {
    order: 2;
  }

  .sd-service-on-this-page__nav {
    display: block;
  }

  .sd-service-on-this-page__label {
    margin-bottom: 6px;
  }

  .sd-service-on-this-page ul {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sd-service-process,
  .sd-service-decision__items,
  .sd-service-media-split,
  .sd-service-life-context,
  .sd-service-related {
    grid-template-columns: 1fr;
  }

  .sd-service-page .wp-block-buttons {
    align-items: stretch;
  }

  .sd-service-page .wp-block-button {
    width: 100%;
  }

  .sd-service-page .wp-block-button__link {
    width: 100%;
    min-height: 48px;
    text-align: center;
  }

  .sd-service-comparison {
    background-image: linear-gradient(to left, rgba(1, 96, 63, 0.13), rgba(1, 96, 63, 0));
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 28px 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sd-service-page *,
  .sd-service-page *::before,
  .sd-service-page *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
