/* =========================================================
   Lemon & Leaves — Visual System
   Layered on top of theme.json styles.
   Paper grain + Polaroid + staggered cards + marginalia +
   pull-quote panel + numbered steps + utilities.
   ========================================================= */

/* ---------- Smooth scroll for in-page anchor links ---------- */
html {
  scroll-behavior: smooth;
  /* So smooth-scroll doesn't land with the heading stuck behind a
     future sticky header. Currently no sticky header, but if one is
     added this padding prevents "hidden under the nav" landings. */
  scroll-padding-top: 1rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Accessibility: skip link + focus styles ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  z-index: 10000;
  background: var(--wp--preset--color--brown);
  color: var(--wp--preset--color--cream);
  padding: 0.75rem 1.25rem;
  border-radius: 3px;
  font-family: var(--wp--preset--font-family--inter);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Visible focus ring for keyboard navigation — brand-matched. */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--wp--preset--color--moss);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Keep default outline for keyboard-only users; hide on mouse click. */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}


/* ---------- Paper grain on body ---------- */
body {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.168  0 0 0 0 0.125  0 0 0 0 0.102  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  line-height: 1.65;
}

/* ---------- Typography — match the Approach 2 mockup exactly.
   Overrides theme.json's fluid clamps with the clamp()s used in
   the mockup so the live site visually matches it. ---------- */
h1 {
  font-size: clamp(2.75rem, 7vw, 5rem) !important;
  line-height: 1.05 !important;
  font-variation-settings: "opsz" 144;
}
h2 {
  font-size: clamp(2rem, 4vw, 2.8rem) !important;
  line-height: 1.2 !important;
  font-variation-settings: "opsz" 96;
}
h3 {
  font-size: 1.35rem !important;
  line-height: 1.3 !important;
  font-variation-settings: "opsz" 36;
}

/* ---------- Section intros (left-aligned to the wide-area's left edge) ----------
   The mockup's section intro sits at the LEFT edge of the 1100px centered
   container — same x as the staggered cards below it, NOT flush against the
   viewport. Implementation:
   - .section-intro itself is alignwide → takes the full 1100px wide area.
   - Its children are capped at 44rem and pulled to the left within that area.
   The .section-intro > * selector has specificity high enough to beat
   WP's auto-centering of constrained children. */
.section-intro > .eyebrow,
.section-intro > .wp-block-heading,
.section-intro > h2,
.section-intro > h3,
.section-intro > p {
  max-width: 44rem !important;
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* ---------- Site nav ---------- */
.site-nav {
  position: relative;
}
.site-nav ul {
  display: flex;
  list-style: none;
  gap: 1.75rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  align-items: center;
}
.site-nav ul ul {
  display: none; /* sub-menu hidden by default on desktop, shown on hover */
}
.site-nav li {
  position: relative;
}
.site-nav li.menu-item-has-children > a::after {
  content: " ▾";
  font-size: 0.7em;
  opacity: 0.6;
}
.site-nav a {
  text-decoration: none;
  color: var(--wp--preset--color--brown);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--wp--preset--font-family--inter);
  display: block;
  padding: 0.25rem 0;
}
.site-nav a:hover {
  color: var(--wp--preset--color--moss);
}

/* Desktop: submenu on hover/focus */
@media (min-width: 821px) {
  .site-nav li:hover > ul,
  .site-nav li:focus-within > ul {
    display: block;
    position: absolute;
    top: 100%;
    left: -0.75rem;
    background: var(--wp--preset--color--cream);
    border: 1px solid #2B201A20;
    border-radius: 3px;
    padding: 0.5rem 0;
    min-width: 12rem;
    z-index: 100;
    box-shadow: 0 4px 20px -6px rgba(43, 32, 26, 0.18);
  }
  .site-nav li ul li {
    padding: 0.35rem 1rem;
  }
  .site-nav li ul a {
    white-space: nowrap;
  }
}

/* Burger button — animated morph between bars and ✕ */
.site-nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--wp--preset--color--brown);
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.95rem;
  font-weight: 500;
  align-items: center;
  gap: 0.5rem;
}
.site-nav-toggle .bars {
  display: inline-block;
  width: 22px;
  height: 2px;
  background-color: currentColor;
  position: relative;
  vertical-align: middle;
  transition: background-color 0.2s ease;
}
.site-nav-toggle .bars::before,
.site-nav-toggle .bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition: top 0.22s ease, transform 0.22s ease;
}
.site-nav-toggle .bars::before { top: -6px; }
.site-nav-toggle .bars::after  { top:  6px; }
.site-header[data-nav-open="true"] .site-nav-toggle .bars { background-color: transparent; }
.site-header[data-nav-open="true"] .site-nav-toggle .bars::before { top: 0; transform: rotate(45deg); }
.site-header[data-nav-open="true"] .site-nav-toggle .bars::after  { top: 0; transform: rotate(-45deg); }

.site-nav-toggle .label {
  transition: opacity 0.18s ease;
}
.site-header[data-nav-open="true"] .site-nav-toggle .label {
  opacity: 0.7;
}

/* Mobile: nav is always in the DOM but collapsed via max-height so it
   can animate smoothly when opened. Desktop rules below reset this. */
@media (max-width: 820px) {
  .site-header {
    position: relative;
  }
  .site-header > div {
    flex-wrap: nowrap !important;
  }
  .site-nav-toggle {
    display: inline-flex;
  }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--wp--preset--color--cream);
    z-index: 50;
    max-height: 0;
    overflow: hidden;
    border-bottom: 0 solid transparent;
    box-shadow: 0 0 0 transparent;
    transition:
      max-height 0.28s ease,
      box-shadow 0.28s ease,
      border-color 0.28s ease;
  }
  .site-header[data-nav-open="true"] .site-nav {
    max-height: 900px;
    border-bottom: 1px solid #2B201A20;
    box-shadow: 0 12px 20px -10px rgba(43, 32, 26, 0.18);
  }
  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem 2rem 1rem;
  }
  .site-nav > ul > li {
    border-top: 1px solid #2B201A10;
  }
  .site-nav > ul > li:first-child {
    border-top: 0;
  }
  .site-nav ul ul {
    display: block !important;
    position: static !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 0 0.5rem 1rem !important;
    background: transparent !important;
    min-width: 0 !important;
  }
  .site-nav a {
    padding: 0.75rem 0;
  }
  .site-nav li.menu-item-has-children > a::after {
    content: "";
  }
}

/* Respect reduced-motion preference — flip instantly, don't animate */
@media (prefers-reduced-motion: reduce) {
  .site-nav,
  .site-nav-toggle .bars,
  .site-nav-toggle .bars::before,
  .site-nav-toggle .bars::after,
  .site-nav-toggle .label {
    transition: none !important;
  }
}

/* ---------- Modality chips (service pages) ---------- */
.modality-chips {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.modality-chips li {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(74, 93, 58, 0.35); /* moss @ 35% */
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--wp--preset--color--moss-dark);
  background: rgba(245, 238, 225, 0.5); /* cream @ 50% for subtle fill */
  font-family: var(--wp--preset--font-family--inter);
  line-height: 1;
}

/* ---------- Blog post body typography ---------- */
.post-body p,
.post-body ul,
.post-body ol {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--wp--preset--color--brown);
  margin: 0 0 1.25rem;
}
.post-body h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.75rem;
}
.post-body h3 {
  margin: 2rem 0 0.75rem;
}
.post-body blockquote {
  border-left: 3px solid var(--wp--preset--color--moss);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 2rem 0;
  font-family: var(--wp--preset--font-family--fraunces);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--wp--preset--color--brown-soft);
}
.post-body a {
  color: var(--wp--preset--color--moss-dark);
  text-decoration-color: rgba(74, 93, 58, 0.35);
  text-underline-offset: 3px;
}
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  margin: 1.75rem 0;
}
.post-body hr {
  border: 0;
  border-top: 1px solid #2B201A20;
  margin: 2.5rem auto;
  max-width: 6rem;
}

/* ---------- Insurance strip ---------- */
.insurance-strip-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  font-family: var(--wp--preset--font-family--inter);
}
.insurance-strip-label {
  font-family: var(--wp--preset--font-family--fraunces);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--wp--preset--color--brown-soft);
}
.insurance-plans {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  gap: 0.4rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--wp--preset--color--brown);
}
.insurance-plans li + li {
  position: relative;
  padding-left: 1.25rem;
}
.insurance-plans li + li::before {
  content: "·";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-55%);
  color: var(--wp--preset--color--clay);
  font-size: 1.3rem;
  line-height: 1;
}
/* Small phones: keep middots but tighten everything so the list fits
   on fewer rows. */
@media (max-width: 520px) {
  .insurance-strip-inner {
    gap: 0.5rem 1rem;
  }
  .insurance-strip-label {
    font-size: 1rem;
  }
  .insurance-plans {
    gap: 0.3rem 0.75rem;
    font-size: 0.85rem;
  }
  .insurance-plans li + li {
    padding-left: 0.9rem;
  }
  .insurance-plans li + li::before {
    font-size: 1.15rem;
  }
}

/* ---------- Utilities ---------- */
.eyebrow {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--wp--preset--color--moss-dark);
  display: inline-block;
  margin-bottom: 1rem;
}
.amp {
  color: var(--wp--preset--color--moss);
  font-style: italic;
  padding: 0 0.05em;
}
.site-footer .amp { color: var(--wp--preset--color--mustard); }

/* ---------- Polaroid frame ---------- */
.polaroid {
  background: #fff;
  padding: 1rem 1rem 3.5rem;
  box-shadow:
    0 15px 40px -10px rgba(43, 32, 26, 0.25),
    0 5px 15px -5px rgba(43, 32, 26, 0.15);
  transform: rotate(-2deg);
  position: relative;
  max-width: 360px;
  margin: 0 auto;
}
.polaroid.rotate-right { transform: rotate(2.5deg); }
.polaroid::before,
.polaroid::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 26px;
  background: rgba(212, 165, 58, 0.35); /* mustard */
  top: -10px;
  transform: rotate(-5deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.polaroid::before { left: -14px; }
.polaroid::after {
  right: -14px;
  transform: rotate(4deg);
  background: rgba(184, 92, 61, 0.28); /* clay */
}
.polaroid .photo-placeholder {
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, var(--wp--preset--color--moss) 0%, var(--wp--preset--color--moss-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(245, 238, 225, 0.6);
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 1rem;
}
.polaroid .photo-placeholder.clay {
  background: linear-gradient(135deg, var(--wp--preset--color--clay) 0%, #8a4328 100%);
}
.polaroid .caption {
  position: absolute;
  bottom: 1rem;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--wp--preset--font-family--fraunces);
  font-style: italic;
  color: var(--wp--preset--color--brown);
  font-size: 1rem;
}

/* ---------- Marginalia ----------
   Aggressive overrides because WP's layout engine fights position:absolute
   and forces margin/width on all children of .is-layout-flow groups. */
.marg {
  position: absolute !important;
  display: block !important;
  width: 160px !important;
  max-width: 160px !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: var(--wp--preset--font-family--fraunces);
  font-style: italic;
  color: var(--wp--preset--color--moss);
  font-size: 0.95rem;
  opacity: 0.8;
  line-height: 1.3;
  z-index: 2;
}
.marg::before {
  content: "— ";
  color: var(--wp--preset--color--clay);
}
.marg-top-right { top: 7rem !important; right: 2rem !important; transform: rotate(-3deg); }
.marg-bottom-left { bottom: 2rem !important; left: 3rem !important; transform: rotate(2deg); }

/* ---------- Staggered cards ---------- */
.who-cards > .wp-block-column:nth-child(1) { transform: translateY(0); }
.who-cards > .wp-block-column:nth-child(2) { transform: translateY(28px); }
.who-cards > .wp-block-column:nth-child(3) { transform: translateY(-12px); }

/* ---------- Pull-quote panel ---------- */
.pull-quote-panel {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    linear-gradient(135deg, var(--wp--preset--color--moss) 0%, var(--wp--preset--color--moss-dark) 100%);
  color: var(--wp--preset--color--cream);
}
.pull-quote-panel blockquote {
  font-family: var(--wp--preset--font-family--fraunces);
  font-style: italic;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  line-height: 1.25;
  max-width: 50rem;
  margin: 0 auto;
  text-align: center;
}
.pull-quote-panel .openmark {
  font-family: var(--wp--preset--font-family--fraunces);
  font-size: 5rem;
  line-height: 0.8;
  color: var(--wp--preset--color--mustard);
  display: block;
  margin-bottom: 0.5rem;
}
.pull-quote-panel cite {
  display: block;
  margin-top: 2rem;
  font-style: normal;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(245, 238, 225, 0.7);
}

/* ---------- Numbered steps ---------- */
.num-step .step-num {
  font-family: var(--wp--preset--font-family--fraunces);
  font-style: italic;
  font-size: 4.5rem;
  font-weight: 500;
  color: var(--wp--preset--color--mustard);
  line-height: 0.8;
  display: block;
  margin-bottom: 0.5rem;
  font-variation-settings: "opsz" 144;
}

/* ---------- Torn-paper top edge as pseudo-element ----------
   Applied via the .has-torn-top class on a section. The pseudo-element
   sits ABOVE the section (top: -40px), filled with the section's own
   cream-deep color so they merge seamlessly. No separate container =
   no seam, no inline SVG baseline gap, no anti-aliasing color mismatch. */
.has-torn-top {
  position: relative;
}
.has-torn-top::before {
  content: "";
  position: absolute;
  top: -39px; /* overlap parent by 1px to bury sub-pixel rounding */
  left: 0;
  right: 0;
  height: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'><path d='M0,40 L0,20 Q30,5 60,18 T120,15 T180,22 T240,12 T300,20 T360,16 T420,24 T480,14 T540,22 T600,16 T660,20 T720,12 T780,24 T840,16 T900,22 T960,14 T1020,20 T1080,16 T1140,22 T1200,18 L1200,40 Z' fill='%23EDE3D0'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}

/* ---------- Old torn-divider pattern (kept in case anyone uses it standalone) ----------
   Aggressive zero-spacing so the torn edge sits flush with the sections
   on either side. Three sources of "body color showing through" that we
   have to defeat:
   (1) WP's :where(.is-layout-flow) > * { margin-block-start: 24px } on the
       SVG inside the divider (handled by !important margin: 0 on children);
   (2) inline-level SVG baseline gap below the SVG (handled by
       vertical-align: top + line-height: 0 + font-size: 0 on container);
   (3) any text-node whitespace inside the divider container (handled by
       font-size: 0 on container).
   We also overlap by 1px on top AND bottom to bury sub-pixel rounding gaps. */
.torn-divider,
.torn-divider.alignfull {
  margin: -1px 0 -1px 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  background: transparent;
}
.torn-divider > * {
  margin: 0 !important;
  padding: 0 !important;
}
.torn-divider svg {
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0;
  vertical-align: top;
}
/* Belt-and-suspenders: any sibling immediately after the divider must have
   no top margin, regardless of class. */
.torn-divider + *,
.torn-divider + .wp-block-group {
  margin-top: 0 !important;
}

/* ---------- Reduced-motion: flatten all rotations ---------- */
@media (prefers-reduced-motion: reduce) {
  .polaroid,
  .polaroid.rotate-right,
  .polaroid::before,
  .polaroid::after,
  .marg-top-right,
  .marg-bottom-left {
    transform: none;
  }
}

/* ---------- Mobile: hide marginalia, flatten card stagger ---------- */
@media (max-width: 820px) {
  .marg { display: none !important; } /* beats the !important on .marg base rule */
  .who-cards > .wp-block-column:nth-child(n) {
    transform: none;
  }
}
