/* ============================================================
   YEAR LONG PHOTO — main.css
   Design tokens sourced directly from Figma (YLP-Designs-03-04)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Ultra&family=IBM+Plex+Mono:wght@400;700&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --color-header-bar:     #9f7d56;
  --color-control-bar:    #3e3e3e;
  --color-grid-bg:        #545454;
  --color-page-bg:        #f5c87a;
  --color-logo-text:      #ffc98b;
  --color-active:         #fa97ff;
  --color-label-view:     #6284bc;
  --color-label-year:     #aba9c5;
  --color-label-hour:     #cdd3dd;
  --color-nav-text:       #ffc98b;
  --color-nav-inactive:   rgba(255,201,139,0.55);
  --color-placeholder-a: #14180F;
  --color-placeholder-b: #14180F;
  --color-est:            #5a4731;

  --font-display: 'Ultra', serif;
  --font-mono:    'IBM Plex Mono', monospace;

  /* Month header colors */
  --month-jan: #d4edf1;
  --month-feb: #bbdde3;
  --month-mar: #91adc7;
  --month-apr: #c0b291;
  --month-may: #c4f398;
  --month-jun: #6ea051;
  --month-jul: #1e751b;
  --month-aug: #94b936;
  --month-sep: #b1282a;
  --month-oct: #c76f1d;
  --month-nov: #ab8a7e;
  --month-dec: #8ea6b5;

  --header-h:  52px;
  --control-h: 152px;
  --gap:        2px;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--color-page-bg);
  font-family: var(--font-mono);
  font-size: 14px;
  color: #fff;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ── Site Header ─────────────────────────────────────────── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.header-top {
  background: var(--color-header-bar);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--color-logo-text);
  cursor: pointer;
  line-height: 1;
  letter-spacing: 0.01em;
  user-select: none;
}
.site-logo:hover { opacity: 0.85; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--color-nav-text);
}

.header-nav a {
  padding: 0 10px;
  color: var(--color-nav-inactive);
  transition: color 0.15s;
}
.header-nav a:hover { color: var(--color-nav-text); }
.header-nav a.active {
  color: #fff;
  font-weight: 700;
}
.header-nav span { color: var(--color-nav-inactive); }

.header-est {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-est);
}

/* ── Control Bar ─────────────────────────────────────────── */
.control-bar {
  background: var(--color-control-bar);
  padding: 10px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.control-row {
  display: flex;
  align-items: baseline;
  gap: 0;
  min-height: 28px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.control-label {
  font-family: var(--font-display);
  font-size: 18px;
  min-width: 80px;
  flex-shrink: 0;
}
.control-label.view-label  { color: var(--color-label-view); }
.control-label.year-label  { color: var(--color-label-year); }
.control-label.month-label { color: var(--color-label-hour); }
.control-label.day-label   { color: var(--color-label-year); }
.control-label.hour-label  { color: var(--color-label-hour); }

.control-values {
  font-family: var(--font-mono);
  font-size: 15px;
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.control-values::-webkit-scrollbar { display: none; }

.control-values .pipe {
  color: rgba(255,255,255,0.3);
  padding: 0 3px;
}

.control-values .val {
  cursor: pointer;
  padding: 0 3px;
  color: rgba(255,255,255,0.55);
  transition: color 0.12s;
  white-space: nowrap;
}
.control-values .val:hover { color: #fff; }
.control-values .val.active {
  color: var(--color-active);
  font-weight: 700;
}
.control-values .val.disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

/* ── Grid Area ───────────────────────────────────────────── */
.grid-area {
  background: var(--color-grid-bg);
  min-height: calc(100vh - var(--header-h) - var(--control-h));
  padding: var(--gap);
}

/* ── Month Header Tiles ──────────────────────────────────── */
.month-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 38px;
  color: #fff;
  text-shadow: 0 2px 3px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  user-select: none;
}
.month-tile:hover { filter: brightness(1.1); }
.month-tile.active { outline: 3px solid var(--color-active); outline-offset: -3px; }

/* ── Photo Cell ──────────────────────────────────────────── */
.photo-cell {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--color-placeholder-a);
}
.photo-cell:nth-child(even) { background: var(--color-placeholder-b); }
.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-cell .placeholder-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 18px;
  color: #545454;
  text-align: center;
  padding: 2px;
  line-height: 1.3;
  pointer-events: none;
}


/* ── Lightbox ────────────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#lightbox.open { display: flex; }

.lightbox-img-wrap {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img-wrap img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 18px;
}
.lightbox-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 8px 20px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 2px;
}
.lightbox-btn:hover { background: rgba(250,151,255,0.25); border-color: var(--color-active); }
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  font-family: var(--font-mono);
  opacity: 0.7;
  transition: opacity 0.15s;
}
.lightbox-close:hover { opacity: 1; color: var(--color-active); }

.lightbox-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-top: 10px;
  text-align: center;
}
.lightbox-share {
  font-size: 12px;
  color: var(--color-active);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-mono);
  margin-left: 16px;
}
.lightbox-share:hover { text-decoration: underline; }

/* ── About Overlay ───────────────────────────────────────── */
#about-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(62,62,62,0.97);
  display: none;
  flex-direction: column;
  padding: 40px;
  overflow-y: auto;
}
#about-overlay.open { display: flex; }

.about-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  font-family: var(--font-mono);
  opacity: 0.6;
}
.about-close:hover { opacity: 1; color: var(--color-active); }

.about-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  font-family: var(--font-display);
  font-size: 28px;
}
.about-tab {
  cursor: pointer;
  color: rgba(255,255,255,0.35);
  padding-right: 24px;
  transition: color 0.15s;
}
.about-tab.active { color: var(--color-active); }
.about-tab:hover { color: #fff; }
.about-tab-sep { color: rgba(255,255,255,0.2); padding-right: 24px; }

.about-content {
  max-width: 560px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255,255,255,0.8);
}
.about-content p { margin-bottom: 20px; }
.about-content strong { color: #fff; font-weight: 700; }

.about-panel { display: none; }
.about-panel.active { display: block; }

.views-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 800px;
}
.view-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 20px;
  border-radius: 2px;
}
.view-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--color-active);
  margin-bottom: 10px;
}
.view-card p {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin: 0;
}

/* ── Context label (Month view top-right) ────────────────── */
.context-label {
  font-family: var(--font-display);
  font-size: 20px;
  color: #fff;
  text-align: right;
  padding: 8px 12px 4px;
  background: var(--color-grid-bg);
  line-height: 1.2;
}
.context-label span { display: block; font-size: 14px; color: var(--color-active); font-family: var(--font-mono); }

/* ── Utility ─────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Year label in side-by-side */
.year-row-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  padding: 3px 6px;
  background: var(--color-grid-bg);
  grid-column: 1 / -1;
}

/* Slices composite area */
.slices-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: crosshair;
}
.slices-wrap img { width: 100%; display: block; }
.slices-placeholder {
  width: 100%;
  height: 60vh;
  background: repeating-linear-gradient(
    90deg,
    var(--color-placeholder-a) 0px,
    var(--color-placeholder-a) 1px,
    var(--color-placeholder-b) 1px,
    var(--color-placeholder-b) 20px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(0,0,0,0.3);
}

/* Slice hover tooltip */
.slice-tooltip {
  position: fixed;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 10px;
  pointer-events: none;
  z-index: 500;
  display: none;
  border-left: 2px solid var(--color-active);
}

/* Toast for share copy */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-active);
  color: #000;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 20px;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* ── Lightbox ─────────────────────────────────────────── */
#lightbox { display:none; position:fixed; inset:0; z-index:1000; }
#lightbox.open { display:flex; align-items:center; justify-content:center; }
.lb-backdrop { position:fixed; inset:0; background:rgba(0,0,0,0.92); }
.lb-inner { position:relative; width:100vw; height:100vh; display:flex; flex-direction:column; z-index:1001; }

.lb-img-wrap { position:fixed; top:44px; left:0; right:0; bottom:90px; overflow:hidden; display:flex; align-items:center; justify-content:center; }
.lb-img-wrap img { max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; display:block; }
.lb-hit-prev { position:absolute; left:0; top:0; width:33%; height:100%; z-index:5; cursor:pointer; }
.lb-hit-next { position:absolute; right:0; top:0; width:33%; height:100%; z-index:5; cursor:pointer; }
.lb-arrow { position:absolute; top:50%; transform:translateY(-50%); font-family:var(--font-mono); font-size:15px; color:rgba(255,255,255,0.55); z-index:6; pointer-events:none; line-height:1; }
.lb-arrow-left { left:16px; }
.lb-arrow-right { right:16px; }
.lb-caption-bar { position:fixed; bottom:0; left:0; right:0; display:flex; justify-content:space-between; align-items:flex-start; padding:10px 20px; background:rgba(0,0,0,0.85); gap:20px; z-index:1001; }
.lb-caption-left { display:flex; flex-direction:column; gap:4px; }
.lb-date { font-family:var(--font-display); font-size:18px; }
.lb-fname { font-family:var(--font-mono); font-size:13px; opacity:0.7; }
.lb-data { font-family:var(--font-mono); font-size:12px; color:#666; line-height:1.6; }
.lb-caption-right { display:flex; flex-direction:column; align-items:flex-end; gap:8px; }
.lb-stars { display:flex; gap:4px; cursor:pointer; }
.lb-star { font-size:22px; transition:color 0.1s; }
.lb-star:hover { opacity:0.8; }
.lb-tags { display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; }
.lb-tag { font-family:var(--font-mono); font-size:11px; padding:2px 8px; border:1px solid #333; color:#555; cursor:pointer; border-radius:2px; transition:all 0.15s; }
.lb-tag:hover { opacity:0.8; }
.lb-month-bar { display:grid; grid-template-columns:repeat(12,1fr); height:8px; }
.lb-month-seg { height:100%; opacity:0.5; }
.lb-month-seg.active { opacity:1; }

/* ── Share button ─────────────────────────────────────── */
.lb-date-row { display: flex; align-items: center; gap: 10px; }

/* ── Share button ─────────────────────────────────────── */
.lb-date-row { display: flex; align-items: center; gap: 10px; }

/* ── Share Dialog ─────────────────────────────────────── */
#share-dialog { display: none; position: fixed; inset: 0; z-index: 2000; }
#share-dialog.open { display: flex; align-items: center; justify-content: center; }
.sd-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.7); }
.sd-box { position: relative; z-index: 2001; background: #1a1a1a; border-top: 3px solid #fff; padding: 24px; width: 480px; max-width: 90vw; }
.sd-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.sd-title { font-family: var(--font-display); font-size: 20px; color: #fff; }
.sd-close { font-family: var(--font-mono); font-size: 18px; color: #666; cursor: pointer; padding: 4px 8px; }
.sd-close:hover { color: #fff; }
.sd-url-row { display: flex; gap: 8px; margin-bottom: 20px; }
.sd-url-input { flex: 1; background: #111; border: 1px solid #333; color: #aaa; font-family: var(--font-mono); font-size: 12px; padding: 8px 10px; outline: none; }
.sd-copy-btn { background: #333; border: none; color: #ccc; font-family: var(--font-mono); font-size: 12px; padding: 8px 16px; cursor: pointer; white-space: nowrap; }
.sd-copy-btn:hover { background: #444; color: #fff; }
.sd-targets { display: flex; gap: 12px; }
.sd-target { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 20px; background: #111; border: 1px solid #222; color: #888; text-decoration: none; font-family: var(--font-mono); font-size: 11px; flex: 1; transition: all 0.15s; }
.sd-target:hover { background: #222; color: #fff; border-color: #444; }
.sd-target-icon { font-size: 20px; }

/* ── About DATA panel ─────────────────────────────────── */
.about-data-wrap { display: flex; gap: 48px; padding: 8px 0; }
.about-data-intro { flex: 0 0 380px; max-width: 380px; }
.about-data-title { font-family: var(--font-display); font-size: 28px; color: var(--color-text); margin: 0 0 16px; }
.about-data-intro p { font-family: var(--font-mono); font-size: 13px; line-height: 1.65; color: var(--color-text); opacity: 0.75; margin: 0 0 14px; }
.about-data-table { font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6; color: #aba9c3; background: transparent; border: none; margin: 0; padding: 0; white-space: pre; overflow-x: auto; flex: 1; }
@media (max-width: 900px) { .about-data-wrap { flex-direction: column; } .about-data-intro { max-width: 100%; } }

/* ── Lightbox top bar ─────────────────────────────────── */
.lb-top-bar { position:fixed; top:0; left:0; right:0; height:44px; display:flex; align-items:center; justify-content:space-between; padding:0 20px; z-index:1001; background:rgba(0,0,0,0.75); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px); }
.lb-share-top { font-family:var(--font-mono); font-size:15px; color:rgba(255,255,255,0.55); cursor:pointer; transition:color 0.12s; line-height:1; display:flex; align-items:center; }
.lb-share-top:hover { color:#fff; }
.lb-close-wrap { display:flex; align-items:center; gap:6px; cursor:pointer; }
.lb-close { font-family:var(--font-mono); font-size:15px; color:rgba(255,255,255,0.55); line-height:1; }
.lb-close-label { font-family:var(--font-mono); font-size:15px; color:rgba(255,255,255,0.55); line-height:1; }
.lb-close-wrap:hover .lb-close,
.lb-close-wrap:hover .lb-close-label { color:#fff; }

/* ── HaikuBox Birds ── */
.lb-birds { display:block; font-size:11px; color:#aba9c3; margin-top:4px; line-height:1.4; }
.lb-bird-link { color:#aba9c3; text-decoration:none; white-space:nowrap; }
.lb-bird-link:hover { color:#fff; text-decoration:underline; }


/* ── Birds inline fix ── */
#lb-birds { display:inline; }

/* ── Lightbox data unified styles ── */
.lb-data, .lb-birds-label, .lb-bird-link, .lb-station-link {
  font-size: 11px;
  font-family: inherit;
  color: inherit;
}
.lb-bird-link, .lb-station-link {
  text-decoration: none;
}
.lb-bird-link:hover, .lb-station-link:hover {
  text-decoration: underline;
}
