/* E18 Loppet — Sweden 2017 */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-alt: #eef2f5;
  --text: #20262d;
  --muted: #64707c;
  --border: #dce2e8;
  --accent: #465c70;
  --accent-dark: #2e4152;
  --sidebar: #18242e;
  --sidebar-text: #eef3f6;
  --sidebar-muted: #aebbc5;
  --shadow: 0 8px 24px rgba(20, 32, 43, 0.07);
  --radius: 14px;
  --content-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-dark);
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 3px solid rgba(70, 92, 112, 0.35);
  outline-offset: 3px;
}

/* Layout */

.page-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  padding: 34px 26px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  margin-bottom: 34px;
  color: var(--sidebar-text);
  text-decoration: none;
}

.brand-main,
.brand-sub {
  display: block;
}

.brand-main {
  font-size: 1.42rem;
  font-weight: 780;
}

.brand-sub {
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 0.88rem;
}

.site-nav {
  display: grid;
  gap: 4px;
}

.site-nav a,
.sidebar-footer a {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--sidebar-muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.sidebar-footer a:hover,
.sidebar-footer a:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-text);
}

.site-nav a.active {
  background: rgba(255, 255, 255, 0.11);
  color: var(--sidebar-text);
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 4px;
}

.content {
  margin-left: 240px;
  padding: 48px clamp(26px, 5vw, 70px) 34px;
}

.content > * {
  width: min(100%, var(--content-width));
  margin-inline: auto;
}

/* Typography */

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: -0.025em;
}

h1 {
  margin: 0;
  font-size: clamp(2.7rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

h2 {
  margin: 0;
  font-size: 1.8rem;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--accent-dark);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 650;
}

.lead {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.9fr);
  gap: 38px;
  align-items: center;
  padding: 24px 0 46px;
  border-bottom: 1px solid var(--border);
}

.hero-photo,
.group-photo,
.photo-grid figure {
  margin: 0;
}

.hero-photo {
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-photo img {
  width: 100%;
  border-radius: 9px;
}

figcaption {
  padding: 9px 5px 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Story */

.story {
  padding: 48px 0 8px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.75fr);
  gap: 36px;
  align-items: start;
}

.story-copy p {
  color: var(--muted);
}

blockquote {
  margin: 24px 0 6px;
  padding: 18px 22px;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  font-size: 1.03rem;
}

.translation {
  margin-top: 8px;
  font-size: 0.91rem;
}

.personal-note {
  margin-top: 26px;
  padding: 20px 22px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.personal-note h3 {
  margin: 0;
  font-size: 1.05rem;
}

.personal-note p {
  margin-bottom: 0;
}

.group-photo {
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.group-photo img {
  width: 100%;
  border-radius: 9px;
}

/* Shared section headings */

.results-section,
.photo-section,
.video-section {
  padding: 50px 0 6px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading > div > p {
  margin-bottom: 5px;
}

.section-heading > p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

/* Results */

.results-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.results-card,
.results-image,
.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.results-card {
  padding: 22px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.results-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.results-image {
  display: block;
  padding: 8px;
}

.results-image img {
  width: 100%;
  border-radius: 9px;
}

/* Photos */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.photo-grid figure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.photo-grid a {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 160ms ease;
}

.photo-grid a:hover img {
  transform: scale(1.025);
}

.photo-grid figcaption {
  padding: 10px 13px 12px;
}

/* Video */

.video-card {
  padding: 10px;
}

.video-card video {
  width: 100%;
  border-radius: 9px;
  background: #000;
}

.video-card p {
  margin: 12px 8px 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Previous / next */

.trip-pagination {
  margin-top: 54px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.trip-pagination a {
  min-height: 105px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.trip-pagination a:hover {
  border-color: #c0cad3;
}

.trip-pagination .next {
  text-align: right;
}

.trip-pagination span {
  color: var(--muted);
  font-size: 0.82rem;
}

.trip-pagination strong {
  margin-top: 3px;
  font-size: 1.08rem;
}

/* Footer */

.footer {
  margin-top: 30px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.84rem;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.footer p {
  margin: 0;
}

/* Responsive */

@media (max-width: 940px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 20px 22px;
  }

  .brand {
    margin-bottom: 13px;
  }

  .site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
  }

  .sidebar-footer {
    display: none;
  }

  .content {
    margin-left: 0;
    padding: 30px 20px 26px;
  }

  .hero,
  .story {
    grid-template-columns: 1fr;
  }

  .hero-photo,
  .group-photo {
    max-width: 720px;
  }
}

@media (max-width: 720px) {
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .section-heading > p {
    text-align: left;
  }

  .results-layout,
  .photo-grid,
  .trip-pagination {
    grid-template-columns: 1fr;
  }

  .trip-pagination .next {
    text-align: left;
  }
}
