/* blocks.css — Phase DP: renderer styles for the faithful block tree.
   Content-first: readable measure for text, grids for galleries/cards,
   mobile stacks in the same order. Uses tokens.css variables. */
.blocks { display: grid; gap: var(--sp-5); }
.blocks > * { min-width: 0; }

.blk-heading { margin: 0; color: var(--ink); line-height: 1.35; }
h1.blk-heading { font-size: 1.7rem; }
h2.blk-heading { font-size: 1.4rem; }
h3.blk-heading { font-size: 1.15rem; }

.blk-richtext { max-width: 90ch; }
.blk-richtext p { margin: 0 0 var(--sp-3); line-height: 1.8; color: var(--ink); }
.blk-richtext p:last-child { margin-bottom: 0; }
.blk-richtext a { color: var(--red); }

.blk-image { margin: 0; text-align: center; }
.blocks .blk-image img { margin-left: auto; margin-right: auto; width: auto; max-width: min(100%, 1024px); border-radius: var(--radius-lg, 16px); box-shadow: var(--shadow-md); }
.blk-image img, .blk-gallery-item img, .blk-it-figure img {
  display: block; max-width: 100%; height: auto; border-radius: var(--radius);
}
.blk-image figcaption, .blk-gallery-item figcaption, .blk-it-figure figcaption {
  margin-top: var(--sp-2); font-size: 0.9rem; color: var(--gray-600);
}

.blk-gallery-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); }
.blk-gallery-grid .blk-gallery-item { flex: 0 0 calc((100% - 6 * var(--sp-3)) / 7); min-width: 110px; }
.blk-gallery-item { margin: 0; }
.blk-gallery-slider {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 70%);
  gap: var(--sp-3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--sp-2);
}
.blk-gallery-slider .blk-gallery-item { scroll-snap-align: start; margin: 0; }

.blk-list { margin: 0; padding-left: 1.4em; display: grid; gap: var(--sp-2); max-width: 90ch; }
.blk-list li { line-height: 1.8; color: var(--ink); }
.blk-list li::marker { color: var(--red); }

.blk-divider { border: 0; border-top: 1px solid var(--gray-200); margin: var(--sp-2) 0; }

.blk-html { max-width: 90ch; }
.blk-html p { margin: 0 0 var(--sp-3); line-height: 1.8; color: var(--ink); }
.blk-html p:last-child { margin-bottom: 0; }
.blk-html a { color: var(--red); text-decoration: underline; }
/* Verbatim label colors from the old /sponsors/ page: maroon #800000, navy #333399. */
.sp-maroon { color: #800000; }
.sp-maroon a { color: #800000 !important; }
.sp-blue { color: #333399; }
.sp-paypal { text-align: center; margin: var(--sp-2) 0 !important; }

.blk-image-text { display: grid; grid-template-columns: 220px 1fr; gap: var(--sp-4); align-items: start; }
.blk-image-text.blk-it-right .blk-it-figure { order: 2; }
.blk-it-figure { margin: 0; }
.blk-it-title { margin: 0 0 var(--sp-2); font-size: 1.05rem; line-height: 1.5; }
.blk-it-text p { margin: 0 0 var(--sp-2); line-height: 1.8; white-space: normal; }
@media (max-width: 640px) {
  .blk-image-text { grid-template-columns: 140px 1fr; gap: var(--sp-3); }
}

.blk-tabs { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.blk-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-4); }
.blk-people.pcols-4 { grid-template-columns: repeat(4, 1fr); }
.blk-people.pcols-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 640px) {
  .blk-people.pcols-4, .blk-people.pcols-5 { grid-template-columns: repeat(2, 1fr); }
}
.blk-person { margin: 0; text-align: center; }
.blk-person-photo { display: block; border-radius: var(--radius); overflow: hidden; }
.blk-person-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.blk-person-title { margin: var(--sp-2) 0 var(--sp-1); font-weight: 600; font-size: 0.95rem; line-height: 1.5; color: var(--navy); }
.blk-person-title a { color: inherit; }
.blk-person-names p { margin: 0; line-height: 1.7; font-size: 0.95rem; color: var(--ink); }
.blk-tablist { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: var(--sp-3); background: var(--surface); border-bottom: 1px solid var(--gray-200); }
.blk-tablist [role="tab"] {
  min-height: 44px; padding: 0 var(--sp-4); border-radius: var(--radius-full);
  border: 1px solid transparent; background: transparent; color: var(--gray-600);
  font-weight: 500; font-size: 0.95rem; cursor: pointer;
}
.blk-tablist [role="tab"][aria-selected="true"] {
  background: var(--paper); border-color: var(--gray-300); color: var(--navy); font-weight: 600;
}
.blk-tabpanel { padding: var(--sp-4); }
.blk-tabpanel .blocks { gap: var(--sp-3); }

.blk-file { margin: 0; }
.blk-file a { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: 600; color: var(--navy); }
.blk-file a:hover { color: var(--red); }
.blk-file-missing { color: var(--gray-600); }

.blk-button { margin: 0; text-align: center; }
.blk-button .btn { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 260px; text-align: center; line-height: 1.35; }

.blk-embed-video { position: relative; aspect-ratio: 16 / 9; max-width: 800px; }
.blk-embed-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.blk-embed-frame iframe { width: 100%; min-height: 480px; border: 1px solid var(--gray-200); border-radius: var(--radius); }

/* columns: the old Elementor multi-column rows, side by side (stack on mobile) */
.blk-columns { display: grid; gap: var(--sp-5); align-items: start; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.blk-cols-1 { --cols: 1; } .blk-cols-2 { --cols: 2; } .blk-cols-3 { --cols: 3; }
.blk-cols-4 { --cols: 4; } .blk-cols-5 { --cols: 5; }
.blk-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); min-width: 0; align-content: start; }
.blk-col .blk-file a { overflow-wrap: anywhere; }
.blk-col .blk-image img { max-width: 100%; width: 100%; }
@media (max-width: 800px) { .blk-cols-3, .blk-cols-4, .blk-cols-5 { --cols: 2; } }
@media (max-width: 560px) { .blk-columns { --cols: 1 !important; } }
/* rows made only of photos: same height for every photo in the row */
.blocks .blk-cols-imgs .blk-image img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
/* mixed rows (photos + videos + collages): center vertically; carousels inside a column list their photos instead of scrolling sideways */
.blk-col .blk-embed-video { width: 100%; }
/* carousels: one photo at a time, dots + arrows */
.blk-gallery-slider { grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 0; padding-bottom: 0; }
.blk-gallery-slider::-webkit-scrollbar { display: none; }
.blk-gallery-slider .blk-gallery-item { scroll-snap-align: center; }
.blk-gallery-slider .blk-gallery-item img { width: 100%; height: auto; }
.blk-slider { position: relative; }
.blk-slider-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(11,37,69,.55); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.blk-slider-btn:hover { background: rgba(11,37,69,.8); }
.blk-slider-btn.prev { left: 6px; } .blk-slider-btn.next { right: 6px; }
.blk-slider-dots { display: flex; justify-content: center; gap: 8px; margin-top: var(--sp-2); }
.blk-slider-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: var(--gray-300); cursor: pointer; }
.blk-slider-dot.on { background: var(--red); }
/* top-level section titles on imported photo pages are centered like the original */
[data-page="media"] .blocks > h1.blk-heading { text-align: center; }
/* a carousel in a column fills the row height set by its neighbours (e.g. two videos) instead of growing the row */
.blk-columns:not(.blk-cols-1):has(.blk-gallery-slider) { align-items: stretch; }
.blk-columns:not(.blk-cols-1) > .blk-col:has(.blk-gallery-slider) { position: relative; min-height: 260px; }
.blk-columns:not(.blk-cols-1) .blk-col:has(.blk-gallery-slider) .blk-gallery, .blk-columns:not(.blk-cols-1) .blk-col:has(.blk-gallery-slider) .blk-slider { position: absolute; inset: 0; }
.blk-columns:not(.blk-cols-1) .blk-col:has(.blk-gallery-slider) .blk-slider { bottom: 20px; }
.blk-columns:not(.blk-cols-1) .blk-col:has(.blk-gallery-slider) .blk-gallery-slider { height: 100%; }
.blk-columns:not(.blk-cols-1) .blk-col:has(.blk-gallery-slider) .blk-gallery-item, .blk-columns:not(.blk-cols-1) .blk-col:has(.blk-gallery-slider) .blk-gallery-item a { display: block; height: 100%; }
.blk-columns:not(.blk-cols-1) .blk-col:has(.blk-gallery-slider) .blk-gallery-item img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.blk-columns:not(.blk-cols-1) .blk-col:has(.blk-gallery-slider) .blk-slider-dots { position: absolute; left: 0; right: 0; bottom: -18px; margin: 0; }

/* responsive visibility copied from the old page's per-device hide settings */
.blk-vis { display: contents; }
@media (min-width: 1025px) { .hide-desktop { display: none !important; } }
@media (min-width: 768px) and (max-width: 1024px) { .hide-tablet { display: none !important; } }
@media (max-width: 767px) { .hide-phone { display: none !important; } }
/* fixed-column thumbnail galleries (old "gallery-columns-N"): square thumbs, captions as tooltips */
.blocks .blk-gallery-grid.blk-gallery-cols { display: grid; justify-content: start; gap: var(--sp-3); grid-template-columns: repeat(var(--gc, 3), minmax(0, 150px)); }
.blk-gallery-c2 { --gc: 2; } .blk-gallery-c3 { --gc: 3; } .blk-gallery-c4 { --gc: 4; } .blk-gallery-c5 { --gc: 5; }
.blocks .blk-gallery-cols .blk-gallery-item { flex: none; min-width: 0; }
.blk-gallery-cols .blk-gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }

/* Home page: same arrangement as the old site, below the new hero */
[data-page="home"] .blocks { max-width: 1000px; margin-inline: auto; gap: var(--sp-6); }
[data-page="home"] .blocks > h1.blk-heading { text-align: center; color: var(--navy); font-size: 1.5rem; }
[data-page="home"] .blk-richtext { max-width: none; }
[data-page="home"] .blk-list { max-width: 760px; margin-inline: auto; width: 100%; }
[data-page="home"] .blocks > .blk-columns:first-child { grid-template-columns: 90px minmax(0,1fr) minmax(0,1fr) 90px; align-items: start; }
[data-page="home"] .blocks > .blk-columns:first-child .blk-image img { box-shadow: none; border-radius: 0; max-width: 100%; }
[data-page="home"] .blk-file, [data-page="home"] .blk-button { text-align: center; margin: 0; }
[data-page="home"] .blk-file a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 22px; border-radius: var(--radius); background: var(--blue); color: #fff; font-weight: 600; text-decoration: none; text-align: center; }
[data-page="home"] .blk-file a svg { display: none; }
[data-page="home"] .blk-file a:hover { background: var(--blue-700); }
[data-page="home"] .blk-columns:has(.blk-button, .blk-file) { align-items: stretch; }
[data-page="home"] .blk-columns:has(.blk-button, .blk-file) .blk-col { align-content: center; justify-items: center; }
@media (max-width: 800px) { [data-page="home"] .blocks > .blk-columns:first-child { grid-template-columns: 1fr; } }
[data-page="home"] .blk-cols-4:has(.blk-button, .blk-file) .blk-col { justify-items: stretch; }
[data-page="home"] .blk-cols-4:has(.blk-button, .blk-file) .blk-col > * { width: 100%; }
[data-page="home"] .blk-cols-4:has(.blk-button, .blk-file) .btn, [data-page="home"] .blk-cols-4:has(.blk-button, .blk-file) .blk-file a { width: 100%; min-height: 56px; }
[data-page="home"] .blk-columns:has(.blk-button, .blk-file) .btn, [data-page="home"] .blk-columns:has(.blk-button, .blk-file) .blk-file a { min-width: 0; }
[data-page="home"] .blk-columns:has(.blk-button, .blk-file) { gap: var(--sp-4); }

/* Home: Upcoming Event (left aligned) with a small month calendar right next to it */
[data-page="home"] .home-upcoming { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--sp-6); align-items: start; }
[data-page="home"] .home-upcoming-list { max-width: none; margin: 0; }
[data-page="home"] .home-upcoming-list > h1.blk-heading { text-align: left; }
[data-page="home"] .home-upcoming .blk-list { margin-inline: 0; max-width: none; }
[data-page="home"] .home-upcoming .blk-file, [data-page="home"] .home-upcoming .blk-columns .blk-col { text-align: left; justify-items: start; }
[data-page="home"] .home-upcoming .blk-columns .blk-col > * { width: auto; }
.mini-cal { background: var(--paper, #fff); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: var(--sp-3); font-size: .85rem; }
.mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); }
.mc-title { font-family: var(--font-serif); font-weight: 600; color: var(--navy); }
.mc-nav { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--surface); color: var(--navy); font-size: 18px; line-height: 1; cursor: pointer; }
.mc-nav:hover { background: var(--gray-200); }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mc-dow { color: var(--gray-600); font-size: .72rem; padding: 4px 0; }
.mc-day { padding: 6px 0; border-radius: 6px; color: var(--ink); }
.mc-empty { visibility: hidden; }
.mc-today { outline: 1px solid var(--navy); }
.mc-has { background: var(--blue); color: #fff; font-weight: 600; cursor: help; }
@media (max-width: 800px) { [data-page="home"] .home-upcoming { grid-template-columns: 1fr; } .mini-cal { max-width: 320px; } }
[data-page="home"] .home-upcoming-side { display: grid; gap: var(--sp-3); }
[data-page="home"] .home-upcoming-cal-btn .blk-file { text-align: center; }
[data-page="home"] .home-upcoming-cal-btn .blk-file a { width: 100%; }
.mini-cal { position: relative; }
.mc-pop { position: absolute; z-index: 20; width: 260px; padding: 10px 12px; background: var(--navy); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: .82rem; line-height: 1.45; text-align: left; pointer-events: none; }
.mc-pop[hidden] { display: none; }
.mc-pop-date { font-weight: 700; color: var(--gold, #C9A227); margin-bottom: 4px; }
.mc-pop-ev + .mc-pop-ev { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.2); }
.mc-has { cursor: pointer; }
[data-page="home"] .home-cal-pdf { margin-top: 6px; font-size: .85rem; text-align: center; }
[data-page="home"] .home-cal-pdf .blk-file a { background: none; border: 0; box-shadow: none; color: var(--blue, #210488); text-decoration: underline; width: auto; padding: 0; min-height: 0; font-weight: 500; }
