/* =========================
   BACKGROUND
   ========================= */
#bg{
  position: fixed;
  inset: 0;
  background: #000 center / cover no-repeat;
  transition: opacity 350ms ease;
  opacity: 1;
  z-index: 0;
}
#bg.is-fading{ opacity: 0; }

/* =========================
   NAV PANEL
   ========================= */
.panel{
  position: fixed;
  top: 18px;
  left: 18px;
  width: 300px;
  max-width: calc(100vw - 36px);

  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  padding: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);

  z-index: 10;
}

.title{
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px 0;
}

/* from map.html */
.links{
  display: flex;
  gap: 10px;
}

.link{
  color: rgba(255,255,255,0.80);
  text-decoration: none;
  font-size: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
}

.link:hover{ background: rgba(255,255,255,0.10); }

/* Left panel */
.nav{
  position: fixed;
  top: 18px;
  left: 18px;
  width: 300px;
  padding: 18px 16px 20px 16px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  z-index: 10;
}

.nav h1{
  margin: 0 0 14px 0;
  font-size: 22px;
  letter-spacing: 1px;
  font-weight: 800;
}

.nav label{
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.year-select{
  width: 100%;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 15px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.year-select option{
  background: #111;
  color: #eee;
}

.hint{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}

/* About flyout (Choir-like) */
.flyout-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.40);
  z-index: 80;
}

.flyout{
  position: fixed;
  top: 16px;
  left: calc(12px + var(--nav-w) + var(--flyout-gap)); /* <-- to the right of nav */
  width: min(420px, calc(100vw - (24px + var(--nav-w) + var(--flyout-gap))));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 14px 14px 16px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  z-index: 90;
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  font-size: 0.95rem;   /* slightly smaller than body */
  line-height: 1.7;     /* compensate for smaller size */  
  line-height: 1.8;
  max-width: 42rem;     /* ~672px if 16px base */
  width: min(42rem, 92vw);

}

.flyout-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.flyout h2
.flyout h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: .03em;
  color: rgba(255,255,255,.90);
}

.flyout-close{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.flyout-close:hover{ background: rgba(255,255,255,.10); }

.flyout-body p{
  margin: 10px 0;
  color: rgba(255,255,255,.78);
  line-height: 1.7;
   margin-bottom: 1rem;

}

.flyout-sep{
  border: 0;
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 14px 0;
}

.flyout-meta{
  font-size: 12px;
  color: rgba(255,255,255,.60);
  margin: 0;
}

/* ========================================
   About Flyout Links
======================================== */

.flyout a {
  color: rgba(255,255,255,.75);   /* light gray */
  text-decoration: underline;
  text-underline-offset: 3px;    /* modern, readable underline */
  text-decoration-thickness: 1px;
  transition: color 160ms ease, opacity 160ms ease;
}

.flyout a:hover {
  color: rgba(255,255,255,.95);   /* brighten slightly */
}

.flyout a:visited {
  color: rgba(255,255,255,.65);   /* subtle visited state */
}
/* Make button visually identical to your pill links */
.hub-link{
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;

  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.88);

  font: inherit;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;

  /* remove browser defaults */
  outline: none;
}

/* Remove default button styling */
button.hub-link{
  appearance: none;
  -webkit-appearance: none;
  background-clip: padding-box;
}

/* Hover state */
.hub-link:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.20);
}

/* On small screens, fall back to full-width overlay */
@media (max-width: 900px){
  .flyout{
    left: 12px;
    width: min(420px, calc(100vw - 24px));
  }
}

/* =========================================
   Slideshow override: TITLE ABOVE IMAGE
   (matches slideshow.html structure:
    slideTitle is in .slide-stage,
    slideImg + slideMetaWrap are in .slide-frame)
   ========================================= */

/* keep overlay on top */
#overlay{
  z-index: 99999 !important;
  position: fixed !important;
  inset: 0 !important;
}

/* stack title row + frame row */
#overlay .slide-stage{
  display: grid !important;
  grid-template-rows: auto 1fr !important;
  justify-items: center !important;
  align-items: start !important;
  row-gap: 10px !important;
}

/* title bar (child of .slide-stage) */
#overlay #slideTitle{
  grid-row: 1 !important;
  width: min(1100px, 92vw) !important;
  padding: 6px 10px !important;
  box-sizing: border-box !important;
  background: rgba(0,0,0,0.55) !important;
  border-radius: 6px !important;
}

/* frame (holds image + meta) goes under title */
#overlay .slide-frame{
  grid-row: 2 !important;
  justify-self: center !important;
}

/* image sizing */
#overlay #slideImg{
  display: block !important;
  max-width: 92vw !important;
  max-height: 85vh !important;
  width: auto !important;
  height: auto !important;
}

/* =========================================
   "more info..." button on top-left of image
   ========================================= */

/* anchor more info... button to the image frame */
#overlay .slide-frame{
  position: relative !important;
  overflow: visible !important;
}

/* ensure the image is below UI */
#overlay #slideImg{
  position: relative !important;
  z-index: 1 !important;
}

/* place the toggle over the image */
#overlay #slideMetaToggle{
  position: absolute !important;
  top: -20px !important;
  left: 10px !important;
  z-index: 99999 !important;

  display: inline-block !important;
  visibility: visible !important;
  opacity: .75 !important;
  pointer-events: auto !important;

  background: rgba(0,0,0,0.60) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
}

/* more info... / hide info... */
#overlay #slideMetaWrap{
  position: absolute !important;
  top: 30px !important;
  left: 20px !important;

  display: block !important;
  width: 600px;

  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;

  z-index: 10 !important;
}

/* Hide/show Description Card */
#overlay #slideMetaWrap.is-hidden{
  display: none !important;
}

/* DESCRIPTION CARD */
#overlay #slideMeta{
  /* sizing: hug content, but wrap at ~600px */
  display: inline-block;
  max-width: min(600px, 92vw) !important;
  width: auto !important;

  /* grow vertically with text */
  height: auto !important;
  max-height: 55vh !important;
  overflow: auto !important;

  margin-top: 8px !important;
  padding: 18px 22px !important;

  background: rgba(0,0,0,0.85) !important;
  border-radius: 12px !important;

  font-size: 14px !important;
  line-height: 1.5 !important;
  box-sizing: border-box !important;
}

/* If any inner element was positioned, force it back into flow */
#overlay #slideMeta > *{
  position: static !important;
}