/* The event post: single posts in the Events category, /events/{slug}/.
 *
 * HAND WRITTEN, to design/event-post-direction-2026-10-02.md. Loaded on event
 * posts only (inc/event-post.php), after love-stories.css, whose crumb, kicker,
 * title and closing band this page reuses inside a scoped wrapper (see
 * erdf_ev_render_top()), so none of those are restyled here.
 *
 * Existing tokens only. Every rule is scoped to .erdf-ev, the body class
 * inc/event-post.php gives single event posts and nothing else.
 */

/* ============================================================
   Astra's shell, off. Same neutralisation as love-stories.css
   and landing.css carry for their pages, for the same reason:
   the page computes its own columns. The white card on blue
   tint goes; the ground is the site's warm-white.
   ============================================================ */
.ast-separate-container.erdf-ev,
.erdf-ev #content { background-color: var(--warm-white); }
.erdf-ev #content > .ast-container { max-width: none; padding-left: 0; padding-right: 0; }
.erdf-ev #primary { margin: 0; padding: 0; width: 100%; max-width: none; float: none; }
.erdf-ev .site-main,
.erdf-ev .ast-article-single { padding: 0; margin: 0; max-width: none; border: 0; background: transparent; box-shadow: none; }

/* Floors under the Astra option filter in inc/event-post.php: its title, its
   "By /" line and its banner, never shown on these pages. */
.erdf-ev .single-layout-1 > .entry-header,
.erdf-ev .ast-single-post-order,
.erdf-ev .entry-title,
.erdf-ev .ast-single-post-featured-section { display: none; }

/* ============================================================
   The opening band: the reused kicker and H1, on the reading
   column's left edge, warm-white, no tint, no card.
   ============================================================ */
.erdf-ev .ev-open { padding-block: var(--sp-6) var(--sp-4); background: var(--warm-white); }
.erdf-ev .ev-col {
  max-width: calc(var(--measure) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter);
  box-sizing: border-box;
  font-size: var(--fs-base);   /* so its 68ch is the reading column's 68ch */
  /* BORDER-BOX, with the padding added to the cap. Astra makes every element
     inherit box-sizing, so a content-box column turned the buttons inside it
     content-box too, and "Download all photos" grew to 70px. */
}
.erdf-ev .ev-open h1 { margin: 0; max-width: none; text-wrap: balance; }
/* The kicker shares its line with the event's badges (R2; the pills are
   ev-badges.css). The line takes the kicker's own bottom margin
   (love-stories.css), so a post with no badge spaces exactly as before. */
.erdf-ev .ev-open .ev-meta { margin: 0 0 var(--sp-2); }
.erdf-ev .ev-open .ev-meta .open-kicker { margin: 0; }

/* ============================================================
   The reading column: 68ch (--measure), centred. Events carry
   schedules and lists, so six characters more than a Love
   Story's letter. No larger first paragraph.
   ============================================================ */
.erdf-ev .single-layout-1 > .entry-content {
  max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: var(--sp-2) var(--gutter) var(--sp-12);
  box-sizing: border-box;
  font-size: var(--fs-base); line-height: var(--lh-body); color: var(--charcoal); text-align: left;
}
.erdf-ev .single-layout-1 > .entry-content::after { content: ''; display: table; clear: both; }
/* Embedded media never wider than the column. Paws on the Patio 2024 carries
   an old video player fixed at 640px (width="640"), which pushed a phone page
   to 660px wide and, with it, every fixed overlay on the page. */
.erdf-ev .single-layout-1 > .entry-content :is(video, iframe, embed, object) { max-width: 100%; }
.erdf-ev .single-layout-1 > .entry-content video { height: auto; }
/* A core Video block takes the photo tiles' corners and shadow (not their
   colour grade: a film's colour is its own). Block, so no inline gap sits
   under it inside the shadow. */
.erdf-ev .single-layout-1 > .entry-content .wp-block-video video {
  display: block; border-radius: var(--r-card); box-shadow: var(--shadow-card);
}
.erdf-ev .single-layout-1 > .entry-content > p,
.erdf-ev .single-layout-1 > .entry-content p { max-width: none; }

/* ============================================================
   The photo band: 1,100px at most, centred on the column,
   breaking out of it the way the Love Story gallery breaks out
   of its letter to 920px. Negative margins rather than a
   transform, so nothing inside gains a new containing block.
   ============================================================ */
.erdf-ev .single-layout-1 > .entry-content .ev-band,
.erdf-ev .single-layout-1 > .entry-content .wp-block-gallery {
  --band: min(1100px, calc(100vw - 2 * var(--gutter)));
  width: var(--band); max-width: none;
  margin-left: calc((100% - var(--band)) / 2); margin-right: 0;
  box-sizing: border-box;
}

/* A NEW EVENT BUILT FROM "ERDF: Event Page" (R2, found in the V2 walk). The
   pattern keeps "About the event", "Photos" and the gallery inside one
   content-locked Group. Two things then broke the band at 1440: Astra bled that
   full-width group 52px past the column each side and padded it 63px back in, so
   its text started 10px right of the opening paragraph; and the group's
   constrained layout (WordPress core) centres every child with
   margin-left/right: auto !important, which beat the band's margin above, so the
   1,100px gallery started at the text column (376 to 1476px, 36px of sideways
   scroll) instead of 170 to 1270 like the recap's. Measured, not assumed:
   tmp/golive-2026-11-01/pe/e3_gallery.py.
   So, on event posts only: a group with no background of its own is a
   structural wrapper and sits flat on the reading column (no bleed, no side
   padding; Astra's top and bottom padding stay); and the photo band inside a
   constrained group takes its margin with the !important core uses, at higher
   specificity. Published event posts carry no group and do not change. */
.erdf-ev .single-layout-1 > .entry-content > .wp-block-group:not(.has-background):not(.erdf-section-tint):not(.erdf-section-dark) {
  margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0;
}
.erdf-ev .single-layout-1 > .entry-content .is-layout-constrained > :is(.wp-block-gallery, .ev-band, .pdl-head--band) {
  margin-left: calc((100% - var(--band)) / 2) !important;
  margin-right: 0 !important;
}

/* Section headings on a post with SEVERAL albums (2026-10-05; Better
   Together 2026's recap has nine): the heading straight above a gallery or
   grid takes the photo band's left edge, so each section reads as its
   heading and its photos. Only with two or more albums: a post with one
   (Juli's ERDF: Event Page pattern, "About the event" then "Photos") keeps
   every heading on the reading column together. A browser without :has()
   keeps today's column. */
.erdf-ev .single-layout-1 > .entry-content:has(> :is(.wp-block-gallery, .ev-grid) ~ :is(.wp-block-gallery, .ev-grid))
  > :is(h2, h3, h4):has(+ :is(.wp-block-gallery, .ev-grid)) {
  --band: min(1100px, calc(100vw - 2 * var(--gutter)));
  width: var(--band); max-width: none; box-sizing: border-box;
  margin-left: calc((100% - var(--band)) / 2); margin-right: 0;
}

/* ============================================================
   Photos. Both shapes take the same tile look: --r-card
   corners, the --warm-photo grade, --shadow-card.
   ============================================================ */

/* One photo, or two, in the text: centred in the column, its own shape,
   never cropped, never taller than 80% of the window (Better Together's
   photos were each a screen tall). */
.erdf-ev .single-layout-1 > .entry-content img[data-ev-photo] {
  display: block; width: auto; height: auto; max-width: 100%; max-height: 80vh;
  object-fit: contain; margin: var(--sp-3) auto;
  border-radius: var(--r-card); filter: var(--warm-photo); box-shadow: var(--shadow-card);
}
/* ...and inside its download wrapper (ls-lightbox.js), the wrapper takes the
   placement and the photograph fills it. */
.erdf-ev .single-layout-1 > .entry-content .ev-ph {
  position: relative; display: block; width: fit-content; max-width: 100%; margin: var(--sp-3) auto;
}
.erdf-ev .single-layout-1 > .entry-content .ev-ph > .lb-open {
  display: block; padding: 0; margin: 0; border: 0; border-radius: var(--r-card);
  background: none; box-shadow: none; cursor: zoom-in;
}
.erdf-ev .single-layout-1 > .entry-content .ev-ph > .lb-open:hover,
.erdf-ev .single-layout-1 > .entry-content .ev-ph > .lb-open:focus { background: none; }
.erdf-ev .single-layout-1 > .entry-content .ev-ph img[data-ev-photo] { margin: 0; float: none; }

/* Photos the old posts float beside text (the 2026 schedule): floated at 700px
   and up, at most 40% of the column; stacked and centred below. */
@media (min-width: 700px) {
  .erdf-ev .single-layout-1 > .entry-content img[data-ev-photo].alignright,
  .erdf-ev .single-layout-1 > .entry-content .ev-ph.alignright {
    float: right; max-width: 40%; margin: var(--sp-1) 0 var(--sp-2) var(--sp-3);
  }
  .erdf-ev .single-layout-1 > .entry-content img[data-ev-photo].alignleft,
  .erdf-ev .single-layout-1 > .entry-content .ev-ph.alignleft {
    float: left; max-width: 40%; margin: var(--sp-1) var(--sp-3) var(--sp-2) 0;
  }
  .erdf-ev .single-layout-1 > .entry-content .ev-ph.alignright img[data-ev-photo],
  .erdf-ev .single-layout-1 > .entry-content .ev-ph.alignleft img[data-ev-photo] { max-width: 100%; }
}

/* A run of four or more photos with no text between them, and a core Gallery
   block: the same no-crop masonry, in CSS columns. Each photo keeps its own
   shape. DEPARTURE FROM THE LOVE STORY GALLERY, stated in the direction: its
   tiles are square crops, and event galleries mix portrait pet-and-owner shots
   with landscapes, where a square crop at a fixed point cuts faces. */
.erdf-ev .single-layout-1 > .entry-content .ev-grid,
.erdf-ev .single-layout-1 > .entry-content .wp-block-gallery.has-nested-images {
  display: block; columns: 2; column-gap: var(--sp-2);
  margin-top: var(--sp-4); margin-bottom: var(--sp-6);
}
@media (min-width: 700px) {
  .erdf-ev .single-layout-1 > .entry-content .ev-grid,
  .erdf-ev .single-layout-1 > .entry-content .wp-block-gallery.has-nested-images { columns: 3; }
}
@media (min-width: 1100px) {
  .erdf-ev .single-layout-1 > .entry-content .ev-grid,
  .erdf-ev .single-layout-1 > .entry-content .wp-block-gallery.has-nested-images { columns: 4; }
}
.erdf-ev .single-layout-1 > .entry-content .ev-grid > * {
  display: block; break-inside: avoid; margin: 0 0 var(--sp-2); padding: 0; width: auto; float: none;
}
.erdf-ev .single-layout-1 > .entry-content .ev-grid figure,
.erdf-ev .single-layout-1 > .entry-content .ev-grid p { margin: 0; }
.erdf-ev .single-layout-1 > .entry-content .ev-grid img[data-ev-photo],
.erdf-ev .single-layout-1 > .entry-content .ev-grid .ev-ph {
  width: 100%; max-height: none; margin: 0;
}
.erdf-ev .single-layout-1 > .entry-content .ev-grid .ev-ph > .lb-open { width: 100%; }
/* A photo the old post floated (alignright) does not float inside a grid. */
.erdf-ev .single-layout-1 > .entry-content .ev-grid img[data-ev-photo].alignright,
.erdf-ev .single-layout-1 > .entry-content .ev-grid img[data-ev-photo].alignleft,
.erdf-ev .single-layout-1 > .entry-content .ev-grid .ev-ph.alignright,
.erdf-ev .single-layout-1 > .entry-content .ev-grid .ev-ph.alignleft {
  float: none; max-width: none; width: 100%; margin: 0 0 var(--sp-2);
}

/* The core gallery's own figures out of core's flex rows and crops. Core's
   rules carry :not(#individual-image), an id's weight, so these carry it too. */
.erdf-ev .single-layout-1 > .entry-content .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
  display: block; width: 100%; margin: 0 0 var(--sp-2); break-inside: avoid;
}
.erdf-ev .single-layout-1 > .entry-content .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) img,
.erdf-ev .single-layout-1 > .entry-content .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) > .lb-open {
  display: block; width: 100%; height: auto; flex: none; object-fit: initial;
}
.erdf-ev .single-layout-1 > .entry-content .wp-block-gallery.has-nested-images figure.wp-block-image img {
  border-radius: var(--r-card); filter: var(--warm-photo); box-shadow: var(--shadow-card);
}
.erdf-ev .single-layout-1 > .entry-content .wp-block-gallery figure.wp-block-image > .lb-open { border-radius: var(--r-card); }
/* Astra's soft shadow on every figure in a post; the photograph carries the
   theme's own now. */
.erdf-ev .single-layout-1 > .entry-content figure { box-shadow: none; }

/* The old carousel's frames are plain boxes now; nothing of the plugin's
   layout survives to clip or hide a photo. */
.erdf-ev .single-layout-1 > .entry-content .swiper-wrapper,
.erdf-ev .single-layout-1 > .entry-content .wpcp-carousel-section { transform: none; overflow: visible; height: auto; }

/* ============================================================
   "Download all photos": one per post, right-aligned, a row
   above the photos.
   ============================================================ */
/* Inline photos only: its own row under the opening band, on the column. */
.erdf-ev .pdl-head--ev {
  display: flex; justify-content: flex-end; align-items: center;   /* not stretch: the pill keeps its 44px */
  max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) var(--sp-2);
  box-sizing: border-box; font-size: var(--fs-base);
}
/* A core gallery: in its heading row, the "Photos" heading left. */
.erdf-ev .pdl-head--ev-gal {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-2) var(--sp-3); margin: var(--sp-6) 0 var(--sp-3);
}
.erdf-ev .pdl-head--ev-gal > h2 { margin: 0; }
/* ...and with no heading above the gallery or grid, the button alone, at the
   photo band's right edge, directly above the photos. */
.erdf-ev .pdl-head--end { justify-content: flex-end; }
.erdf-ev .single-layout-1 > .entry-content .pdl-head--band {
  --band: min(1100px, calc(100vw - 2 * var(--gutter)));
  width: var(--band); max-width: none; box-sizing: border-box;
  margin: var(--sp-6) 0 var(--sp-2) calc((100% - var(--band)) / 2);
}
.erdf-ev .single-layout-1 > .entry-content .pdl-head--band + .ev-grid,
.erdf-ev .single-layout-1 > .entry-content .pdl-head--band + .wp-block-gallery { margin-top: 0; }
.erdf-ev .pdl-head--ev .pdl-btn,
.erdf-ev .pdl-head--ev-gal .pdl-btn { font-size: var(--fs-sm); }
/* Phones: a full-width pill, the --touch height .btn already sets. */
@media (max-width: 699px) {
  .erdf-ev .pdl-head--ev .pdl-btn,
  .erdf-ev .pdl-head--ev-gal .pdl-btn { width: 100%; }
}

/* ============================================================
   Previous / next: Astra's own row and labels, on the photo
   band's width instead of the window's edges.
   ============================================================ */
.erdf-ev .post-navigation {
  max-width: calc(1100px + 2 * var(--gutter)); margin: 0 auto; padding: var(--sp-4) var(--gutter) var(--sp-8);
  box-sizing: border-box; border-top: 1px solid var(--hairline);
}
