/* ============================================================
   HSC 75th Anniversary — Projector Presentation
   All styling lives here.
   ============================================================ */

/* ---------- Colour palette and typography ----------
   Change these values to change the whole presentation.
   ---------------------------------------------------- */
:root {
  --bg:            #0d1b2a;   /* deep navy background */
  --bg-alt:        #12263a;   /* slightly lighter panel */
  --text:          #f0f0f0;   /* off-white, easier on the eye than pure white */
  --text-muted:    #9aa8b5;   /* metadata, dates, locations */
  --accent:        #4a90c2;   /* restrained blue, used sparingly */
  --placeholder:   #1a2f44;   /* placeholder panel background */
  --placeholder-border: #2a4055;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  cursor: none;             /* hidden for projector */
}

/* ---------- The stage ----------
   Fills the screen. Each slide is absolutely positioned within it.
   --------------------------------------------------------------- */
#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Individual slides ----------
   Every slide fades in and out. Only one is visible at a time.
   ------------------------------------------------------------- */
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  pointer-events: none;
}

.slide.active {
  opacity: 1;
}

/* ---------- Title slide ----------
   Centred text, optional background image at low opacity.
   ------------------------------------------------------ */
.slide-title {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8vh 10vw;
}

.slide-title .title-main {
  font-size: 5.5vw;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin-bottom: 0.4em;
}

.slide-title .title-sub {
  font-size: 2.2vw;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.4;
}

.slide-title .title-burgee {
  width: 18vw;
  max-width: 260px;
  margin-bottom: 3vh;
  opacity: 0.95;
  filter: invert(1); /* Flips the black SVG to white for dark backgrounds */
}

/* ---------- Photograph slide ----------
   Image on top, caption below. Consistent caption area.
   ---------------------------------------------- */
.slide-photo {
  padding: 4vh 5vw 0 5vw;
}

.slide-photo .image-area {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;              /* allows image to shrink if needed */
  overflow: hidden;
}

.slide-photo .image-area img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* ---------- Caption block ----------
   Used by photo, collection, thennow, document, people slides.
   --------------------------------------------------------- */
.caption {
  flex: 0 0 auto;
  padding: 2.5vh 0 3vh 0;
  text-align: left;
}

.caption-title {
  font-size: 2.4vw;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.35em;
}

.caption-description {
  font-size: 1.6vw;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text);
  max-width: 85%;
}

.caption-meta {
  font-size: 1.1vw;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 0.6em;
  letter-spacing: 0.03em;
}

/* ---------- Collection slide ----------
   Several photos in a row, shared caption beneath.
   -------------------------------------------------- */
.slide-collection {
  padding: 4vh 4vw 0 4vw;
}

.slide-collection .collection-area {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2vw;
  min-height: 0;
}

.slide-collection .collection-area .item {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 0;
}

.slide-collection .collection-area .item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* ---------- Then and now slide ----------
   Two photos side by side, each with a date label.
   ------------------------------------------------- */
.slide-thennow {
  padding: 4vh 5vw 0 5vw;
}

.slide-thennow .pair-area {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3vw;
  min-height: 0;
}

.slide-thennow .pair-area .half {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 0;
}

.slide-thennow .pair-area .half .img-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
}

.slide-thennow .pair-area .half .img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.slide-thennow .pair-area .half .date-label {
  flex: 0 0 auto;
  font-size: 1.4vw;
  color: var(--text-muted);
  margin-top: 1.2vh;
  letter-spacing: 0.05em;
}

/* ---------- Placeholder ----------
   Shown when an image is missing. Deliberately obvious so it's
   never mistaken for a real slide.
   ---------------------------------- */
.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--placeholder);
  border: 2px dashed var(--placeholder-border);
  border-radius: 8px;
  padding: 4vh 4vw;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
}

.placeholder .ph-label {
  font-size: 1.1vw;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2em;
}

.placeholder .ph-title {
  font-size: 2vw;
  color: var(--text);
  margin-bottom: 0.6em;
  font-weight: 500;
}

.placeholder .ph-hint {
  font-size: 1.2vw;
  color: var(--text-muted);
  max-width: 70%;
  line-height: 1.5;
}

/* ---------- Debug overlay ----------
   Only visible if ?debug is in the URL.
   ---------------------------------- */
#debug {
  position: fixed;
  top: 10px;
  left: 10px;
  font-family: monospace;
  font-size: 14px;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 10px;
  border-radius: 4px;
  z-index: 1000;
  pointer-events: none;
}

#debug.hidden {
  display: none;
}

/* ============================================================
   SIDE-TEXT LAYOUT (for portrait photos and documents)
   ============================================================ */

/* When a slide has side text, switch to a 3-column grid */
.slide-photo.has-side-text .photo-layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr; /* Left text : Image : Right text */
  gap: 3vw;
  align-items: center;
  min-height: 0;
  width: 100%;
}

/* Ensure the image behaves correctly inside the grid */
.slide-photo.has-side-text .photo-layout .image-area {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-photo.has-side-text .photo-layout img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Side text panels */
.side-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.side-text-paragraph {
  font-size: 1.4vw;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 1.5vh;
}

/* Make the first paragraph slightly larger and brighter to act as a pull quote */
.side-text-paragraph:first-child {
  font-size: 1.6vw;
  color: var(--text);
  font-weight: 500;
}

/* Hide empty spacer columns */
.side-spacer {
  display: none;
}

/* ---------- Responsive fallbacks ----------
   At 1080p the vw-based sizing above works well. On smaller
   screens (e.g. testing on a laptop), these adjust for
   readability.
   ---------------------------------------------------------- */
@media (max-width: 1200px) {
  .slide-title .title-main { font-size: 6vw; }
  .slide-title .title-sub  { font-size: 2.6vw; }
  .caption-title           { font-size: 2.8vw; }
  .caption-description     { font-size: 1.9vw; }
  .caption-meta            { font-size: 1.3vw; }
  .placeholder .ph-label   { font-size: 1.4vw; }
  .placeholder .ph-title   { font-size: 2.4vw; }
  .placeholder .ph-hint    { font-size: 1.5vw; }
  .slide-thennow .pair-area .half .date-label { font-size: 1.7vw; }
}

@media (max-width: 800px) {
  .slide-title .title-main { font-size: 8vw; }
  .slide-title .title-sub  { font-size: 3.4vw; }
  .caption-title           { font-size: 3.6vw; }
  .caption-description     { font-size: 2.6vw; }
  .caption-meta            { font-size: 1.8vw; }
  .placeholder .ph-label   { font-size: 1.8vw; }
  .placeholder .ph-title   { font-size: 3vw; }
  .placeholder .ph-hint    { font-size: 2vw; }
  .slide-thennow .pair-area .date-label { font-size: 2.2vw; }
}

/* On smaller screens, stack the side-text layout instead of side-by-side */
@media (max-width: 1000px) {
  .slide-photo.has-side-text .photo-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 2vh;
  }
  .side-text {
    justify-content: flex-start;
  }
  .side-text-paragraph {
    font-size: 2vw;
  }
  .side-text-paragraph:first-child {
    font-size: 2.2vw;
  }
}