html:not(.studio-observatory) body.studio-event-page,
html:not(.studio-observatory) .studio-event-page #content,
html:not(.studio-observatory) .studio-event-page #main {
  background-color: #fff;
}

.event-banner:not(.elementor-motion-effects-element-type-background),
.event-banner > .elementor-motion-effects-container > .elementor-motion-effects-layer {
  background-image: none !important;
}
#main .event-banner {
  background-color: transparent !important;
  background-blend-mode: normal !important;
}
#main .event-banner::before {
  filter: none !important;
  background-color: transparent !important;
  background-image: linear-gradient(180deg, rgba(230, 130, 20, 0.42) 0%, rgba(215, 110, 15, 0.52) 45%, rgba(185, 80, 10, 0.65) 100%) !important;
  --background-overlay: '';
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  z-index: 1;
  pointer-events: none;
}
.event-banner .hero-parallax-plane {
  background-image: url("school-festival-banner.jpg");
  background-position: center 40%;
  background-repeat: no-repeat;
  background-size: cover;
}
.elementor-25 .elementor-element.event-banner > .e-con-inner {
  z-index: 2;
}

/* ==========================================================================
   COMPETITION CARDS
   ========================================================================== */
.competition-section { width: min(1140px, calc(100% - 40px)); margin: 0 auto; padding: clamp(26px, 3.4vw, 48px) 0; }
#competition-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 30px); margin-top: 28px; }
.competition-card { --accent: #ae235e; display: flex; flex-direction: column; min-width: 0; border: 1px solid #e6e2ee; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 8px 24px rgba(40, 35, 65, 0.06); }
.competition-card.flight { --accent: #08777b; }
.competition-card > img { display: block; width: 100%; height: clamp(160px, 15vw, 200px); object-fit: cover; }
.competition-card.technology > img { object-position: center 58%; }
.competition-card.flight > img[src$="/rocket-field.jpg"] { object-position: 58% 79%; }
.competition-copy { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 18px clamp(16px, 2vw, 24px) 20px; }
.competition-copy .competition-place { font: 400 1.25rem/1 var(--studio-display); text-transform: uppercase; margin: 0 0 5px; color: #5b5475; }
.competition-copy h3 { color: var(--accent); font-size: clamp(1.75rem, 2.65vw, 2.2rem); line-height: 1.03; margin: 0 0 9px; }
.competition-copy > p { line-height: 1.55; margin: 0 0 16px; }
.competition-copy .competition-link { margin-top: auto; background: var(--accent); color: white; text-decoration: none; border-radius: 30px; padding: 8px 22px; font: 400 1.4rem/1.1 var(--studio-display); text-transform: uppercase; transition: transform .2s ease; }
.competition-copy .competition-link:hover { transform: translateY(-2px); }
@media (max-width: 700px) {
  #competition-cards { grid-template-columns: 1fr; }
  .competition-card > img { height: clamp(140px, 34vw, 180px); }
}

/* ==========================================================================
   UPGRADED PAST EVENT GALLERY — UNIFORM 3-COLUMN WAVE-MASKED GRID (ZERO GAPS!)
   ========================================================================== */
#gallery.studio-feature-section {
  width: min(1180px, calc(100% - 40px));
}

.event-gallery-kicker {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 999px;
  background: #fceaf3;
  color: #c41c66;
  font: 600 0.76rem/1.4 var(--studio-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.event-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 38px;
}

.event-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1.5px solid #e3ddef;
  background: #ffffff;
  color: #362e4f;
  font: 400 1.32rem/1 var(--studio-display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.event-filter-btn span {
  font: 600 0.72rem/1 var(--studio-body);
  padding: 3px 7px;
  border-radius: 999px;
  background: #f3effa;
  color: #5e547d;
}

.event-filter-btn:hover {
  border-color: #ea3d84;
  color: #ea3d84;
  transform: translateY(-2px);
}

.event-filter-btn.is-active {
  background: #282341;
  border-color: #282341;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(40, 35, 65, 0.2);
  transform: translateY(-2px);
}

.event-filter-btn.is-active span {
  background: #ffbe2e;
  color: #241934;
}

/* Rock-solid CSS Grid — Every row aligns to the exact pixel, ZERO column holes! */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3.2vw, 40px) clamp(22px, 2.8vw, 34px);
  align-items: start;
}

.gallery-grid figure {
  --photo-accent: #f44d8b;
  --photo-shape: var(--photo-wave);
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0 9px 0 0;
  scroll-margin-top: 90px;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.gallery-grid figure[hidden] {
  display: none !important;
}

.gallery-grid figure:nth-child(3n + 2) {
  --photo-accent: #21b8bf;
  --photo-shape: var(--photo-sweep);
}

.gallery-grid figure:nth-child(3n) {
  --photo-accent: #ffba36;
  --photo-shape: var(--photo-arch);
}

.gallery-grid a {
  position: relative;
  isolation: isolate;
  display: block;
  cursor: zoom-in;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-grid a::before {
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-grid a:hover {
  transform: translate(-3px, -5px);
}

.gallery-grid a:hover::before {
  transform: translate(12px, 12px);
}

/* Uniform 4:3 framing across ALL cards so zero uneven bottom holes ever appear! */
.gallery-grid a img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3 !important;
  object-fit: cover;
  object-position: var(--focus-pos, center center);
}

.gallery-grid figcaption {
  margin: 16px 0 0;
  padding: 2px 0 0 12px;
  border-inline-start: 3.5px solid var(--photo-accent);
  overflow-wrap: anywhere;
  transition: border-inline-start-width 0.2s ease, padding-inline-start 0.2s ease;
}

.gallery-grid figure:hover figcaption {
  border-inline-start-width: 6px;
  padding-inline-start: 14px;
}

.gallery-grid figcaption strong {
  display: block;
  font: 400 clamp(1.42rem, 2vw, 1.78rem)/1.05 var(--studio-display);
  color: #282341;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.gallery-grid figcaption span {
  display: block;
  font: 400 0.78rem/1.48 var(--studio-body);
  color: #544e6e;
  text-transform: none;
  letter-spacing: 0;
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   UPGRADED FULL-SCREEN PHOTO VIEWER DIALOG
   ========================================================================== */
.photo-viewer {
  border: 0;
  border-radius: 20px;
  padding: 22px 24px;
  width: min(920px, 94vw);
  margin: auto;
  background: #1a1f38;
  color: #ffffff;
  max-height: 94vh;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
}

.photo-viewer:not([open]) { display: none; }
.photo-viewer::backdrop {
  background: rgba(14, 17, 32, 0.88);
  backdrop-filter: blur(10px);
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.viewer-meta strong {
  display: block;
  font: 400 clamp(1.45rem, 2.4vw, 2rem)/1.05 var(--studio-display);
  color: #ffffff;
  text-transform: uppercase;
}

.viewer-meta small {
  display: block;
  font: 400 0.8rem/1.4 var(--studio-body);
  color: #ffe082;
  margin-top: 2px;
}

.viewer-close-btn {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  border-radius: 999px;
  padding: 7px 18px;
  font: 400 1.25rem/1 var(--studio-display);
  text-transform: uppercase;
  cursor: pointer;
}

.viewer-close-btn:hover { background: #ea3d84; border-color: #ea3d84; }

.viewer-image {
  display: block;
  max-height: 68vh;
  width: 100%;
  object-fit: contain;
  margin-block: 16px;
  border-radius: 12px;
  background: #0f1324;
}

.viewer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.viewer-nav button {
  background: #ffbe2e;
  color: #221832;
  border: 0;
  border-radius: 999px;
  padding: 9px 22px;
  font: 400 1.3rem/1 var(--studio-display);
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.viewer-nav button:hover { transform: translateY(-2px); }

.viewer-counter {
  font: 600 0.8rem/1 var(--studio-body);
  color: #bcb7d8;
  letter-spacing: 0.08em;
}

.published-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.published-list article { padding: 22px; border: 1px solid #d9e4e2; border-top: 4px solid #20b7af; background: white; overflow-wrap: anywhere; }
.published-list h3 { margin: 0 0 6px; color: #ad235f; }
.published-list p { margin: 10px 0; white-space: pre-line; }
.published-list small { color: #41595b; }
