/* ============================================================
   it's irrelevant — shared stylesheet
   Scandinavian minimalist: off-white, charcoal, Samurai Blue.
   All design tokens live in :root so tuning is one-line edits.
   ============================================================ */

:root {
  /* ---- Palette (3–4 colors + neutrals) ---- */
  --color-bg: #FAFAF8;        /* off-white page base */
  --color-surface: #FFFFFF;   /* cards / raised surfaces */
  --color-text: #2B2B2B;      /* charcoal — body text */
  --color-muted: #6B6B6B;     /* secondary text */
  --color-accent: #1A2F5E;    /* Samurai Blue — used sparingly */
  --color-accent-hover: #16274d;
  --color-border: #E6E6E3;    /* hairline dividers */

  /* ---- Type scale (fluid via clamp) ---- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --fs-display: clamp(2.75rem, 6vw, 5rem);
  --fs-h1: clamp(2rem, 4vw, 3rem);
  --fs-h2: clamp(1.4rem, 2.5vw, 1.9rem);
  --fs-lead: clamp(1.05rem, 1.6vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.85rem;

  /* ---- Spacing scale ---- */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  /* ---- Layout ---- */
  --maxw: 72rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.2s;
}

/* ---- Minimal modern reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3 {
  font-weight: 300;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
}

p {
  margin: 0 0 var(--space-2);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

a:hover {
  color: var(--color-accent-hover);
}

/* Visible focus for keyboard users */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-1) var(--space-2);
  z-index: 100;
}
.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
  color: #fff;
}

/* ============================================================
   Header / navigation
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  gap: var(--space-3);
}

.wordmark {
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--color-text);
  white-space: nowrap;
}
.wordmark:hover {
  color: var(--color-text);
  opacity: 0.7;
}
.wordmark .accent {
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  padding: var(--space-1);
  cursor: pointer;
  color: var(--color-text);
}
.nav-toggle svg {
  width: 26px;
  height: 26px;
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-4);
}

.primary-nav a {
  color: var(--color-text);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: var(--space-1) 0;
  position: relative;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.primary-nav a:hover::after,
.primary-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}
.primary-nav a[aria-current="page"] {
  color: var(--color-accent);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  padding: 0.7rem 1.6rem;
  border-radius: 2px;
  background: var(--color-accent);
  color: #fff;
  border: 1px solid var(--color-accent);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover {
  background: var(--color-accent-hover);
  color: #fff;
}
.btn--ghost {
  background: transparent;
  color: var(--color-accent);
}
.btn--ghost:hover {
  background: var(--color-accent);
  color: #fff;
}

/* ============================================================
   Main / sections
   ============================================================ */
main {
  flex: 1 0 auto;
}

/* ============================================================
   Section accent identity
   Life = muted sage, Sport = soft slate blue.
   Colors are space-separated RGB triplets so they can drive rgb()/alpha.
   A .section-* class on a page-head, feature, or card scopes the color;
   anything unscoped falls back to the Samurai Blue accent (26 47 94).
   ============================================================ */
.section-life {
  --accent-section: 95 115 85;
}
.section-sport {
  --accent-section: 79 115 150;
}

/* Section tag + date meta, shared by feature and cards */
.tag {
  display: inline-block;
  font-size: var(--fs-small);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.section-life .tag  { color: #5F7355; }
.section-sport .tag { color: #4F7396; }
.story-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.story-meta::before {
  content: none;
}
.story-date {
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
  color: var(--color-muted);
}
.story-meta .tag + .story-date {
  position: relative;
  padding-left: calc(var(--space-2));
}
.story-meta .tag + .story-date::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 0.85em;
  background: var(--color-border);
  transform: translateY(-50%);
}

/* ---- Featured hero (most recent story) — full-bleed on homepage ---- */
.feature {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  color: var(--color-text);
  transition: transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.feature:hover {
  color: var(--color-text);
  transform: translateY(-3px);
}
.feature__media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.feature__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--color-bg);
}
.feature__title {
  font-size: clamp(1.8rem, 3.4vw, 2.75rem);
  letter-spacing: -0.005em;
  margin-bottom: var(--space-2);
}
.feature__teaser {
  font-size: var(--fs-lead);
  color: var(--color-muted);
  max-width: 48ch;
  margin-bottom: 0;
}

@media (min-width: 860px) {
  .feature {
    grid-template-columns: 1.15fr 0.85fr;
  }
  .feature__media img {
    aspect-ratio: auto;
    min-height: 26rem;
  }
  .feature__body {
    padding: var(--space-5);
  }
}

/* Page header for section/about pages */
.page-head {
  position: relative;
  overflow: hidden;
  padding: var(--space-5) 0 var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
/* Soft, soft-edged radial glow in the section's colour — only on sectioned
   headers (Life/Sport); the About header stays neutral. */
.section-life.page-head::before,
.section-sport.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(66% 150% at 16% -22%, rgb(var(--accent-section) / 0.28), transparent 70%),
    radial-gradient(48% 100% at 88% 6%, rgb(var(--accent-section) / 0.15), transparent 72%);
}
.page-head > .container {
  position: relative;
  z-index: 1;
}
.page-head__eyebrow {
  font-size: var(--fs-small);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}
.section-life .page-head__eyebrow  { color: #5F7355; }
.section-sport .page-head__eyebrow { color: #4F7396; }
.page-head__title {
  font-size: var(--fs-h1);
  letter-spacing: 0.01em;
}
.page-head__lead {
  font-size: var(--fs-lead);
  color: var(--color-muted);
  max-width: 55ch;
  margin-bottom: 0;
}

.section {
  padding: var(--space-5) 0;
}

/* Grid container below the full-bleed hero needs its own top breathing room */
.section > .container {
  padding-top: var(--space-4);
}

/* ---- Story card grid (homepage thumbnails + section lists) ---- */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-3);
}

.story-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  overflow: hidden;
  color: var(--color-text);
  transition: transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.story-card:hover {
  color: var(--color-text);
  transform: translateY(-3px);
  border-color: rgb(var(--accent-section, 26 47 94) / 0.4);
}
.story-card__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.story-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-3) var(--space-3) var(--space-4);
  /* Soft section-colour glow inside the info box, rising from just beneath the
     photo. Driven entirely by the inherited --accent-section, so a given
     section's card looks identical on every page it appears. */
  background: radial-gradient(
    135% 90% at 50% -8%,
    rgb(var(--accent-section, 26 47 94) / 0.16),
    transparent 72%
  );
}
.story-card__title {
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: var(--space-1);
}
.story-card__teaser {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Section intro copy above a story grid */
.section__intro {
  color: var(--color-muted);
  max-width: 55ch;
  margin-bottom: var(--space-4);
}

.prose {
  max-width: 62ch;
}
.prose p {
  margin-bottom: var(--space-3);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--color-border);
  padding: var(--space-4) 0;
  margin-top: var(--space-5);
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.site-footer .wordmark {
  font-size: 1rem;
}
.site-footer small {
  color: var(--color-muted);
  font-size: var(--fs-small);
}

/* ============================================================
   Responsive — mobile nav
   ============================================================ */
@media (max-width: 640px) {
  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--dur) var(--ease);
  }
  .primary-nav.is-open {
    max-height: 60vh;
  }
  .primary-nav ul {
    flex-direction: column;
    gap: 0;
    padding: var(--space-1) 0;
  }
  .primary-nav li {
    border-top: 1px solid var(--color-border);
  }
  .primary-nav li:first-child {
    border-top: 0;
  }
  .primary-nav a {
    display: block;
    padding: var(--space-2) var(--gutter);
  }
  .primary-nav a::after {
    display: none;
  }

  .site-header .container {
    position: relative;
  }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ============================================================
   Social links (About page)
   ============================================================ */
.social-links {
  display: flex;
  justify-content: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.social-link {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.social-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-link:hover,
.social-link:focus-visible {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
