/* Page layout / gutters / directories shells */
/* =====================
   PAGE TYPOGRAPHY
   ===================== */

body.page,
body.page .wp-block-post-content {
  font-family: Avenir, "Avenir Next", Helvetica, Arial, sans-serif;
}

html {
  overflow-x: clip;
  overscroll-behavior-x: none;
  width: 100%;
  max-width: 100%;
  height: 100%;
  /* White chrome so top/bottom rubber-band never flashes page grey */
  background-color: #FFFFFF;
}

body {
  background-color: #FFFFFF !important;
  overflow-x: clip;
  overscroll-behavior-x: none;
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  position: relative;
}

img,
video,
iframe,
svg {
  max-width: 100%;
  height: auto;
}

/*
 * Short pages (Contact, etc.): grow main so the footer sits at the
 * bottom of the viewport instead of floating mid-screen.
 * Shell stays white; only main carries the page grey so overscroll
 * above the header / below the footer never shows grey.
 */
.wp-site-blocks {
  background-color: #FFFFFF !important;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body.admin-bar .wp-site-blocks {
  min-height: calc(100vh - 32px);
  min-height: calc(100dvh - 32px);
}

/* Super Admin toolbar: desktop only — hide on mobile so it doesn't shove the header. */
@media screen and (max-width: 782px) {
  html.admin-bar {
    margin-top: 0 !important;
  }

  #wpadminbar {
    display: none !important;
  }

  body.admin-bar .wp-site-blocks {
    min-height: 100vh;
    min-height: 100dvh;
  }
}

.wp-site-blocks > main,
.wp-site-blocks > main.wp-block-group {
  flex: 1 0 auto;
  background-color: #EFF0F3;
}

.wp-site-blocks > footer,
.wp-site-blocks > footer.wp-block-template-part {
  margin-top: auto;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  background-color: #FFFFFF;
  /* Extra white below the footer for rubber-band — vertical only (no X spread). */
  box-shadow: 0 100vh 0 0 #FFFFFF;
}

/* WordPress block gap leaves a grey strip between header and main */
.wp-site-blocks > main,
header.wp-block-template-part + main {
  margin-block-start: 0 !important;
}

main,
main.wp-block-group {
  overflow-x: clip;
  overflow-y: visible;
  max-width: 100%;
  padding-top: 0;
  gap: 0 !important;
}

/* Hero-first pages (home, mission, etc.) should sit flush under the header */
main:has(.wp-block-post-content > .ja-image:first-child),
main:has(.wp-block-post-content > .alignfull:first-child),
main:has(.wp-block-post-content > .stk-block-image:first-child) {
  padding-top: 0 !important;
}

/*
 * Page spacing — classmates, yearbook home, scrapbook home,
 * yearbook singles, scrapbook singles, my profile.
 * Side gutters live on the content rail (not post-content) so
 * section backgrounds can remain full-bleed.
 */
main:has(.classmates-wrapper) .wp-block-post-content,
main:has(.classmates-wrapper) .entry-content,
main:has(.faculty-staff-wrapper) .wp-block-post-content,
main:has(.faculty-staff-wrapper) .entry-content,
main:has(.yearbooks-wrapper) .wp-block-post-content,
main:has(.yearbooks-wrapper) .entry-content,
main:has(.scrapbooks-directory) .wp-block-post-content,
main:has(.scrapbooks-directory) .entry-content,
main:has(.class-pages-directory) .wp-block-post-content,
main:has(.class-pages-directory) .entry-content,
main:has(.yearbook-single) .wp-block-post-content,
main:has(.yearbook-single) .entry-content,
body.single-yearbooks .wp-block-post-content,
body.single-yearbooks .entry-content,
body.single-scrapbooks .wp-block-post-content,
body.single-scrapbooks .entry-content,
body.post-type-archive-class-pages .wp-block-post-content,
body.post-type-archive-class-pages .entry-content,
body.page-class-pages .wp-block-post-content,
body.page-class-pages .entry-content,
main:has(.jk-profile-page) .wp-block-post-content,
main:has(.jk-profile-page) .entry-content,
body.page-my-profile .wp-block-post-content,
body.page-my-profile .entry-content {
  margin-block: 0 !important;
  padding-block-start: 0 !important;
  padding-inline: 0;
  box-sizing: border-box;
}

/*
 * Constrained layout (theme.json contentSize: 1200px): keep full-bleed
 * shells edge-to-edge; cap width on everything else.
 *
 * Do NOT force margin/padding here — Stackable sets side margins with
 * !important, and a higher-specificity theme override made those editor
 * changes appear to do nothing. WP core still centers blocks that have no
 * custom side margins.
 *
 * Excluded: home + static Stackable pages. Use page-id-* (WP no longer
 * reliably adds page-{slug} on block themes) — mission 52, reunions 59,
 * alma-mater 76, photos 95, hall-of-fame 4559.
 */
body:not(.home):not(.front-page):not(.page-id-10):not(.page-id-52):not(.page-id-59):not(.page-id-76):not(.page-id-95):not(.page-id-4559) .wp-block-post-content.is-layout-constrained > :where(:not(.alignfull):not(.alignwide):not(.yearbooks-wrapper):not(.scrapbooks-directory):not(.class-pages-directory):not(.yearbook-single):not(.jk-profile-page):not(.classmates-wrapper):not(.stk-block-image):not(.ja-image):not(.wp-block-cover)) {
  width: 100%;
  max-width: var(--jt-content-max) !important;
  box-sizing: border-box !important;
}

/*
 * Columns: drop Stackable's inner columnSpacing inset.
 * Do NOT zero .stk-block-text / .stk-block-heading side margins — static
 * Stackable pages use those on purpose for reading width.
 * Same exclusions as the constrained-width rule above.
 */
body:not(.home):not(.front-page):not(.page-id-10):not(.page-id-52):not(.page-id-59):not(.page-id-76):not(.page-id-95):not(.page-id-4559) .wp-block-post-content .stk-block-columns {
  --stk-columns-spacing: 0px;
}

body:not(.home):not(.front-page):not(.page-id-10):not(.page-id-52):not(.page-id-59):not(.page-id-76):not(.page-id-95):not(.page-id-4559) .wp-block-post-content .stk-block-columns .stk-row.stk--flex {
  gap: 1.5rem;
}

body:not(.home):not(.front-page):not(.page-id-10):not(.page-id-52):not(.page-id-59):not(.page-id-76):not(.page-id-95):not(.page-id-4559) .wp-block-post-content .stk-block-column .stk-column-wrapper {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Photos/portraits in columns: sit on the rail, not centered with side gaps */
body:not(.home):not(.front-page):not(.page-id-10):not(.page-id-52):not(.page-id-59):not(.page-id-76):not(.page-id-95):not(.page-id-4559) .wp-block-post-content .stk-block-column .wp-block-image.aligncenter {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.wp-block-post-content.is-layout-constrained > .yearbooks-wrapper,
.wp-block-post-content.is-layout-constrained > .scrapbooks-directory,
.wp-block-post-content.is-layout-constrained > .class-pages-directory,
.wp-block-post-content.is-layout-constrained > .yearbook-single,
.wp-block-post-content.is-layout-constrained > .jk-profile-page,
.wp-block-post-content.is-layout-constrained > .alignfull,
.wp-block-post-content.is-layout-constrained > .stk-block-image,
.wp-block-post-content.is-layout-constrained > .ja-image,
.wp-block-post-content.is-layout-constrained > .wp-block-cover,
.wp-block-post-content.is-layout-constrained > :has(> .yearbooks-wrapper),
.wp-block-post-content.is-layout-constrained > :has(> .scrapbooks-directory),
.wp-block-post-content.is-layout-constrained > :has(> .class-pages-directory),
.wp-block-post-content.is-layout-constrained > :has(> .yearbook-single),
.wp-block-post-content.is-layout-constrained > :has(> .jk-profile-page) {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Home / hero images: always full-bleed — never force onto the content rail */
body.home .wp-block-post-content > .stk-block-image,
body.front-page .wp-block-post-content > .stk-block-image,
body.page-id-10 .wp-block-post-content > .stk-block-image,
.wp-block-post-content > .stk-block-image:first-child,
.wp-block-post-content > .ja-image:first-child,
.wp-block-post-content > .alignfull:first-child,
.wp-block-post-content > .wp-block-cover:first-child {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/*
 * Home Photos / Reunions / Directory — only stack below 900px.
 * Keep three columns (desktop layout) from 900px up. Between 768–899px
 * force a clean full-width stack with real gaps (desktop negative margins
 * collapse cards when wrapped). Cap circle thumbs. Phone (≤767px) untouched.
 */
@media (min-width: 768px) and (max-width: 899px) {
  body.home .stk-c9a01f0 .stk-row.stk-c9a01f0-column,
  body.front-page .stk-c9a01f0 .stk-row.stk-c9a01f0-column,
  body.page-id-10 .stk-c9a01f0 .stk-row.stk-c9a01f0-column {
    flex-wrap: wrap !important;
    row-gap: 2.5rem !important;
    column-gap: 0 !important;
  }

  body.home .stk-c9a01f0 .stk-block-column.stk-4b9ea11,
  body.home .stk-c9a01f0 .stk-block-column.stk-667246c,
  body.home .stk-c9a01f0 .stk-block-column.stk-13fefe6,
  body.front-page .stk-c9a01f0 .stk-block-column.stk-4b9ea11,
  body.front-page .stk-c9a01f0 .stk-block-column.stk-667246c,
  body.front-page .stk-c9a01f0 .stk-block-column.stk-13fefe6,
  body.page-id-10 .stk-c9a01f0 .stk-block-column.stk-4b9ea11,
  body.page-id-10 .stk-c9a01f0 .stk-block-column.stk-667246c,
  body.page-id-10 .stk-c9a01f0 .stk-block-column.stk-13fefe6 {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    /* Kill desktop tight-pack negative margins — they glue stacked cards together */
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  body.home .stk-c9a01f0 :is(.stk-043b49c, .stk-42b9e90, .stk-6ea6e0b) .stk-img-wrapper,
  body.front-page .stk-c9a01f0 :is(.stk-043b49c, .stk-42b9e90, .stk-6ea6e0b) .stk-img-wrapper,
  body.page-id-10 .stk-c9a01f0 :is(.stk-043b49c, .stk-42b9e90, .stk-6ea6e0b) .stk-img-wrapper {
    width: 140px !important;
    max-width: 40% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/*
 * Mission page figure: narrower than the header rail on every breakpoint.
 * Inline max-width alone loses to the constrained-child rail rule.
 */
.jhs-mission-figure,
.wp-block-post-content .jhs-mission-figure,
.wp-block-html .jhs-mission-figure {
  width: 100% !important;
  max-width: 900px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}

.jhs-hero-wrap {
  position: relative;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .jhs-mission-figure,
  .wp-block-post-content .jhs-mission-figure,
  .wp-block-html .jhs-mission-figure {
    max-width: 720px !important;
  }
}

@media (max-width: 767px) {
  .jhs-mission-figure,
  .wp-block-post-content .jhs-mission-figure,
  .wp-block-html .jhs-mission-figure {
    max-width: 100% !important;
  }

  /* Inline caption used left:-8% — keep it inside the figure on phones. */
  .jhs-hero-wrap {
    overflow-x: clip;
  }

  .jhs-hero-wrap > div[style*="position:absolute"],
  .jhs-hero-wrap > div[style*="position: absolute"] {
    left: 0 !important;
    max-width: min(200px, 56%) !important;
  }
}

/* Classmates directory: whole feature sits on the content rail */
.wp-block-post-content.is-layout-constrained > .classmates-wrapper,
.wp-block-post-content.is-layout-constrained > :has(> .classmates-wrapper) > .classmates-wrapper,
.classmates-wrapper {
  width: 100%;
  max-width: var(--jt-content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--jt-page-gutter);
  padding-right: var(--jt-page-gutter);
  box-sizing: border-box;
}

/* Yearbook / scrapbook / class pages archives + singles: gap above the title */
main:has(.yearbooks-wrapper),
main:has(.scrapbooks-directory),
main:has(.class-pages-directory),
main:has(.yearbook-single),
body.single-yearbooks main,
body.single-scrapbooks main,
body.post-type-archive-class-pages main,
body.page-class-pages main {
  padding-top: 40px;
}

@media (max-width: 768px) {
  main:has(.yearbooks-wrapper),
  main:has(.scrapbooks-directory),
  main:has(.class-pages-directory),
  main:has(.yearbook-single),
  body.single-yearbooks main,
  body.single-scrapbooks main,
  body.post-type-archive-class-pages main,
  body.page-class-pages main {
    padding-top: 25px;
  }
}

main .wp-block-post-content > :first-child,
main .wp-block-post-content > .wp-block-group:first-child,
main .wp-block-post-content > .has-background:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 40px gap between consecutive content blocks on those pages only */
main:has(.classmates-wrapper) .wp-block-post-content > * + *,
main:has(.classmates-wrapper) .entry-content > * + *,
main:has(.faculty-staff-wrapper) .wp-block-post-content > * + *,
main:has(.faculty-staff-wrapper) .entry-content > * + *,
main:has(.yearbooks-wrapper) .wp-block-post-content > * + *,
main:has(.yearbooks-wrapper) .entry-content > * + *,
main:has(.scrapbooks-directory) .wp-block-post-content > * + *,
main:has(.scrapbooks-directory) .entry-content > * + *,
main:has(.class-pages-directory) .wp-block-post-content > * + *,
main:has(.class-pages-directory) .entry-content > * + *,
main:has(.yearbook-single) .wp-block-post-content > * + *,
main:has(.yearbook-single) .entry-content > * + *,
body.single-yearbooks .wp-block-post-content > * + *,
body.single-yearbooks .entry-content > * + *,
body.single-scrapbooks .wp-block-post-content > * + *,
body.single-scrapbooks .entry-content > * + *,
body.post-type-archive-class-pages .wp-block-post-content > * + *,
body.post-type-archive-class-pages .entry-content > * + *,
body.page-class-pages .wp-block-post-content > * + *,
body.page-class-pages .entry-content > * + *,
main:has(.jk-profile-page) .wp-block-post-content > * + *,
main:has(.jk-profile-page) .entry-content > * + *,
body.page-my-profile .wp-block-post-content > * + *,
body.page-my-profile .entry-content > * + * {
  margin-top: var(--jt-section-gap) !important;
  margin-block-start: var(--jt-section-gap) !important;
}

/* Hyperlinks — brand red; underline only on hover (skip home + classmates + profile; leave buttons / highlight / See All CTAs alone) */
body:not(.home):not(.page-id-10):not(.front-page) main:not(:has(.classmates-wrapper)):not(:has(.jk-profile-page)) a:not(.wp-block-button__link):not(.wp-element-button):not(.directory-card-link):not(.scrapbook-card-link):not(.jt-directory-cta):not(:is(.stk-highlight *)),
body:not(.home):not(.page-id-10):not(.front-page) main:not(:has(.classmates-wrapper)):not(:has(.jk-profile-page)) a:not(.wp-block-button__link):not(.wp-element-button):not(.directory-card-link):not(.scrapbook-card-link):not(.jt-directory-cta):not(:is(.stk-highlight *)):visited {
  color: var(--jt-link-color) !important;
  text-decoration: none !important;
}

body:not(.home):not(.page-id-10):not(.front-page) main:not(:has(.classmates-wrapper)):not(:has(.jk-profile-page)) a:not(.wp-block-button__link):not(.wp-element-button):not(.directory-card-link):not(.scrapbook-card-link):not(.jt-directory-cta):not(:is(.stk-highlight *)):hover,
body:not(.home):not(.page-id-10):not(.front-page) main:not(:has(.classmates-wrapper)):not(:has(.jk-profile-page)) a:not(.wp-block-button__link):not(.wp-element-button):not(.directory-card-link):not(.scrapbook-card-link):not(.jt-directory-cta):not(:is(.stk-highlight *)):focus {
  color: var(--jt-link-color) !important;
  text-decoration: underline !important;
}

/* Yearbook / scrapbook archive intro links */
.yearbooks-intro a,
.yearbooks-intro a:visited {
  color: var(--jt-link-color) !important;
  text-decoration: none !important;
}

.yearbooks-intro a:hover,
.yearbooks-intro a:focus {
  color: var(--jt-link-color) !important;
  text-decoration: underline !important;
}

/* See All Yearbooks / Scrapbooks CTAs keep navy button styling */
a.jt-directory-cta,
a.jt-directory-cta:visited,
a.jt-directory-cta:hover,
a.jt-directory-cta:focus {
  color: #fff !important;
  text-decoration: none !important;
}

.classmates-wrapper,
.yearbooks-wrapper,
.scrapbooks-directory,
.yearbook-single,
.jk-profile-page {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

main:has(.classmates-wrapper) .classmates-wrapper,
main:has(.jk-profile-page) .jk-profile-page,
body.page-my-profile .jk-profile-page {
  padding-top: var(--jt-section-gap) !important;
}

@media (max-width: 768px) {
  main:has(.classmates-wrapper) .classmates-wrapper,
  main:has(.faculty-staff-wrapper) .faculty-staff-wrapper,
  main:has(.jk-profile-page) .jk-profile-page,
  body.page-my-profile .jk-profile-page {
    padding-top: 30px !important;
  }

  .classmates-header-title {
    margin-bottom: 30px !important;
  }

  .jk-profile-page__title {
    margin-bottom: 30px !important;
  }
}

/* Shortcode directory / single shells: full-bleed; inners carry the rail */
.yearbooks-wrapper,
.scrapbooks-directory,
.class-pages-directory,
.yearbook-single {
  width: 100%;
  max-width: none;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  :root {
    --jt-page-gutter: 40px;
  }
}

@media (max-width: 768px) {
  :root {
    --jt-page-gutter: 0;
    --jt-header-gutter: 16px;
  }

  /* No theme side padding on mobile content — Stackable owns those gutters.
   * Header keeps --jt-header-gutter so logo / menu / CTA aren't flush.
   * Classmates / Staff / yearbook-family / profile use 40px side padding (below). */
  .jt-container,
  .yearbook-single__inner,
  .site-footer {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .classmates-wrapper,
  .faculty-staff-wrapper,
  .jk-profile-page__inner,
  .yearbooks-wrapper > .jt-container,
  .scrapbooks-directory > .jt-container,
  .class-pages-directory > .jt-container,
  .yearbook-single > .jt-container,
  .yearbook-single > .yearbook-single__inner {
    padding-left: 40px !important;
    padding-right: 40px !important;
  }

  .classmates-wrapper,
  .faculty-staff-wrapper {
    padding-bottom: 25px !important;
  }
}

/* Fix template part wrapper */
header.wp-block-template-part {
  position: sticky !important;
  top: 0 !important;
  z-index: 9999 !important;
  width: 100% !important;
  background: #ffffff;
  border-bottom: 1px solid var(--jt-border);
  overflow: visible;
  /* Block grey main from painting through during overscroll */
  isolation: isolate;
}

.site-header {
  width: 100%;
  box-sizing: border-box;
  border-bottom: none;
  background: #FFFFFF;
}

