/* ==========================================================
   Contraception guide pages (/contraception/*): pack diagrams,
   article layout with contents, callouts, comparison table,
   emergency timeline. Load after lyla-base.css.
   ========================================================== */

/* two stacked pack cards read as a small fanned-out pile
   (on phones they sit side by side instead, see below) */
@media (min-width: 561px) {
  .hero-visual > .cycle:first-child:not(:last-child) {
    margin-right: 44px;
    transform: rotate(-1.5deg);
  }
  .hero-visual > .cycle + .cycle {
    margin-left: 44px;
    margin-top: -18px;
    position: relative;
    transform: rotate(1deg);
  }
}

/* ---------- quick facts row ---------- */
.facts {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--section-rule);
  max-width: 720px;
}
.facts div {
  padding: 16px 20px 0 0;
}
.facts dt {
  font-size: 13px;
  color: var(--muted);
}
.facts dd {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--purple-deep);
}

/* ---------- pack cycle diagram (28 days as dots) ---------- */
.cycle {
  background: var(--white);
  border-radius: 20px;
  padding: 24px 24px 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(125, 61, 142, 0.12);
}
.cycle + .cycle {
  margin-top: 14px;
}
.cycle-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
}
.cycle-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}
.cycle-dots {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  max-width: 236px;
}
.cycle-dots i {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--dot, var(--purple-deep));
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}
.cycle-dots i.off {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--lavender-mid);
}
.cycle-dots i.inactive {
  background: var(--dot-inactive, var(--lavender-mid));
}
.cycle-key {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.cycle-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cycle-key span::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot, var(--purple-deep));
}
.cycle-key .k-off::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--lavender-mid);
}
.cycle-key .k-inactive::before {
  background: var(--dot-inactive, var(--lavender-mid));
}
.cycle.is-sage {
  --dot: var(--sage-mid);
  --dot-inactive: #b9d8c6;
}

/* ---------- guide layout: article + sticky contents ---------- */
.guide {
  background: var(--white);
  padding: clamp(56px, 7vw, 96px) 0;
}
.guide .container {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
}
.toc {
  position: sticky;
  top: 104px;
}
.toc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.toc ol {
  list-style: none;
  margin-top: 12px;
  display: grid;
  gap: 2px;
  border-left: 1px solid var(--section-rule);
}
.toc a {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.toc a:hover,
.toc a.is-current {
  color: var(--purple-deep);
  border-left-color: var(--purple-deep);
}
.guide-body {
  max-width: 70ch;
}
.guide-body > section + section {
  margin-top: clamp(48px, 6vw, 72px);
}
.guide-body h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--purple-deep);
  text-wrap: balance;
}
.guide-body h3 {
  margin-top: 28px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-soft);
}
.guide-body p,
.guide-body li {
  font-size: 17px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--dark);
  text-wrap: pretty;
}
.guide-body h2 + p,
.guide-body h2 + .cycle,
.guide-body h3 + p {
  margin-top: 14px;
}
.guide-body p + p,
.guide-body ul + p,
.guide-body p + ul {
  margin-top: 14px;
}
.guide-body > section > .cycle,
.guide-body > section > .callout,
.guide-body > section > .types,
.guide-body > section > .timeline,
.guide-body > section > .where {
  margin-top: 24px;
}
.guide-body ul {
  list-style: none;
  display: grid;
  gap: 8px;
}
.guide-body ul li {
  position: relative;
  padding-left: 24px;
}
.guide-body ul li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple-light);
}
.guide-body strong {
  font-weight: 600;
  color: var(--ink-soft);
}
.guide-body a:not(.btn-primary):not(.btn-quiet) {
  color: var(--purple-deep);
  text-decoration: underline;
  text-decoration-color: rgba(125, 61, 142, 0.4);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.guide-body a:not(.btn-primary):not(.btn-quiet):hover {
  text-decoration-color: currentColor;
}
.source-note {
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: 20px;
  border-top: 1px solid var(--section-rule);
  font-size: 14px !important;
  color: var(--muted) !important;
  line-height: 1.6 !important;
}

/* two-column pros / cons */
.split {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.split > div {
  border-radius: 16px;
  padding: 22px 22px 20px;
  background: var(--lavender-pale);
  border: 1px solid rgba(125, 61, 142, 0.14);
}
.split > div.is-sage {
  background: var(--sage-pale);
  border-color: rgba(45, 92, 67, 0.18);
}
.split h3 {
  margin-top: 0;
}
.split ul {
  margin-top: 12px;
}
.split li {
  font-size: 16px;
}
.split .is-sage li::before {
  background: var(--sage-mid);
}

/* callouts: fully bordered tinted boxes */
.callout {
  border-radius: 16px;
  padding: 22px 24px;
  background: var(--lavender-pale);
  border: 1px solid rgba(125, 61, 142, 0.18);
}
.callout p,
.callout li {
  font-size: 16px;
}
.callout-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600 !important;
  color: var(--purple-deep) !important;
}
.callout-title svg {
  flex-shrink: 0;
}
.callout.is-warn {
  background: var(--amber-pale);
  border-color: rgba(122, 66, 16, 0.22);
}
.callout.is-warn .callout-title {
  color: var(--amber-deep) !important;
}
.callout.is-warn li::before {
  background: #c27a2c;
}
.callout .btn-quiet {
  margin-top: 16px;
}

/* ---------- mini pill types ---------- */
.types {
  display: grid;
  gap: 12px;
}
.type-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 20px;
  align-items: center;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid rgba(45, 92, 67, 0.18);
  background: var(--white);
}
.type-row h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--sage-deep);
}
.type-row p {
  margin-top: 4px !important;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}
.window {
  text-align: right;
}
.window-hours {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--sage-mid);
}
.window-label {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.window-bar {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: var(--sage-pale);
  overflow: hidden;
}
.window-bar span {
  display: block;
  height: 100%;
  width: var(--w);
  margin-left: auto;
  border-radius: inherit;
  background: var(--sage-mid);
}

/* ---------- emergency timeline ---------- */
.timeline {
  border-radius: 20px;
  padding: 24px clamp(18px, 3vw, 28px) 22px;
  background: var(--white);
  border: 1px solid rgba(125, 61, 142, 0.14);
  box-shadow: var(--shadow-soft);
}
.tl-scale {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-left: var(--label-w, 0px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.tl-scale span {
  border-left: 1px dashed var(--lavender-mid);
  padding: 0 0 8px 6px;
}
.tl-row {
  margin-top: 16px;
}
.tl-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
}
.tl-name small {
  font-weight: 400;
  font-size: 13.5px;
  color: var(--muted);
}
.tl-track {
  margin-top: 6px;
  height: 14px;
  border-radius: 999px;
  background: var(--lavender-pale);
  position: relative;
  overflow: hidden;
}
.tl-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--c1, #7d3d8e), var(--c2, #c9a8e0));
}
.tl-note {
  margin-top: 18px;
  font-size: 13.5px !important;
  line-height: 1.55 !important;
  color: var(--muted) !important;
}

/* where to get EC */
.where {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.where > div {
  padding: 20px 22px;
  border-radius: 16px;
  background: var(--lavender-pale);
  border: 1px solid rgba(125, 61, 142, 0.14);
}
.where h3 {
  margin-top: 0;
  font-size: 17px;
}
.where p {
  margin-top: 6px !important;
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- hub: the two pills ---------- */
.two-pills {
  background: var(--white);
  padding: clamp(56px, 7vw, 96px) 0;
}
.section-head {
  max-width: 640px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--purple-deep);
  text-wrap: balance;
}
.section-head p {
  margin-top: 14px;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}
.pill-doors {
  margin-top: clamp(32px, 4vw, 48px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2vw, 24px);
}
.door {
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  padding: clamp(24px, 3vw, 36px);
  background: var(--lavender-pale);
  border: 1px solid rgba(125, 61, 142, 0.16);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.door:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}
.door.is-sage {
  background: var(--sage-pale);
  border-color: rgba(45, 92, 67, 0.2);
}
.door-kicker {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.door h3 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--purple-deep);
}
.door.is-sage h3 {
  color: var(--sage-deep);
}
.door p {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 44ch;
}
.door .cycle {
  margin-top: 22px;
  box-shadow: none;
}
.door .go {
  margin-top: auto;
  padding-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--purple-deep);
}
.door.is-sage .go {
  color: var(--sage-deep);
}
.door:hover .go .arrow {
  transform: translateX(3px);
}

/* comparison */
.compare {
  margin-top: clamp(40px, 5vw, 64px);
  border-radius: 20px;
  border: 1px solid var(--section-rule);
  overflow: hidden;
}
.compare-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
}
.compare-row + .compare-row {
  border-top: 1px solid var(--section-rule);
}
.compare-row > * {
  padding: 16px 20px;
  font-size: 15.5px;
  line-height: 1.55;
}
.compare-row > :first-child {
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--cream);
}
.compare-row > :nth-child(2) {
  border-left: 1px solid var(--section-rule);
}
.compare-row > :nth-child(3) {
  border-left: 1px solid var(--section-rule);
}
.compare-head > * {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--purple-deep);
  background: var(--lavender-pale);
}
.compare-head > :nth-child(3) {
  color: var(--sage-deep);
  background: var(--sage-pale);
}
.compare-head > :first-child {
  background: var(--cream);
}

/* ---------- urgent band (emergency contraception) ---------- */
.urgent {
  background: var(--berry-deep);
  color: var(--white);
  padding: clamp(48px, 6vw, 80px) 0;
}
.urgent .container {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
}
.urgent h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.urgent p {
  margin-top: 14px;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.86);
  max-width: 56ch;
}
.urgent-actions {
  display: grid;
  gap: 12px;
}
.urgent-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 16px 22px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.25s ease, border-color 0.25s ease;
}
.urgent-link:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.34);
}
.urgent-link strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}
.urgent-link small {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.72);
}

/* single-column guide section (hub FAQ) */
.guide.is-narrow .container {
  grid-template-columns: minmax(0, 1fr);
  max-width: 760px;
}
.split + .callout,
.callout + .callout {
  margin-top: 16px;
}
.guide-body ol.steps + .callout,
.guide-body ul + .callout {
  margin-top: 24px;
}
.timeline .tl-scale {
  margin-top: 18px;
}

/* numbered steps: used where the order is the point */
.guide-body ol.steps {
  margin-top: 20px;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 14px;
}
.guide-body ol.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  min-height: 34px;
}
.guide-body ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--purple-deep);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .guide .container,
  .urgent .container {
    grid-template-columns: minmax(0, 1fr);
  }
  .toc {
    position: static;
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--cream);
    border: 1px solid var(--section-rule);
  }
  .toc ol {
    border-left: none;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .toc a {
    padding: 11px 0;
    border-left: none;
  }
}
@media (max-width: 767px) {
  .pill-doors,
  .split,
  .where {
    grid-template-columns: minmax(0, 1fr);
  }
  .compare-row {
    grid-template-columns: 1fr 1fr;
  }
  .compare-row > :first-child {
    grid-column: 1 / -1;
    padding-bottom: 10px;
    font-size: 14px;
  }
  .compare-row > :nth-child(2) {
    border-left: none;
  }
  .compare-head > :first-child {
    display: none;
  }
  .compare-row > * {
    padding: 12px 14px;
    font-size: 14.5px;
  }
  .type-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .window {
    text-align: left;
  }
}
@media (max-width: 560px) {
  .cta-section .btn-primary {
    width: 100%;
  }
  .guide-body p,
  .guide-body li {
    font-size: 16.5px;
  }
  /* the two pack diagrams sit side by side, small */
  .hero-visual.is-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: none;
  }
  .hero-visual.is-pair > .cycle + .cycle {
    margin-top: 0;
  }
  .hero-visual.is-pair > .cycle {
    padding: 14px 12px 12px;
    border-radius: 14px;
  }
  .hero-visual.is-pair .cycle-title {
    font-size: 13.5px;
  }
  .hero-visual.is-pair .cycle-sub {
    font-size: 12px;
    line-height: 1.35;
  }
  .hero-visual.is-pair .cycle-dots {
    gap: 4px;
    margin-top: 10px;
  }
  .hero-visual.is-pair .cycle-key {
    font-size: 11.5px;
    gap: 4px 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .door:hover {
    transform: none;
  }
}
