/* Cincinnati Community Kollel, direction B (photo-led) */

:root {
  --blue: #0D2DB8;
  --navy: #13224F;
  --ink: #22252B;
  --muted: #62666F;
  --paper: #FBF8F3;
  --sand: #F1EBE1;
  --line: #E3DBCD;
  --serif: "Frank Ruhl Libre", Georgia, serif;
  --sans: "Figtree", -apple-system, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font: 400 18px/1.6 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
img { display: block; max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 860px; }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); font-weight: 500; line-height: 1.15; }
h2 { font-size: 40px; margin-bottom: 12px; }
h3 { font-size: 22px; font-weight: 700; }
section { padding: 88px 0; }
.intro { color: var(--muted); max-width: 60ch; font-size: 19px; }
.muted { color: var(--muted); }

.btn { display: inline-block; padding: 13px 22px; border-radius: 6px; font: 600 16px/1.2 var(--sans); text-decoration: none; border: 0; cursor: pointer; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--navy); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--sand); }
.btn-ghost { color: #fff; border: 1.5px solid rgba(255,255,255,.7); background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-outline { color: var(--blue); border: 1.5px solid var(--blue); background: transparent; }
.btn-outline:hover { background: #fff; }

/* Photo header: the menu sits on a photo, like the current site */
.hero, .page-hero { position: relative; display: flex; flex-direction: column; color: #fff; padding: 0; }
.hero { min-height: 640px; }
.page-hero { min-height: 400px; }
.hero > img, .page-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after, .page-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,16,40,.78) 0%, rgba(10,16,40,.45) 28%, rgba(10,16,40,.55) 55%, rgba(10,16,40,.9) 100%); }
.page-hero::after { background: linear-gradient(180deg, rgba(10,16,40,.8) 0%, rgba(10,16,40,.55) 40%, rgba(10,16,40,.88) 100%); }
.hero > *:not(img), .page-hero > *:not(img) { position: relative; z-index: 1; }
/* Above the page title, so the dropdown and the phone menu cover it. */
.hero > .site-header, .page-hero > .site-header { z-index: 2; }

.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 100px; }
.brand img { width: 84px; }
nav.main { display: flex; align-items: center; gap: 26px; }
nav.main > a { color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; }
nav.main > a:hover, nav.main > a[aria-current] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
nav.main > a.btn { padding: 10px 18px; color: var(--navy); }
nav.main > a.btn:hover { text-decoration: none; }
/* Dropdown: opens on hover and on keyboard focus. The padding bridges the gap so the pointer can reach it. */
.sub { position: relative; }
.sub > a { color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; }
.sub > a::after { content: ""; display: inline-block; margin: 0 0 3px 7px; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.sub:hover > a, .sub:focus-within > a, .sub > a[aria-current] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.sub ul { display: none; position: absolute; left: -16px; top: 100%; z-index: 20; padding-top: 14px; list-style: none; min-width: 220px; filter: drop-shadow(0 8px 16px rgba(0,0,0,.2)); }
.sub:hover ul, .sub:focus-within ul { display: block; }
.sub li a { display: block; padding: 12px 16px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; border-bottom: 1px solid var(--line); }
.sub li:first-child a { border-radius: 8px 8px 0 0; }
.sub li:last-child a { border-radius: 0 0 8px 8px; border-bottom: 0; }
.sub li a:hover, .sub li a:focus-visible, .sub li a[aria-current] { background: var(--sand); color: var(--navy); }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; font-weight: 600; color: #fff; border: 1.5px solid rgba(255,255,255,.7); padding: 9px 14px; border-radius: 6px; }
.menu summary::-webkit-details-marker { display: none; }
.menu ul { position: absolute; right: 0; top: 50px; z-index: 20; background: #fff; border-radius: 8px; list-style: none; min-width: 230px; box-shadow: 0 8px 24px rgba(0,0,0,.2); overflow: hidden; }
.menu li a { display: block; padding: 12px 16px; color: var(--ink); text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); }
.menu li.child a { padding-left: 32px; font-weight: 500; }

.hero-text { margin-top: auto; padding-bottom: 56px; width: 100%; }
.hero-text h1 { color: #fff; font-size: 58px; max-width: 14ch; margin-bottom: 16px; }
.hero-text p { font-size: 20px; max-width: 46ch; color: #E9ECF5; margin-bottom: 28px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.page-title { margin-top: auto; padding-bottom: 48px; width: 100%; }
.page-title h1 { color: #fff; font-size: 52px; margin-bottom: 8px; }
.page-title p { color: #E1E5F0; font-size: 19px; max-width: 56ch; }

/* Homepage shortcuts under the photo */
.quick { background: #fff; border-bottom: 1px solid var(--line); }
.quick .wrap { display: grid; grid-template-columns: repeat(3, 1fr); }
.quick a { padding: 26px 28px; text-decoration: none; color: var(--ink); border-left: 1px solid var(--line); }
.quick a:last-child { border-right: 1px solid var(--line); }
.quick a:hover { background: var(--paper); }
.quick strong { display: block; font: 700 20px/1.3 var(--serif); color: var(--navy); }
.quick span { color: var(--muted); font-size: 16px; }

/* Jump links on long inner pages */
.jump { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.jump .wrap { display: flex; gap: 28px; overflow-x: auto; }
.jump a { padding: 16px 0; font-weight: 600; font-size: 16px; color: var(--ink); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.jump a:hover { color: var(--blue); border-bottom-color: var(--blue); }

/* Davening */
.tefillos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 36px; }
.tef { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.tef h3 { font-size: 26px; margin-bottom: 14px; }
.tef dl { display: grid; grid-template-columns: 1fr auto; }
.tef dt, .tef dd { padding: 11px 0; border-top: 1px solid var(--line); font-size: 16px; }
.tef dt { color: var(--muted); padding-right: 12px; }
.tef dd { font-weight: 700; color: var(--navy); text-align: right; font-variant-numeric: tabular-nums; }
.tef dd small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.dav-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 40px; margin-top: 24px; font-size: 15px; color: var(--muted); }
.confirm-box { margin-top: 24px; background: var(--sand); border-radius: 8px; padding: 16px 20px; font-size: 16px; }

/* Class schedule rows (homepage) */

.rows { margin-top: 40px; border-top: 2px solid var(--navy); }
.row { display: grid; grid-template-columns: 180px 1fr; gap: 32px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.row > h3 { font-size: 22px; }
/* Columns, not a grid: a tall item does not push down the item beside it. */
.row ul { list-style: none; columns: 2; column-gap: 40px; }
.row li { break-inside: avoid; margin-bottom: 16px; }
.row li:last-child { margin-bottom: 0; }
.row li b { display: block; color: var(--navy); font-weight: 700; }
.row li span { display: block; color: var(--muted); font-size: 16px; }
.note { margin-top: 20px; color: var(--muted); font-size: 16px; }

/* Program list (classes page) */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.filters button { font: 600 15px/1 var(--sans); padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.group { margin-top: 48px; }
.group > h3 { font-size: 28px; font-weight: 500; padding-bottom: 12px; border-bottom: 2px solid var(--navy); }
.day-label { font: 700 20px/1.3 var(--serif); color: var(--navy); margin: 28px 0 4px; }
.prog { display: grid; grid-template-columns: 1fr 1.4fr 200px; gap: 8px 40px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.prog h4 { font-size: 18px; color: var(--navy); }
.prog .when { color: var(--blue); font-weight: 600; font-size: 15px; margin-top: 2px; }
.prog .who { color: var(--muted); font-size: 15px; margin-top: 2px; }
.prog p { color: var(--muted); font-size: 16px; }
.prog .tags { display: flex; gap: 6px; flex-wrap: wrap; align-content: flex-start; }
.prog .tags:empty { display: none; }
.prog .tags span { font-size: 13px; font-weight: 600; color: var(--navy); background: var(--sand); border-radius: 4px; padding: 3px 8px; }
.prog[hidden] { display: none; }
.day-label[hidden] { display: none; }

/* Forms */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 32px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; margin-top: 20px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=search], textarea, select { width: 100%; font: 400 17px/1.4 var(--sans); padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
/* The native arrow sits against the edge; draw our own with room on the right. */
select { appearance: none; padding-right: 44px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2322252B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center; cursor: pointer; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
textarea { min-height: 110px; resize: vertical; }
fieldset { border: 0; }
.radios { display: flex; gap: 10px; flex-wrap: wrap; }
.radios label { display: flex; align-items: center; gap: 8px; font-weight: 500; border: 1.5px solid var(--line); border-radius: 6px; padding: 10px 14px; margin: 0; cursor: pointer; }

/* People */

.staff { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 32px; margin-top: 64px; }
.staff article { display: grid; grid-template-columns: 110px 1fr; gap: 18px; align-items: start; }
.staff img { height: 130px; width: auto; justify-self: center; }
.staff h3 { font-size: 20px; }
.role { color: var(--blue); font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.staff p { color: var(--muted); font-size: 15px; line-height: 1.5; }

.bios { display: grid; gap: 28px; margin-top: 8px; }
.bio { display: grid; grid-template-columns: 200px 1fr; gap: 36px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 32px; }
.bio img { height: 230px; width: auto; justify-self: center; }
.bio h3 { font-size: 28px; font-weight: 500; }
.bio .role { font-size: 16px; margin: 4px 0 12px; }
.bio p + p { margin-top: .8em; }
.scholars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 20px; margin-top: 32px; text-align: center; }
.scholars img { height: 130px; width: auto; margin: 0 auto 10px; }
.scholars b { font: 700 17px/1.3 var(--serif); color: var(--navy); }
.alumni { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.alumni > div { display: flex; gap: 16px; align-items: flex-start; background: #fff; border-radius: 10px; padding: 22px 24px; }
.alumni img { flex: none; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: top; }
.alumni p { font-size: 16px; color: var(--muted); min-width: 0; }
.alumni b { display: block; font: 700 18px/1.3 var(--serif); color: var(--navy); margin-bottom: 4px; }

/* Publications */

.latest { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 36px; }
.latest .vol { color: var(--blue); font-weight: 600; font-size: 15px; }
.latest h3 { font-size: 40px; font-weight: 500; margin: 4px 0 10px; }
.signup { background: var(--navy); color: #DCE1EF; border-radius: 10px; padding: 28px; }
.signup h3 { color: #fff; font-size: 22px; margin-bottom: 6px; }
.signup p { font-size: 16px; margin-bottom: 16px; }
/* Issue cards: the first page of the PDF, as on the old site's archive */
.issue-search { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: end; margin: 8px 0 12px; }
.issue-search label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.issue-count { font-size: 16px; }
.issue-volume { font-size: 26px; font-weight: 500; margin: 40px 0 16px; padding-top: 20px; border-top: 2px solid var(--navy); }
.issue-count + .issue-grid { margin-top: 24px; }
.issue-grid { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.issue-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 16px 14px; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
.issue-card:hover { border-color: #C9BEA9; box-shadow: 0 6px 18px rgba(19,34,79,.08); }
.issue-preview { display: block; aspect-ratio: 17 / 22; background: var(--sand); border-radius: 4px; overflow: hidden; outline: 1px solid rgba(0,0,0,.08); outline-offset: -1px; margin-bottom: 14px; }
.issue-preview img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.issue-blank { display: grid; place-items: center; height: 100%; color: var(--muted); font-weight: 600; letter-spacing: .08em; }
.issue-card h3 { font-size: 18px; line-height: 1.3; }
.issue-card h3 a { color: var(--navy); text-decoration: none; }
/* The whole card opens the PDF: the title link covers it. */
.issue-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.issue-card h3 a:focus-visible { outline: none; }
.issue-card:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.issue-parsha { color: var(--blue); font-weight: 600; font-size: 16px; margin-top: 2px; }
.issue-date { color: var(--muted); font-size: 15px; margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; font-variant-numeric: tabular-nums; }
.issue-date [lang="he"] { font-family: var(--serif); }
.pager { display: flex; gap: 8px; margin-top: 20px; align-items: center; font-size: 15px; }
.pager a, .pager span { padding: 6px 12px; border-radius: 6px; text-decoration: none; }

/* Giving */

/* Visit */

/* Support band */

/* Footer */
footer { background: var(--navy); color: #C9D0E4; padding: 64px 0 36px; font-size: 16px; }
footer .cols { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 40px; }
footer img.logo { width: 84px; margin-bottom: 14px; }
footer h4 { color: #fff; font: 700 17px/1.3 var(--serif); margin-bottom: 10px; }
footer a { color: #fff; }
footer address { font-style: normal; }
footer .legal { margin-top: 48px; padding-top: 24px; border-top: 1px solid #2B3A6B; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 14px; }
footer .partners { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
footer .partners img { height: 40px; background: #fff; padding: 4px 8px; border-radius: 4px; }

/* The full menu needs about 1030px, so the Menu button takes over below 1080px. */
@media (max-width: 1080px) {
  nav.main > a:not(.btn), nav.main > .sub { display: none; }
  .menu { display: block; }
}

@media (max-width: 960px) {
  .hero { min-height: 560px; }
  .page-hero { min-height: 340px; }
  .hero-text h1 { font-size: 40px; }
  .page-title h1 { font-size: 38px; }
  h2 { font-size: 32px; }
  section { padding: 64px 0; }
  .quick .wrap, .tefillos, .staff, .dav-notes, .alumni, .latest, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .quick a { border-left: 0; border-right: 0 !important; border-bottom: 1px solid var(--line); }
  .row, .prog { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .row ul { columns: 1; }
  .bio { grid-template-columns: minmax(0, 1fr); padding: 24px; gap: 16px; }
  .bio img { height: 180px; }
  .scholars { grid-template-columns: repeat(2, 1fr); }
  .issue-search { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .issue-search-q { grid-column: 1 / -1; }
  footer .cols { grid-template-columns: 1fr 1fr; }
  .latest, .form-card { padding: 24px; }
  .latest h3 { font-size: 32px; }
}

@media print {
  .page-hero, .site-header, .jump, footer { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  section { padding: 0; }
  .tef { break-inside: avoid; border-color: #999; }
}

/* Homepage section backgrounds */

/* ---------- WordPress additions ---------- */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.skip-link:focus { position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 100; background: #fff; color: var(--navy); padding: 12px 16px; border-radius: 6px; }
body.admin-bar .jump { top: 32px; }

/* Editable page content */
.prose { max-width: 70ch; }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 1.4em; }
.prose h3 { margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose img { border-radius: 10px; height: auto; }
.prose blockquote { border-left: 4px solid var(--blue); padding-left: 20px; font: 500 20px/1.5 var(--serif); color: var(--navy); }

/* Notices */
.notice { border-radius: 8px; padding: 14px 18px; margin-bottom: 20px; font-size: 16px; }
.notice-ok { background: #E6F2EA; color: #1E5631; }
.notice-error { background: #FBE9E7; color: #8A1F11; }
.hp-field { position: absolute; left: -10000px; }

/* Pagination from paginate_links() */
.pager .page-numbers { padding: 6px 12px; border-radius: 6px; text-decoration: none; }
.pager .page-numbers.current { background: var(--navy); color: #fff; }

/* Single issue */
.pdf-frame { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.post-list { list-style: none; border-top: 2px solid var(--navy); }
.post-list li { padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
.post-list a { font: 700 19px/1.3 var(--serif); color: var(--navy); text-decoration: none; }
.post-list a:hover { color: var(--blue); }

/* ---------- Block content (pages are built from blocks) ---------- */
.entry-content > .alignfull { margin-top: 0; margin-bottom: 0; }
.entry-content > :not(.alignfull):first-child { margin-top: 64px; }
.entry-content > :not(.alignfull):last-child { margin-bottom: 88px; }
.entry-content h2 { margin-bottom: 12px; }
.entry-content .wp-block-columns { gap: 56px; }
.entry-content .is-layout-grid { gap: 20px; }

/* Group styles */
.is-style-ck-section, .is-style-ck-section-white, .is-style-ck-section-sand { padding-top: 88px; padding-bottom: 88px; }
.is-style-ck-section-white { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.is-style-ck-section-sand { background: var(--sand); }
.is-style-ck-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px 26px; }
.is-style-ck-section-sand .is-style-ck-card { border-color: transparent; }
.is-style-ck-card h3 { margin-bottom: 6px; }
.is-style-ck-card p { font-size: 16px; }
.is-style-ck-card .wp-block-image img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }
.is-style-ck-note { background: var(--sand); border-radius: 8px; padding: 16px 20px; font-size: 16px; }
.is-style-ck-signup { background: var(--navy); color: #DCE1EF; border-radius: 10px; padding: 28px; }
.is-style-ck-signup h2, .is-style-ck-signup h3 { color: #fff; }

/* Paragraph styles */
/* Keep intros aligned with headings. The padding must use the constrained
   content width, rather than the full section width on ultrawide screens. */
.is-style-ck-intro { color: var(--muted); font-size: 19px; padding-right: max(0px, calc(min(100%, var(--wp--style--global--content-size, 1144px)) - 60ch)); }
.is-style-ck-mission { background: var(--sand); border-radius: 8px; padding: 20px 24px; font: 500 19px/1.5 var(--serif); color: var(--navy); }
.is-style-ck-small { color: var(--muted); font-size: 15px; }

/* Buttons */
.wp-block-button.is-style-ck-light .wp-block-button__link { background: #fff; color: var(--navy); }
.wp-block-button.is-style-ck-light .wp-block-button__link:hover { background: var(--sand); }
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); padding: 11.5px 20.5px; }
.wp-block-cover .wp-block-button.is-style-outline .wp-block-button__link, .is-style-ck-signup .wp-block-button.is-style-outline .wp-block-button__link { color: #fff; border-color: rgba(255,255,255,.7); }
.btn-large { font-size: 18px; padding: 15px 28px; }

/* Images */
.is-style-ck-rounded img { border-radius: 10px; }

/* Gallery "Mosaic": rows of two wide photos, then three, cropped to 3:2. The photos keep their page order.
   The :not(#individual-image) selectors match core's, which sets each photo's width. */
.wp-block-gallery.is-style-ck-mosaic.has-nested-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wp-block-gallery.is-style-ck-mosaic.has-nested-images figure.wp-block-image:not(#individual-image) { width: auto; margin: 0; aspect-ratio: 3 / 2; border-radius: 8px; overflow: hidden; background: var(--sand); }
/* Phones: one wide photo, then two side by side. A photo left alone in its row takes the whole row. */
@media (max-width: 600px) {
  .wp-block-gallery.is-style-ck-mosaic.has-nested-images figure.wp-block-image:not(#individual-image):is(:nth-child(3n+1), :nth-child(3n+2):last-child) { grid-column: 1 / -1; }
}
@media (min-width: 601px) {
  .wp-block-gallery.is-style-ck-mosaic.has-nested-images { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
  .wp-block-gallery.is-style-ck-mosaic.has-nested-images figure.wp-block-image:not(#individual-image) { grid-column: span 2; border-radius: 10px; }
  .wp-block-gallery.is-style-ck-mosaic.has-nested-images figure.wp-block-image:not(#individual-image):is(:nth-child(5n+1), :nth-child(5n+2)) { grid-column: span 3; }
  /* A row that is not full: the last photos share it. */
  /* A last photo alone sits in the middle, rather than at full width. */
  .wp-block-gallery.is-style-ck-mosaic.has-nested-images figure.wp-block-image:not(#individual-image):is(:nth-child(5n+1), :nth-child(5n+3)):last-child { grid-column: 2 / span 4; }
  .wp-block-gallery.is-style-ck-mosaic.has-nested-images figure.wp-block-image:not(#individual-image):nth-child(5n+3):nth-last-child(2),
  .wp-block-gallery.is-style-ck-mosaic.has-nested-images figure.wp-block-image:not(#individual-image):nth-child(5n+4):last-child { grid-column: span 3; }
}
.wp-block-gallery.is-style-ck-mosaic.has-nested-images figure.wp-block-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, filter .3s ease; }
.wp-block-gallery.is-style-ck-mosaic.has-nested-images figure.wp-block-image:hover img { transform: scale(1.03); filter: brightness(1.04); }
.wp-block-gallery.is-style-ck-mosaic .wp-lightbox-container button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
/* The lightbox in the brand navy, rather than white. */
.wp-lightbox-overlay .scrim { background-color: var(--navy) !important; opacity: .96; }
.wp-lightbox-overlay button { color: #fff !important; }
.wp-lightbox-overlay button svg { fill: currentColor !important; }
@media (prefers-reduced-motion: reduce) {
  .wp-block-gallery.is-style-ck-mosaic.has-nested-images figure.wp-block-image img { transition: none; }
  .wp-block-gallery.is-style-ck-mosaic.has-nested-images figure.wp-block-image:hover img { transform: none; }
}

/* Photo galleries: a card per gallery page. The title link covers the whole card, like the issue cards. */
.gallery-cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.gallery-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.gallery-card:hover { border-color: #C9BEA9; box-shadow: 0 6px 18px rgba(19,34,79,.08); }
.gallery-card:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.gallery-card-photo { aspect-ratio: 3 / 2; background: var(--sand); overflow: hidden; }
.gallery-card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gallery-card:hover .gallery-card-photo img { transform: scale(1.03); }
.gallery-card h3 { font-size: 22px; line-height: 1.25; padding: 18px 20px 0; }
.gallery-card h3:last-child { padding-bottom: 20px; }
.gallery-card h3 a { color: var(--navy); text-decoration: none; }
.gallery-card h3 a::after { content: ""; position: absolute; inset: 0; }
.gallery-card h3 a:focus-visible { outline: none; }
.gallery-card:hover h3 a { color: var(--blue); }
.gallery-card-count { padding: 4px 20px 20px; color: var(--muted); font-size: 15px; }
@media (prefers-reduced-motion: reduce) {
  .gallery-card-photo img, .gallery-card:hover .gallery-card-photo img { transition: none; transform: none; }
}

/* Photo band: navy fades into the photo from the left, like the approved design */
.wp-block-cover.is-style-ck-photo-band { min-height: 560px; padding: 0 28px; color: #fff; }
.wp-block-cover.is-style-ck-photo-band .wp-block-cover__background { background: linear-gradient(90deg, rgba(19,34,79,.94) 0%, rgba(19,34,79,.85) 45%, rgba(19,34,79,.1) 80%) !important; opacity: 1 !important; }
/* Doubled classes beat core's content-position rule (five classes). */
.wp-block-cover.wp-block-cover.is-style-ck-photo-band.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container { width: 100%; max-width: 1144px; margin: 0 auto; }
.wp-block-cover.is-style-ck-photo-band .wp-block-cover__inner-container > * { max-width: 520px; }
.wp-block-cover.is-style-ck-photo-band h2 { color: #fff; }
.wp-block-cover.is-style-ck-photo-band p { color: #DCE1EF; }
.wp-block-cover.is-style-ck-photo-band .wp-block-quote { border-left: 0; padding-left: 0; font-size: 18px; color: #fff; }
.wp-block-cover.is-style-ck-photo-band .wp-block-quote cite { display: block; font: 400 14px/1.4 var(--sans); color: #AEB7D2; font-style: normal; margin-top: 6px; }
.wp-block-quote cite { display: block; font: 400 15px/1.4 var(--sans); color: var(--muted); font-style: normal; margin-top: 12px; }

/* Dynamic block details */
.latest.no-signup { grid-template-columns: 1fr; }
.ck-parsha-latest + * { margin-top: 64px; }
.legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.ck-contact-details h3 { font-size: 18px; margin: 18px 0 4px; }
.ck-contact-details h3:first-child { margin-top: 0; }
/* Legacy Society names are a plain list block, so the office edits them as text: one name per line. */
.ck-names { list-style: none; columns: 3; column-gap: 40px; margin: 24px 0; line-height: 1.8; }
.ck-names li { break-inside: avoid; }

@media (max-width: 1100px) {
  .issue-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .issue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .is-style-ck-section, .is-style-ck-section-white, .is-style-ck-section-sand { padding-top: 64px; padding-bottom: 64px; }
  .entry-content .wp-block-columns { gap: 32px; }
  .ck-names { columns: 2; }
  .wp-block-cover.is-style-ck-photo-band .wp-block-cover__background { background: rgba(19,34,79,.9) !important; }
}
@media (max-width: 600px) {
  .ck-names { columns: 1; }
  .issue-grid { grid-template-columns: minmax(0, 1fr); }
  /* One column: a small page beside the text, so a phone shows more issues per screen. */
  .issue-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); grid-auto-rows: min-content; gap: 2px 14px; }
  .issue-preview { grid-row: 1 / span 3; margin: 0; }
  .issue-date { padding-top: 4px; }
}

/* Class photos: a cover in the schedule row, and the lightbox. */
.prog-photo { position: relative; float: left; width: 72px; height: 72px; margin: 2px 14px 4px 0; padding: 0; border: 0; background: var(--sand); cursor: zoom-in; border-radius: 6px; overflow: hidden; }
.prog-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.prog-photo:hover img { transform: scale(1.04); }
.prog-photo:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.photo-count { position: absolute; right: 4px; bottom: 4px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(19,34,79,.8); border-radius: 4px; padding: 1px 5px; }
.lightbox { max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; padding: 0; border: 0; background: transparent; }
.lightbox::backdrop { background: rgba(10,16,36,.92); }
.lightbox figure { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 56px 72px 24px; pointer-events: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); width: auto; height: auto; object-fit: contain; border-radius: 4px; pointer-events: auto; }
.lightbox figcaption { color: #fff; font-size: 16px; pointer-events: auto; }
.lightbox button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 32px; line-height: 1; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lightbox button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-close { right: 12px; top: 12px; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
@media (max-width: 600px) {
  .lightbox figure { padding: 56px 8px 24px; }
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
}
