/* ============================================
   Photography Portfolio — Minimal B&W Style
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: transparent;
  pointer-events: none;
}

.site-title {
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  pointer-events: auto;
}

/* Site Right — view switcher + day/night toggle */
.site-right {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

/* --- Dropdown Component --- */
.dropdown {
  position: relative;
  pointer-events: auto;
}

.dropdown-trigger {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.dropdown-icon {
  font-size: 0.8rem;
}

.dropdown-view-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.dropdown-arrow {
  width: 10px;
  height: 10px;
  opacity: 0.4;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 0;
  width: max-content;
  background: rgba(22, 22, 28, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: dropdown-fade 0.18s ease;
}

.dropdown-menu-right {
  left: auto;
  right: 0;
}

.dropdown.open .dropdown-menu {
  display: block;
}

@keyframes dropdown-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.68rem;
  padding: 5px 10px 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-align: left;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

.dropdown-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
}

.dropdown-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  flex-shrink: 0;
  font-size: 0.72rem;
}

.dropdown-item-icon svg {
  width: 14px;
  height: 14px;
}

/* View btn — kept for theme-toggle only */
.view-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.view-btn svg {
  width: 15px;
  height: 15px;
}

.view-btn:hover {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Theme toggle — always visible, independent from view-switcher */
.theme-toggle {
  pointer-events: auto;
  margin-left: 6px;
}

.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
body.light-theme .theme-toggle .icon-moon { display: block; }
body.light-theme .theme-toggle .icon-sun { display: none; }

/* Light theme — Dropdowns */
body.light-theme .dropdown-trigger {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.7);
}

body.light-theme .dropdown-trigger:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.18);
}

body.light-theme .dropdown-menu {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

body.light-theme .dropdown-item {
  color: rgba(0, 0, 0, 0.55);
}

body.light-theme .dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.85);
}

body.light-theme .dropdown-item.active {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.9);
}

/* Views */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* Map view — fullscreen */
.view-map {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.view-map #photo-map {
  width: 100%;
  height: 100%;
}

/* --- Timeline View --- */
.view-timeline {
  padding: 60px 0 40px;
}

/* Timeline scroll area */
.timeline-scroll {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}

/* Month group */
.tl-month {
  margin-bottom: 48px;
}

.tl-month:last-child {
  margin-bottom: 0;
}

.tl-month-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tl-month-body {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Day group */
.tl-day {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tl-day-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  position: relative;
  padding-left: 16px;
}

.tl-day-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e63946;
}

/* Cards container — horizontal wrap on PC */
.tl-day-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Single card */
.tl-node {
  width: 220px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease, transform 0.2s ease;
}

.tl-node:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}

.tl-node img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.tl-device {
  font-size: 0.64rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.tl-params {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.35);
  font-variant-numeric: tabular-nums;
}

body.light-theme .tl-device {
  color: rgba(0, 0, 0, 0.55);
}

body.light-theme .tl-params {
  color: rgba(0, 0, 0, 0.3);
}

.tl-meta {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.tl-time {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  font-variant-numeric: tabular-nums;
}

.tl-loc {
  font-size: 0.64rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-device {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.22);
}

/* Light theme timeline */
body.light-theme .tl-month-label {
  color: rgba(0, 0, 0, 0.85);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .tl-day-label {
  color: rgba(0, 0, 0, 0.5);
}

body.light-theme .tl-node {
  background: rgba(0, 0, 0, 0.03);
}

body.light-theme .tl-node:hover {
  background: rgba(0, 0, 0, 0.07);
}

body.light-theme .tl-time {
  color: rgba(0, 0, 0, 0.75);
}

body.light-theme .tl-loc {
  color: rgba(0, 0, 0, 0.38);
}

body.light-theme .tl-device {
  color: rgba(0, 0, 0, 0.2);
}

/* --- Sort Bar --- */
.toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 50px 0 10px;
}

body.light-theme .toolbar {
  background: rgba(250, 250, 250, 0.88);
}

.sort-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 12px 0;
}

.sort-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.sort-btn:hover {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.25);
}

.sort-btn.active {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.sort-btn::after {
  content: '';
  display: inline-block;
  margin-left: 4px;
  width: 0;
}

.sort-btn.asc::after {
  content: '↑';
}

.sort-btn.desc::after {
  content: '↓';
}

.reset-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.62rem;
  cursor: pointer;
  padding: 2px 8px;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.reset-btn:hover {
  color: #e63946;
}

body.light-theme .reset-btn {
  color: rgba(0, 0, 0, 0.25);
}

body.light-theme .reset-btn:hover {
  color: #e63946;
}

/* Light theme sort bar */
body.light-theme .sort-btn {
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.4);
}

body.light-theme .sort-btn:hover {
  color: rgba(0, 0, 0, 0.7);
  border-color: rgba(0, 0, 0, 0.2);
}

body.light-theme .sort-btn.active {
  color: rgba(0, 0, 0, 0.85);
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 0;
  max-width: 720px;
  margin: 0 auto;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  flex-shrink: 0;
  font-size: 0.64rem;
  color: rgba(255, 255, 255, 0.45);
  width: 32px;
  text-align: right;
}

body.light-theme .filter-label {
  color: rgba(0, 0, 0, 0.4);
}

.filter-tags {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}

.filter-tags::-webkit-scrollbar {
  display: none;
}

.filter-tags:empty {
  display: none;
}

.filter-tag {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.66rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-tag:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.filter-tag.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.ft-count {
  font-size: 0.56rem;
  color: rgba(255, 255, 255, 0.4);
}

.filter-tag.active .ft-count {
  color: rgba(255, 255, 255, 0.75);
}

body.light-theme .filter-tag {
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.65);
}

body.light-theme .filter-tag:hover {
  color: rgba(0, 0, 0, 0.85);
  background: rgba(0, 0, 0, 0.08);
}

body.light-theme .filter-tag.active {
  color: #000;
  background: rgba(0, 0, 0, 0.12);
}

body.light-theme .ft-count {
  color: rgba(0, 0, 0, 0.35);
}

body.light-theme .filter-tag.active .ft-count {
  color: rgba(255, 255, 255, 0.75);
}

/* --- Masonry Gallery --- */
.gallery {
  column-count: 5;
  column-gap: 12px;
  padding: 140px 12px 40px;
  margin: 0 auto;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 20px;
  background: #111;
  border-radius: 4px;
  overflow: hidden;
}

.photo-wrapper {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.photo-wrapper img {
  width: 100%;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.6s ease;
  filter: none;
}

.photo-wrapper:hover img {
  transform: scale(1.03);
}

/* Photo info below image */
.photo-info {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  min-height: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  gap: 12px;
}

.photo-info.visible {
  opacity: 1;
}

.photo-info:empty {
  padding: 0;
  display: none;
}

.photo-info .info-left {
  flex: 1;
  min-width: 0;
}

.photo-info .info-right {
  text-align: right;
  flex-shrink: 0;
}

.photo-info .info-device,
.photo-info .info-params {
  font-variant-numeric: tabular-nums;
}

.photo-info .info-params {
  color: rgba(255, 255, 255, 0.5);
}

.photo-info .info-date {
  font-variant-numeric: tabular-nums;
}

.photo-info .info-location {
  color: rgba(255, 255, 255, 0.55);
}

/* Loading placeholder */
.gallery-item.loading .photo-wrapper {
  background: #1a1a1a;
  min-height: 200px;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

/* --- Lightbox --- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Color grading mode: left image + right sidebar */
.lightbox-overlay.cg-mode {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
}

.lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  height: 100%;
}

.lightbox-overlay.cg-mode .lightbox-body {
  flex: 1;
}

.lightbox-overlay.cg-mode .lightbox-image {
  max-width: 100%;
  max-height: 90vh;
}

.lightbox-image {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 2px;
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.35s ease;
  cursor: default;
}

.lightbox-overlay.active .lightbox-image {
  transform: scale(1);
  opacity: 1;
}

/* Sidebar hidden by default */
.lightbox-cg-sidebar {
  display: none;
}

.lightbox-overlay.cg-mode .lightbox-cg-sidebar {
  display: block;
  width: 320px;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(18, 18, 22, 0.98);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  cursor: default;
}

/* Sidebar scrollbar */
.lightbox-cg-sidebar::-webkit-scrollbar {
  width: 4px;
}
.lightbox-cg-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.lightbox-cg-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

/* Adjust nav/close in cg-mode */
.lightbox-overlay.cg-mode .lightbox-nav,
.lightbox-overlay.cg-mode .lightbox-counter,
.lightbox-overlay.cg-mode .lightbox-exif {
  display: none;
}

.lightbox-overlay.cg-mode .lightbox-close {
  right: 332px;
}

/* Sidebar always stays dark inside lightbox — no light theme override */

/* Lightbox navigation */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 2.4rem;
  cursor: pointer;
  padding: 20px;
  transition: color 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1;
}

.lightbox-nav:hover {
  color: rgba(255, 255, 255, 0.9);
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 12px;
  transition: color 0.2s ease;
  line-height: 1;
}

.lightbox-close:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* Counter */
.lightbox-counter {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.5);
}

/* EXIF Info Bar */
.lightbox-exif {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  max-width: 92vw;
  width: auto;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  opacity: 0;
  transition: opacity 0.4s ease;
  font-variant-numeric: tabular-nums;
  gap: 24px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-exif.visible {
  opacity: 1;
}

.lightbox-exif .exif-device,
.lightbox-exif .exif-params,
.lightbox-exif .exif-date {
  color: rgba(255, 255, 255, 0.8);
}

/* Desktop: one line with · separators */
.lightbox-exif .exif-device::after,
.lightbox-exif .exif-params::after,
.lightbox-exif .exif-date::after {
  content: '  ·  ';
  color: rgba(255, 255, 255, 0.3);
}

.lightbox-exif .exif-location {
  color: rgba(255, 255, 255, 0.55);
}

/* --- Photo Map --- */
#photo-map .leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.5) !important;
  color: rgba(255, 255, 255, 0.4) !important;
  font-size: 0.6rem;
}

#photo-map .leaflet-control-attribution a {
  color: rgba(255, 255, 255, 0.5) !important;
}

#photo-map .leaflet-control-zoom {
  margin-top: 70px;
}

.map-photo-marker {
  background: #e63946;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 0 12px rgba(230, 57, 70, 0.7), 0 0 24px rgba(230, 57, 70, 0.35);
  transition: transform 0.2s ease;
}

.map-photo-marker:hover {
  transform: scale(1.4);
}

.map-tooltip {
  background: rgba(18, 18, 18, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 0.72rem !important;
  padding: 0 !important;
  border-radius: 6px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
  overflow: hidden;
  max-width: 200px;
}

.map-tooltip::before {
  display: none !important;
}

.map-tooltip-content {
  display: flex;
  flex-direction: column;
}

.map-tooltip-thumb {
  width: 200px;
  height: 130px;
  object-fit: cover;
  display: block;
}

.map-tooltip-info {
  padding: 8px 10px;
}

.map-tooltip-location {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
  margin-bottom: 3px;
}

.map-tooltip-coords {
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.35);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 40px 20px 32px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.2);
}

/* --- Responsive --- */
@media (max-width: 1400px) {
  .gallery {
    column-count: 4;
    padding: 90px 10px 30px;
  }
}

@media (max-width: 900px) {
  .gallery {
    column-count: 2;
    column-gap: 8px;
    padding: 80px 8px 24px;
  }
  .gallery-item {
    margin-bottom: 8px;
  }
  /* Card info: stack on tablets */
  .photo-info {
    flex-direction: column;
    gap: 4px;
  }
  .photo-info .info-right {
    text-align: left;
  }
  /* Lightbox EXIF: stack on mobile */
  .lightbox-exif .exif-device,
  .lightbox-exif .exif-params,
  .lightbox-exif .exif-date,
  .lightbox-exif .exif-location {
    display: block;
    text-align: center;
  }
  .lightbox-exif .exif-device::after,
  .lightbox-exif .exif-params::after,
  .lightbox-exif .exif-date::after {
    content: '';
  }
  /* Timeline mobile */
  .tl-node {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .gallery {
    column-count: 1;
    column-gap: 0;
    padding: 130px 6px 20px;
  }
  .gallery-item {
    margin-bottom: 6px;
  }
  .site-header {
    padding: 12px 14px;
  }
  .toolbar {
    padding-top: 48px;
  }
  /* Sort bar: smaller on mobile */
  .sort-bar {
    gap: 6px;
    padding: 10px 8px 0;
  }
  .sort-btn {
    font-size: 0.66rem;
    padding: 4px 10px;
  }
  /* Card info */
  .photo-info {
    padding: 8px 10px;
    font-size: 0.64rem;
  }
  /* Lightbox */
  .lightbox-nav {
    font-size: 1.8rem;
    padding: 14px;
  }
  .lightbox-prev {
    left: 4px;
  }
  .lightbox-next {
    right: 4px;
  }
  .lightbox-counter {
    bottom: 70px;
    font-size: 0.68rem;
  }
  .lightbox-exif {
    bottom: 10px;
    padding: 6px 12px;
    max-width: 96vw;
    font-size: 0.64rem;
    gap: 2px;
    border-radius: 4px;
  }
}

/* --- Scroll hide body overflow when lightbox open --- */
body.lightbox-open {
  overflow: hidden;
}

/* ==========================================
   Light Theme
   ========================================== */
body.light-theme {
  background: #f5f5f5;
  color: #222;
}

body.light-theme .site-header {
  background: transparent;
}

body.light-theme .site-title {
  color: rgba(0, 0, 0, 0.7);
}

body.light-theme .view-btn {
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.35);
}

body.light-theme .view-btn:hover {
  color: rgba(0, 0, 0, 0.7);
  border-color: rgba(0, 0, 0, 0.25);
}

body.light-theme .view-btn.active {
  color: rgba(0, 0, 0, 0.85);
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .view-divider {
  background: rgba(0, 0, 0, 0.1);
}

body.light-theme .gallery-item {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

body.light-theme .photo-wrapper img {
  filter: none;
}

body.light-theme .photo-info {
  color: rgba(0, 0, 0, 0.6);
}

body.light-theme .photo-info .info-params {
  color: rgba(0, 0, 0, 0.4);
}

body.light-theme .photo-info .info-location {
  color: rgba(0, 0, 0, 0.4);
}

body.light-theme .gallery-item.loading .photo-wrapper {
  background: #e8e8e8;
}

body.light-theme .site-footer {
  color: rgba(0, 0, 0, 0.2);
}

body.light-theme ::selection {
  background: rgba(0, 0, 0, 0.12);
}

/* === River View === */
.view-river {
  padding: 70px 0 40px;
}

.river-container {
  max-width: 100%;
  padding: 0 24px;
}

/* Tab bar — switch between parameter lanes */
.river-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
  padding: 0 12px;
}

.river-tab {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.river-tab:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
}

.river-tab.active {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

body.light-theme .river-tab {
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.45);
}

body.light-theme .river-tab:hover {
  color: rgba(0, 0, 0, 0.8);
  border-color: rgba(0, 0, 0, 0.25);
}

body.light-theme .river-tab.active {
  color: rgba(0, 0, 0, 0.9);
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.18);
}

@media (max-width: 600px) {
  .river-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0 16px;
    -webkit-overflow-scrolling: touch;
  }

  .river-tab {
    flex-shrink: 0;
  }
}

.river-lane {
  margin-bottom: 56px;
  position: relative;
}

.river-lane:last-child {
  margin-bottom: 0;
}

.river-header {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  padding-left: 4px;
}

.river-label {
  font-size: 1.2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.05em;
}

.river-range {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}


.river-card {
  flex-shrink: 0;
  width: 220px;
  height: 240px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.river-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.river-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.river-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Light theme overrides for river */
body.light-theme .river-label {
  color: rgba(0, 0, 0, 0.85);
}

body.light-theme .river-range {
  color: rgba(0, 0, 0, 0.4);
}

body.light-theme .river-gradient {
  opacity: 0.12;
}

body.light-theme .river-card {
  background: rgba(0, 0, 0, 0.04);
}

/* River scene groups */
.river-group {
  display: flex;
  align-items: stretch;
  margin-bottom: 2px;
}

.river-group:last-child {
  margin-bottom: 0;
}

.river-group-header {
  flex-shrink: 0;
  width: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 14px 16px 14px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  text-align: right;
  gap: 3px;
}

.river-group-range {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.river-group-desc {
  font-size: 0.64rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.3;
}

.river-group-label {
  font-size: 0.58rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
}

.river-group-cards {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 12px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* PC: wrap to new line instead of horizontal scroll */
@media (min-width: 601px) {
  .river-group-cards {
    flex-wrap: wrap;
    align-items: flex-start;
    overflow-x: visible;
    overflow-y: visible;
    row-gap: 10px;
  }
}

.river-group-cards::-webkit-scrollbar {
  height: 3px;
}

.river-group-cards::-webkit-scrollbar-track {
  background: transparent;
}

.river-group-cards::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

.river-group-empty {
  padding: 16px 12px;
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  margin: 10px 12px;
}

/* Light theme overrides for groups */
body.light-theme .river-group-header {
  border-right-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .river-group-range {
  color: rgba(0, 0, 0, 0.85);
}

body.light-theme .river-group-desc {
  color: rgba(0, 0, 0, 0.5);
}

body.light-theme .river-group-label {
  color: rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.04);
}

body.light-theme .river-group-cards::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.06);
}

body.light-theme .river-group-empty {
  color: rgba(0, 0, 0, 0.35);
  border-color: rgba(0, 0, 0, 0.1);
}

/* --- Tone Cards with Histogram --- */
.river-card--tone {
  width: 220px;
  height: auto;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.4);
}

.river-card--tone img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.river-card--tone .river-card-label {
  position: static;
  background: none;
  padding: 3px 8px 0;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.45);
}

.tone-histogram {
  display: block;
  width: 100%;
  height: 40px;
  border-radius: 0 0 8px 8px;
  image-rendering: pixelated;
}

body.light-theme .river-card--tone {
  background: rgba(0, 0, 0, 0.06);
}

/* --- Tone Lane Loading --- */
.tone-loading {
  padding: 24px 16px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.04em;
  animation: tonePulse 1.5s ease-in-out infinite;
}

@keyframes tonePulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

body.light-theme .tone-loading {
  color: rgba(0, 0, 0, 0.3);
}

@media (max-width: 600px) {
  .river-header {
    flex-direction: row !important;
    align-items: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    justify-content: flex-start;
  }

  .river-trend {
    margin-left: 8px;
  }

  .river-affect {
    margin-left: 8px;
    font-size: 0.58rem;
  }

  .river-group {
    flex-direction: column;
  }

  .river-group-header {
    width: auto;
    align-items: baseline;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 8px 12px 6px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
  }
}

/* River affect tag */
.river-affect {
  margin-left: 14px;
  font-size: 0.64rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
}

body.light-theme .river-affect {
  color: rgba(0, 0, 0, 0.45);
  background: rgba(0, 0, 0, 0.05);
}

/* River trend arrow — inline with header */
.river-trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 14px;
}

.river-trend-endpoint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.river-trend-num,
.river-trend-feel {
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.2;
}

body.light-theme .river-trend-num,
body.light-theme .river-trend-feel {
  color: rgba(0, 0, 0, 0.4);
}

.river-trend-arrow {
  display: inline-block;
  width: 36px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.25);
  position: relative;
}

.river-trend-arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 3px 0 3px 5px;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.4);
}

body.light-theme .river-trend-left,
body.light-theme .river-trend-right {
  color: rgba(0, 0, 0, 0.4);
}

body.light-theme .river-trend-arrow {
  background: rgba(0, 0, 0, 0.15);
}

body.light-theme .river-trend-arrow::after {
  border-color: transparent transparent transparent rgba(0, 0, 0, 0.3);
}

/* River video embed */
.river-video {
  margin-bottom: 40px;
}

.river-video-header {
  font-size: 0.76rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
  padding-left: 4px;
}

.river-video-wrapper {
  position: relative;
  width: 100%;
  max-width: 640px;
  padding-bottom: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.river-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

body.light-theme .river-video-header {
  color: rgba(0, 0, 0, 0.45);
}

body.light-theme .river-video-wrapper {
  background: rgba(0, 0, 0, 0.05);
}

/* === Vlog Player Overlay === */
.vlog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.vlog-overlay.active {
  display: flex;
}

.vlog-player {
  position: relative;
  width: 90vw;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.vlog-player iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.vlog-close {
  position: absolute;
  top: -36px;
  right: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
  z-index: 10;
}

.vlog-close:hover {
  color: #fff;
}

/* Vlog entry card — shared style for map & gallery */
.vlog-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.95);
  transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.2s, background 0.2s;
}

.vlog-entry.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.vlog-entry:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(20, 20, 20, 0.92);
}

.vlog-entry-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  animation: vlogPulse 2s ease-in-out infinite;
}

@keyframes vlogPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}

.vlog-entry-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vlog-entry-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.vlog-entry-subtitle {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Map-specific positioning */
.vlog-entry--map {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px) scale(0.95);
  z-index: 800;
}

.vlog-entry--map.visible {
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Vlog gallery banner */
/* Gallery-specific — floating centered above photos */
.vlog-entry--gallery {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px) scale(0.95);
  z-index: 800;
  width: fit-content;
}

.vlog-entry--gallery.visible {
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Light theme for vlog entries */
body.light-theme .vlog-entry {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .vlog-entry:hover {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.96);
}

body.light-theme .vlog-entry-icon {
  background: rgba(0, 0, 0, 0.06);
}

body.light-theme .vlog-entry-title {
  color: rgba(0, 0, 0, 0.85);
}

body.light-theme .vlog-entry-subtitle {
  color: rgba(0, 0, 0, 0.4);
}

@keyframes vlogPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.08); }
  50% { box-shadow: 0 0 0 8px rgba(0, 0, 0, 0); }
}

/* River source attribution */
.river-source {
  margin-top: 40px;
  padding: 16px 24px;
  font-size: 0.64rem;
  color: rgba(255, 255, 255, 0.3);
  line-height: 1.8;
}

.river-source a {
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 0.2s, border-color 0.2s;
}

.river-source a:hover {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.3);
}

body.light-theme .river-source {
  color: rgba(0, 0, 0, 0.3);
}

body.light-theme .river-source a {
  color: rgba(0, 0, 0, 0.45);
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .river-source a:hover {
  color: rgba(0, 0, 0, 0.7);
  border-bottom-color: rgba(0, 0, 0, 0.3);
}

/* River responsive */
@media (max-width: 600px) {
  .river-card {
    width: 160px;
  }

  .river-container {
    padding: 0 12px;
  }

  .river-card {
    width: 160px;
  }
}

/* ============================================
   Theme Tabs — Photo / Music Switch (shared)
   ============================================ */
.site-left {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: auto;
}

/* Hide view-dropdown for non-gallery themes */
body[data-theme="music"] .view-dropdown,
body[data-theme="design"] .view-dropdown,
body[data-theme="reading"] .view-dropdown {
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px);
  transition: opacity 0.3s, transform 0.3s;
}

/* --- Placeholder Views --- */
.placeholder-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 60px 24px;
  text-align: center;
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.6;
}

.placeholder-title {
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.placeholder-desc {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.05em;
}

body.light-theme .placeholder-title {
  color: rgba(0, 0, 0, 0.5);
}

body.light-theme .placeholder-desc {
  color: rgba(0, 0, 0, 0.3);
}

.view-switcher {
  transition: opacity 0.35s ease, transform 0.35s ease;
}
