.responsive-section-background {
  display: none;
}

.stationery-page .cloud-floating-poster {
  top: 40%;
  left: 12px;
}

.cloud-floating-poster,
.stationery-page .floating-poster {
  position: fixed;
  z-index: 1300;
  top: 40%;
  width: var(--poster-width, 150px);
  max-width: min(36vw, 240px);
  padding: 7px;
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 18px;
  background: linear-gradient(145deg,#fff,#edf3fb);
  box-shadow: 0 0 0 2px rgba(242,185,47,.9), 0 14px 36px rgba(7,24,68,.38);
  backdrop-filter: blur(10px);
  animation: cloud-poster-float 4s ease-in-out infinite;
}

.cloud-floating-poster[hidden],
.stationery-page .floating-poster[hidden] {
  display: none;
}

.cloud-floating-poster .floating-poster__open,
.stationery-page .floating-poster__open {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: #fff;
}

.cloud-floating-poster .floating-poster__open img,
.stationery-page .floating-poster__open img {
  width: 100%;
  height: auto;
  max-height: min(32vh, 280px);
  object-fit: contain;
}

.cloud-floating-poster.is-static,
.stationery-page .floating-poster.is-static {
  animation: none;
}

@keyframes cloud-poster-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.floating-poster.is-static {
  animation: none;
}

.floating-poster__close {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 28px;
  height: 28px;
  min-height: 28px;
  border: 1px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #b42332;
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 3px 9px rgba(0,0,0,.25);
}

.cloud-poster-modal {
  position: fixed;
  z-index: 4000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2,10,31,.86);
  backdrop-filter: blur(12px);
}

.cloud-poster-modal[hidden] {
  display: none;
}

.cloud-poster-modal img {
  width: auto;
  height: auto;
  max-width: min(100%, 900px);
  max-height: calc(100vh - 36px);
  object-fit: contain;
}

.cloud-poster-modal button {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  width: 44px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.12);
  font-size: 1.3rem;
}

@media (prefers-reduced-motion: reduce) {
  .cloud-floating-poster,
  .stationery-page .floating-poster {
    animation: none;
  }
}

.stationery-page {
  overflow-x: clip;
}

.stationery-page .brand-logo {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(7, 24, 68, 0.12);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(7, 24, 68, 0.16);
}

.stationery-page .brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stationery-page footer {
  padding: 68px 0 24px;
  color: #dbe7f6;
  background: linear-gradient(135deg, #06143a, #0b2b61);
}

.stationery-page .footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}

.stationery-page .footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stationery-page .footer-brand .brand-logo {
  padding: 3px;
  border-color: rgba(255, 255, 255, 0.75);
}

.stationery-page footer h3 {
  margin-bottom: 16px;
  color: #fff;
  font-family: "Montserrat", sans-serif;
  font-size: 0.95rem;
}

.stationery-page .footer-links {
  display: grid;
  gap: 10px;
  color: #b9c9df;
  font-size: 0.87rem;
}

.stationery-page .footer-links a:hover,
.stationery-page .footer-bottom a:hover {
  color: #f2b92f;
}

.stationery-page .footer-links .footer-support {
  color: #fff;
  font-weight: 800;
}

.stationery-page .footer-contact h3 {
  margin-bottom: 10px;
}

.stationery-page .footer-contact .footer-support + .footer-support {
  margin-top: -10px;
}

.stationery-page .footer-note {
  margin-top: 14px;
  color: #aebfd6;
  font-size: 0.82rem;
  line-height: 1.65;
}

.stationery-page .footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 45px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  color: #91a6c3;
  font-size: 0.75rem;
}

.stationery-page .footer-bottom a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(242, 185, 47, 0.65);
  text-underline-offset: 3px;
}

.stationery-page .back-to-top {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

button:not(.news-hero__arrow):not(.news-hero__dot):not(.menu-btn):not(.icon-btn):not(.floating-poster__open):not(.floating-poster__minimize):not(.floating-poster__close):not(.story-modal__close):not(.poster-modal__close):not(.admin-shell__close):not(.close-modal):not(.back-to-top),
input[type="button"],
input[type="submit"] {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: .84rem;
  line-height: 1.25;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease, filter .18s ease;
}

.btn,
.admin-button,
.gm-btn,
.resource-btn,
.apply-btn,
.help-whatsapp {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: .84rem;
  line-height: 1.25;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease, filter .18s ease;
}

button:not(.news-hero__arrow):not(.news-hero__dot):not(.menu-btn):not(.icon-btn):not(.floating-poster__open):not(.floating-poster__minimize):not(.floating-poster__close):not(.story-modal__close):not(.poster-modal__close):not(.admin-shell__close):not(.close-modal):not(.back-to-top):hover:not(:disabled),
input[type="button"]:hover:not(:disabled),
input[type="submit"]:hover:not(:disabled),
.btn:hover,
.admin-button:hover:not(:disabled),
.gm-btn:hover:not(:disabled),
.resource-btn:hover,
.stationery-page .apply-btn:hover {
  filter: brightness(1.07);
}

button:not(.news-hero__arrow):not(.news-hero__dot):not(.menu-btn):not(.icon-btn):not(.floating-poster__open):not(.floating-poster__minimize):not(.floating-poster__close):not(.story-modal__close):not(.poster-modal__close):not(.admin-shell__close):not(.close-modal):not(.back-to-top):active:not(:disabled),
input[type="button"]:active:not(:disabled),
input[type="submit"]:active:not(:disabled),
.btn:active,
.admin-button:active:not(:disabled),
.gm-btn:active:not(:disabled),
.resource-btn:active,
.stationery-page .apply-btn:active {
  filter: brightness(.94);
  transform: translateY(1px) scale(.985);
}

button:not(.news-hero__arrow):not(.news-hero__dot):not(.menu-btn):not(.icon-btn):not(.floating-poster__open):not(.floating-poster__minimize):not(.floating-poster__close):not(.story-modal__close):not(.poster-modal__close):not(.admin-shell__close):not(.close-modal):not(.back-to-top):focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
.btn:focus-visible,
.admin-button:focus-visible,
.gm-btn:focus-visible,
.resource-btn:focus-visible,
.stationery-page .apply-btn:focus-visible {
  outline: 3px solid #f2b92f;
  outline-offset: 2px;
}

button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled,
.admin-button:disabled,
.gm-btn:disabled {
  cursor: not-allowed;
}

.story-modal__footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .admin-modal .notice-form__actions > .admin-button,
  .admin-modal .local-news-editor__actions > .admin-button {
    flex: 0 1 auto;
  }

  .admin-toolbar__actions .admin-button,
  .content-editor-actions .admin-button {
    flex: 0 1 auto;
  }

  .gm-card__actions .gm-btn {
    min-height: 38px;
    padding: 8px 10px;
  }
}

@media (max-width: 760px) {
  .story-modal__footer-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .story-modal__footer-actions .btn {
    width: 100%;
    min-width: 0;
    padding: 8px 6px;
    font-size: .76rem;
    white-space: normal;
    overflow-wrap: normal;
  }

  .story-modal__footer-actions .article-export-status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1024px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  img,
  video,
  svg,
  canvas {
    max-width: 100%;
  }

  .responsive-section-background {
    display: block;
    order: 2;
    width: min(calc(100% - 32px), 760px);
    max-height: clamp(220px, 55vw, 440px);
    height: auto;
    margin: 28px auto 0;
    aspect-ratio: 16 / 10;
    object-fit: contain;
    object-position: center;
  }

  .learning-resources,
  .cambridge-help,
  .parent-services {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .learning-resources::before,
  .cambridge-help::before,
  .parent-services::before {
    position: absolute !important;
    visibility: hidden !important;
  }

  .learning-resources::after,
  .cambridge-help::after {
    display: none;
  }

  .learning-resources .resources-inner,
  .cambridge-help .help-shell,
  .parent-services > .container {
    order: 1;
    width: min(100% - 32px, 1180px);
    max-width: 1180px;
    margin-right: auto;
    margin-left: auto;
  }

  .learning-resources .resources-inner {
    padding: 42px 0 0;
  }

  .cambridge-help .help-shell {
    margin-top: 30px;
    margin-bottom: 0;
  }

  .parent-services > .container {
    padding-right: 0;
    padding-left: 0;
  }

  .stationery-page .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .stationery-page .nav {
    grid-template-columns: 1fr;
    padding: 18px 0;
  }

  .stationery-page .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
  }

  .stationery-page .nav-links a {
    padding: 8px 0;
  }

  .stationery-page .nav-links a::after {
    bottom: 2px;
  }

  .stationery-page .nav-actions {
    justify-content: center;
  }

  #featured-news {
    min-height: 0;
    padding: 0 0 48px;
  }

  #featured-news .news-hero__backdrops {
    position: relative;
    inset: auto;
    z-index: 0;
    width: 100%;
    padding: 16px 16px 0;
    overflow: visible;
    background: none;
  }

  #featured-news .news-hero__backdrop {
    position: relative;
    top: auto;
    left: auto;
    width: min(100%, 1200px);
    height: clamp(190px, 48vw, 440px);
    margin: 0 auto;
    object-fit: contain !important;
    object-position: center !important;
    opacity: 1;
    filter: none;
    transform: none;
    animation: none !important;
    transition: none;
  }

  #featured-news .news-hero__backdrop:not(.is-active) {
    display: none;
  }

  #featured-news .news-hero__veil {
    display: none;
  }

  #featured-news .news-hero__shell {
    min-height: 0;
    padding: 24px 20px 0;
  }

  #featured-news .news-hero__slide {
    display: flex;
    min-height: 0;
    padding: 20px 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  #featured-news .news-hero__photo-label {
    position: static;
    order: 0;
    max-width: 100%;
    margin: 0 0 14px;
  }

  #featured-news .news-hero__copy {
    order: 1;
    width: 100%;
  }

  #about.section {
    min-height: 0;
    padding: 0;
  }

  #about::before {
    display: none;
  }

  #about .about-grid {
    display: flex;
    min-height: 0;
    padding: 64px 20px;
    flex-direction: column;
    gap: 30px;
  }

  #about .about-copy {
    order: 1;
    width: 100%;
  }

  #about .about-poster {
    position: relative;
    inset: auto;
    order: 2;
    width: min(100%, 900px);
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 10;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 24px;
    background: #06143a;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.3);
  }

  #about .about-poster__background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    filter: saturate(1.04) contrast(1.03) brightness(0.78);
    transform: none;
  }

  #about .about-poster__group {
    position: absolute !important;
    inset: 0 auto 0 50% !important;
    width: auto !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: fill;
    aspect-ratio: 1717 / 916;
    transform: translateX(-70.5%) !important;
  }

  #about .about-poster {
    aspect-ratio: 20 / 17 !important;
  }

  #about .about-poster__background {
    object-fit: cover;
  }

  .notice-board {
    display: flex;
    flex-direction: column;
  }

  .notice-board > .container {
    order: 1;
  }

  .notice-board__student {
    position: static;
    order: 2;
    width: min(calc(100% - 16px), 620px);
    height: clamp(460px, 135vw, 760px);
    max-height: none;
    margin: 26px auto 0;
    object-fit: contain;
    object-position: center bottom;
    transform: none;
    opacity: 1;
  }

  .notice-board {
    padding-bottom: 0 !important;
  }
}

@media (max-width: 760px) {
  .responsive-section-background {
    width: min(calc(100% - 24px), 620px);
    max-height: 360px;
    margin-top: 22px;
  }

  #featured-news {
    padding-bottom: 40px;
  }

  #featured-news .news-hero__backdrops {
    padding: 12px 12px 0;
  }

  #featured-news .news-hero__backdrop {
    height: clamp(180px, 58vw, 340px);
  }

  #featured-news .news-hero__shell {
    padding: 20px 16px 0;
  }

  #featured-news .news-hero__slide {
    padding: 16px 0;
  }

  #featured-news .news-hero__headline {
    font-size: clamp(2rem, 9vw, 3.2rem);
    overflow-wrap: anywhere;
  }

  #featured-news .news-hero__controls {
    grid-template-columns: auto 1fr;
    gap: 12px;
  }

  #featured-news .news-hero__progress {
    display: none;
  }

  #about .about-grid {
    padding: 46px 16px;
    gap: 24px;
  }

  #about .about-poster {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 18px;
  }

  .notice-board__student {
    width: min(calc(100% - 16px), 520px);
    max-height: none;
  }

  .section {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 28px;
  }

  .section-copy,
  .parent-services .section-copy,
  #suggestions .section-head > .section-copy {
    margin-top: 0;
  }

  .proof-inner {
    grid-template-columns: 1fr;
  }

  .proof-item,
  .proof-item:nth-child(2) {
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .proof-item:last-child {
    border-bottom: 0;
  }

  .form-shell {
    padding: 22px 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .field.full {
    grid-column: auto;
  }

  .form-grid .btn {
    width: 100%;
  }

  .download-card,
  .action-card,
  .resource-card {
    min-width: 0;
  }

  .learning-resources .resources-inner {
    padding-top: 32px;
  }

  .cambridge-help .help-shell {
    padding: 24px 18px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .stationery-page .footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .stationery-page .nav-links {
    gap: 6px 14px;
    font-size: 0.82rem;
  }

  .stationery-page .brand-logo {
    width: 58px;
    height: 58px;
  }

  .stationery-page .footer-bottom {
    position: relative;
    align-items: center;
    padding-right: 0;
  }

  .stationery-page .back-to-top {
    position: static;
    margin-left: auto;
  }
}

@media (max-width: 400px) {
  .container {
    width: calc(100% - 24px);
  }

  #about .curriculum-cards {
    grid-template-columns: 1fr;
  }

  #about .curriculum {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
  }

  #about .round {
    flex: 0 0 auto;
  }
}

@media (max-width: 1100px) {
  /* Keep the opened hamburger menu above the School Update bar */
  header {
    z-index: 20 !important;
  }

  .nav-links.open {
    z-index: 30;
    background: #fff;
  }

  .news-flash {
    position: relative;
    z-index: 1;
  }
}

/* Phones: curriculum cards as left-aligned rows (icon, then name) */
@media (max-width: 760px) {
  #about .curriculum-cards {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  #about .curriculum {
    display: flex !important;
    align-items: center;
    justify-content: flex-start !important;
    gap: 16px;
    padding: 14px 18px !important;
    font-size: 1.05rem !important;
    text-align: left !important;
  }

  #about .curriculum .round {
    flex: 0 0 auto;
    width: 46px !important;
    height: 46px !important;
    margin: 0 !important;
  }

  #about .curriculum strong {
    flex: 1 1 auto;
    text-align: left;
  }

  /* School update bar: no notice-board link, larger navy and gold text */
  .news-flash .flash-link {
    display: none !important;
  }

  .news-flash .container {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    grid-template-areas: "bell copy" !important;
    align-items: center;
    column-gap: 12px !important;
    min-height: 64px;
    padding: 10px 0 !important;
  }

  .news-flash .flash-label-group {
    grid-area: bell;
  }

  .news-flash .flash-copy {
    grid-area: copy;
    font-size: 1.2rem;
    font-weight: 800;
  }

  .news-flash .flash-copy__message {
    animation: none !important;
  }

  .news-flash .flash-word {
    display: inline-block;
    color: #0a1f58;
    font-weight: 800;
    transform-origin: left center;
    animation: flash-word-size 1.6s ease-in-out infinite alternate;
    animation-delay: calc(var(--i, 0) * -0.4s);
  }

  .news-flash .flash-word:nth-child(even) {
    color: #c98a06;
  }
}

#about .about-poster.has-background-fallback {
  background-image: url("images/Students-in-class.png");
  background-position: center;
  background-size: cover;
}

#about .about-poster__background.is-unavailable {
  display: none !important;
}

@keyframes flash-word-size {
  from { font-size: 1.7rem; }
  to { font-size: 1rem; }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .news-flash .flash-word { animation: none; font-size: 1.2rem; }
}

/* Larger student images on phones and tablets */
@media (max-width: 1024px) {
  .parent-services > .responsive-section-background,
  .learning-resources > .responsive-section-background,
  .cambridge-help > .responsive-section-background {
    width: auto;
    max-width: calc(100% - 32px);
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    margin: 28px auto 0;
  }

  .parent-services > .responsive-section-background {
    height: clamp(400px, 125vw, 640px);
  }

  .learning-resources > .responsive-section-background {
    width: min(calc(100% - 24px), 640px);
  }

  .cambridge-help > .responsive-section-background {
    height: clamp(400px, 115vw, 620px);
  }
}


/* Admin panel: login spacing (all screens) */
#adminLoginForm .field + .field { margin-top: 14px; }
#adminLoginForm .notice-form__actions { margin-top: 18px; }
#adminLoginForm #loginBtn { min-height: 38px; padding: 8px 18px; border-radius: 8px; }
.admin-password-control .admin-button { min-height: 36px; padding: 6px 10px; border-radius: 8px; }

/* Admin panel: mobile-first layout, no sticky headers */
@media (max-width: 760px) {
  .admin-shell__close {
    position: static;
    margin: 10px 10px -44px 0;
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
  }

  .admin-shell__header { padding-right: 52px; }
  .admin-shell__header h2 { font-size: 1.45rem; line-height: 1.15; }

  .content-editor-actions {
    position: static;
    top: auto;
    gap: 6px;
    justify-content: flex-start;
    padding: 8px 12px;
    backdrop-filter: none;
  }

  .content-editor-actions #websiteSaveStatus,
  .content-editor-actions #cloudAdminIdentity {
    flex: 1 1 100%;
    font-size: .78rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .content-editor-actions #websiteSaveStatus:empty { display: none; }
  .content-editor-actions #cloudAdminIdentity { opacity: .75; }

  .admin-modal .admin-button,
  .admin-modal .content-editor-actions .admin-button {
    flex: 0 1 auto;
    min-height: 32px;
    padding: 5px 10px;
    border-radius: 7px;
    font-size: .76rem;
    line-height: 1.2;
    white-space: normal;
    text-align: center;
    transition: background-color .18s ease, color .18s ease, transform .12s ease, filter .18s ease;
  }

  .content-editor-actions #saveWebsiteChanges { order: -1; flex: 1 1 auto; min-height: 34px; }
  .content-editor-actions #migrateLocalContent { order: 5; flex: 1 1 100%; }

  .admin-modal .admin-button:active:not(:disabled) {
    filter: brightness(.88);
    transform: scale(.97);
  }

  .admin-modal .notice-form__actions,
  .admin-modal .local-news-editor__actions { gap: 6px; }

  .admin-modal input,
  .admin-modal select,
  .admin-modal textarea { font-size: 16px; }

  .admin-shell { max-height: calc(100dvh - 16px); scroll-padding-bottom: 40vh; }
}
