/* SGS Site Features: front end. Colours follow the school site (crimson, gold, blue). */
.sgs-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Ticker */
.sgs-ticker { display: flex; align-items: stretch; background: var(--sgs-tk-bg, #1c3f94); color: var(--sgs-tk-fg, #fff); font: 600 15px/1.3 Arial, Helvetica, sans-serif; overflow: hidden; position: relative; z-index: 50; }
.sgs-ticker-label { flex: none; display: flex; align-items: center; padding: 0 14px; background: #8b0d10; color: #fff; font-weight: 700; }
.sgs-ticker-viewport { flex: 1; overflow: hidden; min-width: 0; }
.sgs-ticker-track { display: flex; width: max-content; margin: 0; padding: 0; list-style: none; animation: sgs-scroll var(--sgs-tk-dur, 40s) linear infinite; }
.sgs-ticker-track li { padding: 9px 0; white-space: nowrap; margin: 0; }
.sgs-ticker-track li::after { content: "\25C6"; margin: 0 22px; color: #e8b923; font-size: 11px; vertical-align: 2px; }
.sgs-ticker a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.5); }
.sgs-ticker a:hover { text-decoration-color: currentColor; }
.sgs-ticker:hover .sgs-ticker-track, .sgs-ticker:focus-within .sgs-ticker-track, .sgs-ticker.is-paused .sgs-ticker-track { animation-play-state: paused; }
.sgs-ticker-pause { flex: none; width: 40px; border: 0; background: rgba(0,0,0,.18); color: inherit; cursor: pointer; position: relative; }
.sgs-ticker-pause::before, .sgs-ticker-pause::after { content: ""; position: absolute; top: 50%; width: 3px; height: 12px; margin-top: -6px; background: currentColor; }
.sgs-ticker-pause::before { left: 15px; } .sgs-ticker-pause::after { left: 21px; }
.sgs-ticker.is-paused .sgs-ticker-pause::before { left: 16px; width: 0; height: 0; margin-top: -6px; background: none; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.sgs-ticker.is-paused .sgs-ticker-pause::after { display: none; }
@keyframes sgs-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Notice board */
.sgs-notices { list-style: none; margin: 0 0 1em; padding: 0; border-top: 2px solid #8b0d10; }
.sgs-notices li { display: flex; align-items: center; gap: 16px; padding: 12px 4px; border-bottom: 1px solid #e2e0da; margin: 0; }
.sgs-notices time { flex: none; width: 64px; text-align: center; border: 1px solid #e2e0da; border-top: 4px solid #e8b923; background: #fff; padding: 4px 0; line-height: 1.1; }
.sgs-notices time .d { display: block; font: 700 22px/1.1 Arial, sans-serif; color: #8b0d10; }
.sgs-notices time .m { display: block; font-size: 11px; color: #555; }
.sgs-notices a { font-weight: 600; text-decoration: none; }
.sgs-notices a:hover { text-decoration: underline; }
.sgs-new { flex: none; background: #8b0d10; color: #fff; font: 700 11px/1 Arial, sans-serif; padding: 4px 7px; border-radius: 3px; }
.sgs-notices-all { font-weight: 600; }

/* Slide show */
.sgs-slider { position: relative; width: 100%; aspect-ratio: var(--sgs-shape, 16/7); background: #2b2f33; overflow: hidden; margin: 0 0 1.5em; }
.sgs-slides, .sgs-slide { position: absolute; inset: 0; }
.sgs-slide { opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility 0s .7s; }
.sgs-slide.is-active { opacity: 1; visibility: visible; transition: opacity .7s ease; }
.sgs-slide img, .sgs-slide-link { display: block; width: 100%; height: 100%; }
.sgs-slide img { object-fit: cover; max-width: none; }
.sgs-fit-contain .sgs-slide img { object-fit: contain; }
.sgs-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 6% 44px; color: #fff; text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.sgs-cap p { margin: 0 auto; max-width: 46em; }
.sgs-cap-title { font: 700 clamp(18px, 3vw, 32px)/1.2 Arial, Helvetica, sans-serif; text-shadow: 0 2px 6px rgba(0,0,0,.5); }
.sgs-cap-text { margin-top: 6px !important; font-size: clamp(14px, 1.6vw, 18px); }
.sgs-btn { display: inline-block; margin-top: 12px; padding: 10px 20px; background: #e8b923; color: #1c1c1c !important; font: 700 15px/1.2 Arial, sans-serif; text-decoration: none !important; border-radius: 3px; }
.sgs-btn:hover { background: #fff; }
.sgs-prev, .sgs-next { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.4); cursor: pointer; z-index: 2; }
.sgs-prev { left: 12px; } .sgs-next { right: 12px; }
.sgs-prev::after, .sgs-next::after { content: ""; position: absolute; top: 50%; left: 50%; width: 11px; height: 11px; border: solid #fff; border-width: 0 3px 3px 0; }
.sgs-prev::after { transform: translate(-30%, -50%) rotate(135deg); }
.sgs-next::after { transform: translate(-70%, -50%) rotate(-45deg); }
.sgs-prev:hover, .sgs-next:hover { background: #8b0d10; }
.sgs-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 4px; z-index: 2; }
.sgs-dots button { width: 22px; height: 22px; border: 0; background: none; cursor: pointer; position: relative; padding: 0; }
.sgs-dots button::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: rgba(255,255,255,.55); }
.sgs-dots button[aria-current]::after { background: #e8b923; inset: 5px; }
.sgs-slider-pause { position: absolute; right: 10px; bottom: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(0,0,0,.4); cursor: pointer; z-index: 3; }
.sgs-slider-pause::before, .sgs-slider-pause::after { content: ""; position: absolute; top: 9px; width: 3px; height: 12px; background: #fff; }
.sgs-slider-pause::before { left: 11px; } .sgs-slider-pause::after { left: 16px; }
.sgs-slider-pause[aria-pressed="true"]::before { left: 12px; width: 0; height: 0; background: none; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.sgs-slider-pause[aria-pressed="true"]::after { display: none; }
.sgs-slider button:focus-visible, .sgs-card-turn:focus-visible + .sgs-card-inner, .sgs-popup button:focus-visible { outline: 3px solid #e8b923; outline-offset: 2px; }

/* Flash cards */
.sgs-cards { display: grid; grid-template-columns: repeat(var(--sgs-cols, 3), minmax(0, 1fr)); gap: 20px; margin: 0 0 1.5em; }
.sgs-card { position: relative; perspective: 1200px; min-height: 260px; }
.sgs-card-turn { position: absolute; inset: 0; z-index: 2; width: 100%; border: 0; background: transparent; cursor: pointer; padding: 0; }
.sgs-card-inner { position: relative; height: 100%; min-height: 260px; transition: transform .6s ease; transform-style: preserve-3d; }
.sgs-card.is-flipped .sgs-card-inner { transform: rotateY(180deg); }
.sgs-flip-hover .sgs-card:hover .sgs-card-inner { transform: rotateY(180deg); }
.sgs-card-front, .sgs-card-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.sgs-card-front { background: var(--sgs-card, #8b0d10); color: #fff; border-bottom: 5px solid #e8b923; }
.sgs-card-front img { width: 100%; flex: 1; min-height: 0; object-fit: cover; display: block; max-width: none; }
.sgs-card-title { margin: 0; padding: 14px 16px; font: 700 18px/1.25 Arial, Helvetica, sans-serif; position: relative; }
.sgs-card-front:not(:has(img)) { justify-content: center; text-align: center; }
.sgs-card-front:not(:has(img)) .sgs-card-title { font-size: 22px; padding: 24px; }
.sgs-card-title { padding-right: 44px; }
.sgs-card-front:not(:has(img)) .sgs-card-title { padding: 24px 44px; }
.sgs-card-front::after { content: ""; position: absolute; right: 14px; bottom: 16px; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.7); border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.8) 2px, transparent 3px); }
.sgs-card-back { transform: rotateY(180deg); background: #fff; color: #1f2328; border: 1px solid #e2e0da; border-top: 5px solid var(--sgs-card, #8b0d10); padding: 18px; justify-content: space-between; }
.sgs-card-text { overflow-y: auto; font-size: 15px; line-height: 1.55; }
.sgs-card-text p { margin: 0 0 .6em; }
.sgs-card-link { position: relative; z-index: 3; align-self: flex-start; margin-top: 10px; font-weight: 700; pointer-events: none; }
.sgs-card.is-flipped .sgs-card-link, .sgs-flip-hover .sgs-card:hover .sgs-card-link { pointer-events: auto; }
@media (max-width: 900px) { .sgs-cards { grid-template-columns: repeat(min(var(--sgs-cols, 3), 2), minmax(0, 1fr)); } }
@media (max-width: 520px) { .sgs-cards { grid-template-columns: 1fr; } }

/* Pop-up flier */
.sgs-popup { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; padding: 16px; background: rgba(20, 10, 10, .72); }
.sgs-popup[hidden] { display: none; }
.sgs-popup-box { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-top: 5px solid #e8b923; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,.4); outline: none; }
.sgs-popup-img { display: block; width: 100%; height: auto; max-width: none; max-height: 68vh; object-fit: contain; background: #f3f3f1; }
.sgs-popup-body { padding: 20px 24px 24px; color: #1f2328; font: 400 16px/1.55 Arial, Helvetica, sans-serif; }
.sgs-popup-title { margin: 0 0 8px; font: 700 22px/1.25 Arial, Helvetica, sans-serif; color: #8b0d10; }
.sgs-popup-body .sgs-btn { background: #8b0d10; color: #fff !important; }
.sgs-popup-body .sgs-btn:hover { background: #6a080b; }
.sgs-popup-close { position: sticky; float: right; top: 8px; margin: 8px 8px -48px 0; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font: 400 28px/1 Arial, sans-serif; cursor: pointer; z-index: 2; }
.sgs-popup-close:hover { background: #8b0d10; }

@media (prefers-reduced-motion: reduce) {
  .sgs-ticker-track { animation: none; flex-wrap: wrap; width: auto; }
  .sgs-slide, .sgs-card-inner { transition: none; }
  .sgs-card-back { transform: none; visibility: hidden; }
  .sgs-card.is-flipped .sgs-card-inner { transform: none; }
  .sgs-card.is-flipped .sgs-card-back { visibility: visible; }
  .sgs-card.is-flipped .sgs-card-front { visibility: hidden; }
}

/* Class resources */
.sgs-res { margin: 0 0 2em; }
.sgs-res-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 3px solid #8b0d10; }
.sgs-res-tabs [role=tab] { flex: none; display: flex; align-items: center; gap: 8px; padding: 11px 16px; border: 1px solid #e2e0da; border-bottom: 0; border-radius: 4px 4px 0 0; background: #f3f3f1; color: #1f2328; font: 700 15px/1.2 Arial, Helvetica, sans-serif; cursor: pointer; }
.sgs-res-tabs [role=tab]:hover { background: #fff; color: #8b0d10; }
.sgs-res-tabs [role=tab][aria-selected=true] { background: #8b0d10; border-color: #8b0d10; color: #fff; }
.sgs-res-tabs [role=tab]:focus-visible { outline: 3px solid #e8b923; outline-offset: -3px; }
.sgs-res-count { min-width: 22px; padding: 2px 6px; border-radius: 10px; background: rgba(0,0,0,.08); font-size: 12px; text-align: center; }
[aria-selected=true] .sgs-res-count { background: #e8b923; color: #1c1c1c; }
.sgs-res-panel { padding: 18px 2px 4px; }
.sgs-res-panel:focus-visible { outline: 2px solid #e8b923; }
.sgs-res-intro { margin: 0 0 12px; color: #444; }
.sgs-res-empty { color: #666; font-style: italic; }
.sgs-res-list { list-style: none; margin: 0; padding: 0; }
.sgs-res-item { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid #e2e0da; margin: 0; }
.sgs-res-type { flex: none; width: 44px; padding: 7px 0; text-align: center; border-radius: 3px; font: 700 11px/1 Arial, sans-serif; color: #fff; background: #5b6570; }
.sgs-type-pdf { background: #b3261e; } .sgs-type-doc { background: #1c5aa8; } .sgs-type-xls { background: #1e7a3c; }
.sgs-type-ppt { background: #c2541b; } .sgs-type-img { background: #6a4c93; } .sgs-type-link { background: #1c3f94; }
.sgs-res-main { flex: 1; min-width: 0; }
.sgs-res-main a { font-weight: 700; text-decoration: none; }
.sgs-res-main a:hover { text-decoration: underline; }
.sgs-res-meta { display: block; font-size: 13px; color: #666; margin-top: 2px; }
.sgs-res-action { flex: none; padding: 6px 12px; border: 1px solid #8b0d10; border-radius: 3px; color: #8b0d10; font: 700 13px/1.2 Arial, sans-serif; text-decoration: none; }
.sgs-res-action:hover { background: #8b0d10; color: #fff; }
@media (max-width: 600px) { .sgs-res-action { display: none; } }
.sgs-res-index { list-style: none; margin: 0 0 2em; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.sgs-res-index a { display: block; height: 100%; padding: 18px 18px 16px; background: #fff; border: 1px solid #e2e0da; border-top: 5px solid #8b0d10; text-decoration: none; color: #1f2328; }
.sgs-res-index a:hover { border-top-color: #e8b923; }
.sgs-res-index-title { display: block; font: 700 20px/1.2 Arial, Helvetica, sans-serif; color: #8b0d10; margin-bottom: 6px; }
.sgs-res-index-tabs { display: block; font-size: 13px; color: #555; line-height: 1.5; }

/* Page Designer output */
.sgs-design { overflow-x: clip; }
.sgs-sec { position: relative; background-size: cover; background-position: center; margin: 0; }
.sgs-sec-full { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); padding-left: max(16px, calc(50vw - 600px)); padding-right: max(16px, calc(50vw - 600px)); }
.sgs-sec:not(.sgs-sec-full) { padding-left: 16px; padding-right: 16px; }
.sgs-sec-overlay { position: absolute; inset: 0; background: #000; pointer-events: none; }
.sgs-sec-grid { position: relative; display: grid; }
.sgs-va-center { align-items: center; } .sgs-va-end { align-items: end; } .sgs-va-start { align-items: start; }
.sgs-col { min-width: 0; }
.sgs-col > .sgs-blk + .sgs-blk { margin-top: 16px; }
.sgs-blk { box-sizing: border-box; }
.sgs-h { margin: 0; color: inherit; font-family: inherit; line-height: 1.2; }
h1.sgs-h { font-size: clamp(28px, 4.4vw, 46px); } h2.sgs-h { font-size: clamp(24px, 3.4vw, 34px); }
h3.sgs-h { font-size: clamp(20px, 2.4vw, 25px); } h4.sgs-h { font-size: 19px; }
.sgs-blk[style*="font-size"] .sgs-h { font-size: inherit; }
.sgs-text > :first-child { margin-top: 0; } .sgs-text > :last-child { margin-bottom: 0; }
.sgs-text a { color: inherit; text-decoration: underline; }
.sgs-img { margin: 0 auto; overflow: hidden; }
.sgs-img img { display: block; width: 100%; height: auto; transition: transform .5s ease; }
.sgs-shape-rounded img { border-radius: 14px; }
.sgs-shape-circle img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; }
.sgs-hover-zoom:hover img { transform: scale(1.06); }
.sgs-hover-lift img { transition: transform .3s ease, box-shadow .3s ease; }
.sgs-hover-lift:hover img { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(0,0,0,.2); }
.sgs-img figcaption { margin-top: 8px; font-size: .9em; opacity: .8; text-align: center; }
.sgs-video { position: relative; width: 100%; }
.sgs-yt { aspect-ratio: 16/9; }
.sgs-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sgs-video video { display: block; width: 100%; height: auto; }
.sgs-audio audio { width: 100%; }
.sgs-audio-title { margin: 0 0 6px; font-weight: 700; }
.sgs-dbtn { display: inline-block; padding: 12px 24px; background: #8b0d10; color: #fff !important; font-weight: 700; text-decoration: none !important; border-radius: 4px; transition: background .2s ease, transform .2s ease; }
.sgs-dbtn:hover { background: #6a080b; transform: translateY(-2px); }
.sgs-blk[style*="background-color"] > .sgs-dbtn { background: transparent; }
.sgs-dbtn-full { display: block; text-align: center; }
.sgs-spacer { width: 100%; }
.sgs-divider { margin: 8px auto; border: 0; }
.sgs-cards-single { grid-template-columns: 1fr !important; margin: 0; }

/* Scroll animations (only when JavaScript is running) */
.sgs-js [data-sgs-anim] { opacity: 0; transition: opacity var(--sgs-dur, .8s) ease var(--sgs-delay, 0s), transform var(--sgs-dur, .8s) cubic-bezier(.2,.7,.2,1) var(--sgs-delay, 0s); }
.sgs-js [data-sgs-anim="up"] { transform: translateY(40px); }
.sgs-js [data-sgs-anim="down"] { transform: translateY(-40px); }
.sgs-js [data-sgs-anim="left"] { transform: translateX(-60px); }
.sgs-js [data-sgs-anim="right"] { transform: translateX(60px); }
.sgs-js [data-sgs-anim="zoom"] { transform: scale(.85); }
.sgs-js [data-sgs-anim="flip"] { transform: perspective(800px) rotateX(35deg); transform-origin: top; }
.sgs-js [data-sgs-anim].is-in { opacity: 1; transform: none; }

/* Background music button */
.sgs-music-btn { position: fixed; left: 16px; bottom: 16px; z-index: 9990; display: flex; align-items: center; gap: 8px; padding: 9px 14px 9px 12px; border: 2px solid #e8b923; border-radius: 30px; background: #8b0d10; color: #fff; font: 700 14px/1 Arial, Helvetica, sans-serif; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.sgs-music-btn:hover { background: #6a080b; }
.sgs-music-btn:focus-visible { outline: 3px solid #1c3f94; outline-offset: 2px; }
.sgs-music-icon { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.sgs-music-icon i { display: block; width: 3px; height: 4px; background: #e8b923; border-radius: 1px; }
.sgs-music-btn[aria-pressed="true"] .sgs-music-icon i { animation: sgs-eq 1s ease-in-out infinite; }
.sgs-music-btn[aria-pressed="true"] .sgs-music-icon i:nth-child(2) { animation-delay: .2s; }
.sgs-music-btn[aria-pressed="true"] .sgs-music-icon i:nth-child(3) { animation-delay: .4s; }
@keyframes sgs-eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

@media (max-width: 782px) {
  .sgs-sec-grid { grid-template-columns: 1fr !important; }
  .sgs-sec { padding-top: min(var(--sgs-pad-m, 32px), 40px); }
}
@media (prefers-reduced-motion: reduce) {
  .sgs-js [data-sgs-anim] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .sgs-music-btn .sgs-music-icon i { animation: none !important; }
}

/* Flashing cards: a soft glow on the card that is turning */
.sgs-flip-auto .sgs-card.is-flipped .sgs-card-back { box-shadow: 0 0 0 3px #e8b923, 0 10px 26px rgba(0,0,0,.18); }
