/* ============================================================
   SOUTHSTART 2026 - Festival Photo Gallery
   Restyled to match the SOUTHSTART site system (warm cream +
   Newsreader / Inter). Shares the global nav + footer.
   ============================================================ */

@font-face {
  font-family: "Calibre";
  src: url("../fonts/calibre-semibold.woff2") format("woff2"),
       url("../fonts/calibre-semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Site palette (from the home / The Table system) */
  --cream: #fbf8f0;        /* warm canvas */
  --sand: #f3ece0;         /* raised band */
  --sand-deep: #ece2d2;
  --bg: var(--cream);
  --bg-alt: var(--sand);
  --ink: #241a33;          /* warm ink-violet */
  --ink-soft: #6f6678;     /* secondary */
  --ink-muted: #9b93a3;    /* tertiary / labels */
  --rule: #e4dccd;         /* hairlines */
  --line: #e4dccd;
  --pink: #ff0099;         /* the single live accent */
  --hero-bg: #241a33;      /* dark canvas behind photos */

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --max-w: 1500px;
  --maxw: 1180px;
  --nav-h: 64px;
  --gap-sm: 4px;
  --gap: 12px;
  --pad-x: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* ---------- Global site nav (shared with home) ---------- */
.global-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(251, 248, 240, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.global-nav .mark {
  font-family: "Calibre", sans-serif;
  font-size: 23px;
  letter-spacing: -0.005em;
  font-weight: 600;
  color: var(--ink);
}
.global-nav .mark b { font-weight: 600; }
.navlinks { display: flex; gap: 30px; align-items: center; }
.navlinks a { font-size: 14px; color: var(--ink-soft); transition: color 0.2s; }
.navlinks a:hover { color: var(--ink); }
.navlinks a.navcurrent { color: var(--ink); border-bottom: 1.5px solid var(--pink); padding-bottom: 2px; }
.navcta {
  font-size: 13px;
  letter-spacing: 0.04em;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 9px 18px;
  color: var(--ink) !important;
}
.navcta:hover { background: var(--ink); color: var(--cream) !important; }
.navcta-eoi { background: var(--pink); border-color: var(--pink); color: #fff !important; }
.navcta-eoi:hover { background: #e0008a; border-color: #e0008a; color: #fff !important; }
@media (max-width: 820px) { .navlinks a:not(.navcta) { display: none; } }

/* ---------- Gallery day bar (contextual sub-nav) ---------- */
.site-header {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  background: rgba(251, 248, 240, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 32px;
}
.brand { display: inline-flex; align-items: baseline; gap: 12px; line-height: 1; }
.brand-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.brand-year {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--ink-soft);
}
.site-nav { display: flex; gap: 34px; }
.site-nav a {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  transition: color 0.18s ease;
}
.site-nav a:hover,
.site-nav a.active { color: var(--pink); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: clamp(420px, 75vh, 720px);
  background: var(--hero-bg) center/cover no-repeat;
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(36,26,51,0.30) 0%, rgba(36,26,51,0.72) 100%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; padding: 0 var(--pad-x); max-width: 1200px; }
.hero-kicker {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  opacity: 0.9;
  margin-bottom: 22px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(48px, 9vw, 130px);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0;
}
.hero-meta { margin-top: 26px; font-size: 12px; letter-spacing: 0.22em; }
.hero-meta .dot { padding: 0 14px; opacity: 0.6; }

/* ---------- Section ---------- */
.section { padding: clamp(60px, 9vw, 110px) var(--pad-x); max-width: var(--max-w); margin: 0 auto; }
.section-head { text-align: center; margin-bottom: clamp(40px, 6vw, 64px); }
.section-kicker {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--pink);
  font-weight: 500;
  margin-bottom: 18px;
}
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5.2vw, 60px);
  line-height: 1.06;
  margin: 0;
}
.section-lede {
  margin-top: 18px;
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Day tiles ---------- */
.day-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 900px) { .day-tiles { grid-template-columns: 1fr; } }
.day-tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--hero-bg) center/cover no-repeat;
  overflow: hidden;
  color: #fff;
  border-radius: 12px;
  transition: transform 0.4s ease;
}
.day-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(36,26,51,0.05) 0%, rgba(36,26,51,0.85) 100%);
  transition: opacity 0.3s ease;
}
.day-tile:hover { transform: translateY(-3px); }
.day-tile:hover::after { opacity: 0.92; }
.day-tile .day-tile-body { position: absolute; bottom: 0; left: 0; right: 0; padding: 28px 32px; z-index: 1; }
.day-tile-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.1;
  margin: 0 0 8px 0;
}
.day-tile-count { font-size: 11px; letter-spacing: 0.26em; opacity: 0.85; }

/* ---------- Sub-album tiles ---------- */
.sub-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.sub-tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--hero-bg) center/cover no-repeat;
  overflow: hidden;
  color: #fff;
  border-radius: 12px;
}
.sub-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(36,26,51,0.1) 0%, rgba(36,26,51,0.8) 100%);
}
.sub-tile-body { position: absolute; bottom: 0; left: 0; right: 0; padding: 22px 24px; z-index: 1; }
.sub-tile-title { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.1; margin: 0 0 6px 0; }
.sub-tile-count { font-size: 11px; letter-spacing: 0.24em; opacity: 0.85; }

/* ---------- Breadcrumb / page head ---------- */
.crumbs { font-size: 11px; letter-spacing: 0.24em; color: var(--ink-muted); margin-bottom: 22px; }
.crumbs a:hover { color: var(--pink); }
.crumbs .sep { padding: 0 10px; opacity: 0.5; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: clamp(32px, 5vw, 48px);
}
.page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.05;
  margin: 0;
}
.page-sub { font-size: 12px; letter-spacing: 0.22em; color: var(--ink-soft); margin-top: 6px; }

/* ---------- Photo grid ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap); }
@media (max-width: 640px) { .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-sm); } }
.photo-cell {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--sand-deep);
  overflow: hidden;
  cursor: zoom-in;
  border-radius: 6px;
}
.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, opacity 0.4s ease;
  opacity: 0;
}
.photo-cell img.loaded { opacity: 1; }
.photo-cell:hover img { transform: scale(1.04); }

/* ---------- Loading / empty ---------- */
.loading, .empty {
  padding: 120px var(--pad-x);
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
  letter-spacing: 0.18em;
}

/* ---------- Global footer (shared with home) ---------- */
footer.door {
  background: var(--ink);
  color: rgba(251, 248, 240, 0.7);
  text-align: left;
  padding: 70px 0 60px;
}
footer.door .row {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(251, 248, 240, 0.14);
  padding-top: 46px;
}
footer.door .mark { font-family: "Calibre", sans-serif; font-weight: 600; color: var(--cream); }
footer.door .mark b { font-weight: 600; }
footer.door .mark a { color: var(--cream); }
footer.door .ack { max-width: 40ch; font-size: 14px; line-height: 1.6; }
footer.door .social { display: flex; gap: 20px; font-size: 14px; }
footer.door .social a:hover { color: var(--cream); }
footer.door .copy { margin-top: 40px; font-size: 12.5px; color: rgba(251, 248, 240, 0.4); letter-spacing: 0.03em; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(20, 14, 28, 0.97); z-index: 100; display: flex; flex-direction: column; }
.lightbox[hidden] { display: none; }
.lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px 80px 0; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px 22px;
  color: #e7e0ec;
  font-size: 12px;
  letter-spacing: 0.18em;
  gap: 16px;
  flex-wrap: wrap;
}
.lb-counter { font-variant-numeric: tabular-nums; opacity: 0.7; min-width: 80px; }
.lb-name { opacity: 0.85; flex: 1; text-align: center; word-break: break-all; }
.lb-download {
  border: 1px solid rgba(255,255,255,0.35);
  padding: 8px 14px;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.2em;
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.lb-download:hover { background: var(--pink); color: #fff; border-color: var(--pink); }
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease, background 0.2s ease;
  border-radius: 50%;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.lb-close { top: 14px; right: 18px; font-size: 32px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

@media (max-width: 640px) {
  .lb-stage { padding: 50px 12px 0; }
  .lb-prev, .lb-next { width: 44px; height: 44px; }
  .lb-meta { padding: 14px 14px 18px; font-size: 11px; }
  .lb-name { width: 100%; text-align: center; order: 3; }
}

/* Skeleton shimmer for empty tiles */
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.photo-cell.skeleton {
  background: linear-gradient(90deg, var(--sand-deep) 0px, var(--sand) 200px, var(--sand-deep) 400px);
  background-size: 800px 100%;
  animation: shimmer 1.6s linear infinite;
}
