/* =========================================================================
   Travel section — Academic grid, interactive maps, lightbox
   Loaded by index.html (Life Mode → Travel). Theme-aware via body.mode-life.
   ========================================================================= */

/* Larger sub-tabs for Academic / Personal */
.life-subtabs.travel-tabs { gap: 14px; margin-bottom: 22px; }
.life-subtabs.travel-tabs .life-subtab-btn {
  padding: 11px 26px;
  font-size: 0.95em;
  border-radius: 999px;
}

/* ---------- Academic travel grid ---------- */
.acad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.acad-card {
  background: #fff;
  border: 1px solid #ecebe4;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.acad-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,0.14); }
.acad-card .acad-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background-size: cover;
  background-position: center;
  background-color: #e9ece6;
  position: relative;
}
.acad-card .acad-photo.square { aspect-ratio: 1 / 1; }
.acad-card .acad-name {
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.92em;
  color: #2c3e50;
  text-align: center;
  line-height: 1.35;
}

/* ---------- Photography grid: hover-reveal year / location / caption ----------
   Photography cards reuse .acad-card (same lift + shadow + rounded corners),
   plus a .photo-card modifier that overlays metadata directly on the photo
   instead of showing a caption block underneath it. */
.acad-card.photo-card { position: relative; }

/* Dark ribbon gradients behind the text, hidden until hover */
.acad-card.photo-card::before,
.acad-card.photo-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}
.acad-card.photo-card::before {
  top: 0;
  height: 42%;
  background: linear-gradient(to bottom, rgba(15, 17, 15, 0.62), rgba(15, 17, 15, 0));
}
.acad-card.photo-card::after {
  bottom: 0;
  height: 46%;
  background: linear-gradient(to top, rgba(15, 17, 15, 0.72), rgba(15, 17, 15, 0));
}
.acad-card.photo-card:hover::before,
.acad-card.photo-card:hover::after {
  opacity: 1;
}

.photo-meta-top {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 11px 13px;
  text-align: right;
  opacity: 0.4;
  transform: translateY(-5px);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.photo-year {
  color: #fff;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}
.photo-location {
  color: #f1efe8;
  font-size: 0.7em;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.photo-meta-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 12px 14px;
  opacity: 0.4;
  transform: translateY(5px);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.photo-caption {
  color: #fff;
  font-size: 0.86em;
  font-weight: 600;
  line-height: 1.35;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.acad-card.photo-card:hover .photo-meta-top,
.acad-card.photo-card:hover .photo-meta-bottom {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Personal travel: maps ---------- */
.travel-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.map-switch { display: inline-flex; background: #eef1ec; border-radius: 999px; padding: 4px; }
.map-switch button {
  margin: 0;
  border: none;
  background: transparent;
  color: #55634f;
  font-weight: 700;
  font-size: 0.85em;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.map-switch button.active { background: #6a994e; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }

.map-legend { display: flex; align-items: center; gap: 16px; font-size: 0.8em; color: #6b7280; flex-wrap: wrap; }
.map-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.map-legend .sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.map-legend .sw.visited { background: #6a994e; }
.map-legend .sw.photos { background: #b5652d; border-radius: 50%; }

.travel-map-wrap {
  position: relative;
  background: linear-gradient(180deg, #f3f6f1, #eef2ea);
  border: 1px solid #e4e9de;
  border-radius: 14px;
  padding: 8px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}
.travel-map {
  width: 100%;
  height: 60vh;
  min-height: 420px;
  max-height: 620px;
}
#india-map { display: none; } /* unused — India now lives on the same map as states, see travel.js */

.map-loading, .map-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #7d8a72;
  font-size: 0.9em;
  text-align: center;
  padding: 20px;
}
.map-fallback { display: none; }
.map-spinner {
  width: 34px; height: 34px;
  border: 3px solid #d6e0cf;
  border-top-color: #6a994e;
  border-radius: 50%;
  animation: tvspin 0.9s linear infinite;
}
@keyframes tvspin { to { transform: rotate(360deg); } }

/* jsVectorMap tooltip theme */
.jvm-tooltip {
  border-radius: 8px !important;
  background: #2e3b2f !important;
  color: #fff !important;
  padding: 8px 12px !important;
  font-family: Arial, sans-serif !important;
  font-size: 0.82em !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25) !important;
  line-height: 1.4 !important;
}
.jvm-tooltip .tt-title { font-weight: 700; }
.jvm-tooltip .tt-sub { opacity: 0.85; font-size: 0.92em; }
.jvm-tooltip .tt-photos { color: #ffd9a8; font-size: 0.9em; margin-top: 2px; }

/* Country chips fallback (if map library fails to load) */
.country-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.country-chip {
  border: 1px solid #d9e0d2;
  background: #f4f7f1;
  color: #3c5a3e;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.82em;
  font-weight: 600;
  cursor: default;
}
.country-chip.has-photos { cursor: pointer; background: #6a994e; color: #fff; border-color: #6a994e; }
.country-chip.has-photos:hover { background: #557d3e; }

/* ---------- Lightbox ---------- */
.tv-lb {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 18, 14, 0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 16px 20px;
}
.tv-lb.open { display: flex; }
.tv-lb-title {
  color: #fff;
  font-size: 1.05em;
  font-weight: 700;
  margin-bottom: 14px;
  text-align: center;
}
.tv-lb-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1100px;
  width: 100%;
  flex: 1;
  min-height: 0;
}
.tv-lb-img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  object-fit: contain;
}
.tv-lb-btn {
  margin: 0;
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  width: 46px; height: 46px;
  border-radius: 50%;
  font-size: 1.6em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.tv-lb-btn:hover { background: rgba(255,255,255,0.28); }
.tv-lb-prev { position: absolute; left: 8px; }
.tv-lb-next { position: absolute; right: 8px; }
.tv-lb-close {
  position: absolute;
  top: 18px; right: 22px;
  width: 44px; height: 44px;
  font-size: 1.8em;
}
.tv-lb-cap { color: #d9dcd5; font-size: 0.85em; margin-top: 12px; text-align: center; }
.tv-lb-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 6px;
}
.tv-lb-thumb {
  width: 64px; height: 48px;
  border-radius: 5px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  opacity: 0.55;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}
.tv-lb-thumb:hover { opacity: 0.85; }
.tv-lb-thumb.active { opacity: 1; border-color: #6a994e; }

/* Toast */
.tv-toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #2e3b2f;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.86em;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 2100;
}
.tv-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Empty states */
.tv-empty {
  text-align: center;
  color: #8a9382;
  padding: 30px 16px;
  font-size: 0.9em;
  border: 1px dashed #d3dccb;
  border-radius: 12px;
  background: #f8faf5;
}
.tv-empty code {
  background: #eef2e8;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #55634f;
}

/* ---------- Guitar & Singing: video grid ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.video-card {
  background: #fff;
  border: 1px solid #ecebe4;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.video-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,0.14); }
.video-card .video-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #1b1f1a;
}
.video-card .video-meta { padding: 12px 14px; }
.video-card .video-title {
  font-weight: 700;
  font-size: 0.92em;
  color: #2c3e50;
  line-height: 1.35;
}
.video-card .video-sub {
  font-size: 0.8em;
  color: #7d8a72;
  margin-top: 3px;
}

/* ---------- Carousels (Photography + Guitar & Singing) ----------
   Default state: a horizontally-scrolling "window" onto the grid, with
   prev/next arrows and gentle autoplay. ".carousel-mode" is what turns a
   normal wrapping grid into that scrolling strip — removing the class
   (via the "Show all" toggle) reveals the exact same cards as an ordinary
   wrapped grid, with nothing re-rendered or duplicated. */
.carousel-expand-btn {
  border: 1px solid #cfd8c4;
  background: #fff;
  color: #3c5a3e;
  font-size: 0.8em;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.carousel-expand-btn:hover { background: #f3f6f1; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }

.carousel-wrap { position: relative; }
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #e4e9de;
  background: rgba(255,255,255,0.95);
  color: #3c5a3e;
  font-size: 1.3em;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.carousel-arrow:hover { background: #fff; }
.carousel-arrow.prev { left: -6px; }
.carousel-arrow.next { right: -6px; }

.life-grid.carousel-mode {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 18px;
  padding: 2px 4px 10px;
  /* thin, unobtrusive scrollbar where supported, invisible elsewhere */
  scrollbar-width: thin;
}
.life-grid.carousel-mode::-webkit-scrollbar { height: 6px; }
.life-grid.carousel-mode::-webkit-scrollbar-thumb { background: #d3dccb; border-radius: 999px; }
.life-grid.carousel-mode > * {
  scroll-snap-align: start;
  flex: 0 0 auto;
}
.acad-grid.carousel-mode > .acad-card { width: 210px; }
.video-grid.carousel-mode > .video-card { width: 280px; }
.life-grid.carousel-mode > .tv-empty { flex: 1 1 100%; width: 100%; }

@media (max-width: 600px) {
  .acad-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .video-grid { grid-template-columns: 1fr; }
  .acad-grid.carousel-mode > .acad-card { width: 150px; }
  .video-grid.carousel-mode > .video-card { width: 240px; }
  .carousel-arrow { width: 32px; height: 32px; font-size: 1.1em; }
  .carousel-arrow.prev { left: -4px; } .carousel-arrow.next { right: -4px; }
  .travel-map { height: 46vh; min-height: 300px; }
  .tv-lb-prev { left: 2px; } .tv-lb-next { right: 2px; }
}
