/* =========================================================================
   EVENT CASA — Single story (story.php)
   Hero with couple name · story text · masonry gallery · prev / next.
   Desktop values are px on the 1920 design (× var(--u)).
   ========================================================================= */

/* ---------- Hero ---------- */
.shero {
  position: relative; overflow: hidden;
  height: min(calc(100svh - var(--header-h)), 56.25vw);
  min-height: calc(640 * var(--u));
  background: var(--ink-deep);
  color: var(--cream);
}
.shero__media {
  position: absolute; left: 0; right: 0; top: -8%; bottom: -8%;
  will-change: transform;
}
.shero__media img { width: 100%; height: 100%; object-fit: cover; }
.shero::after {                                   /* keeps the name readable on any photo */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(42, 6, 2, .62) 0%, rgba(42, 6, 2, .18) 34%, rgba(42, 6, 2, 0) 58%);
}
.shero__cap {
  position: absolute; z-index: 1;
  left: calc(88 * var(--u)); right: calc(88 * var(--u)); bottom: calc(78 * var(--u));
}
.shero__name {
  margin: 0;
  font-family: var(--f-body); font-weight: 600;
  font-size: calc(102.8 * var(--u)); line-height: 1.02;
  letter-spacing: calc(.85 * var(--u));
  text-transform: uppercase;
}
.shero__edition {
  margin: calc(14 * var(--u)) 0 0;
  font-family: var(--f-garamond); font-style: italic; font-weight: 500;
  font-size: calc(38 * var(--u)); line-height: 1.2;
}
/* Story without photos yet: a quiet title block instead of an image */
.shero--plain {
  height: auto; min-height: 0;
  padding: calc(150 * var(--u)) 0 calc(60 * var(--u));
  background: none; color: var(--ink-title); text-align: center;
}
.shero--plain::after { display: none; }
.shero--plain .shero__cap { position: static; }

/* ---------- Text ---------- */
.sd { color: var(--ink-deep); }
.sd__text {
  width: calc(1000 * var(--u));
  margin: calc(110 * var(--u)) auto 0;
  text-align: center;
}
.sd__text .sd__venue {
  margin: 0 0 calc(34 * var(--u));
  font-family: var(--f-garamond); font-weight: 600;
  font-size: max(13px, calc(20 * var(--u))); line-height: 1.3;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--olive);
}
.sd__text p {
  margin: 0;
  font-family: var(--f-garamond); font-weight: 500;
  font-size: max(17px, calc(26 * var(--u))); line-height: 1.5;
}
.sd__text p + p { margin-top: .85em; }
.sd__text .sd__lead {
  margin-bottom: calc(46 * var(--u));
  font-style: italic;
  font-size: max(20px, calc(36 * var(--u))); line-height: 1.36;
  color: var(--ink-title);
}
.sd__text strong { font-weight: 700; }

/* ---------- Gallery (Isotope masonry, 2 columns) ---------- */
.sg {
  --gap: calc(36 * var(--u));
  position: relative;
  width: calc(1744 * var(--u));
  margin: calc(120 * var(--u)) auto 0;
}
.sg::after { content: ""; display: block; clear: both; }        /* no-JS fallback flow */
.sg__sizer,
.sg__item { width: calc((100% - var(--gap)) / 2); }
.sg__gutter { width: var(--gap); }
.sg__item {
  display: block; float: left;                    /* Isotope positions absolutely once it runs */
  margin-bottom: var(--gap);
  cursor: zoom-in;
}
.sg__frame {
  position: relative; display: block; overflow: hidden;
  background: rgba(198, 167, 134, .35);           /* --tan, softened: shows while lazy images load */
}
.sg__frame picture { display: block; height: 100%; }
.sg__frame img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .9s var(--ease-out), transform 1.2s var(--ease-out);
}
.sg__frame img.is-loaded,
html:not(.js) .sg__frame img { opacity: 1; }
@media (hover: hover) {
  .sg__item:hover img { transform: scale(1.035); }
}

/* ---------- Flourish + pager ---------- */
.sd__flourish {
  display: block; width: calc(151.6 * var(--u)); height: auto;
  margin: calc(70 * var(--u)) auto 0;
}
.story-pager {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  width: calc(1744 * var(--u));
  margin: calc(56 * var(--u)) auto 0;
  padding: calc(40 * var(--u)) 0 calc(90 * var(--u));
  border-top: 1px solid rgba(66, 33, 11, .18);
  color: var(--ink);
}
.story-pager__link { display: inline-flex; align-items: center; gap: calc(20 * var(--u)); }
.story-pager__link--next { justify-self: end; text-align: right; }
.story-pager__arrow {
  font-family: var(--f-garamond); font-size: calc(64 * var(--u)); line-height: 1;
  transition: transform .6s var(--ease-out);
}
.story-pager__txt { display: grid; gap: calc(4 * var(--u)); }
.story-pager__label {
  font-family: var(--f-garamond); font-weight: 600;
  font-size: max(11px, calc(16 * var(--u))); letter-spacing: .16em; text-transform: uppercase;
  color: var(--olive);
}
.story-pager__name {
  font-family: var(--f-body);
  font-size: max(15px, calc(28 * var(--u))); line-height: 1.2;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .6s var(--ease-out);
}
.story-pager__all {
  font-family: var(--f-body); text-transform: uppercase;
  font-size: max(12px, calc(20 * var(--u))); letter-spacing: .08em;
}
@media (hover: hover) {
  .story-pager__link:hover .story-pager__name { background-size: 100% 1px; }
  .story-pager__link--prev:hover .story-pager__arrow { transform: translateX(-6px); }
  .story-pager__link--next:hover .story-pager__arrow { transform: translateX(6px); }
}

/* ---------- 404 ---------- */
.story-missing {
  padding: calc(200 * var(--u)) 24px calc(200 * var(--u));
  text-align: center; font-family: var(--f-garamond); font-size: max(17px, calc(26 * var(--u)));
}
.story-missing__h {
  margin: 0 0 .5em; font-family: var(--f-body); font-weight: 600;
  font-size: max(28px, calc(72 * var(--u))); text-transform: uppercase; color: var(--ink-title);
}

/* ---------- lightGallery: on-brand skin ---------- */
.lg-backdrop { background-color: var(--ink-deep); }
.lg-backdrop.in { opacity: 1; }
.lg-toolbar .lg-icon, .lg-next, .lg-prev, .lg-counter { color: var(--cream); }
.lg-next, .lg-prev { background-color: rgba(239, 237, 228, .08); border-radius: 50%; }
.lg-toolbar .lg-icon:hover, .lg-next:hover:not(.disabled), .lg-prev:hover:not(.disabled) { color: var(--tan); }
.lg-counter { font-family: var(--f-garamond); font-size: 18px; letter-spacing: .1em; }

/* ---------- Tablet & mobile ---------- */
@media (max-width: 1099px) {
  .shero { height: min(calc(100svh - var(--header-h)), 118vw); min-height: 360px; }
  .shero__cap { left: 20px; right: 20px; bottom: 26px; }
  .shero__name { font-size: clamp(30px, 8.4vw, 76px); letter-spacing: .01em; }
  .shero__edition { margin-top: 6px; font-size: clamp(18px, 4.4vw, 30px); }
  .shero--plain { padding: 64px 16px 8px; }

  .sd__text { width: auto; max-width: 680px; margin-top: 48px; padding: 0 24px; }
  .sd__text .sd__venue { margin-bottom: 18px; font-size: 13px; }
  .sd__text p { font-size: 18px; line-height: 1.55; }
  .sd__text .sd__lead { margin-bottom: 24px; font-size: clamp(20px, 5vw, 26px); line-height: 1.4; }

  .sg { --gap: 12px; width: auto; margin: 56px 16px 0; }
  .sd__flourish { width: 96px; margin-top: 44px; }
  .story-pager {
    width: auto; margin: 32px 16px 0; padding: 24px 0 48px;
    grid-template-columns: 1fr 1fr; row-gap: 22px;
  }
  .story-pager__all { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .story-pager__link { gap: 10px; }
  .story-pager__arrow { font-size: 34px; }
}
@media (max-width: 599px) {
  .sg__sizer, .sg__item { width: 100%; }
  .sg__gutter { width: 0; }
}
