/* Basic, clean styling. Customize freely. */

:root {
  --bg: #0b0f14;
  --panel: rgba(18, 24, 38, 0.75);
  --text: #e8eef6;
  --muted: rgba(232, 238, 246, 0.7);
  --border: rgba(255, 255, 255, 0.12);
  --accent: #ff6a00;
  --accent2: #ff9f1c;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1000px 500px at 10% 0%, rgba(255, 159, 28, 0.20), transparent 60%),
              radial-gradient(900px 520px at 90% 10%, rgba(255, 106, 0, 0.16), transparent 60%),
              var(--bg);
  color: var(--text);
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.brand__title {
  font-weight: 800;
  letter-spacing: 0.2px;
}
.brand__subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.nav__btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 650;
}
.nav__btn:hover {
  border-color: rgba(255, 106, 0, 0.35);
}
.nav__btn.is-active {
  background: linear-gradient(90deg,
    rgba(11, 15, 20, 0.65),
    rgba(255, 106, 0, 0.32)
  );
  border-color: rgba(255, 106, 0, 0.45);
}
.nav__divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  display: inline-block;
  margin: 0 6px;
}
.nav__pages { display: inline-flex; gap: 10px; flex-wrap: wrap; }

.main {
  height: calc(100vh - 68px);
}

.tab {
  display: none;
  height: 100%;
}
.tab.is-active {
  display: block;
}

.map {
  height: 100%;
  width: 100%;
}

.mapHud {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 5;
  display: grid;
  gap: 10px;
  max-width: min(520px, calc(100vw - 28px));
}
.hudStatus, .hudHint {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  backdrop-filter: blur(10px);
}
.hudStatus { display: none; }
.hudStatus.is-visible { display: block; }
.hudHint { color: var(--muted); font-size: 13px; }

.panel {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}
.panel__controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel__summary {
  color: var(--muted);
  font-size: 13px;
  padding-bottom: 8px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 240px;
}
.field__label { font-size: 12px; color: var(--muted); }
.field__input {
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  outline: none;
}
.field__input:focus { border-color: rgba(255, 106, 0, 0.75); }

.tableWrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(10px);
}
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.table th, .table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  vertical-align: top;
}
.table th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  position: sticky;
  top: 0;
  background: rgba(11, 15, 20, 0.75);
  backdrop-filter: blur(10px);
}
.table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}
.table button.rowBtn {
  all: unset;
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
}
.table button.rowBtn:hover {
  text-decoration: underline;
}

.panel__note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 18px;
}
.page__title { margin: 8px 0 14px; }
.page__content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  backdrop-filter: blur(10px);
  line-height: 1.55;
}
.page__content a { color: var(--accent2); }
.page__content code {
  background: rgba(0,0,0,0.35);
  padding: 2px 6px;
  border-radius: 8px;
}

.footer {
  border-top: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(11, 15, 20, 0.85), rgba(255, 106, 0, 0.16));
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

/* Popup */
.summitPopup {
  max-width: 360px;
}
.summitPopup__title {
  margin: 0 0 6px;
  font-size: 16px;
}
.summitPopup__meta {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  margin-bottom: 10px;
}
.summitPopup__meta div { margin-bottom: 3px; }

.summitPopup__videoTitle {
  font-weight: 700;
  margin: 10px 0 8px;
}
.summitPopup__select {
  width: 100%;
  margin: 6px 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.2);
}

.summitPopup__iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.summitPopup__links {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.summitPopup__links a {
  color: var(--accent2);
  font-weight: 650;
  font-size: 13px;
  text-decoration: none;
}
.summitPopup__links a:hover { text-decoration: underline; }

/* Make Mapbox popup content match the site style a bit */
.mapboxgl-popup-content {
  background: rgba(11, 15, 20, 0.92);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.mapboxgl-popup-tip {
  border-top-color: rgba(11, 15, 20, 0.92) !important;
}


/* Mapbox attribution (bottom-right "citation" control) */
.mapboxgl-ctrl.mapboxgl-ctrl-attrib,
.mapboxgl-ctrl.mapboxgl-ctrl-attrib.mapboxgl-compact {
  background: rgba(11, 15, 20, 0.78) !important;
  color: rgba(232, 238, 246, 0.75) !important;
  border: 1px solid rgba(255, 106, 0, 0.22);
  border-radius: 12px;
  padding: 6px 8px !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.mapboxgl-ctrl-attrib a {
  color: var(--accent2) !important;
  text-decoration: none;
}
.mapboxgl-ctrl-attrib a:hover { text-decoration: underline; }

.mapboxgl-ctrl-attrib-button {
  background: rgba(11, 15, 20, 0.78) !important;
  border: 1px solid rgba(255, 106, 0, 0.22) !important;
  border-radius: 12px !important;
}



.otherIntro {
  margin-bottom: 16px;
}
.otherIntro__title {
  margin: 0 0 12px;
}
.otherIntro__content {
  background: rgba(255, 159, 28, 0.12);
  border: 1px solid rgba(255, 159, 28, 0.28);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text);
  line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.otherIntro__content > :first-child { margin-top: 0; }
.otherIntro__content > :last-child { margin-bottom: 0; }
.otherIntro__content a { color: var(--accent2); }

.table__empty {
  color: var(--muted);
  font-style: italic;
}

.otherPopup__header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.otherPopup__badge {
  width: 40px;
  height: 40px;
  min-width: 40px;
  flex: 0 0 40px;
  object-fit: contain;
}
.otherPopup__titleWrap {
  min-width: 0;
}
.otherPopup .summitPopup__title {
  margin-top: 4px;
}

#otherTable {
  min-width: 760px;
}
#otherTable th:nth-child(1),
#otherTable td:nth-child(1) {
  width: 280px;
  min-width: 280px;
}
#otherTable th:nth-child(2),
#otherTable td:nth-child(2),
#otherTable th:nth-child(3),
#otherTable td:nth-child(3),
#otherTable th:nth-child(4),
#otherTable td:nth-child(4),
#otherTable th:nth-child(5),
#otherTable td:nth-child(5) {
  white-space: nowrap;
}
#otherTable th:nth-child(2),
#otherTable td:nth-child(2) {
  width: 130px;
  min-width: 130px;
}
#otherTable th:nth-child(3),
#otherTable td:nth-child(3) {
  width: 170px;
  min-width: 170px;
}
#otherTable th:nth-child(4),
#otherTable td:nth-child(4) {
  width: 150px;
  min-width: 150px;
}
#otherTable th:nth-child(5),
#otherTable td:nth-child(5) {
  width: 92px;
  min-width: 92px;
}

/* Mobile adjustments */
@media (max-width: 720px) {
  .main { height: calc(100vh - 92px); }
  .field { min-width: 160px; flex: 1; }
  .table { min-width: 680px; }
}

/* --- Photo backgrounds for Summits and About tabs --- */
#tab-page, #tab-summits, #tab-other {
  /* Let these tabs grow if their content is taller than the viewport */
  height: auto;
  min-height: 100%;
  position: relative;
}

.tabPhotoBg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Ensure the real content sits above the photo background */
#tab-page .page,
#tab-summits .panel,
#tab-other .panel {
  position: relative;
  z-index: 1;
}

/* About tab background */
.tabPhotoBg--about {
  background-image: url('./assets/about-bg.jpg');
  background-size: cover;
  background-position: center;
  /* Slight brightening for a more vivid background */
  filter: brightness(1.10) saturate(1.05) contrast(1.03);
}

/* Other tab background */
.tabPhotoBg--other {
  background-image: url('./assets/other-bg.jpg');
  background-size: cover;
  background-position: center center;
  filter: brightness(1.04) saturate(1.04) contrast(1.03);
}

/* Summits tab: 4 photo bands (top → bottom) */
.tabPhotoBg--summits .tabPhotoBg__band {
  position: absolute;
  left: 0;
  right: 0;
  height: 25%;
  background-size: cover;
  background-position: center;
  /* Brighter + slightly punchier for readability and pop */
  filter: brightness(1.10) saturate(1.05) contrast(1.05);
}

/* Summits tab photo order tweak:
   Move the 4th photo to the top, keep the remaining order the same.
   Old: 1,2,3,4  ->  New: 4,1,2,3 */
.tabPhotoBg--summits .tabPhotoBg__band.is-1 { top: 0%;  background-image: url('./assets/summits-bg-4.jpg'); }
.tabPhotoBg--summits .tabPhotoBg__band.is-2 { top: 25%; background-image: url('./assets/summits-bg-1.jpg'); }
.tabPhotoBg--summits .tabPhotoBg__band.is-3 { top: 50%; background-image: url('./assets/summits-bg-2.jpg'); }
.tabPhotoBg--summits .tabPhotoBg__band.is-4 { top: 75%; background-image: url('./assets/summits-bg-3.jpg'); }

/* Dark overlay for readability (applied on top of the photos, behind content) */
.tabPhotoBg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(11, 15, 20, 0.55) 0%,
    rgba(11, 15, 20, 0.35) 45%,
    rgba(11, 15, 20, 0.55) 100%
  );
}

/* --- Summits table column tuning: prevent overlap, pull Location left a bit, give Company more room --- */
#summitsTable {
  min-width: 980px;
}

/* Keep Name, Elevation, Location, and Summit date on one line */
#summitsTable th:nth-child(1),
#summitsTable td:nth-child(1),
#summitsTable th:nth-child(2),
#summitsTable td:nth-child(2),
#summitsTable th:nth-child(3),
#summitsTable td:nth-child(3),
#summitsTable th:nth-child(4),
#summitsTable td:nth-child(4) {
  white-space: nowrap;
}

/* Name column: still slightly narrower, but let very long names breathe if needed */
#summitsTable th:nth-child(1),
#summitsTable td:nth-child(1) {
  width: 198px;
  min-width: 198px;
}

/* Elevation + Summit date: reserve enough room so they never collide with neighbors */
#summitsTable th:nth-child(2),
#summitsTable td:nth-child(2) {
  width: 108px;
  min-width: 108px;
  font-size: 13px;
}

#summitsTable th:nth-child(4),
#summitsTable td:nth-child(4) {
  width: 122px;
  min-width: 122px;
  font-size: 13px;
}

/* Location: pull it left a bit, but use min-width (not max-width) so it never overlaps Summit date */
#summitsTable th:nth-child(3),
#summitsTable td:nth-child(3) {
  font-size: 12px;
  width: 138px;
  min-width: 138px;
}

/* Company: give names a bit more room while keeping the compact font size */
#summitsTable th:nth-child(5),
#summitsTable td:nth-child(5) {
  width: 238px;
  min-width: 238px;
}

#summitsTable td:nth-child(5) {
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}
