/* ==========================================================================
   v1.2.0
   1. Directory pages (School Life, Achievements): the About index, with each
      row's picture shown in the row instead of following the cursor
   2. Our Achievements: year chips + list
   3. Awards / Scholarships: year cards
   4. Photo galleries in posts (imported achievements)
   ========================================================================== */

/* ---------- 1. directory pages ---------- */
.ab-root .ab-hero{min-height:min(calc(100dvh - var(--bar-h,92px)),860px)}
.ab-root-content{margin:0!important;max-width:none!important}
.ab-root-hero .ab-eyebrow-row{flex-wrap:wrap;row-gap:8px}
/* tighter title so long single words (Achievements) stay on one line */
.ab-root-hero .ab-hero-title{letter-spacing:-.055em!important}
@media (max-width:600px){
  /* the page title is right below: keep the crumb to Home · eyebrow */
  .ab-root-hero .ab-eyebrow-row > i:first-of-type,.ab-root-hero .ab-eyebrow-row > span:first-of-type{display:none}
}
.ab-root-content > .ab-menu{padding-top:clamp(56px,7vw,112px)!important}

@media (min-width:861px) and (hover:hover){
  .ab-menu.is-static .ab-card{grid-template-columns:clamp(44px,4vw,64px) clamp(132px,13vw,200px) minmax(0,1fr) auto;
    grid-template-areas:"n p t l" "n p d l";align-items:center;row-gap:4px}
  .ab-menu.is-static .ab-card::before{align-self:center;transform:none}
  .ab-menu.is-static .ab-card .ab-pic{position:relative;grid-area:p;align-self:center;width:auto;height:auto;opacity:1;clip-path:none;pointer-events:auto;
    aspect-ratio:4/3;border-radius:14px;overflow:hidden;background:var(--ab-paper-2)}
  .ab-menu.is-static .ab-card .ab-pic a{display:block;height:100%}
  .ab-menu.is-static .ab-card .ab-pic img{display:block;width:100%!important;height:100%!important;object-fit:cover;transition:transform 1.1s var(--ab-ease)}
  .ab-menu.is-static .ab-title{align-self:end;font-size:clamp(28px,2.7vw,44px)!important}
  .ab-menu.is-static .ab-desc{align-self:start}
  .ab-menu.is-static .ab-card:hover .ab-pic img{transform:scale(1.06)}
}

/* ---------- 2. Our Achievements ---------- */
.ach-years{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 clamp(24px,3vw,36px)!important;scroll-margin-top:calc(var(--bar-h,90px) + 24px)}
.ab-sub-content .ach-years a{padding:7px 14px;border-radius:999px;border:1px solid var(--ab-line);background:#fff;
  font-family:var(--ab-label);font-size:13px;letter-spacing:.06em;color:var(--ab-navy);text-decoration:none;transition:background-color .25s,color .25s,border-color .25s}
.ab-sub-content .ach-years a:hover{border-color:var(--ab-navy)}
.ab-sub-content .ach-years a.is-on{background:var(--ab-navy);border-color:var(--ab-navy);color:#fff}

.ab-sub-content .ach-items{list-style:none;padding:0;margin:0;display:block}
.ab-sub-content .ach-items > li{display:grid;grid-template-columns:clamp(120px,30%,220px) minmax(0,1fr);gap:clamp(16px,2.4vw,28px);align-items:start;
  margin:0!important;padding:clamp(18px,2.2vw,26px) 0;border-bottom:1px solid var(--ab-line)}
.ab-sub-content .ach-items > li:first-child{padding-top:0}
.ab-sub-content .ach-items > li::marker{content:none}
.ab-sub-content .ach-img{margin:0!important;border-radius:14px;overflow:hidden;background:var(--ab-paper-2)}
.ab-sub-content .ach-img img{display:block;width:100%;height:100%;object-fit:cover;border-radius:0;transition:transform 1s var(--ab-ease)}
.ab-sub-content .ach-items > li:hover .ach-img img{transform:scale(1.05)}
.ach-text > *{margin:0!important}
.ach-text > * + *{margin-top:.45em!important}
.ab-sub-content .ach-date{font-family:var(--ab-label);font-size:12.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--ab-gold)}
.ab-sub-content h2.ach-title{margin:0!important;font-size:clamp(22px,2vw,28px);line-height:1.2}
.ab-sub-content h2.ach-title::before{display:none}
.ab-sub-content .ach-title a{color:var(--ab-navy);text-decoration:none}
.ab-sub-content .ach-title a:hover{color:var(--ab-blue)}
.ab-sub-content .ach-excerpt p{margin:0;font-size:15.5px;line-height:1.7;color:var(--ab-muted)}
.ab-sub-content .ach-excerpt .wp-block-post-excerpt__more-text{display:none}
.ab-sub-content .ach-pages{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:clamp(24px,3vw,36px)!important;font-family:var(--ab-label)}
.ab-sub-content .ach-pages a,.ab-sub-content .ach-pages .page-numbers{display:inline-block;min-width:38px;padding:7px 12px;border-radius:999px;text-align:center;text-decoration:none;color:var(--ab-navy)}
.ab-sub-content .ach-pages .page-numbers.current{background:var(--ab-navy);color:#fff}
.ab-sub-content .ach-pages a:hover{background:var(--ab-paper-2)}
@media (max-width:560px){
  .ab-sub-content .ach-items > li{grid-template-columns:96px minmax(0,1fr)}
  .ab-sub-content .ach-excerpt{display:none}
}

/* ---------- 3. year cards (Awards, Scholarships) ---------- */
.ab-yearcards{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px}
.ab-yearcards > *{margin:0!important}
.ab-yearcard{position:relative;display:flex;flex-direction:column;justify-content:space-between;gap:18px;min-height:132px;padding:20px 22px;
  border-radius:16px;background:#fff;box-shadow:0 0 0 1px var(--ab-line);transition:box-shadow .3s,transform .4s var(--ab-ease)}
.ab-yearcard > *{margin:0!important}
.ab-sub-content .ab-yearcard-y{font-family:var(--ab-display);font-weight:500;font-size:clamp(24px,2vw,30px);line-height:1.05;color:var(--ab-navy)}
.ab-sub-content .ab-yearcard-dl a{display:inline-flex;align-items:center;gap:10px;font-family:var(--ab-label);font-size:13px;letter-spacing:.1em;text-transform:uppercase;text-decoration:none;color:var(--ab-blue)}
.ab-sub-content .ab-yearcard-dl a::before{content:"";width:30px;height:30px;flex:none;border-radius:50%;border:1px solid var(--ab-line);
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B4B97' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E") center/15px no-repeat}
.ab-sub-content .ab-yearcard-dl a::after{content:"";position:absolute;inset:0;border-radius:16px}
.ab-yearcard:hover{box-shadow:0 0 0 1px var(--ab-navy),0 18px 36px -24px rgba(11,34,84,.45);transform:translateY(-2px)}
.ab-yearcard:has(a:focus-visible){outline:2px solid #4A83CF;outline-offset:3px}
.ab-yearcard.is-latest{grid-column:span 2;background:var(--ab-navy);box-shadow:none}
.ab-sub-content .ab-yearcard.is-latest .ab-yearcard-y{font-size:clamp(32px,3vw,44px);color:#fff}
.ab-sub-content .ab-yearcard.is-latest .ab-yearcard-dl a{color:var(--ab-gold-soft)}
.ab-sub-content .ab-yearcard.is-latest .ab-yearcard-dl a::before{border-color:rgba(255,255,255,.3);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D9BC85' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E")}
@media (max-width:600px){
  .ab-yearcards{grid-template-columns:1fr 1fr;gap:10px}
  .ab-yearcard{min-height:112px;padding:16px 16px 14px;gap:14px}
  .ab-sub-content .ab-yearcard-y{font-size:22px}
  .ab-sub-content .ab-yearcard-dl a{font-size:11.5px;gap:8px;letter-spacing:.06em;white-space:nowrap}
}

/* ---------- 4. photo galleries in posts ---------- */
.art-content .wp-block-gallery.ywgs-gallery{gap:10px!important;margin:32px 0!important}
.art-content .wp-block-gallery.ywgs-gallery figure.wp-block-image{margin:0!important;border-radius:12px;overflow:hidden;background:#F1ECE2}
.ywgs-main .art-content .wp-block-gallery.ywgs-gallery img{border-radius:0;height:100%;object-fit:cover;transition:transform .9s cubic-bezier(.16,1,.3,1)}
.art-content .wp-block-gallery.ywgs-gallery figure.wp-block-image:hover img{transform:scale(1.04)}
@media (prefers-reduced-motion:reduce){
  .ab-menu.is-static .ab-card .ab-pic img,.ab-sub-content .ach-img img,.ab-yearcard,.art-content .ywgs-gallery img{transition:none}
}

/* ---------- 5. flipbook (Gallery block with class "ywgs-flipbook") ---------- */
/* a page with a flipbook gets the full width of the sheet; the sidebar moves below */
.ab-sub-grid:has(.ywgs-flipbook){grid-template-columns:minmax(0,1fr)}
.ab-sub-grid:has(.ywgs-flipbook) .ab-sub-side{position:static;display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:16px;align-items:start}
.ab-sub-content:has(.ywgs-flipbook),.ab-sub-sheet:has(.ywgs-flipbook) .ab-pager{max-width:none}
@media (max-width:900px){.ab-sub-grid:has(.ywgs-flipbook) .ab-sub-side{grid-template-columns:minmax(0,1fr)}}

.wp-block-gallery.ywgs-flipbook.is-enhanced{display:none!important}
.ywgs-fb{position:relative;margin:clamp(20px,3vw,32px) 0!important;border-radius:20px;overflow:hidden;outline:none;
  background:radial-gradient(120% 90% at 50% 0%,#1B3A6B 0%,var(--ab-navy,#0B2254) 55%,var(--ab-navy-deep,#061431) 100%);
  box-shadow:0 30px 60px -36px rgba(6,20,49,.55)}
.ywgs-fb:focus-visible{box-shadow:0 0 0 3px #4A83CF,0 30px 60px -36px rgba(6,20,49,.55)}
.ywgs-fb::before{content:"";position:absolute;inset:0;pointer-events:none;opacity:.08;background:url(../images/brick.webp) 0 0/360px 240px repeat;mix-blend-mode:screen}
.ywgs-fb-stage{position:relative;height:clamp(420px,min(74vh,62vw),860px)}
.ywgs-fb-stage canvas{display:block;width:100%!important;height:100%!important;touch-action:none;cursor:grab}
.ywgs-fb-loading{position:absolute;inset:0;display:grid;place-items:center;font-family:var(--ab-label,Marcellus,serif);letter-spacing:.12em;text-transform:uppercase;font-size:13px;color:#D9BC85}
.ywgs-fb-bar{position:relative;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px 16px;padding:12px clamp(12px,2vw,20px);
  border-top:1px solid rgba(255,255,255,.12);background:rgba(6,20,49,.55)}
.ywgs-fb-nav,.ywgs-fb-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ywgs-fb .ywgs-fb-btn,.ywgs-fb-jump,.ywgs-fb-zoom{min-height:38px;padding:0 14px;border-radius:999px;border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.06);color:#fff!important;
  font-family:var(--ab-label,Marcellus,serif);font-size:13.5px;letter-spacing:.04em;text-decoration:none!important;cursor:pointer;display:inline-flex;align-items:center;transition:background-color .2s,border-color .2s}
.ywgs-fb .ywgs-fb-btn:hover{background:rgba(255,255,255,.16);border-color:#D9BC85}
.ywgs-fb .ywgs-fb-btn:disabled{opacity:.35;cursor:default}
.ywgs-fb-jump{width:64px;padding:0 10px;text-align:center}
.ywgs-fb-zoom option{color:#0B2254}
.ywgs-fb-status{min-width:72px;text-align:center;font-family:var(--ab-label,Marcellus,serif);font-size:14px;letter-spacing:.06em;color:#D9BC85}
.ab-sub-content .ywgs-fb-hint,.ywgs-fb-hint{position:relative;margin:0!important;padding:0 clamp(12px,2vw,20px) 12px;background:rgba(6,20,49,.55);font-size:12.5px;line-height:1.5;color:#B9C6DC}
/* v1.12.16: the canvas no longer sizes the stage (it pushed full screen past the bottom of the screen) */
.ywgs-fb-stage{min-height:0;overflow:hidden}
.ywgs-fb-stage canvas{position:absolute;inset:0}
.ywgs-fb.is-full{border-radius:0;display:flex;flex-direction:column;height:100vh;height:100dvh;margin:0!important}
.ywgs-fb.is-full .ywgs-fb-stage{flex:1 1 0;height:auto;min-height:0}
.ywgs-fb.is-full .ywgs-fb-bar,.ywgs-fb.is-full .ywgs-fb-hint{flex:none}
/* no Fullscreen API (iPhone): the book covers the window */
html.ywgs-fb-lock,html.ywgs-fb-lock body,html.ywgs-fb-rd-lock,html.ywgs-fb-rd-lock body{overflow:hidden}
html.ywgs-fb-lock .ywgs-fb.is-full{position:fixed;inset:0;z-index:100000;height:100%}
.ywgs-fb.is-zoomed .ywgs-fb-stage canvas{cursor:move}
.ywgs-fb-zoom{display:inline-flex;align-items:center;gap:4px}
.ywgs-fb .ywgs-fb-z{width:38px;padding:0;justify-content:center;font-size:18px;line-height:1}
.ywgs-fb .ywgs-fb-zl{min-width:64px;justify-content:center;padding:0 10px}
/* Read page: one page, zoom and move */
.ywgs-fb-rd{position:fixed;inset:0;z-index:100001;display:flex;flex-direction:column;background:rgba(4,13,33,.96);outline:none}
.ywgs-fb-rd-view{position:relative;flex:1 1 0;min-height:0;overflow:hidden;display:grid;place-items:center;touch-action:none;user-select:none;-webkit-user-select:none}
.ywgs-fb-rd-view img{position:absolute;inset:0;margin:auto;max-width:calc(100% - 24px);max-height:calc(100% - 24px);width:auto;height:auto;transform-origin:50% 50%;will-change:transform;box-shadow:0 20px 50px -20px rgba(0,0,0,.7);pointer-events:none}
.ywgs-fb-rd-bar{flex:none;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px 16px;padding:12px clamp(12px,2vw,20px);border-top:1px solid rgba(255,255,255,.12);background:rgba(6,20,49,.9)}
.ywgs-fb-rd .ywgs-fb-btn{min-height:38px;padding:0 14px;border-radius:999px;border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.06);color:#fff!important;font-family:var(--ab-label,Marcellus,serif);font-size:13.5px;letter-spacing:.04em;text-decoration:none!important;cursor:pointer;display:inline-flex;align-items:center}
.ywgs-fb-rd .ywgs-fb-btn:hover{background:rgba(255,255,255,.16);border-color:#D9BC85}
.ywgs-fb-rd .ywgs-fb-btn:disabled{opacity:.35;cursor:default}
.ywgs-fb-rd .ywgs-fb-z{width:38px;padding:0;justify-content:center;font-size:18px}
@media (max-width:700px){.ywgs-fb-rd-bar{justify-content:center}}
@media (max-width:700px){
  .ywgs-fb{border-radius:14px;margin-left:calc(clamp(22px,5.4vw,88px) * -1 + 6px)!important;margin-right:calc(clamp(22px,5.4vw,88px) * -1 + 6px)!important}
  .ywgs-fb-stage{height:min(76vh,128vw)}
  .ywgs-fb-bar{justify-content:center}
  .ywgs-fb-hint{display:none}
}

/* newsletter issue heading + download */
.ywgs-nl-issue > *{margin:0!important}
.ywgs-nl-issue > * + *{margin-top:14px!important}
.ywgs-nl-issue + .ywgs-nl-issue{margin-top:clamp(48px,6vw,80px)!important;padding-top:clamp(32px,4vw,48px);border-top:1px solid var(--ab-line)}
.ab-sub-content .ywgs-nl-eyebrow{font-family:var(--ab-label);font-size:12.5px;letter-spacing:.2em;text-transform:uppercase;color:var(--ab-gold)}
.ab-sub-content h2.ywgs-nl-title{margin-top:6px!important}
.ab-sub-content h2.ywgs-nl-title::before{display:none}

/* ---------- 6. header (desktop): one-line motto, links + search + button on one row,
   slim one-row header after scrolling down (header.js adds .is-compact) ---------- */
@media (min-width:1081px){
  .bar-right{flex-direction:row;align-items:center;gap:22px}
  .actions-top{gap:12px}
  .brand small{white-space:nowrap}
  .site-header.is-compact .brand span,.site-header.is-compact .util{display:none}
  .site-header.is-compact .brand img{width:34px}
  .site-header.is-compact .bar-in{padding-top:6px;padding-bottom:6px;animation:ywgs-bar-in .35s cubic-bezier(.2,.7,.2,1)}
  .site-header.is-compact .support{min-height:40px;padding:0 18px}
}
/* one slim row when the menu fits next to the crest and the button; header.js adds .nav-2row
   when it does not (long labels, narrower windows) and the slim header keeps the menu on its own row */
@media (min-width:1240px){
  .site-header.is-compact:not(.nav-2row) .bar-in{grid-template-columns:auto 1fr auto;column-gap:16px}
  .site-header.is-compact:not(.nav-2row) .mainnav{grid-row:1;grid-column:2;border-top:0;margin:0;padding:0}
  .site-header.is-compact:not(.nav-2row) .mainnav-list{gap:0 clamp(12px,1.4vw,30px)}
  .site-header.is-compact:not(.nav-2row) .mainnav-list > li > a{padding:13px 2px 12px}
}
@keyframes ywgs-bar-in{from{opacity:.4;transform:translateY(-6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.site-header.is-compact .bar-in{animation:none}}
/* v1.11.0: seven menu items — the slim row uses the tighter type up to 1599px so it still fits on one line */
@media (min-width:1240px) and (max-width:1599px){
  .site-header.is-compact:not(.nav-2row) .mainnav-list{gap:0 clamp(10px,1vw,16px)}
  .site-header.is-compact:not(.nav-2row) .mainnav-list > li > a{font-size:14.5px;letter-spacing:.025em}
  .site-header.is-compact:not(.nav-2row) .mainnav-list > li > .sub-toggle{width:22px}
}
