*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
main {
  width: 100%;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  background: #f6f5f0;
  color: #252a24;
  font-family: "Segoe UI", Arial, sans-serif;
}

.site-header {
  position: relative;
  display: grid;
  min-height: 126px;
  place-items: center;
  padding: 20px max(5vw, 24px);
  border-bottom: 1px solid #e7e6de;
  background: #fffefa;
}

.site-masthead {
  text-align: center;
}

.site-title {
  color: #252a24;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 750;
  letter-spacing: -1.2px;
  text-decoration: none;
}

.site-masthead p {
  margin: 5px 0 0;
  color: #60665c;
  font-size: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #252a24;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #286849;
  color: #fff;
  font-size: 20px;
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  color: #7c8177;
  font-size: 10px;
  font-weight: 400;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 25px;
}

.site-nav a {
  color: #60665c;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  color: #286849;
}

.language-picker {
  position: absolute;
  top: 20px;
  left: max(5vw, 24px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid #e7e6de;
  border-radius: 7px;
  color: #60665c;
  font-size: 12px;
}

.language-picker select {
  max-width: 125px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: 600 11px "Segoe UI", Arial, sans-serif;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 36px max(5vw, 24px) 48px;
}

.home-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin: 0 0 35px;
}

.home-tile {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid #e7e6de;
  border-radius: 11px;
  background: #fffefa;
  color: #343b32;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.home-tile:hover {
  transform: translateY(-2px);
  border-color: #a9c2aa;
  box-shadow: 0 5px 16px rgba(43, 49, 36, .07);
}

.home-tile-arrow {
  flex: 0 0 auto;
  color: #286849;
  font-size: 18px;
}

.map-section {
  scroll-margin-top: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #286849;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -1.2px;
}

.intro-copy {
  margin: 9px 0 0;
  color: #7c8177;
  font-size: 12px;
}

.map-hint {
  padding-bottom: 2px;
  color: #7c8177;
  font-size: 11px;
  white-space: nowrap;
}

.route-planner {
  display: grid;
  gap: 19px;
  margin: 0 0 17px;
  padding: 18px 20px 15px;
  border: 1px solid #e7e6de;
  border-radius: 11px;
  background: #fffefa;
}

.planner-top-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(160px, .9fr) minmax(230px, 1.2fr);
  gap: 18px;
  align-items: end;
}

.planner-field,
.transfer-limit-field,
.journey-field,
.duration-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.planner-label {
  display: block;
  margin: 0 0 8px;
  color: #4c5449;
  font-size: 11px;
  font-weight: 700;
}

.planner-field select {
  width: 100%;
  height: 39px;
  padding: 0 34px 0 11px;
  border: 1px solid #dfe2d9;
  border-radius: 7px;
  background: #fff;
  color: #343b32;
  font: 12px "Segoe UI", Arial, sans-serif;
}

.journey-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 39px;
  padding: 3px;
  border: 1px solid #e3e5dd;
  border-radius: 8px;
  background: #f4f5f0;
}

.journey-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.journey-switch label {
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #73786e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.journey-switch input:checked + label {
  background: #fffefa;
  color: #286849;
  box-shadow: 0 1px 4px rgba(25, 34, 27, .12);
}

.journey-switch input:focus-visible + label {
  outline: 3px solid #83ab87;
  outline-offset: 2px;
}

.planner-controls-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr);
  gap: 26px;
  align-items: end;
}

.duration-field {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #d4b45f;
  border-radius: 9px;
  background: #fff3d2;
}

.transfer-limit-field {
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #dfe2d9;
  border-radius: 9px;
}

.search-field {
  position: relative;
  min-width: 0;
}

.search-input-row {
  display: flex;
  gap: 7px;
}

.search-input-row input {
  width: 100%;
  min-width: 0;
  height: 39px;
  padding: 0 11px;
  border: 1px solid #dfe2d9;
  border-radius: 7px;
  background: #fff;
  color: #343b32;
  font: 12px "Segoe UI", Arial, sans-serif;
}

.search-input-row input::placeholder {
  color: #92968e;
}

.search-input-row button {
  flex: 0 0 auto;
  min-width: 72px;
  height: 39px;
  padding: 0 13px;
  border: 1px solid #286849;
  border-radius: 7px;
  background: #286849;
  color: #fff;
  font: 700 12px "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

.search-input-row button:hover {
  border-color: #20563c;
  background: #20563c;
}

.search-input-row button:focus-visible {
  outline: 3px solid #82ad84;
  outline-offset: 2px;
}

.search-feedback {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  right: 0;
  padding: 7px 11px;
  border-radius: 6px;
  background: #b42318;
  box-shadow: 0 3px 10px rgba(58, 19, 16, .2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.search-feedback[hidden] {
  display: none;
}

.duration-value {
  float: right;
  color: #286849;
  font-size: 11px;
  font-weight: 700;
}

.duration-field input[type="range"] {
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: #286849;
  cursor: pointer;
}

.transfer-limit-field input[type="range"] {
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: #286849;
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: #85897f;
  font-size: 10px;
}

.map-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: clamp(430px, 66vh, 720px);
  border: 1px solid #e3e2d9;
  border-radius: 12px;
  background: #e9e8e0;
  box-shadow: 0 5px 24px rgba(43, 49, 36, .06);
}

#map {
  width: 100%;
  height: 100%;
  cursor: grab;
}

#map:active {
  cursor: grabbing;
}

.info-section {
  max-width: 760px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid #e3e2d9;
  scroll-margin-top: 22px;
}

.info-section h2 {
  margin: 0 0 10px;
  font-size: 21px;
  letter-spacing: -.4px;
}

.info-section > p:last-child {
  margin: 0;
  color: #73786e;
  font-size: 13px;
  line-height: 1.75;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 19px 20px 25px;
  border-top: 1px solid #e3e2d9;
  background: #fffefa;
}

.site-footer a {
  color: #60665c;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  color: #286849;
  text-decoration: underline;
}

.leaflet-marker-icon {
  cursor: pointer;
}

.train-marker-icon {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, .9));
}

.train-marker-icon svg {
  display: block;
  width: 27px;
  height: 21px;
}

.summit-marker-icon {
  border: 0;
  background: transparent;
}

.summit-marker-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 2px 2px rgba(30, 49, 39, .3));
}

.summit-marker-muted svg {
  filter: grayscale(1) drop-shadow(0 2px 2px rgba(30, 49, 39, .2));
  opacity: .62;
}

.summit-marker-shadow {
  stroke: #fffefa;
  stroke-width: 2;
}

.summit-marker-mountain {
  fill: #fffefa;
  stroke: #fffefa;
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.summit-marker-snow {
  fill: #b8d7c1;
}

.summit-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 9px;
}

.summit-popup .leaflet-popup-content {
  width: 220px !important;
  margin: 0;
}

.summit-popup .leaflet-popup-tip {
  box-shadow: none;
}

.summit-popup-card {
  display: grid;
  gap: 5px;
  padding: 9px;
  color: #252a24;
  text-decoration: none;
}

.summit-popup-image {
  display: block;
  width: 100%;
  height: 104px;
  margin-bottom: 3px;
  border-radius: 6px;
  background: #e6ece5;
  object-fit: cover;
}

.summit-popup-card:hover .summit-popup-details {
  text-decoration: underline;
}

.summit-popup-name {
  font-size: 13px;
  font-weight: 700;
}

.summit-popup-elevation {
  color: #6f756b;
  font-size: 11px;
}

.summit-popup-details {
  margin-top: 3px;
  color: #286849;
  font-size: 10px;
  font-weight: 700;
}

.hike-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 9px;
}

.hike-popup .leaflet-popup-content {
  width: 230px !important;
  margin: 0;
}

.hike-popup-card {
  display: grid;
  gap: 7px;
  padding: 13px 14px;
  color: #252a24;
  text-decoration: none;
}

.hike-popup-name {
  font-size: 12px;
  font-weight: 700;
}

.hike-popup-description {
  color: #73786e;
  font-size: 10px;
  line-height: 1.5;
}

.hike-popup-details {
  color: #286849;
  font-size: 10px;
  font-weight: 700;
}

.hike-popup-card:hover .hike-popup-details {
  text-decoration: underline;
}

.mountain-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 9px;
}

.mountain-popup .leaflet-popup-content {
  width: 320px !important;
  max-width: calc(100vw - 56px);
  margin: 0;
}

.mountain-popup-card {
  display: grid;
  gap: 9px;
  padding: 12px 13px;
  color: #252a24;
}

.mountain-popup-name {
  font-size: 13px;
  font-weight: 700;
}

.mountain-popup-name-highlighted {
  color: #286849;
  font-weight: 800;
}

.mountain-popup-duration {
  color: #73786e;
  font-size: 11px;
}

.mountain-weather {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.mountain-weather-heading,
.mountain-weather-attribution {
  grid-column: 1 / -1;
}

.mountain-weather-heading {
  color: #60665c;
  font-size: 10px;
  font-weight: 700;
}

.mountain-weather-status {
  grid-column: 1 / -1;
  color: #73786e;
  font-size: 10px;
}

.mountain-weather-day {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  padding: 7px 3px;
  border: 1px solid #e7e6de;
  border-radius: 7px;
  background: #faf9f5;
  text-align: center;
}

.mountain-weather-date {
  color: #60665c;
  font-size: 9px;
}

.mountain-weather-icon,
.mountain-weather-icon svg {
  width: 26px;
  height: 26px;
}

.mountain-weather-temperature {
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.mountain-weather-sunshine {
  color: #73786e;
  font-size: 7px;
  white-space: nowrap;
}

.mountain-weather-note {
  grid-column: 1 / -1;
  color: #73786e;
  font-size: 8px;
}

.mountain-weather-attribution {
  grid-column: 1 / -1;
  color: #73786e;
  font-size: 9px;
}

.mountain-weather-attribution a {
  color: inherit;
  text-decoration: underline;
}

.mountain-popup-details {
  color: #286849;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.mountain-popup-card:hover .mountain-popup-details {
  text-decoration: underline;
}

.weather-map-control {
  width: min(260px, calc(100vw - 42px));
  overflow: hidden;
  border: 1px solid #dfe2d9;
  border-radius: 8px;
  background: rgba(255, 254, 250, .97);
  box-shadow: 0 2px 8px rgba(25, 34, 27, .2);
}

.weather-map-toggle {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  background: #fffefa;
  color: #286849;
  cursor: pointer;
  font: 700 12px "Segoe UI", Arial, sans-serif;
  text-align: left;
}

.weather-map-toggle[aria-pressed="true"] {
  background: #286849;
  color: #fffefa;
}

.weather-map-toggle:focus-visible,
.weather-map-date:focus-visible {
  outline: 3px solid #82ad84;
  outline-offset: -3px;
}

.weather-map-panel {
  display: grid;
  gap: 9px;
  padding: 10px 12px 11px;
  border-top: 1px solid #e7e6de;
}

.weather-map-panel[hidden] {
  display: none;
}

.weather-map-date-label {
  display: grid;
  gap: 4px;
  color: #4c5449;
  font-size: 10px;
  font-weight: 700;
}

.weather-map-date {
  width: 100%;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #dfe2d9;
  border-radius: 5px;
  background: #fff;
  color: #343b32;
  font: 11px "Segoe UI", Arial, sans-serif;
}

.weather-map-legend {
  display: grid;
  gap: 4px;
}

.weather-map-legend-title {
  color: #4c5449;
  font-size: 10px;
  font-weight: 700;
}

.weather-map-legend-scale {
  height: 10px;
  border: 1px solid rgba(37, 42, 36, .15);
  border-radius: 5px;
  background: linear-gradient(90deg, #c23731, #f2c143, #308b4e);
}

.weather-map-legend-labels {
  display: flex;
  justify-content: space-between;
  color: #73786e;
  font-size: 9px;
}

.weather-map-status,
.weather-map-note,
.weather-map-attribution {
  color: #73786e;
  font-size: 9px;
  line-height: 1.4;
}

.weather-map-attribution a {
  color: inherit;
  text-decoration: underline;
}

.leaflet-interactive:focus-visible {
  outline: 3px solid #253f35;
  outline-offset: 4px;
}

.leaflet-control-attribution {
  font-size: 10px !important;
}

@media (max-width: 760px) {
  .planner-top-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .journey-field {
    grid-column: 1 / -1;
  }
}

.site-header a:focus-visible,
.site-nav a:focus-visible,
.language-picker select:focus-visible,
.home-tile:focus-visible,
.site-footer a:focus-visible,
.search-input-row input:focus-visible {
  outline: 3px solid #82ad84;
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .site-header {
    min-height: 120px;
    padding: 47px 17px 15px;
  }

  .language-picker {
    top: 12px;
    left: 15px;
    gap: 3px;
    padding: 5px;
  }

  .language-picker select {
    max-width: 93px;
    font-size: 10px;
  }

  .site-masthead p {
    max-width: 290px;
    font-size: 12px;
  }

  .home-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 28px;
  }

  .home-tile {
    min-height: 72px;
    padding: 12px;
    font-size: 12px;
  }

  main {
    padding: 27px 15px 38px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .route-planner {
    padding: 15px;
  }

  .planner-top-row {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .planner-controls-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .map-frame {
    height: 63vh;
    min-height: 370px;
    max-height: 620px;
  }

  .info-section {
    margin-top: 34px;
  }
}

@media (max-width: 360px) {
  .home-tiles {
    grid-template-columns: 1fr;
  }
}
