/* ==========================================================
   LYLA base styles for the newer pages (contraception guides,
   /pills). Tokens, nav, mobile drawer, footer and booking modal
   mirror what the older pages inline, so every page looks the
   same. Page-specific styles live in lyla-guide.css and
   pill-finder.css.
   ========================================================== */

:root {
  --purple-deep: #7d3d8e;
  --purple-action: #7d3d8e;
  --purple-hover: #6b2d8b;
  --purple-light: #9b6bb5;
  --lavender-mid: #c9a8e0;
  --lavender-bg: #f0e6f6;
  --lavender-pale: #f7eff8;
  --cream: #fcf7f3;
  --dark: #170d1f;
  --muted: #5f4a6a;
  --white: #ffffff;
  --ink-soft: #2d1d39;
  --berry-deep: #2d113e;
  --sage-deep: #1c3a2e;
  --sage-mid: #2d5c43;
  --sage-pale: #e8f5ee;
  --amber-pale: #fdf1e3;
  --amber-deep: #7a4210;
  --section-rule: rgba(116, 64, 145, 0.16);
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Instrument Sans", sans-serif;
  --font-mono: "DM Mono", monospace;
  --container: min(1240px, calc(100vw - 48px));
  --shadow-soft: 0 18px 42px rgba(53, 18, 74, 0.09);
  --shadow-strong: 0 28px 72px rgba(42, 12, 61, 0.16);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  background: var(--cream);
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
body {
  font-family: var(--font-body);
  color: var(--dark);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 2px solid var(--purple-action);
  outline-offset: 3px;
}
.container {
  width: var(--container);
  margin: 0 auto;
  position: relative;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border-radius: 9999px;
  background: var(--purple-action);
  color: var(--white);
  font-weight: 500;
  font-size: 15px;
  padding: 14px 32px;
  border: none;
  box-shadow: 0 16px 38px rgba(88, 31, 122, 0.26);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}
.btn-primary:hover {
  background: var(--purple-hover);
  transform: translateY(-3px);
}
.btn-small {
  min-height: 40px;
  padding: 10px 22px;
  font-size: 14px;
  box-shadow: 0 6px 24px rgba(123, 63, 160, 0.2);
}
.btn-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 9999px;
  border: 1px solid rgba(125, 61, 142, 0.3);
  background: var(--white);
  color: var(--purple-deep);
  font-weight: 500;
  font-size: 15px;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.btn-quiet:hover {
  background: var(--lavender-pale);
  border-color: rgba(125, 61, 142, 0.55);
}
.arrow {
  display: inline-block;
  transition: transform 300ms var(--ease-out);
}
a:hover > .arrow,
a:hover .go .arrow {
  transform: translateX(3px);
}

/* ---------- nav ---------- */
.nav-link {
  background-image: linear-gradient(var(--purple-action), var(--purple-action));
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: left calc(100% - 1px);
  transition: background-size 0.3s ease, color 0.3s ease;
  padding-bottom: 4px;
}
.nav-link:hover,
.nav-link[aria-current="page"] {
  background-size: 100% 1px;
}
#nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  z-index: 1000;
  background: var(--cream);
  transition: all 0.5s var(--ease-out);
}
#nav.scrolled {
  background: rgba(252, 247, 243, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(107, 45, 139, 0.12);
}
.nav-inner {
  width: var(--container);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  height: 40px;
}
.nav-logo img {
  height: 100%;
  width: auto;
  max-height: 40px;
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  color: var(--purple-deep);
  font-size: 14px;
  font-weight: 500;
}
.nav-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}
.nhs-badge {
  display: inline-block;
  width: 52px;
  height: 28px;
  object-fit: contain;
}
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  height: 1.5px;
  background: var(--purple-deep);
  border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.2s ease;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}
.mobile-nav-drawer {
  visibility: hidden;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
}
.mobile-nav-drawer.open {
  visibility: visible;
  pointer-events: auto;
}
.mobile-nav-overlay {
  position: absolute;
  inset: 0;
  background: rgba(23, 13, 31, 0.56);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mobile-nav-drawer.open .mobile-nav-overlay {
  opacity: 1;
}
.mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 84vw);
  background: var(--cream);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out);
  overflow-y: auto;
}
.mobile-nav-drawer.open .mobile-nav-panel {
  transform: translateX(0);
}
.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--lavender-bg);
}
.mobile-nav-logo img {
  height: 32px;
  width: auto;
}
.mobile-nav-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--lavender-mid);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--purple-deep);
  flex-shrink: 0;
}
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  flex: 1;
}
.mobile-nav-links a {
  display: block;
  padding: 16px 24px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--purple-deep);
  border-bottom: 1px solid var(--lavender-bg);
  transition: background 0.2s ease;
}
.mobile-nav-links a:last-child {
  border-bottom: none;
}
.mobile-nav-links a:active {
  background: var(--lavender-bg);
}
.mobile-nav-cta {
  padding: 24px;
  border-top: 1px solid var(--lavender-bg);
}
.mobile-nav-cta .btn-primary {
  width: 100%;
}

/* ---------- footer ---------- */
.footer {
  background: var(--purple-deep);
  color: var(--white);
  padding: 80px 0 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 48px;
}
.footer-logo {
  display: inline-flex;
  align-items: center;
}
.footer-logo img {
  height: 40px;
  width: auto;
}
.footer-tagline {
  margin-top: 12px;
  max-width: 240px;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.75);
}
.footer-reg {
  margin-top: 20px;
  display: grid;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
}
.social-links {
  margin-top: 24px;
  display: flex;
  gap: 16px;
}
.social-link {
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.3s ease, transform 0.3s ease;
}
.social-link:hover {
  color: var(--cream);
  transform: translateY(-2px);
}
.footer-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lavender-pale);
  font-weight: 500;
}
.footer-links {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}
.footer-link {
  width: fit-content;
  padding-bottom: 3px;
  font-size: 14px;
  color: var(--cream);
  background-image: linear-gradient(var(--cream), var(--cream));
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  background-position: left bottom;
  transition: background-size 0.3s ease, color 0.3s ease;
}
.footer-link:hover {
  color: var(--white);
  background-size: 100% 1.5px;
}
.footer-bottom {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}
.footer-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  line-height: 1.6;
}

/* ---------- booking modal ---------- */
.booking-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.booking-modal[hidden] {
  display: none;
}
.booking-overlay {
  position: absolute;
  inset: 0;
  background: rgba(23, 13, 31, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.booking-panel {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: 20px;
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-strong);
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.booking-modal.is-open .booking-overlay {
  opacity: 1;
}
.booking-modal.is-open .booking-panel {
  opacity: 1;
  transform: none;
}
.booking-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--lavender-mid);
  background: var(--lavender-bg);
}
.booking-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple-deep);
  margin: 0 0 4px;
}
.booking-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--purple-deep);
}
.booking-pill {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 46ch;
}
.booking-pill strong {
  font-weight: 600;
  color: var(--purple-deep);
}
.booking-pill[hidden] {
  display: none;
}
.booking-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--lavender-mid);
  background: var(--white);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.booking-close:hover {
  background: var(--purple-deep);
  color: var(--white);
  border-color: var(--purple-deep);
}
.booking-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#booking-iframe {
  flex: 1;
  width: 100%;
  min-height: 540px;
  border: none;
}
.booking-fallback {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 16px;
  border-top: 1px solid var(--lavender-bg);
}
.booking-fallback a {
  color: var(--purple-action);
  text-decoration: underline;
}

/* ---------- page hero (shared by guides and the finder) ---------- */
.page-hero {
  padding: 132px 0 64px;
  background: var(--lavender-pale);
  position: relative;
  overflow: hidden;
}
.page-hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs a {
  color: var(--purple-deep);
  text-decoration: underline;
  text-decoration-color: rgba(125, 61, 142, 0.35);
  text-underline-offset: 3px;
}
.crumbs a:hover {
  text-decoration-color: currentColor;
}
.crumbs span[aria-hidden] {
  color: var(--lavender-mid);
}
.page-hero h1 {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--purple-deep);
  text-wrap: balance;
}
.page-hero h1 em {
  font-style: italic;
  font-weight: 600;
}
.page-hero .lede {
  margin-top: 20px;
  max-width: 54ch;
  font-size: clamp(17px, 1.6vw, 19px);
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.hero-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-visual {
  justify-self: end;
  width: 100%;
  max-width: 400px;
}
/* ---------- FAQ (native details) ---------- */
.faqs {
  margin-top: 20px;
  border-top: 1px solid var(--section-rule);
}
.faqs details {
  border-bottom: 1px solid var(--section-rule);
}
.faqs summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-soft);
}
.faqs summary::-webkit-details-marker {
  display: none;
}
.faqs summary::after {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 1.6px solid var(--purple-deep);
  border-bottom: 1.6px solid var(--purple-deep);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.3s var(--ease-out);
}
.faqs details[open] summary::after {
  transform: rotate(-135deg) translateX(-3px);
}
.faqs details > p {
  padding: 0 0 18px;
  font-size: 16px !important;
  color: var(--ink-soft) !important;
}

/* ---------- closing CTA ---------- */
.cta-section {
  background: var(--lavender-pale);
  padding: clamp(64px, 8vw, 96px) 0;
  text-align: center;
}
.cta-section h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--purple-deep);
  text-wrap: balance;
}
.cta-section p {
  margin: 14px auto 0;
  max-width: 52ch;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--muted);
}
.cta-section .hero-actions {
  justify-content: center;
}
button.btn-quiet {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .nav-links {
    gap: 26px;
  }
}
/* six links no longer fit beside the logo on tablets: use the drawer */
@media (max-width: 1023px) {
  .nav-inner {
    grid-template-columns: 1fr auto;
  }
  .nav-links {
    display: none;
  }
  .nav-hamburger {
    display: flex;
  }
}
@media (max-width: 960px) {
  .page-hero .container {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-visual {
    justify-self: start;
  }
}
@media (max-width: 767px) {
  #nav {
    height: 64px;
  }
  .nav-inner {
    grid-template-columns: 1fr auto;
  }
  .nav-links,
  .nav-actions .nhs-badge,
  .nav-actions .btn-primary {
    display: none;
  }
  .nav-hamburger {
    display: flex;
  }
  .page-hero {
    padding: 100px 0 48px;
  }
  .footer {
    padding: 56px 0 32px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px 20px;
  }
  .footer-grid > *:first-child {
    grid-column: 1 / -1;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    margin-top: 40px;
    font-size: 12px;
  }
  .booking-modal {
    padding: 12px;
  }
  .booking-panel-header {
    padding: 20px 20px 16px;
  }
}
@media (max-width: 560px) {
  .container {
    width: calc(100vw - 32px);
  }
  .nav-inner {
    width: calc(100vw - 32px);
  }
  .hero-actions .btn-primary,
  .hero-actions .btn-quiet {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .btn-primary:hover {
    transform: none;
  }
}
