:root {
  --background: #e4f6f1;
  --surface: #f5fcf9;
  --tint: #d3eae0;
  --text: #334b3e;
  --primary: #19492e;
  --accent: #a71c6c;
  --duration: 400ms;
}

html {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

html:has(dialog:modal) {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 64px;
  background: var(--background);
  color: var(--text);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--primary);
  overflow-wrap: anywhere;
}

h1 {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
}

h3 {
  font-weight: 600;
}

a {
  color: var(--primary);
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

button {
  color: inherit;
  font-size: inherit;
  font-weight: 500;
  line-height: inherit;
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

strong,
b {
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.walking-guide {
  width: calc(100% - 76px);
  max-width: 1310px;
  margin-inline: auto;
  padding-inline: 0;
}

.trailhead {
  position: static;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--primary);
}

.walk-card-home-link {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-block: 10px;
  text-decoration: none;
}

.walk-card-home-link img {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.expedition-name {
  min-width: 0;
  font-size: 24px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.publication {
  font-size: 14px;
  font-weight: 500;
  text-align: right;
}

.walking-guide-skip {
  position: fixed;
  top: 12px;
  left: 38px;
  z-index: 20;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.walking-guide-skip:focus {
  width: auto;
  height: auto;
  max-width: calc(100% - 76px);
  margin: 0;
  padding: 12px 16px;
  clip-path: none;
  overflow: visible;
  background: var(--surface);
  border: 1px solid var(--primary);
  white-space: normal;
}

.walking-guide-accessible {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.waymark {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.trail-menu-toggle,
.close-button,
.direction-button {
  width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid var(--primary);
  border-radius: 0;
  background: transparent;
}

.trail-menu-toggle {
  display: none;
}

.close-button,
.direction-button {
  display: inline-flex;
}

main.walking-guide {
  flex: 1;
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  column-gap: 34px;
  align-items: start;
}

.navigation-panel {
  min-width: 0;
  padding-top: 20px;
  border-top: 3px double var(--primary);
}

.navigation-title {
  margin-bottom: 20px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

.trail-menu-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--primary);
  list-style: none;
}

.trail-menu-links li {
  min-width: 0;
}

.trail-menu-links a {
  display: block;
  padding: 12px;
  border: 1px solid var(--primary);
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.trail-menu-links a[aria-current="page"],
.footer-links a[aria-current="page"] {
  border-left: 4px solid var(--accent);
  background: var(--surface);
}

.trail-drawer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100%;
  margin: 0;
  padding: 28px 38px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  color: var(--text);
  background: var(--background);
}

.trail-drawer[open] {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.trail-drawer::backdrop {
  background: var(--primary);
}

.trail-drawer.is-opening {
  animation: menu-slide var(--duration) ease both;
}

.trail-drawer-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 3px double var(--primary);
}

.trail-drawer-dialog-heading h2 {
  min-width: 0;
  font-size: 26px;
}

.trail-drawer-links {
  min-width: 0;
}

.trail-drawer .trail-menu-links a {
  padding: 16px;
  font-size: 18px;
}

.walking-guide-layout {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.starting-point-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: end;
  gap: 24px;
}

.starting-point {
  min-width: 0;
}

.starting-point p {
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.starting-point-art {
  width: 140px;
  height: 140px;
}

.terrain-index,
.library,
.scenic-picks {
  min-width: 0;
  display: grid;
  gap: 24px;
}

.terrain-index-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 3px double var(--primary);
}

.terrain-index-header h2 {
  min-width: 0;
}

.terrain-index-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.walk-card-section {
  display: inline-block;
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--primary);
  background: var(--tint);
  color: var(--primary);
  font-size: 16px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

#walks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  list-style: none;
}

.walk-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--primary);
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--primary);
  text-align: right;
}

.walk-card h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
}

.walk-card-details {
  color: var(--primary);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.walk-card-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow-wrap: anywhere;
}

.outline-link,
.playback-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--primary);
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
}

.walk-card .outline-link {
  width: 100%;
}

.photo-strip {
  min-width: 0;
  display: grid;
  gap: 24px;
  padding: 20px;
  border: 1px solid var(--primary);
  background: var(--tint);
  box-shadow: 6px 6px 0 var(--primary);
}

.photo-strip-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
}

.photo-strip-list li {
  min-width: 0;
}

.photo-strip-choice {
  width: 100%;
  height: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--primary);
  border-bottom: 3px solid var(--primary);
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: anywhere;
}

.photo-strip-choice[aria-pressed="true"] {
  border-bottom-color: var(--accent);
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
}

.photo-strip-stage {
  min-width: 0;
}

.photo-strip-panel {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 35fr) minmax(0, 65fr);
  align-items: center;
}

.photo-strip-visual {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--background);
  border: 1px solid var(--primary);
}

.photo-strip-visual img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.photo-strip-copy {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 24px;
  padding: 20px 0 20px 28px;
}

.photo-strip-copy h3 {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.3;
}

.photo-strip-panel.is-fading-out .photo-strip-visual {
  animation: image-out calc(var(--duration) / 2) ease both;
}

.photo-strip-panel.is-fading-in .photo-strip-visual {
  animation: image-in calc(var(--duration) / 2) ease both;
}

.photo-strip-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 20px;
  border-top: 3px double var(--primary);
}

.direction-controls {
  display: flex;
  gap: 12px;
}

.motion-note {
  flex-basis: 100%;
  font-size: 14px;
}

.route-description {
  width: 100%;
  max-width: 620px;
  min-width: 0;
  margin-left: auto;
  margin-right: 0;
  display: grid;
  gap: 32px;
}

.reading-heading {
  min-width: 0;
  display: grid;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 3px double var(--primary);
}

.route-path {
  font-size: 14px;
  line-height: 1.5;
}

.route-path ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 0;
  list-style: none;
}

.route-path li {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  overflow-wrap: anywhere;
}

.route-path li[aria-current="page"] {
  flex: 1 1 180px;
}

.route-path li span:last-child {
  min-width: 0;
}

.route-description-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.route-description-text > :first-child {
  margin-top: 0;
}

.route-description-text > :last-child {
  margin-bottom: 0;
}

.route-description-text p {
  margin-block: 0 24px;
}

.route-description-text h2 {
  margin-block: 48px 20px;
  padding-top: 20px;
  border-top: 3px double var(--primary);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.3;
}

.route-description-text h3 {
  margin-block: 32px 16px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
}

.route-description-text blockquote {
  margin: 32px 0;
  padding: 24px;
  border-left: 4px solid var(--accent);
  background: var(--tint);
}

.route-description-text blockquote p:last-child {
  margin-bottom: 0;
}

.route-description-text cite {
  display: block;
  margin-top: 16px;
  color: var(--primary);
  font-size: 16px;
  font-weight: 400;
  font-style: italic;
}

.route-description-text ul,
.route-description-text ol {
  margin-block: 24px;
  padding-left: 30px;
  list-style-type: decimal;
}

.route-description-text li {
  padding-left: 6px;
  margin-block: 10px;
}

.route-description-text li::marker {
  color: var(--accent);
  font-weight: 600;
}

.route-description-text li ul,
.route-description-text li ol {
  margin-block: 12px;
}

.route-description-text table {
  width: 100%;
  margin-block: 24px;
  border-collapse: collapse;
  font-size: 18px;
  line-height: 1.5;
}

.route-description-text caption {
  padding-bottom: 12px;
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  caption-side: top;
}

.route-description-text th,
.route-description-text td {
  min-width: 130px;
  padding: 14px;
  border: 1px solid var(--primary);
  vertical-align: top;
  text-align: left;
}

.route-description-text th {
  background: var(--primary);
  color: var(--surface);
  font-weight: 600;
}

.route-description-text tbody tr:nth-child(even) td {
  background: var(--tint);
}

.route-description-text tbody tr:nth-child(odd) td {
  background: var(--surface);
}

.route-description-text img {
  max-width: 100%;
  height: auto;
}

.route-description-text a {
  text-decoration-thickness: 1px;
}

.trail-credits {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding-block: 24px 32px;
  border-top: 3px double var(--primary);
}

.trail-credits-note {
  font-size: 14px;
}

.trail-credits nav {
  min-width: 0;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--primary);
  list-style: none;
}

.footer-links li {
  min-width: 0;
}

.footer-links a {
  display: block;
  padding: 10px;
  border: 1px solid var(--primary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.walking-guide-appear.walking-guide-in-view {
  animation: enter var(--duration) ease 50ms both;
}

@keyframes enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes menu-slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes image-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes image-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 1180px) {
  #walks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .starting-point-welcome {
    grid-template-columns: minmax(0, 1fr) 100px;
  }

  .starting-point-art {
    width: 100px;
    height: 100px;
  }

  .photo-strip-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 944px) {
  body {
    gap: 40px;
    font-size: 18px;
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 24px;
  }

  .trailhead {
    min-height: 64px;
    gap: 16px;
  }

  .walk-card-home-link {
    max-width: calc(100% - 60px);
  }

  .expedition-name {
    font-size: 22px;
  }

  .publication {
    display: none;
  }

  .enhanced .trail-menu-toggle {
    display: inline-flex;
  }

  main.walking-guide {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .enhanced .navigation-panel {
    display: none;
  }

  .walking-guide-layout {
    gap: 40px;
  }

  #walks {
    grid-template-columns: minmax(0, 1fr);
  }

  .photo-strip-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .photo-strip-copy {
    gap: 20px;
    padding: 20px 0 0;
  }

  .photo-strip-copy h3 {
    font-size: 26px;
  }

  .photo-strip-copy .outline-link {
    width: 100%;
  }

  .route-description {
    gap: 24px;
  }

  .route-description-text h2 {
    margin-top: 40px;
    font-size: 28px;
  }

  .route-description-text h3 {
    font-size: 22px;
  }

  .route-description-text blockquote {
    padding: 20px;
  }

  .trail-credits {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

@media (max-width: 600px) {
  .starting-point-welcome {
    grid-template-columns: minmax(0, 1fr);
  }

  .starting-point-art {
    width: 88px;
    height: 88px;
    justify-self: end;
  }
}

@media (max-width: 480px) {
  .walking-guide {
    width: calc(100% - 44px);
  }

  h1 {
    font-size: 32px;
  }

  .walk-card-home-link {
    gap: 10px;
  }

  .walk-card-home-link img {
    width: 36px;
    height: 36px;
  }

  .expedition-name {
    font-size: 18px;
  }

  .walking-guide-skip {
    left: 22px;
  }

  .walking-guide-skip:focus {
    max-width: calc(100% - 44px);
  }

  .trail-drawer {
    padding: 22px;
  }

  .photo-strip-list,
  .footer-links {
    grid-template-columns: minmax(0, 1fr);
  }

  .photo-strip-copy h3 {
    font-size: 24px;
  }

  .walk-card-section {
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .walking-guide-appear.walking-guide-in-view,
  .trail-drawer.is-opening,
  .photo-strip-panel.is-fading-out .photo-strip-visual,
  .photo-strip-panel.is-fading-in .photo-strip-visual {
    animation: none;
  }

  .photo-strip-visual {
    opacity: 1;
  }

  .trail-drawer {
    transform: none;
  }
}
