/* ═══════════════════════════════════════════════════════════
   Editorial Layer — magazine treatment for Nico & Fer
   Chapter markers · drop caps · side rail · 21 motif · dedicatoria
   ═══════════════════════════════════════════════════════════ */

/* ── Extended palette ── */
:root {
  --ink-deep:   oklch(0.36 0.05 28);    /* cordovan accent */
  --ink-dark:   #1c1612;                 /* near-black for inverted moments */
}

/* Allow watermark and dedication to clip without invading neighbours */
section.section-pad,
section.story,
section.location,
section.programa,
section.dresscode,
section.lodging,
section.gifts,
section.rsvp,
section.dedication {
  overflow: hidden;
}

/* ═════════════════════════════════════════
   1. Edge rail — vertical marginalia
   ═════════════════════════════════════════ */
.edge-rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 36px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(240, 233, 220, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-right: 1px solid var(--rule-soft);
}
.edge-rail::before,
.edge-rail::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 28px;
  background: var(--sepia);
  opacity: 0.4;
}
.edge-rail::before { top: 14px; }
.edge-rail::after  { bottom: 14px; }

.edge-rail-text {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.42em;
  color: var(--sepia);
  text-transform: uppercase;
  writing-mode: vertical-rl;
  white-space: nowrap;
  transform: rotate(180deg);
  padding: 56px 0;
}
.edge-rail-text .amp {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  padding: 0 6px;
}
.edge-rail-text .sep {
  display: inline-block;
  padding: 0 12px;
  color: var(--sepia);
  opacity: 0.6;
}

@media (min-width: 1100px) {
  .nav { padding-left: 56px; }
}
@media (max-width: 1099px) {
  .edge-rail { display: none; }
}

/* ═════════════════════════════════════════
   2. Chapter watermark — giant faded numeral
   ═════════════════════════════════════════ */
.chapter-watermark {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(220px, 32vw, 480px);
  line-height: 0.78;
  letter-spacing: -0.02em;
  color: var(--ink);
  opacity: 0.05;
  z-index: 0;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
}
.chapter-watermark.cw-right { right: -2vw; }
.chapter-watermark.cw-left  { left: -2vw; }

/* keep content above watermark */
section.section-pad > .container,
section.section-pad > .container-narrow {
  position: relative;
  z-index: 1;
}

/* ═════════════════════════════════════════
   3. Page marker — chapter divider
   ═════════════════════════════════════════ */
.page-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 0 auto 32px;
  width: fit-content;
}
.pm-line {
  width: 60px;
  height: 1px;
  background: var(--sepia);
  opacity: 0.55;
  display: block;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.95s cubic-bezier(.2,.8,.2,1) 0.1s;
}
.pm-roman {
  font-family: var(--serif);
  font-style: italic;
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
  color: var(--ink-deep);
  letter-spacing: 0.04em;
  display: block;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.7s 0.3s, transform 0.7s 0.3s;
}
[data-reveal].is-revealed .page-mark .pm-line,
.page-mark.is-revealed .pm-line { transform: scaleX(1); }
[data-reveal].is-revealed .page-mark .pm-roman,
.page-mark.is-revealed .pm-roman { opacity: 1; transform: translateY(0); }

/* ═════════════════════════════════════════
   4. Drop cap
   ═════════════════════════════════════════ */
.has-dropcap { text-align: left; }
.has-dropcap::first-letter {
  font-family: var(--serif);
  font-style: italic;
  float: left;
  font-size: var(--dropcap-size, 3.2em);
  line-height: var(--dropcap-line, 0.95);
  margin: var(--dropcap-y, 0.05em) var(--dropcap-x, 0.1em) var(--dropcap-yb, 0em) 0;
  color: var(--ink-deep);
  font-weight: 400;
}

/* ═════════════════════════════════════════
   5. Historia — 21 motif date stamps
   ═════════════════════════════════════════ */
.story-21 {
  margin: 72px auto 0;
  max-width: 760px;
  padding: 42px 36px 32px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 36px;
  position: relative;
}
.story-21::before {
  content: "21";
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-style: italic;
  font-size: 30px;
  background: var(--paper);
  color: var(--ink-deep);
  padding: 0 16px;
  letter-spacing: 0.04em;
  line-height: 1;
}
.s21-side { text-align: center; }
.s21-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(34px, 4.4vw, 48px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.s21-num .accent {
  color: var(--ink-deep);
  font-weight: 500;
  font-style: normal;
}
.s21-cap {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--sepia);
  margin-top: 14px;
}
.s21-conn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--sepia);
}
.s21-conn svg {
  width: 72px;
  height: 14px;
  opacity: 0.6;
}
.s21-conn-label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--sepia);
  margin-top: 2px;
}

/* ═════════════════════════════════════════
   6. Dedicatoria — dark inverted panel
   ═════════════════════════════════════════ */
.dedication {
  position: relative;
  background: var(--ink-dark);
  color: var(--paper);
  padding: 140px 40px 130px;
  z-index: 1;
}
.dedication::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  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.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.96 0 0 0 0 0.92 0 0 0 0 0.85 0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.dedication-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.ded-eyebrow {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: rgba(240, 233, 220, 0.55);
  margin-bottom: 36px;
}
.ded-num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(150px, 26vw, 320px);
  line-height: 0.86;
  color: var(--paper);
  margin: 0;
  letter-spacing: 0.02em;
  position: relative;
}
.ded-num::before,
.ded-num::after {
  content: "";
  position: absolute;
  top: 55%;
  width: 60px;
  height: 1px;
  background: rgba(240,233,220,0.4);
}
.ded-num::before { right: calc(100% + 32px); }
.ded-num::after  { left:  calc(100% + 32px); }
.ded-subnum {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.45em;
  color: rgba(240, 233, 220, 0.55);
  margin: 18px 0 56px;
}
.ded-lines {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(20px, 2.3vw, 28px);
  line-height: 1.65;
  color: var(--paper);
  max-width: 620px;
  margin: 0 auto 56px;
  text-wrap: balance;
}
.ded-lines b {
  font-style: normal;
  font-weight: 400;
  font-family: var(--serif);
  color: var(--paper);
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(240, 233, 220, 0.4);
  padding: 0 4px 1px;
}
.ded-dates {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 0 28px;
  padding: 18px 32px;
  border-top: 1px solid rgba(240,233,220,0.18);
  border-bottom: 1px solid rgba(240,233,220,0.18);
}
.ded-dates .dd-block {
  text-align: center;
}
.ded-dates .dd-roman {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.4em;
  color: var(--paper);
  font-weight: 500;
}
.ded-dates .dd-label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: rgba(240, 233, 220, 0.7);
  margin-top: 6px;
}
.ded-dates .dd-dash {
  width: 32px;
  height: 1px;
  background: rgba(240, 233, 220, 0.35);
  align-self: center;
}

/* ═════════════════════════════════════════
   7. Footer enrichment — monogram + coda
   ═════════════════════════════════════════ */
.footer {
  position: relative;
}
.footer-monogram {
  width: 92px;
  height: 92px;
  margin: 0 auto 28px;
  display: block;
  color: var(--sepia);
}
.footer-monogram .mg-text {
  font-family: var(--serif);
  font-style: italic;
  fill: var(--ink);
}
.footer-monogram .mg-cap {
  font-family: var(--mono);
  letter-spacing: 0.3em;
  fill: var(--sepia);
}
.footer-coda {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  color: var(--sepia);
  font-size: clamp(17px, 1.9vw, 22px);
  line-height: 1.6;
  max-width: 560px;
  margin: -10px auto 40px;
  letter-spacing: 0.005em;
  text-wrap: balance;
}
.footer-coda .big-21 {
  font-style: normal;
  font-family: var(--serif);
  font-size: 1.35em;
  color: var(--ink);
  padding: 0 4px;
  letter-spacing: 0.02em;
}
.footer-rule {
  width: 56px;
  height: 1px;
  background: var(--rule);
  margin: 0 auto 24px;
}

/* ═════════════════════════════════════════
   7b. Historia — dark contrast variant
   ═════════════════════════════════════════ */
.story {
  background: var(--ink-dark) !important;
  color: #f0e9dc;
  position: relative;
}
.story::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: screen;
  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.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.story > * { position: relative; z-index: 1; }

.story .chapter-watermark { color: #f0e9dc; opacity: 0.045; }
.story .eyebrow { color: rgba(240, 233, 220, 0.62); }
.story h2 { color: #f4ecd9; }
.story .page-mark { color: rgba(240, 233, 220, 0.55); }
.story .page-mark .pm-line { background: rgba(240, 233, 220, 0.28); }
.story .pm-roman { color: rgba(240, 233, 220, 0.75); }

.story-lead { color: #f0e9dc !important; }
.story .has-dropcap::first-letter {
  color: #e9d9b7;
}

.story-year .num { color: #f4ecd9 !important; }
.story-year .lbl { color: rgba(240, 233, 220, 0.6) !important; }

.story-photo {
  background: #2a201a !important;
  border-color: rgba(240, 233, 220, 0.14) !important;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.5),
    0 18px 30px -16px rgba(0, 0, 0, 0.7) !important;
}
.story-photo::after { background: rgba(240, 233, 220, 0.35) !important; }

.story-arrow .yrs { color: rgba(240, 233, 220, 0.6); }
.story-arrow svg path { stroke: rgba(240, 233, 220, 0.55) !important; }

.story-bullet { border-top-color: rgba(240, 233, 220, 0.18); }
.story-bullet .label { color: rgba(240, 233, 220, 0.55) !important; }
.story-bullet p { color: #f0e9dc !important; }

.story-21 {
  border-top-color: rgba(240, 233, 220, 0.22);
  border-bottom-color: rgba(240, 233, 220, 0.22);
}
.story-21::before {
  background: var(--ink-dark);
  color: #e9d9b7;
}
.s21-num { color: #f4ecd9; }
.s21-num .accent { color: #e9d9b7; }
.s21-cap { color: rgba(240, 233, 220, 0.6); }
.s21-conn { color: rgba(240, 233, 220, 0.55); }
.s21-conn svg path { stroke: rgba(240, 233, 220, 0.55) !important; }
.s21-conn-label { color: rgba(240, 233, 220, 0.55); }

/* ═════════════════════════════════════════
   8. Mobile
   ═════════════════════════════════════════ */
@media (max-width: 900px) {
  .chapter-watermark { font-size: 220px; opacity: 0.06; }
  .story-21 {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 36px 22px 28px;
    gap: 20px;
  }
  .s21-conn svg { transform: rotate(90deg); }
  .dedication { padding: 90px 24px 80px; }
  .ded-num::before,
  .ded-num::after { display: none; }
  .ded-lines { font-size: 19px; }
  .ded-dates {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px 18px;
  }
  .ded-dates .dd-dash {
    width: 1px;
    height: 14px;
    justify-self: center;
  }
  .has-dropcap::first-letter { font-size: 2.6em; }
  .footer-coda { font-size: 17px; }
}


/* ═════════════════════════════════════════
   9. Tweaks & comment-driven adjustments
   ═════════════════════════════════════════ */

/* — Tighten Historia (Fer: "achica este espacio") — */
section.story.section-pad { padding: 80px 0 72px; }
.story-wrap .eyebrow + h2 { margin-bottom: 18px !important; }
.story-lead { margin: 0 auto 36px !important; }
.story-years { margin-bottom: 32px !important; gap: 32px; }
.story-bullets { gap: 26px; }
.story-21 { margin: 48px auto 0; padding: 32px 32px 24px; }

/* — Light frame variant for the 2026 polaroid (Fer) — */
.story-photo.story-photo--light {
  background: #fbf7ee !important;
  border-color: rgba(107, 90, 69, 0.18) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6),
    0 18px 30px -16px rgba(0, 0, 0, 0.4) !important;
}
.story-photo.story-photo--light::after { background: var(--sepia) !important; opacity: 0.45 !important; }

/* — image-slot placeholder inside polaroid frames — */
/* height:auto is required to defeat the component's :host{height:160px}
   default so aspect-ratio can size the slot (matches the real img in the
   sibling card so both polaroids end up identical). */
.story-photo image-slot {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  display: block;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(240, 233, 220, 0.65);
  border-radius: 0;
}

/* — Bank-details disclosure (Fer: "datos bancarios para otro monto") — */
.gifts-bank {
  margin: 28px 0 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0;
}
.gifts-bank summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 22px 4px;
  font-family: var(--sans);
  color: var(--ink);
  transition: color 0.25s;
}
.gifts-bank summary::-webkit-details-marker { display: none; }
.gifts-bank summary:hover { color: var(--sepia); }
.gb-eyebrow {
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--sepia);
  font-weight: 500;
}
.gb-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  letter-spacing: 0.005em;
  color: var(--ink);
}
.gb-chev {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--sepia);
  transition: transform 0.3s;
}
.gb-chev svg { width: 18px; height: 18px; }
.gifts-bank[open] .gb-chev { transform: rotate(180deg); }
.gb-body {
  padding: 4px 4px 28px;
  display: grid;
  gap: 22px;
}
.gb-intro {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0;
  max-width: 540px;
}
.gb-data {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 32px;
  padding: 22px 24px;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
}
.gb-row { display: flex; flex-direction: column; gap: 4px; }
.gb-row dt {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sepia);
  font-weight: 500;
}
.gb-row dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  letter-spacing: 0.005em;
  font-variant-numeric: tabular-nums;
}
.gb-row dd .amp { color: var(--sepia); font-style: italic; padding: 0 2px; }
.gb-hint {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--sepia-soft);
  margin-left: 8px;
  opacity: 0.8;
}
.gb-confirm {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: background 0.3s, transform 0.2s;
}
.gb-confirm svg { width: 16px; height: 16px; }
.gb-confirm:hover { background: var(--sepia); border-color: var(--sepia); transform: translateY(-1px); }
.gb-copy { margin-top: 22px; cursor: pointer; font: inherit; appearance: none; }
.gb-copy.is-copied { background: var(--sepia); border-color: var(--sepia); }

@media (max-width: 720px) {
  .gifts-bank summary { grid-template-columns: 1fr auto; }
  .gb-eyebrow { grid-column: 1 / -1; }
  .gb-data { grid-template-columns: 1fr; gap: 14px; padding: 18px 18px; }
  .story-21 { padding: 28px 18px 22px; }
}

/* ═════════════════════════════════════════
   10. Tweaks panel (drop-cap controls)
   ═════════════════════════════════════════ */
#tweaks-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: 0 18px 50px -10px rgba(0,0,0,0.25);
  font-family: var(--sans);
  color: var(--ink);
  display: none;
  flex-direction: column;
  user-select: none;
}
#tweaks-panel.is-open { display: flex; }
.tp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  cursor: move;
}
.tp-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink);
}
.tp-close {
  background: none; border: 0; cursor: pointer;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  color: var(--sepia);
  font-size: 18px; line-height: 1;
}
.tp-close:hover { color: var(--ink); }
.tp-body {
  padding: 16px 16px 18px;
  display: grid;
  gap: 16px;
}
.tp-section-label {
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--sepia);
  margin: 0;
}
.tp-row { display: grid; gap: 6px; }
.tp-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.tp-row-head .tp-label { color: var(--ink); }
.tp-row-head .tp-val {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--sepia);
  font-variant-numeric: tabular-nums;
}
.tp-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: var(--rule);
  outline: none;
}
.tp-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--ink);
}
.tp-row input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--ink);
}
.tp-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--rule);
  margin-top: 4px;
  padding-top: 14px;
}
.tp-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--rule);
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tp-btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }


/* — RSVP combobox dropdown was being clipped by section overflow:hidden + footer — */
section.rsvp {
  overflow: visible;
  overflow-x: clip;
  position: relative;
  z-index: 2;
}
.rsvp-combo-list {
  z-index: 50 !important;
  max-height: min(60vh, 420px) !important;
}
