/* The celebrations: one screen of cards, each with its painting. A card opens to the whole section.
   Each card sets --w (its painting's background wash) and --g (its accent colour). */
#events { padding: 0; }
.o2-all { min-height: calc(100svh - 56px); display: grid; grid-template-rows: auto 1fr; gap: clamp(16px, 2.4vh, 28px); padding: clamp(24px, 4vh, 48px) clamp(16px, 3vw, 48px); background: var(--bg); scroll-margin-top: 56px; }
.o2-hd { text-align: center; display: grid; gap: 6px; }
.o2-hd h2 { font: 500 clamp(2.4rem, 4.4vw, 3.6rem)/1 "Cormorant Garamond", serif; }
.o2-hd .tap { display: none; }

/* ---------- the cards ---------- */
.o2-grid { list-style: none; margin: 0 auto; padding: 0; width: 100%; max-width: min(1400px, calc(var(--n, 5) * 300px)); display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 18px); }
.o2-c { min-width: 0; background: var(--panel); border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; cursor: pointer; transition: transform .25s ease, box-shadow .25s ease; }
.o2-c:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line), 0 16px 34px -18px #26402F55; }
@media (min-width: 821px) {
  /* every picture area is the same height, so the text panels all start on one line */
  .o2-grid { grid-template-rows: minmax(0, 1fr) auto; row-gap: 0; }
  .o2-c { grid-row: span 2; grid-template-rows: subgrid; }
}
.o2-art { background: var(--w); display: grid; place-items: center; min-height: 0; overflow: hidden; }

/* the painting: wide ones are shown whole (.mul, at one common size), the rest fill the card (.cv) */
.o2-pic { width: 100%; height: 100%; min-height: 120px; background: var(--a) center / contain no-repeat; }
.o2-c .o2-pic.cv { background-size: cover; }   /* on the card only: an open card shows the whole painting */
/* painted on white paper: printed with multiply onto the wash, edges softened so a cropped edge dissolves into it */
.o2-pic.mul {
  mix-blend-mode: multiply;
  -webkit-mask: linear-gradient(to bottom, transparent, #000 5%, #000 80%, transparent), linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); -webkit-mask-composite: source-in;
  mask: linear-gradient(to bottom, transparent, #000 5%, #000 80%, transparent), linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); mask-composite: intersect;
}
.o2-c .o2-pic.mul:not(.cv) { background-origin: content-box; padding: 8%; }
/* a painting cropped to fill its card, anchored at --crop (the night reception) */
.o2-c.crop .o2-pic { min-height: 100%; background-position: var(--crop); }

/* the text under the painting */
.o2-tx { padding: 16px 18px 18px; display: grid; gap: 7px; align-content: start; min-height: 15.2rem; }
.o2-tx .dt { font: 500 .78rem/1.3 "Jost", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--g); }
.o2-tx .dt span { letter-spacing: .04em; text-transform: none; }
.o2-tx h3 { font: 500 clamp(1.7rem, 2.2vw, 2.2rem)/1.02 "Cormorant Garamond", serif; }
.o2-tx .s { font: 400 .95rem/1.4 "Jost", sans-serif; color: var(--soft); }
.o2-tx .at { font: 400 .9rem/1.35 "Jost", sans-serif; border-top: 1px solid var(--line); padding-top: 9px; margin-top: 2px; }
.o2-tx .at a { color: inherit; text-decoration: none; display: grid; gap: 2px; }
.o2-tx .at b, .o2-tx .at > span { display: block; }
.o2-tx .at b { font-weight: 500; }
.o2-tx .at span { color: var(--soft); font-size: .84rem; }
.o2-tx .wr { font: 400 .84rem/1.3 "Jost", sans-serif; display: flex; align-items: center; gap: 8px; }
.o2-tx .wr .sw { gap: 3px; }
.o2-tx .wr .sw i { width: 14px; height: 14px; }
.o2-more { justify-self: start; font: 500 .84rem/1.2 "Jost", sans-serif; color: var(--g); background: none; border: 0; padding: 6px 0 0; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.o2-more:hover { text-decoration-thickness: 2px; }
@media (max-width: 1100px) and (min-width: 821px) {
  .o2-tx .s { display: none; }
}

/* colour swatches: what to wear */
.sw { display: flex; gap: 6px; }
.sw i { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px #0000001a; }

/* the wedding's timetable (shorter on the card) */
.sch { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; max-width: 46ch; }
.sch li { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); gap: 10px; font: 400 1rem/1.4 "Jost", sans-serif; }
.sch time { font-weight: 500; color: var(--accent); font-variant-numeric: tabular-nums; }
.o2-tx .sch.pt { margin: 2px 0 0; gap: 1px; }
.o2-tx .sch.pt li { grid-template-columns: 4.9em minmax(0, 1fr); gap: 6px; font-size: .84rem; line-height: 1.3; color: var(--soft); }
.o2-tx .sch.pt time { color: var(--g); }

/* ---------- an open card: the painting on one side, the whole story on the other ---------- */
.o2-all.open { grid-template-rows: 1fr; }
.o2-all.open > .o2-hd, .o2-all.open > .o2-grid { display: none; }
.o2-x { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); width: 100%; max-width: 1240px; margin: 0 auto; background: var(--panel); border-radius: 22px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -30px #26402F40; animation: o2in .4s cubic-bezier(.2, .7, .2, 1); }
.o2-x[hidden] { display: none; }
@keyframes o2in { from { opacity: 0; transform: scale(.97) translateY(10px); } }
.o2-back { position: absolute; z-index: 2; left: 18px; top: 18px; font: 500 .86rem/1 "Jost", sans-serif; color: var(--ink); background: #FFFFFFE6; border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px; cursor: pointer; }
.o2-back:hover { border-color: var(--ink); background: #fff; }
.o2-xa { background: var(--w); display: grid; place-items: center; padding: clamp(24px, 4vw, 56px); min-height: 0; }
.o2-xa .o2-pic { min-height: 300px; max-height: 62svh; }
.o2-xt { padding: clamp(24px, 3.4vw, 52px); display: grid; align-content: start; gap: 12px; }
.o2-xt .dt { font: 500 .82rem/1.3 "Jost", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--g); }
.o2-xt .dt span { text-transform: none; letter-spacing: .04em; color: var(--soft); }
.o2-xt h2 { font: 500 clamp(2.6rem, 4.4vw, 4rem)/1 "Cormorant Garamond", serif; color: var(--g); outline: none; }
.o2-xt h2 span { font-size: .5em; color: var(--soft); font-weight: 400; margin-left: .2em; }
.o2-xt .s { font: italic 400 1.25rem/1.35 "Cormorant Garamond", serif; color: var(--soft); }
.o2-xt .m, .o2-xt .k { font: 400 1.02rem/1.6 "Jost", sans-serif; max-width: 62ch; }
.o2-xt h4 { font: 500 .74rem/1 "Jost", sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--soft); margin-top: 10px; }
.o2-xt h4 + p { margin-top: -4px; }
.o2-xt .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px; }
.o2-xt .cols h4 { margin-bottom: 8px; }
.o2-xt .wr { display: grid; gap: 8px; font: 400 .95rem/1.45 "Jost", sans-serif; }
.o2-xt .at { font: 400 .95rem/1.45 "Jost", sans-serif; }
.o2-xt .at a { color: inherit; text-decoration: none; display: grid; gap: 2px; }
.o2-xt .at b { font-weight: 500; display: block; }
.o2-xt .at span { color: var(--soft); display: block; }
.o2-xt .note { font: 400 .88rem/1.4 "Jost", sans-serif; color: var(--soft); margin-top: 6px; }
.o2-xt .nx { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 10px; }
.o2-xt .nx button, .o2-xt .nx a { font: 500 .9rem/1.2 "Jost", sans-serif; color: var(--g); background: none; border: 0; padding: 6px 0; cursor: pointer; text-decoration: none; }
.o2-xt .nx button:hover, .o2-xt .nx a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* the venue name is the map link */
:is(.o2-tx, .o2-xt) .at b.ln { text-decoration: underline; text-decoration-color: #B8913F; text-decoration-thickness: 1px; text-underline-offset: 4px; }
:is(.o2-tx, .o2-xt) .at a:hover b.ln { text-decoration-thickness: 2px; }
:is(.o2-tx, .o2-xt) .at b.ln small { font-size: .75em; color: var(--g); text-decoration: none; }

/* ---------- phones: the cards become rows, picture on the left; tap one to open it ---------- */
@media (max-width: 820px) {
  .o2-all { padding: 18px 14px 22px; gap: 12px; }
  .o2-all.few:not(.open) { min-height: 0; padding-bottom: 40px; }
  .o2-all.open { padding: 12px 10px 18px; }
  .o2-hd h2 { font-size: 2.2rem; }
  .o2-hd .tap { display: block; font: 400 .88rem/1.3 "Jost", sans-serif; color: var(--soft); }
  .o2-grid { grid-template-columns: 1fr; gap: 8px; align-content: start; }
  .o2-c { position: relative; grid-template-rows: none; grid-template-columns: 84px minmax(0, 1fr); border-radius: 14px; }
  .o2-c:hover { transform: none; }
  .o2-c::after { content: "›"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 300 1.6rem/1 "Jost", sans-serif; color: var(--g); opacity: .6; }
  .o2-pic { min-height: 0; }
  .o2-tx { padding: 10px 26px 10px 4px; gap: 3px; min-height: 0; }
  .o2-tx h3 { font-size: 1.45rem; }
  .o2-tx .s { font-size: .84rem; line-height: 1.3; }
  .o2-tx .at { border: 0; padding: 0; margin: 0; font-size: .84rem; }
  .o2-tx .at a, .o2-tx .at > b { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
  .o2-tx .at span { display: none; }
  .o2-tx .wr, .o2-more { display: none; }
  .sch li { font-size: .95rem; }
  .o2-tx .sch.pt li { font-size: .8rem; }
  .o2-x { grid-template-columns: 1fr; border-radius: 16px; }
  .o2-xa { padding: 18px; }
  .o2-xa .o2-pic { min-height: 0; height: 28svh; max-height: none; }
  .o2-xt { padding: 18px 18px 20px; gap: 10px; }
  .o2-xt h2 { font-size: 2.6rem; }
  .o2-xt .cols { grid-template-columns: 1fr; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .o2-x { animation: none; }
  .o2-c { transition: none; }
}
