/* The layout builder (apps/site_pages/layout_blocks.py): sections cut into columns, filled with elements.
   Every class here is one of the builder's fixed choices; the templates are site_pages/blocks/layout/. */

/* --- the section ------------------------------------------------------------------------------------ */
.lb-section { position: relative; isolation: isolate; color: var(--film-ink); }
.lb-surface-paper { background: var(--film-paper); }
.lb-surface-white { background: #fff; }
.lb-surface-grey { background: #e9e9e9; border-block: 1px solid #dfdfdf; }
.lb-surface-dark, .lb-surface-photo { background: #000; color: #f0f0ee; }
.lb-backdrop { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; opacity: .38; }
.lb-surface-photo::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 75% 85% at 50% 45%, transparent 35%, #000000d9 100%);
}

.lb-space-none { padding-block: 0; }
.lb-space-s { padding-block: 32px; }
.lb-space-m { padding-block: clamp(48px, 6vw, 80px); }
.lb-space-l { padding-block: clamp(64px, 9vw, 120px); }
.lb-space-xl { padding-block: clamp(80px, 12vw, 168px); }

.lb-width-narrow, .lb-width-normal, .lb-width-wide { width: calc(100% - 112px); margin-inline: auto; }
.lb-width-narrow { max-width: 760px; }
.lb-width-normal { max-width: 1280px; }
.lb-width-wide { max-width: 1600px; }
.lb-width-full { width: 100%; }

/* --- columns ------------------------------------------------------------------------------------------ */
.lb-grid { display: grid; align-items: start; }
.lb-cols-1 { grid-template-columns: minmax(0, 1fr); }
.lb-cols-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lb-cols-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.lb-cols-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.lb-cols-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.lb-cols-2-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.lb-cols-1-1-1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lb-cols-1-2-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); }
.lb-cols-1-1-1-1 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lb-gap-none { gap: 0; }
.lb-gap-s { gap: 16px; }
.lb-gap-m { gap: 32px; }
.lb-gap-l { gap: clamp(32px, 5vw, 72px); }
.lb-valign-top { align-items: start; }
.lb-valign-center { align-items: center; }
.lb-valign-bottom { align-items: end; }
.lb-valign-stretch { align-items: stretch; }
.lb-self-top { align-self: start; }
.lb-self-center { align-self: center; }
.lb-self-bottom { align-self: end; }
.lb-self-stretch { align-self: stretch; }
.lb-stack { display: flex; flex-direction: column; }

.lb-col { min-width: 0; container-type: inline-size; }
.lb-col > * + * { margin-top: 28px; }
.lb-col > .lb-label + * { margin-top: 14px; }
.lb-col > .lb-heading + :is(.lb-text, .lb-list, .lb-details) { margin-top: 20px; }
.lb-col > .lb-space, .lb-col > .lb-space + * { margin-top: 0; }

/* Panels: a column or a part standing on its own ground */
.lb-panel-white, .lb-panel-grey, .lb-panel-dark, .lb-panel-outline { padding: clamp(24px, 3.2vw, 48px); }
.lb-panel-white { background: #fff; }
.lb-panel-grey { background: #e9e9e9; }
.lb-panel-dark { background: #000; }
.lb-panel-outline { border: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.lb-on-light {
  color: var(--film-ink); --color-yellow: #000; --color-on-accent: #fff; --color-surface: #fff; --color-focus: #000;
  --film-yellow: #000; --film-on-accent: #fff;
}
.lb-on-dark { color: #f0f0ee; }
.lb-on-dark .btn-secondary { color: #fff; border-color: #fff; background-color: #000; }
.lb-on-light .btn-secondary { color: #000; border-color: #000; background-color: #fff; }
.lb-on-dark :is(.prose-site a, .quiet-link) { color: #fff; text-decoration-color: currentColor; }
.lb-on-dark .section-label:not(#_) { color: #bdbdbd; }
.lb-on-light .section-label:not(#_) { color: #595959; }
.lb-on-light .prose-site a { color: #000; }

/* --- type ----------------------------------------------------------------------------------------------- */
.lb-align-left { text-align: left; }
.lb-align-center { text-align: center; }
.lb-align-right { text-align: right; }
.lb-buttons.lb-align-center { justify-content: center; }
.lb-buttons.lb-align-right { justify-content: flex-end; }

:where(.lb-heading) { margin: 0; }
.lb-heading { overflow-wrap: break-word; }
.lb-h-xl { font-size: clamp(46px, 7vw, 104px); line-height: .98; }
.lb-h-l { font-size: clamp(34px, 3.8vw, 56px); line-height: 1.04; }
.lb-h-m { font-size: clamp(26px, 2.4vw, 34px); line-height: 1.12; }
.lb-h-s { font-size: 21px; line-height: 1.25; }
.lb-heading.lb-hs-serif:not(#_):not(#_) { font-family: var(--font-display); font-style: normal; }
.lb-heading.lb-hs-serif_italic:not(#_):not(#_) { font-family: var(--font-display); font-style: italic; font-weight: 400; }
.lb-heading.lb-hs-sans:not(#_):not(#_) { font-family: var(--font-sans); font-weight: 600; letter-spacing: -.015em; }
.lb-heading.lb-hs-caps:not(#_):not(#_) {
  font-family: var(--font-sans); font-weight: 600; text-transform: uppercase; letter-spacing: .16em; line-height: 1.3;
}
.lb-hs-caps.lb-h-xl { font-size: 28px; }
.lb-hs-caps.lb-h-l { font-size: 20px; }
.lb-hs-caps.lb-h-m { font-size: 16px; }
.lb-hs-caps.lb-h-s { font-size: 13px; }

:where(.lb-label) { margin: 0; }
.lb-text { font-size: 18px; }
.lb-text > :first-child { margin-top: 0; }
.lb-text blockquote { margin-top: 16px; padding-left: 20px; border-left: 2px solid currentColor; font-style: italic; }
.lb-t-lead { font-size: clamp(20px, 1.8vw, 24px); line-height: 1.5; }
.lb-t-accent { font: italic 400 clamp(26px, 2.8vw, 38px)/1.25 var(--font-display); letter-spacing: -.01em; }
.lb-t-accent p { line-height: 1.25; }
.lb-t-small { font-size: 15px; }
.lb-t-muted { color: var(--film-muted); }
.lb-on-dark .lb-t-muted, .lb-on-dark .lb-t-caption { color: #bdbdbd; }
.lb-t-caption { font-size: 14px; font-style: italic; color: var(--film-muted); }

/* --- lists ---------------------------------------------------------------------------------------------- */
:where(.lb-list) { margin: 0; }
.lb-list { padding: 0; list-style: none; counter-reset: lb; font-size: 18px; }
.lb-list li { position: relative; padding-left: 34px; break-inside: avoid; counter-increment: lb; }
.lb-list li + li { margin-top: 12px; }
.lb-list li::before { position: absolute; left: 0; top: 0; }
.lb-m-dash li::before { content: "—"; }
.lb-m-bullet li::before { content: "●"; font-size: .5em; top: .75em; }
.lb-m-check li::before { content: "✓"; font-weight: 600; }
.lb-m-number li { padding-left: 48px; }
.lb-m-number li::before { content: counter(lb, decimal-leading-zero); font: italic 400 1em/inherit var(--font-display); opacity: .7; }
.lb-m-none li { padding-left: 0; }
.lb-ls-large { font: 400 clamp(22px, 2vw, 28px)/1.3 var(--font-display); }
.lb-ls-large li + li { margin-top: 16px; }
.lb-ls-ruled li + li { margin-top: 0; }
.lb-ls-ruled li { padding-block: 14px; border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.lb-ls-ruled li::before { top: 14px; }
.lb-ls-ruled.lb-m-bullet li::before { top: calc(14px + .75em); }
.lb-lc-2 { columns: 2; column-gap: 40px; }

/* --- pictures ------------------------------------------------------------------------------------------- */
:where(.lb-figure, .lb-slide, .lb-gallery figure, .lb-quote, .lb-video) { margin: 0; }
:is(.lb-figure, .lb-slide, .lb-gallery figure, .lb-card-image) img { display: block; width: 100%; height: auto; }
:is(.lb-figure, .lb-slide, .lb-gallery, .lb-video) figcaption {
  margin-top: 10px; font-size: 14px; font-style: italic; color: var(--film-muted);
}
.lb-on-dark :is(.lb-figure, .lb-slide, .lb-gallery, .lb-video) figcaption { color: #bdbdbd; }
.lb-frame-inner { position: relative; }
.lb-frame-border .lb-frame-inner { border: 1px solid currentColor; padding: 10px; }
.lb-vf { position: absolute; width: 26px; height: 26px; pointer-events: none; z-index: 1; }
.lb-vf-top { left: 16px; top: 16px; border-left: 2px solid #f4f4f4c0; border-top: 2px solid #f4f4f4c0; }
.lb-vf-bottom { right: 16px; bottom: 16px; border-right: 2px solid #f4f4f4c0; border-bottom: 2px solid #f4f4f4c0; }
/* A print on film: black stock with sprocket holes above and below the frame */
.lb-frame-filmstrip .lb-frame-inner, .lb-strip {
  background: #000; position: relative;
  --holes: repeating-linear-gradient(90deg, transparent 0 9px, #e8e8e4 9px 19px, transparent 19px 28px);
}
.lb-frame-filmstrip .lb-frame-inner { padding: 26px 12px; }
.lb-frame-filmstrip .lb-frame-inner::before, .lb-frame-filmstrip .lb-frame-inner::after,
.lb-strip::before, .lb-strip::after {
  content: ""; position: absolute; left: 6px; right: 6px; height: 8px; background: var(--holes); border-radius: 1px;
}
.lb-frame-filmstrip .lb-frame-inner::before, .lb-strip::before { top: 9px; }
.lb-frame-filmstrip .lb-frame-inner::after, .lb-strip::after { bottom: 9px; }
.lb-strip { height: 44px; }

.lb-gallery { display: grid; gap: 16px; }
.lb-gc-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lb-gc-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lb-gc-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Carousel: a strip that scrolls with snap points; layout.js adds the arrows, the counter and the autoplay */
.lb-carousel { position: relative; }
.lb-track {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.lb-track::-webkit-scrollbar { display: none; }
.lb-track:focus-visible { outline: 3px solid #6e6e6e; outline-offset: 4px; }
.lb-slide { flex: 0 0 100%; scroll-snap-align: start; }
.lb-pv-2 .lb-slide { flex-basis: calc((100% - 16px) / 2); }
.lb-pv-3 .lb-slide { flex-basis: calc((100% - 32px) / 3); }
.lb-controls { display: flex; align-items: center; gap: 18px; margin-top: 16px; }
.lb-controls button {
  width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%;
  background: transparent; color: inherit; font-size: 20px; cursor: pointer;
}
.lb-controls button:hover { background: currentColor; }
.lb-controls button:hover span { color: var(--film-paper); }
.lb-on-dark .lb-controls button:hover span { color: #000; }
.lb-controls button:disabled { opacity: .3; cursor: default; background: transparent; }
.lb-controls button:disabled span { color: inherit !important; }
.lb-count { font: italic 400 18px/1 var(--font-display); letter-spacing: .04em; min-width: 72px; }

/* --- cards, figures, details ---------------------------------------------------------------------------- */
.lb-cards { display: grid; gap: clamp(20px, 2.6vw, 36px); }
.lb-pr-1 { grid-template-columns: minmax(0, 1fr); }
.lb-pr-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lb-pr-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lb-pr-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lb-card { display: flex; flex-direction: column; }
.lb-card-body { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.lb-card-body h3 { margin: 0; font: 500 clamp(22px, 1.9vw, 26px)/1.2 var(--font-display); }
.lb-card-body p { margin: 0; color: var(--film-muted); font-size: 17px; }
.lb-card-body .quiet-link { margin-top: auto; padding-top: 6px; }
.lb-card-image { margin-bottom: 18px; }
.lb-cs-plain .lb-card { border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent); padding-top: 22px; }
.lb-cs-panel .lb-card { background: #fff; color: var(--film-ink); }
.lb-cs-panel .lb-card-body, .lb-cs-dark .lb-card-body, .lb-cs-outline .lb-card-body { padding: 26px; }
.lb-cs-panel .lb-card-image, .lb-cs-dark .lb-card-image, .lb-cs-outline .lb-card-image { margin-bottom: 0; }
.lb-cs-dark .lb-card { background: #000; }
.lb-cs-dark .lb-card-body p, .lb-on-dark .lb-card-body p { color: #bdbdbd; }
.lb-cs-panel .lb-card-body p { color: var(--film-muted); }
.lb-cs-outline .lb-card { border: 1px solid color-mix(in srgb, currentColor 35%, transparent); }

.lb-stats { display: flex; flex-wrap: wrap; row-gap: 24px; }
.lb-stats p { display: flex; align-items: center; gap: 14px; margin: 0; padding: 0 28px; line-height: 1.1; }
.lb-stats p:first-child { padding-left: 0; }
.lb-st-ruled p + p { border-left: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.lb-stats strong { font: 500 clamp(40px, 4vw, 56px)/1 var(--font-display); }
.lb-stats span { font-size: 15px; max-width: 130px; }

.lb-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }

.lb-quote blockquote { margin: 0; font: italic 400 clamp(24px, 2.4vw, 32px)/1.3 var(--font-display); }
.lb-q-l blockquote { font-size: clamp(32px, 4vw, 54px); line-height: 1.15; }
.lb-quote figcaption { margin-top: 14px; font-size: 15px; color: var(--film-muted); }
.lb-on-dark .lb-quote figcaption { color: #bdbdbd; }

.lb-video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.lb-video-frame :is(iframe, video, object) { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lb-accordion details { border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.lb-accordion details:last-child { border-bottom: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.lb-accordion summary {
  display: flex; justify-content: space-between; gap: 20px; padding: 18px 0; cursor: pointer; list-style: none;
  font: 500 21px/1.3 var(--font-display);
}
.lb-accordion summary::-webkit-details-marker { display: none; }
.lb-accordion summary::after { content: "+"; font-family: var(--font-sans); font-weight: 400; }
.lb-accordion details[open] summary::after { content: "−"; }
.lb-accordion details p { margin: 0; padding-bottom: 20px; max-width: 70ch; color: var(--film-muted); }
.lb-on-dark .lb-accordion details p { color: #bdbdbd; }

:where(.lb-details) { margin: 0; }
.lb-details div { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr; gap: 20px; padding-block: 12px;
                  border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.lb-details dt { font-style: italic; font-family: var(--font-display); }
.lb-details dd { margin: 0; }

:where(.lb-rule) { margin-block: 0; }
.lb-rule { border: 0; border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.lb-rule-thick { border-top: 3px solid currentColor; }
.lb-space_s { height: 16px; }
.lb-space_m { height: 40px; }
.lb-space_l { height: 80px; }

/* A split inside a narrow column stands its parts one above the other */
@container (max-width: 520px) {
  .lb-split.lb-grid { grid-template-columns: minmax(0, 1fr); }
  .lb-cards { grid-template-columns: minmax(0, 1fr); }
  .lb-gallery.lb-gc-3, .lb-gallery.lb-gc-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-lc-2 { columns: 1; }
}

/* --- narrower screens ----------------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .lb-width-narrow, .lb-width-normal, .lb-width-wide { width: calc(100% - 64px); }
  .lb-cols-1-1-1-1, .lb-pr-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-pr-3, .lb-gc-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .lb-width-narrow, .lb-width-normal, .lb-width-wide { width: calc(100% - 40px); }
  .lb-section > [class^="lb-width"] > .lb-grid { grid-template-columns: minmax(0, 1fr); }
  .lb-mobile-reversed > .lb-col:last-child { order: -1; }
  .lb-pr-2, .lb-pr-3, .lb-pr-4 { grid-template-columns: minmax(0, 1fr); }
  .lb-gc-3, .lb-gc-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-pv-2 .lb-slide, .lb-pv-3 .lb-slide { flex-basis: 86%; }
  .lb-stats p { padding: 0 18px; }
  .lb-details div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .lb-text.lb-align-right, .lb-heading.lb-align-right { text-align: left; }
}
@media (max-width: 380px) {
  .lb-width-narrow, .lb-width-normal, .lb-width-wide { width: calc(100% - 32px); }
}

/* --- live elements: the course, its dates, the interest form, the photo studies ------------------------- */
.lb-course { display: flex; flex-direction: column; gap: 10px; }
.lb-course p { margin: 0; }
.lb-course-title { margin: 0; font: 500 clamp(28px, 3vw, 42px)/1.05 var(--font-display); }
.lb-course-sub { font-size: 19px; }
.lb-course-facts { color: var(--film-muted); font-size: 15px; letter-spacing: .02em; }
.lb-on-dark .lb-course-facts { color: #bdbdbd; }
.lb-course-status { margin-top: 12px; padding-top: 18px; border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent);
                    display: flex; flex-direction: column; gap: 12px; }
.lb-course-note { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.lb-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 15%, transparent); }
.lb-course-price { font: 500 clamp(30px, 3vw, 40px)/1 var(--font-display); }

.lb-cohorts { border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.lb-cohort { display: grid; grid-template-columns: minmax(96px, 1fr) 3fr auto auto; gap: 8px 24px; align-items: baseline;
             padding-block: 16px; border-bottom: 1px solid color-mix(in srgb, currentColor 25%, transparent);
             text-decoration: none; color: inherit; }
.lb-cohort:hover .lb-cohort-go { text-decoration: underline; text-underline-offset: 5px; }
.lb-cohort-date { font: italic 400 19px/1.2 var(--font-display); }
.lb-cohort-name strong { display: block; font-weight: 600; }
.lb-cohort-name { font-size: 15px; color: var(--film-muted); }
.lb-on-dark .lb-cohort-name { color: #bdbdbd; }
.lb-cohort-name strong { color: var(--film-ink); }
.lb-on-dark .lb-cohort-name strong { color: #fff; }
.lb-cohort-price { font-weight: 600; white-space: nowrap; }
.lb-cohort-go { font-weight: 600; font-size: 15px; white-space: nowrap; }
.lb-cohorts-empty { margin: 0; padding-block: 16px; color: var(--film-muted); }
@container (max-width: 560px) {
  .lb-cohort { grid-template-columns: 1fr auto; }
  .lb-cohort-name { grid-column: 1 / -1; grid-row: 2; }
  .lb-cohort-go { grid-column: 1 / -1; }
}

.lb-interest-heading { margin: 0 0 10px; font: 500 clamp(26px, 2.6vw, 36px)/1.1 var(--font-display); }
.lb-interest-text { margin: 0 0 18px; color: var(--film-muted); font-size: 17px; }
.lb-on-dark .lb-interest-text { color: #bdbdbd; }
.lb-interest .interest-form { max-width: none; }
.lb-interest .form-note { margin-top: 15px; }
.lb-on-dark .lb-interest .form-field input, .lb-on-dark .lb-interest .form-field select { color: var(--film-ink); }

/* The photo studies inside a column: the same frames and tabs, on their own black ground */
.lb-frame-lab.frame-lab { padding: clamp(18px, 2.4vw, 32px); }
.lb-frame-lab.frame-lab::before { display: none; }
.lb-frame-lab .frame-panel { margin-block: 20px 8px; }
@container (max-width: 760px) {
  .lb-frame-lab .frame-selector { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lb-frame-lab .frame-panel { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .lb-frame-lab .study-image img { height: 300px; }
  .lb-frame-lab .study-copy h3 { font-size: 34px; max-width: 100%; }
  .lb-frame-lab .frame-choice-arrow { display: none; }
}
