/* ─── Font: shared Avenir Heavy from /assets/css/fonts.css ─── */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-display);
}

/* ─── App shell ──────────────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ─── Header ─────────────────────────────────────────────────────────────────── */
#header {
  flex-shrink: 0;
  height: 8vh;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: var(--ink);
  border-bottom: 2px solid var(--green);
}

#header-title {
  font-size: 3.5vh;
  color: var(--green);
  letter-spacing: 0.04em;
}

#header-title a {
  color: var(--green);
  text-decoration: underline;
  font-family: inherit;
  font-size: inherit;
}

#header-title a:hover {
  color: var(--ink);
  background: var(--green);
}

/* ─── Main row ───────────────────────────────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ─── Projects column ────────────────────────────────────────────────────────── */
#projects-column {
  width: 25%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  border-right: 2px solid var(--green);
  overflow: hidden;
}

#projects-label {
  flex-shrink: 0;
  padding: 14px 18px 12px;
  font-size: 2.2vh;
  color: var(--green);
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--green);
}

#projects-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0;
}

.project-row {
  display: block;
  padding: 7px 18px;
  cursor: pointer;
  color: var(--green);
  text-decoration: none;
  font-size: 2.1vh;
  line-height: 1.35;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Highlight = the homepage menu's swap: one box per word, green box + dark letters. */
.project-row .word {
  display: inline-block;
  padding: 0.03em 0.1em;
  transition: background-color 0.07s ease, color 0.07s ease;
}
.project-row:hover .word,
.project-row:focus-visible .word {
  background-color: var(--green);
  color: var(--ink);
}

/* Selected project: the whole line is green, so it reads clearly as "this one is open". */
.project-row.selected {
  background-color: var(--green);
  color: var(--ink);
}
.project-row.selected .word {
  background-color: transparent;
  color: var(--ink);
}
.project-row:focus-visible { outline: none; }

.row-year {
  opacity: 0.72;
  font-size: 1.9vh;
}

/* ─── Right panel ────────────────────────────────────────────────────────────── */
#right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

/* ─── Project content wrapper ────────────────────────────────────────────────── */
#project-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

#project-content.hidden {
  display: none;
}

/* ─── Project info (title / year / metadata) ─────────────────────────────────── */
#project-info {
  flex-shrink: 0;
  padding: 14px 22px 10px;
  border-bottom: 1px solid var(--green);
}

#project-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

#selected-title {
  font-size: 3.3vh;
  color: var(--green);
  line-height: 1.2;
}

#selected-title a {
  color: var(--green);
  text-decoration: underline;
  font-size: inherit;
  font-family: inherit;
}

#selected-title a:hover {
  color: var(--ink);
  background: var(--green);
}

#selected-year {
  font-size: 2.2vh;
  color: var(--green);
  opacity: 0.72;
  white-space: nowrap;
}

#project-metadata {
  font-size: 1.85vh;
  color: var(--green);
  line-height: 1.55;
  opacity: 0.88;
}

#project-metadata a {
  color: var(--green);
  text-decoration: underline;
}

#project-metadata a:hover {
  color: var(--ink);
  background: var(--green);
}

/* ─── Media section ──────────────────────────────────────────────────────────── */
#media-section {
  flex-shrink: 0;
  height: 45vh;
  display: flex;
  gap: 10px;
  padding: 10px 22px;
  overflow: hidden;
}

/* ─── Carousel ───────────────────────────────────────────────────────────────── */
#carousel-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-width: 0;
}

#carousel-viewport {
  flex: 1;
  height: 100%;
  overflow: hidden;
  position: relative;
}

#carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
  will-change: transform;
}

#carousel-track img {
  height: 100%;
  object-fit: contain;
  flex-shrink: 0;
  cursor: zoom-in;
  display: block;
  /* width set via JS */
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: var(--green);
  color: var(--ink);
  border: 1px solid var(--green);
  font-size: 4vh;
  line-height: 1;
  cursor: pointer;
  padding: 3px 10px 5px;
  border-radius: 3px;
  opacity: 0.85;
  transition: background 0.12s, color 0.12s;
}

.carousel-btn:hover {
  background: var(--ink);
  color: var(--green);
  opacity: 1;
}

#carousel-prev { left: 4px; }
#carousel-next { right: 4px; }

#carousel-counter {
  position: absolute;
  bottom: 6px;
  right: 14px;
  font-size: 1.7vh;
  color: var(--green);
  opacity: 0.55;
  pointer-events: none;
}

/* ─── Video container ────────────────────────────────────────────────────────── */
#video-container {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
}

#video-container video,
#video-container iframe {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  display: block;
}

/* ─── Several videos with titles (player + list) ─────────────────────────────── */
#video-container.has-list {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
}
.vid-player {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
}
#video-container.has-list .vid-player iframe {
  height: 100%;
  width: auto;
  max-width: 100%;
  aspect-ratio: 16 / 9;
}
.vid-list {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  justify-content: center;
}
/* same highlight as the project list: word boxes on hover, whole line green when selected */
.vid-item {
  color: var(--green);
  text-decoration: none;
  font-size: 1.9vh;
  line-height: 1.35;
  padding: 2px 4px;
  cursor: pointer;
}
.vid-item .word {
  display: inline-block;
  padding: 0.03em 0.1em;
  transition: background-color 0.07s ease, color 0.07s ease;
}
.vid-item:hover .word,
.vid-item:focus-visible .word {
  background-color: var(--green);
  color: var(--ink);
}
.vid-item.selected {
  background-color: var(--green);
  color: var(--ink);
}
.vid-item.selected .word { background-color: transparent; color: var(--ink); }
.vid-item:focus-visible { outline: none; }

/* ─── Description ────────────────────────────────────────────────────────────── */
#description-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 22px 14px;
  min-height: 0;
}

#description-text p {
  font-size: 2.1vh;
  color: var(--green);
  line-height: 1.65;
  margin-bottom: 10px;
}

#description-text a {
  color: var(--green);
  text-decoration: underline;
}

#description-text a:hover {
  color: var(--ink);
  background: var(--green);
}

/* ─── Custom scrollbars ──────────────────────────────────────────────────────── */
#projects-list::-webkit-scrollbar,
#description-container::-webkit-scrollbar {
  width: 7px;
}

#projects-list::-webkit-scrollbar-track,
#description-container::-webkit-scrollbar-track {
  background: transparent;
}

#projects-list::-webkit-scrollbar-thumb,
#description-container::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 4px;
}

#projects-list::-webkit-scrollbar-thumb:hover,
#description-container::-webkit-scrollbar-thumb:hover {
  background: var(--green);
}

/* ─── Lightbox ───────────────────────────────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox.hidden {
  display: none;
}

#lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

#lightbox-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 90vw;
  max-height: 90vh;
}

#lightbox-img {
  max-width: 78vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

#lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  font-size: 4.5vh;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  line-height: 1;
  opacity: 0.75;
  transition: opacity 0.12s;
  padding: 4px;
}

#lightbox-close:hover {
  opacity: 1;
}

.lightbox-nav-btn {
  font-size: 6vh;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px 14px;
  opacity: 0.65;
  transition: opacity 0.12s;
  line-height: 1;
  flex-shrink: 0;
}

.lightbox-nav-btn:hover {
  opacity: 1;
}
