/* ==========================================================================
   Rapson Pain Clinic — site styles
   Palette: charcoal #38383B · sage #BCBC9F · cream #F2F1E9
   Type: Cormorant Garamond (display) · Open Sans (body)
   ========================================================================== */

:root {
  --charcoal: #38383b;
  --charcoal-deep: #2e2e31;
  --charcoal-soft: #47474b;
  --sage: #bcbc9f;
  --sage-bright: #cfcfb4;
  --sage-dim: rgba(188, 188, 159, 0.28);
  --sage-faint: rgba(188, 188, 159, 0.14);
  --cream: #f2f1e9;
  --cream-deep: #e7e5d8;
  --ink: #2c2c2f;
  --ink-soft: #55555a;
  --white: #fdfdfb;

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Open Sans", "Helvetica Neue", Arial, sans-serif;

  --container: 71.25rem; /* 1140px */
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --section-y: clamp(4rem, 10vw, 7.5rem);
}

/* Reset ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
h1, h2, h3, h4, p,
figure, blockquote,
ul, ol, dl, dd {
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--white);
  background-color: var(--charcoal);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

::selection {
  background: var(--sage);
  color: var(--charcoal);
}

:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
}

/* Utilities -------------------------------------------------------------- */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: 46rem;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--sage);
  color: var(--charcoal);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1.25rem;
}

.light .eyebrow {
  color: #8f8f6f;
}

/* Type ------------------------------------------------------------------- */

h1, h2, h3,
.display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
}

h3 {
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
}

.lede {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  max-width: 42rem;
}

/* Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: var(--sage);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 1px solid var(--sage);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  background: var(--sage-bright);
  border-color: var(--sage-bright);
}

.btn--ghost {
  background: transparent;
  color: var(--sage);
}

.btn--ghost:hover {
  background: var(--sage);
  color: var(--charcoal);
}

.light .btn--ghost {
  color: var(--charcoal);
  border-color: var(--charcoal);
}

.light .btn--ghost:hover {
  background: var(--charcoal);
  color: var(--cream);
}

/* Header ----------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--charcoal);
  border-bottom: 1px solid var(--sage-faint);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 5.25rem;
}

.site-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  margin-right: auto;
}

.site-header__logo img {
  width: 3.25rem;
  height: 3.25rem;
}

.site-header__wordmark {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  color: var(--sage);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.75rem);
}

.site-nav a {
  font-size: 0.95rem;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover {
  color: var(--sage-bright);
}

/* Header button: same style as the standard .btn (sage fill, charcoal text,
   lighter sage on hover). These overrides keep the generic nav-link color
   rules from tinting its text. */
.site-nav .btn {
  color: var(--charcoal);
}

.site-nav .btn:hover {
  background: var(--sage-bright);
  color: var(--charcoal);
}

.site-nav a[aria-current="page"] {
  color: var(--sage);
  border-bottom-color: var(--sage);
}

.site-nav .btn {
  padding: 0.6rem 1.4rem;
  border-bottom: 1px solid var(--sage);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.6rem;
  background: none;
  border: 1px solid var(--sage-dim);
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--sage);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 56.25em) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: 5.3rem 0 0 0;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding: 2rem var(--gutter) 3rem;
    background: var(--charcoal-deep);
    overflow-y: auto;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s;
  }

  .site-nav.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .site-nav a {
    width: 100%;
    padding: 1.1rem 0;
    font-family: var(--font-display);
    font-size: 1.6rem;
    border-bottom: 1px solid var(--sage-faint);
  }

  .site-nav a[aria-current="page"] {
    border-bottom-color: var(--sage);
  }

  .site-nav .btn {
    margin-top: 2rem;
    text-align: center;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1px solid var(--sage);
  }

  body.nav-locked {
    overflow: hidden;
  }
}

/* Sections --------------------------------------------------------------- */

.section {
  padding-block: var(--section-y);
}

.section--flush {
  padding-block: 0;
}

.light {
  background: var(--cream);
  color: var(--ink);
}

.light h1,
.light h2,
.light h3 {
  color: var(--ink);
}

.dark-deep {
  background: var(--charcoal-deep);
}

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

/* Hero ------------------------------------------------------------------- */

.hero {
  display: flex;
  align-items: center;
  min-height: min(78vh, 46rem);
  padding-block: clamp(5rem, 12vw, 9rem);
}

.hero h1 {
  color: var(--sage);
  max-width: 18ch;
}

.hero h1 em {
  font-style: italic;
}

.hero .lede {
  margin-top: 2rem;
  color: var(--white);
}

.hero__actions {
  margin-top: 2.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Page hero (interior pages) */

.page-hero {
  padding-block: clamp(4rem, 9vw, 6.5rem);
  border-bottom: 1px solid var(--sage-faint);
}

.page-hero h1 {
  color: var(--sage);
  max-width: 22ch;
}

.page-hero .lede {
  margin-top: 1.5rem;
}

/* Split (image + text) --------------------------------------------------- */

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

@media (min-width: 50em) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .split--text-first .split__media {
    order: 2;
  }
}

.split__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.split__body > * + * {
  margin-top: 1.25rem;
}

/* Card grid -------------------------------------------------------------- */

.card-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
}

.card {
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border: 1px solid var(--sage-dim);
  background: transparent;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--sage);
}

.card h3 {
  color: var(--sage);
  margin-bottom: 1rem;
}

.light .card {
  background: var(--white);
  border-color: var(--cream-deep);
}

.light .card:hover {
  border-color: var(--sage);
}

.light .card h3 {
  color: var(--ink);
}

.card .note {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.card ul {
  padding-left: 1.1rem;
  margin-top: 0.5rem;
}

.card li {
  margin-block: 0.3rem;
}

/* CTA band --------------------------------------------------------------- */

.cta-band {
  background: var(--sage);
  color: var(--charcoal);
  text-align: center;
  padding-block: clamp(3.5rem, 8vw, 5.5rem);
}

.cta-band h2 {
  color: var(--charcoal);
  margin-bottom: 1.5rem;
}

.cta-band .btn {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--sage-bright);
}

.cta-band .btn:hover {
  background: var(--charcoal-deep);
}

/* Team ------------------------------------------------------------------- */

.team-member {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--cream-deep);
}

.team-member:first-of-type {
  border-top: 0;
  padding-top: 0;
}

@media (min-width: 43.75em) {
  .team-member {
    grid-template-columns: 14rem 1fr;
  }
}

.team-member__photo img {
  width: 100%;
  max-width: 14rem;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--cream-deep);
}

.team-member h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
}

.team-member__credentials {
  display: block;
  margin-top: 0.35rem;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8f8f6f;
}

.team-member__bio > * + * {
  margin-top: 1rem;
}

/* Prose (generic rich text) ---------------------------------------------- */

.prose > * + * {
  margin-top: 1.25rem;
}

.prose h2 {
  margin-top: 3rem;
}

.prose h3 {
  margin-top: 2.5rem;
}

.prose h4 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 2rem;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li {
  margin-block: 0.5rem;
}

.prose li p {
  margin: 0;
}

.prose li p + p {
  margin-top: 0.5rem;
}

.prose a {
  color: var(--sage);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--sage-dim);
  transition: text-decoration-color 0.2s ease;
}

.prose a:hover {
  text-decoration-color: var(--sage);
}

.light .prose a,
.light.prose a {
  color: #77774f;
}

.prose blockquote {
  border-left: 3px solid var(--sage);
  padding: 0.25rem 0 0.25rem 1.5rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
}

.prose figure {
  margin-block: 2rem;
}

.prose figcaption {
  font-size: 0.85rem;
  color: var(--sage);
  margin-top: 0.6rem;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--sage-dim);
  margin-block: 2.5rem;
}

/* FAQ -------------------------------------------------------------------- */

.faq-item {
  border-bottom: 1px solid var(--cream-deep);
}

.faq-item summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  font-weight: 500;
  line-height: 1.3;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 300;
  color: #8f8f6f;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

/* Animate the expanding panel where the browser supports it
   (interpolate-size + ::details-content, Chrome 131+); elsewhere the
   content still gets the fade/slide keyframe below. */
.faq-item {
  interpolate-size: allow-keywords;
}

.faq-item::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    content-visibility 0.35s allow-discrete;
}

.faq-item[open]::details-content {
  block-size: auto;
}

.faq-item__body {
  padding-bottom: 1.75rem;
  max-width: 60ch;
}

.faq-item[open] .faq-item__body {
  animation: faq-reveal 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes faq-reveal {
  from {
    opacity: 0;
    transform: translateY(-0.4rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-item[open] .faq-item__body {
    animation: none;
  }
}

.faq-item__body > * + * {
  margin-top: 1rem;
}

.faq-item__body ul {
  padding-left: 1.4rem;
}

.faq-item__body li {
  margin-block: 0.4rem;
}

.faq-item__body a {
  color: #77774f;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Resources -------------------------------------------------------------- */

.resource-list {
  list-style: none;
  padding: 0;
}

.resource-list li {
  border-bottom: 1px solid var(--sage-faint);
}

.resource-list a {
  display: block;
  padding: 1.4rem 0;
  text-decoration: none;
  transition: padding-left 0.2s ease;
}

.resource-list a:hover {
  padding-left: 0.5rem;
}

.resource-list a:hover .resource-list__title {
  color: var(--sage-bright);
}

.resource-list__title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  color: var(--sage);
}

.resource-list__title::after {
  content: " ↗";
  font-size: 0.9em;
}

.resource-list__meta {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: rgba(253, 253, 251, 0.7);
}

/* Blog index ------------------------------------------------------------- */

.post-list {
  list-style: none;
  padding: 0;
}

.post-list__item {
  border-bottom: 1px solid var(--sage-faint);
}

.post-list__item a {
  display: block;
  padding: clamp(1.75rem, 4vw, 2.5rem) 0;
  text-decoration: none;
}

.post-list__date {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage);
}

.post-list__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  font-weight: 500;
  line-height: 1.2;
  margin-top: 0.6rem;
  transition: color 0.2s ease;
}

.post-list__item a:hover .post-list__title {
  color: var(--sage-bright);
}

.post-list__excerpt {
  margin-top: 0.75rem;
  max-width: 62ch;
  color: rgba(253, 253, 251, 0.78);
}

.post-list__more {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
}

/* Blog post -------------------------------------------------------------- */

.post-header {
  padding-block: clamp(4rem, 9vw, 6rem) clamp(2rem, 5vw, 3rem);
}

.post-header h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  color: var(--sage);
}

.post-header__meta {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(253, 253, 251, 0.7);
}

.post-header__meta strong {
  color: var(--sage);
  font-weight: 600;
}

.post-body {
  padding-bottom: var(--section-y);
}

.post-tags {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-tags span {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--sage-dim);
  color: var(--sage);
}

.post-author {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--sage-dim);
  font-size: 0.9rem;
  color: rgba(253, 253, 251, 0.75);
}

.post-author strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--sage);
  margin-bottom: 0.4rem;
}

.post-nav {
  padding-block: 2.5rem;
  border-top: 1px solid var(--sage-faint);
}

.post-nav a {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
}

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-block: 2rem;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Forms ------------------------------------------------------------------ */

.form-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 37.5em) {
  .form-grid--half {
    grid-template-columns: 1fr 1fr;
  }
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.5rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--white);
  background: transparent;
  border: 1px solid var(--sage-dim);
  border-radius: 0;
  transition: border-color 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--sage);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%23bcbc9f' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.75rem;
}

.field select option {
  background: var(--charcoal);
  color: var(--white);
}

.field textarea {
  resize: vertical;
  min-height: 10rem;
}

/* Contact ---------------------------------------------------------------- */

.contact-layout {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
}

@media (min-width: 50em) {
  .contact-layout {
    grid-template-columns: 3fr 2fr;
  }
}

.contact-info h2 {
  font-size: 1.6rem;
  color: var(--sage);
  margin-bottom: 1rem;
}

.contact-info > * + h2 {
  margin-top: 2.5rem;
}

.contact-info p + p {
  margin-top: 1rem;
}

.contact-info p {
  color: rgba(253, 253, 251, 0.85);
}

.contact-info a {
  color: var(--sage);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--sage-dim);
}

.contact-info a:hover {
  text-decoration-color: var(--sage);
}

.map-embed {
  margin-top: var(--section-y);
}

.map-embed iframe {
  display: block;
  width: 100%;
  height: clamp(20rem, 50vw, 28rem);
  border: 0;
  filter: grayscale(1) contrast(1.05);
}

/* Footer ----------------------------------------------------------------- */

.site-footer {
  background: var(--charcoal-deep);
  border-top: 1px solid var(--sage-faint);
  padding-block: clamp(3.5rem, 8vw, 5.5rem) 2.5rem;
}

.site-footer__grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
}

@media (min-width: 50em) {
  .site-footer__grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.site-footer h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.7rem);
  color: var(--sage);
  margin-bottom: 0.75rem;
}

.site-footer address {
  font-style: normal;
  line-height: 2;
  color: rgba(253, 253, 251, 0.85);
}

.site-footer address a {
  color: var(--sage);
  text-decoration: none;
}

.site-footer address a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer__bottom {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--sage-faint);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: rgba(253, 253, 251, 0.55);
}

.site-footer__bottom a {
  color: rgba(253, 253, 251, 0.7);
}

/* 404 -------------------------------------------------------------------- */

.error-page {
  min-height: 55vh;
  display: flex;
  align-items: center;
  text-align: center;
}

.error-page .container {
  width: 100%;
}

.error-page h1 {
  color: var(--sage);
}

.error-page p {
  margin: 1.5rem auto 2.5rem;
  max-width: 34rem;
}
