/* Which layout shows where */
.sps-phone-header, .sps-phone-footer, .sps-phone-home { display: none; }
@media (max-width: 899px) {
  html, body { overflow-x: clip; } /* clip (not hidden): no sideways scrolling, and the phone header and section bar can still stick */
  .sps-phone-header { display: block; position: relative; z-index: 60; } /* scrolls away on phones (180 px is too tall to keep); the section bar sticks at the top instead */
  .sps-phone-footer { display: block; }
  #sps-page [data-part="Header"], #sps-page [data-part="Footer"] { display: none !important; }
  body.home #sps-page { display: none; }
  body.home .sps-phone-home { display: block; }
  /* page banners: shorter on phones so the content is reached sooner */
  #sps-page main section[style*="height: 680px"]:not([data-sps-pic]) { height: 420px !important; } /* picture banners size to their image */
  #sps-page img { max-width: 100%; }
}
/* Phone menu */
.sps-drawer { position: fixed; inset: 0; z-index: 100; background: #243b6b; color: #F3E6C8; overflow-y: auto; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; padding-bottom: 40px; }
.sps-drawer[hidden] { display: none; }
.sps-drawer-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 4px solid #A9C7E8; font-weight: 800; color: #FFFFFF; }
.sps-drawer-top button { width: 48px; height: 48px; border-radius: 999px; border: 0; background: rgba(255,255,255,.12); color: #FFFFFF; font-size: 28px; line-height: 1; cursor: pointer; }
.sps-drawer-quick { display: grid; gap: 8px; padding: 16px; }
.sps-drawer-quick a { display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 12px; background: #A9C7E8; color: #292929; font-weight: 800; text-decoration: none; }
.sps-drawer-sections details { border-top: 1px solid rgba(255,255,255,.14); }
.sps-drawer-sections summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 20px; font-size: 17px; font-weight: 800; color: #FFFFFF; cursor: pointer; }
.sps-drawer-sections summary::-webkit-details-marker { display: none; }
.sps-drawer-sections summary::after { content: '▾'; color: #A9C7E8; }
.sps-drawer-sections details[open] summary::after { content: '▴'; }
.sps-drawer-sections a { display: flex; align-items: center; min-height: 46px; padding: 0 20px 0 32px; color: #E8C98E; font-weight: 600; text-decoration: none; }
.sps-drawer-sections a.sps-go { color: #FFFFFF; font-weight: 800; }
.sps-drawer-sections a[aria-current="page"] { color: #FFFFFF; text-decoration: underline; text-decoration-color: #A9C7E8; text-decoration-thickness: 3px; text-underline-offset: 6px; }
@media (min-width: 900px) { .sps-drawer { display: none !important; } }
.sps-phone-header, .sps-phone-home, .sps-phone-footer { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: #292929; background: #F6F8FC; }

/* Home page notice list: one copy rises from the bottom of the box and leaves at the top, in a loop (any number of notices) */
@media (prefers-reduced-motion: no-preference) {
  #sps-page .nb-track { animation-name: sps-nb-rise !important; }
  #sps-page .nb-track > ul[aria-hidden="true"] { display: none; }
  @keyframes sps-nb-rise { from { transform: translateY(272px); } to { transform: translateY(-100%); } }
}
/* pause the notice list while the mouse is over it or a notice link has keyboard focus */
#sps-page .nb-view:hover .nb-track, #sps-page .nb-view:focus-within .nb-track { animation-play-state: paused !important; }
/* Picture banner: the whole designed image, uncropped, with the page title in a band just below */
#sps-page section[data-sps-pic] { height: auto !important; background: #243b6b !important; }
#sps-page section[data-sps-pic] > img { position: static !important; display: block; width: 100% !important; height: auto !important; aspect-ratio: 2 / 1; object-fit: cover; }
#sps-page section[data-sps-pic] > div { position: static !important; display: block !important; }
#sps-page section[data-sps-pic] > div > div { padding: 18px 32px 20px !important; }
#sps-page section[data-sps-pic] > div > div > div { background: transparent !important; text-shadow: none !important; max-width: 900px !important; padding: 0 !important; }
@media (max-width: 899px) { #sps-page section[data-sps-pic] { height: auto !important; } #sps-page section[data-sps-pic] h1 { font-size: 28px !important; } }
/* Menu panels: never wider than the page content (1280 px), centred, so they do not stretch on large screens (e.g. 2560 × 1440) */
[data-part="Header"] .sps-panel [role="region"][data-hk] { left: max(72px, calc((100% - 1280px) / 2)) !important; right: max(72px, calc((100% - 1280px) / 2)) !important; }

/* "In this section" bar: white with a gold line on top, so it stands apart from the burgundy menu when it sticks under it */
#sps-page nav[aria-label^="In this section"] { top: var(--sps-hdr, 0px) !important; background: #FFFFFF !important; border-top: 3px solid #A9C7E8 !important; border-bottom: 1px solid #E4DED3 !important; box-shadow: 0 6px 16px rgba(41, 41, 41, 0.08) !important; }
#sps-page nav[aria-label^="In this section"] > div > span { color: #66605A !important; border-right-color: #E4DED3 !important; }
#sps-page nav[aria-label^="In this section"] .sec-tabs a { color: #243b6b !important; border-bottom: 4px solid transparent !important; }
#sps-page nav[aria-label^="In this section"] .sec-tabs a:hover, #sps-page nav[aria-label^="In this section"] .sec-tabs a:focus-visible { background: #E9EEF8; }
#sps-page nav[aria-label^="In this section"] .sec-tabs a[aria-current="page"] { color: #15254A !important; font-weight: 800 !important; border-bottom-color: #243b6b !important; }
/* Occasion logo card: opens gently (fade and slight slide) on mouse-over or click */
[data-part="Header"] [data-sps-card] { opacity: 0; transform: translateY(-6px); transition: opacity .25s ease, transform .25s ease; }
[data-part="Header"] [data-sps-card].sps-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-part="Header"] [data-sps-card] { transition: none; } }
/* Picture banners never keep an empty burgundy block: the section shrinks to the image (plus its title band, when the page has one) */
#sps-page section[data-sps-pic] { min-height: 0 !important; }
#sps-page section[data-sps-pic] > div:not(:has(h1, h2, p)) { display: none !important; }

/* phones: the occasion logo in the crest row (no place-name beside the crest), its info card opening below the whole bar */
@media (max-width: 899px) {
  .sps-ph-logo { flex: 1; display: flex; justify-content: center; min-width: 0; }
  .sps-ph-logo [data-sps-plogo] { padding: 0 !important; gap: 1px !important; }
  .sps-ph-logo [data-sps-plogo] img { height: 74px !important; width: auto !important; max-width: 230px !important; }
  .sps-ph-logo [data-sps-plogo] > span { display: none !important; }   /* no caption: tapping the logo opens its information box */
  .sps-ph-logo [data-sps-pcard] { position: absolute !important; left: 12px; right: 12px; top: calc(100% + 4px); z-index: 70; width: auto !important; margin: 0 !important; }
  .sps-phone-video { background: #EDE6DA; }
}

/* the scrolling announcement bar: dark on every screen (computer and phone); the gold tag only on IMPORTANT notices */
section:has(.tk-view) { background: var(--sps-bar, #48001C) !important; border-color: var(--sps-bar, #48001C) !important; font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
section:has(.tk-view) .tk-li, section:has(.tk-view) .tk-li a, section:has(.tk-view) .tk-li span { color: #FFFFFF !important; }
section:has(.tk-view) .tk-li > span[style*="text-transform: uppercase"] { background: var(--sps-bar-tag, #A9C7E8) !important; color: var(--sps-bar, #48001C) !important; border-radius: 4px; padding: 2px 7px; }
/* the bar at the very top: on computers a copy is the first row of the sticky header (the original strip is hidden once the copy is in place);
   on phones the bar itself is moved above the crest bar */
.sps-topbar { position: relative !important; top: auto !important; margin: 0 !important; }
body.sps-bar-top #sps-page section:has(.tk-view):not(.sps-topbar) { display: none !important; }
@media (min-width: 900px) { .sps-phone-topbar { display: none !important; } }
@media (max-width: 899px) { .sps-topbar { display: none !important; } }

/* Main menu panels (computers): a narrower title column, the page links beside it, and the panel only as wide as its contents */
@media (min-width: 900px) {
[data-part="Header"] div[style*="position: absolute; left: 72px; right: 72px"] { right: auto !important; width: max-content !important; max-width: calc(100% - 144px) !important; }
[data-part="Header"] div[style*="position: absolute; left: 72px; right: 72px"] > div[style*="max-width: 1280px"] { max-width: none !important; gap: 26px !important; padding: 26px 56px 28px 28px !important; }
[data-part="Header"] div[style*="position: absolute; left: 72px; right: 72px"] > div > figure { flex: 0 0 220px !important; }
[data-part="Header"] div[style*="position: absolute; left: 72px; right: 72px"] > div > div[style*="flex: 1 1 240px"] { flex: 0 0 240px !important; gap: 10px !important; }
[data-part="Header"] div[style*="position: absolute; left: 72px; right: 72px"] > div > ul { flex: 0 0 auto !important; grid-template-columns: repeat(2, 250px) !important; }
}

/* bigger crest and occasion logo (the logos' empty margins are trimmed by the plugin, so the drawing fills this space) */
@media (min-width: 900px) {
  #sps-page [data-part="Header"] img[alt$="crest"] { height: 104px !important; width: auto !important; }   /* 140px before 1.7.1 */
  #sps-page [data-part="Header"] button[data-dc-click="toggleDoodle"] img { height: 96px !important; width: auto !important; max-width: 300px !important; }   /* 124px before 1.7.1: a less tall crest band */
}
@media (max-width: 899px) {
  .sps-phone-header a img[alt$="crest"] { height: 72px !important; width: auto !important; }
}

/* see-through main menu (computers): the menu is a floating rounded box like the banner's text box — the theme's dark shade
   at 45% with a blur — and the page banner runs up under it. "Solid (original)" in Colour themes removes body.sps-glass. */
@media (min-width: 900px) {
  body.sps-glass .sps-navbar { background: transparent !important; border-bottom-color: transparent !important; }
  body.sps-glass .sps-navbar nav[aria-label="Main"] { background: rgba(var(--sps-navd-rgb, 94, 0, 38), .45); -webkit-backdrop-filter: blur(10px) saturate(1.1); backdrop-filter: blur(10px) saturate(1.1); border-radius: 16px; max-width: 1180px; margin-left: auto; margin-right: auto; padding-left: 18px; padding-right: 18px; }
  body.sps-glass .sps-navbar nav[aria-label="Main"] a, body.sps-glass .sps-navbar nav[aria-label="Main"] button { text-shadow: 0 1px 3px rgba(0, 0, 0, .55), 0 0 1px rgba(0, 0, 0, .6); }
}
/* the same, from the very first moment: the menu bar is recognised by its place in the page (the strip holding the Main menu),
   not by the script's mark, so it never shows solid first. Separate rules, so browsers without :has() still use the mark above. */
@media (min-width: 900px) {
  body.sps-glass #sps-page [data-part="Header"] div:has(> div > nav[aria-label="Main"]) { background: transparent !important; border-bottom-color: transparent !important; }
}
@media (min-width: 900px) {
  body.sps-glass #sps-page [data-part="Header"] nav[aria-label="Main"] { background: rgba(var(--sps-navd-rgb, 94, 0, 38), .45); -webkit-backdrop-filter: blur(10px) saturate(1.1); backdrop-filter: blur(10px) saturate(1.1); border-radius: 16px; max-width: 1180px; margin-left: auto; margin-right: auto; padding-left: 18px; padding-right: 18px; }
  body.sps-glass #sps-page [data-part="Header"] nav[aria-label="Main"] a, body.sps-glass #sps-page [data-part="Header"] nav[aria-label="Main"] button { text-shadow: 0 1px 3px rgba(0, 0, 0, .55), 0 0 1px rgba(0, 0, 0, .6); }
}

/* see-through menu: the page area moves up under the menu bar (a page-wide value, so redrawing part of a page never makes the banner jump) */
@media (min-width: 900px) {
  body.sps-glass #sps-page main { margin-top: var(--sps-glass-up, -52px); }   /* 52px from the first moment (measured at every width); the script only corrects it */
  body.sps-glass.sps-pg-gallery #sps-page main > section:first-of-type img { margin-top: var(--sps-glass-bar, 52px); height: calc(100% - var(--sps-glass-bar, 52px)); }
}

/* home page: the scrolling bar's row at the top of the header is reserved from the first moment, and the original bar is hidden
   straight away, so moving the bar to the top shifts nothing (the bar is 31px tall at every width) */
@media (min-width: 900px) {
  body.home:not(.sps-bar-top):has(#sps-page main .tk-view) #sps-page [data-part="Header"] { padding-top: 31px; }   /* only when there is a scrolling bar: no announcements, no empty band */
  body.home #sps-page main section:has(.tk-view):not(.sps-topbar) { display: none !important; }
}

/* menu panels: the lift's shadow is a little deeper on the burgundy panel */
@media (hover: hover) { #sps-page .sps-panel .fx-lift:hover, #sps-page .sps-panel .fx-lift:focus-visible { box-shadow: 0 10px 22px rgba(0, 0, 0, .35) !important; } }

/* Accolades cards act as one link: the hand pointer over the whole card */
article.sps-cardlink { cursor: pointer; }

/* School name when no occasion logo is scheduled — Gloock (SIL OFL 1.1, assets/fonts/OFL-Gloock.txt), trimmed to these letters */
@font-face { font-family: 'SPS Gloock'; src: url('https://spsrohini.com/wp-content/themes/sps-rohini/assets/fonts/gloock-sps.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
.sps-wm { display: flex; flex-direction: column; align-items: center; line-height: .98; text-decoration: none; }
.sps-wm-1, .sps-wm-2 { font-family: 'SPS Gloock', Georgia, 'Times New Roman', serif; font-weight: 400; letter-spacing: .005em; color: #1A3A9E;
  background: linear-gradient(180deg, #2B54C4 0%, #1A3A9E 55%, #0E2A7D 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sps-wm-1 { font-size: 46px; }
.sps-wm-2 { font-size: 33px; margin-top: 2px; }
.sps-wm-3 { font-size: 13px; color: #66605A; margin-top: 6px; letter-spacing: .02em; font-family: inherit; }
.sps-wm-ph { justify-content: center; }
.sps-wm-ph .sps-wm-1 { font-size: 30px; }
.sps-wm-ph .sps-wm-2 { font-size: 21px; margin-top: 1px; }
@media (forced-colors: active) { .sps-wm-1, .sps-wm-2 { background: none; -webkit-text-fill-color: CanvasText; color: CanvasText; } }

/* a less tall crest band (computer): smaller crest, occasion logo and school name; quick-link labels on one line */
@media (min-width: 900px) {
  #sps-page [data-part="Header"] .sps-wm-1 { font-size: 36px; }
  #sps-page [data-part="Header"] .sps-wm-2 { font-size: 26px; }
  #sps-page [data-part="Header"] .sps-wm-3 { font-size: 12px; margin-top: 4px; }
  #sps-page [data-part="Header"] a > span:last-child { white-space: nowrap; }
  #sps-page [data-part="Header"] nav:has(a[href*="tc"]) , #sps-page [data-part="Header"] nav[style*="justify-content: flex-end"] { gap: 14px !important; }
  #sps-page [data-part="Header"] nav[style*="justify-content: flex-end"] > a { width: auto !important; min-width: 64px; padding-left: 2px !important; padding-right: 2px !important; }   /* each round button as wide as its one-line label */
  #sps-page [data-part="Header"] > div > div[style*="min-height: 156px"], #sps-page [data-part="Header"] div[style*="min-height: 156px"] { min-height: 0 !important; padding-top: 8px !important; padding-bottom: 8px !important; }   /* the band takes the height of its contents */
}
