/* Alsike Prästgård — style.css */

/* ─── Tokens ──────────────────────────────────────────────────── */

:root {

  /* Brand palette */
  --deep-brown: #1A1514;
  --canvas-white: #FAF7F2;
  --light-brown: #EFE9DE;
  --natural-green: #7C8B6B;
  --cta-green: #1A936F;
  --thistle: #D3C4E3;
  --golden-chestnut: #C5874D;
  --dry-sage: #BCC1A3;
  --dry-sage-2: #B0BF93;
  --pale-oak: #C8C2B3;
  --warm-grey: #3C322E;
  --pacific-blue: #58a4b0;
  --nav-grey: oklch(84% 0.012 80);
  /* Pärl grå — nav + breadcrumb surface */

  /* Derived section backgrounds */
  --section-sky: oklch(94% 0.025 208);
  /* Very pale pacific blue — symbolises sky, use high */
  --section-grass: oklch(93% 0.025 136);
  /* Very pale natural green — symbolises grass, use sparingly */

  /* Semantic roles */
  --bg: var(--canvas-white);
  --surface: var(--light-brown);
  --text: var(--deep-brown);
  --muted: var(--warm-grey);
  --accent: var(--cta-green);
  --border: var(--pale-oak);

  /* Fonts */
  --font-body: 'Alegreya', Georgia, serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Type scale (rem relative to browser default 16px) */
  --text-sm: 0.8125rem;
  /* 13px */
  --text-base: 1.3125rem;
  /* 21px */
  --text-lg: 1.625rem;
  /* 26px */
  --text-xl: 2rem;
  /* 32px */
  --text-2xl: 2.75rem;
  /* 44px */

  /* Spacing */
  --s-xs: 0.5rem;
  --s-s: 1rem;
  --s-m: 2rem;
  --s-l: 4rem;
  --s-xl: 8rem;

  /* Layout */
  --readable: 66ch;
  --max-width: 1440px;
  --gutter: clamp(1rem, 4vw, 3rem);

  /* Radii */
  --r-s: 3px;
  --r-m: 8px;

  /* Shadow */
  --shadow-s: 0 1px 4px rgba(26, 21, 20, 0.10);
  --shadow-m: 0 4px 20px rgba(26, 21, 20, 0.12);

  /* Border */
  --border-width: 1px;
}

/* ─── Reset ───────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

/* ─── Base ────────────────────────────────────────────────────── */

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

/* ─── Typography ──────────────────────────────────────────────── */

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
}

h1 {
  font-size: var(--text-2xl);
}

h2 {
  font-size: var(--text-xl);
}

h3 {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.4;
}

p {
  max-width: var(--readable);
}

p+p {
  margin-top: var(--s-s);
}

*+h2 {
  margin-top: var(--s-l);
}

*+h3 {
  margin-top: var(--s-m);
}

h1+p,
h2+p,
h3+p {
  margin-top: var(--s-xs);
}

strong {
  font-weight: 700;
}

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

figcaption,
time,
.meta {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--muted);
}

ul,
ol {
  max-width: var(--readable);
  padding-left: 1.5em;
}

main li+li {
  margin-top: var(--s-xs);
}

*+ul,
*+ol {
  margin-top: var(--s-s);
}

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

/* ─── Layout ──────────────────────────────────────────────────── */

main {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: var(--s-l) var(--s-xl);
}

section+section {
  margin-top: var(--s-l);
}

/* ─── Sections ────────────────────────────────────────────────── */

.section {
  padding-block: var(--s-l);
  padding-inline: var(--gutter);
}

.section__inner {
  max-width: var(--max-width);
  margin-inline: auto;
}

.section--sky {
  background: var(--section-sky);
}

.section--grass {
  background: var(--section-grass);
}

.section--surface {
  background: var(--surface);
}

.section--dark {
  background: var(--deep-brown);
  color: var(--canvas-white);
}

.section--dark a {
  color: var(--dry-sage-2);
}

/* ─── Hero ────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
      rgba(26, 21, 20, 0.92) 0%,
      rgba(26, 21, 20, 0.45) 50%,
      transparent 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding: var(--s-l) var(--gutter);
  color: var(--canvas-white);
  backdrop-filter: blur(2px);
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.04em;
  color: var(--dry-sage);
  max-width: none;
  margin-bottom: var(--s-xs);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 5vw, 4.5rem);
  font-weight: 600;
  line-height: 1.1;
  color: inherit;
  max-width: none;
}

.hero__tagline {
  color: inherit;
  opacity: 0.85;
  margin-top: var(--s-xs);
  max-width: 44ch;
}

/* ─── Split (image + text) ───────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-l);
  align-items: start;
}

.split__image img {
  width: 100%;
  height: auto;
  border-radius: var(--r-m);
}

.split--reverse .split__image {
  order: 2;
}

.split--reverse .split__text {
  order: 1;
}

/* ─── Icon list ───────────────────────────────────────────── */

.icon-list {
  list-style: none;
  padding-left: 0;
}

.icon-list li {
  display: flex;
  align-items: baseline;
  gap: var(--s-xs);
}

.icon-list li + li {
  margin-top: var(--s-xs);
}

.icon-list iconify-icon {
  flex-shrink: 0;
  color: var(--natural-green);
  font-size: 1em;
  position: relative;
  top: 0.1em;
}

/* ─── Breadcrumbs ─────────────────────────────────────────────── */

.breadcrumbs {
  background: var(--nav-grey);
  padding-block: var(--s-xs);
  padding-inline: var(--gutter);
}

.breadcrumbs ol {
  max-width: var(--max-width);
  margin-inline: auto;
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
}

.breadcrumbs li+li::before {
  content: '/';
  padding-inline: var(--s-xs);
  opacity: 0.4;
}

.breadcrumbs a {
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
}

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

.breadcrumbs [aria-current] {
  color: var(--muted);
}

/* ─── Nav ─────────────────────────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: var(--s-s);
  position: relative;
  z-index: 100;
}

.header-logo {
  max-width: 240px;
}

.nav-list {
  display: flex;
  gap: var(--s-m);
  list-style: none;
  padding: 0;
}

.nav-list a {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  background-color: white;
  padding: 6px 16px;
}

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

.nav-list a[aria-current] {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: white;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  padding: 6px 16px;
}

.nav-toggle::before {
  content: '☰';
}

.nav-toggle[aria-expanded="true"]::before {
  content: '✕';
}

/* ─── Footer ──────────────────────────────────────────────────── */

.site-footer {
  background: var(--surface);
  border-top: var(--border-width) solid var(--border);
  font-family: var(--font-mono);
}

.site-footer--dark {
  background: var(--deep-brown);
  color: rgba(255, 255, 255, 0.75);
  border-top-color: var(--warm-grey);
  --muted: var(--dry-sage);
}

.site-footer--dark a {
  color: rgba(255, 255, 255, 0.95);
}

.site-footer--dark h3 {
  color: var(--canvas-white);
}

.footer-social {
  display: flex;
  gap: var(--s-s);
  margin-top: var(--s-s);
  justify-content: center;
}

.footer-social a {
  font-size: 50px;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: var(--s-l);
  padding-inline: var(--gutter);
}

.footer-logo-link {
  display: inline-block;
}

.footer-logo {
  max-width: 280px;
}

.footer-sections {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-m);
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-bottom: var(--s-l);
}

.footer-section {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: var(--s-m);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-m);
  transition: background 0.15s, border-color 0.15s;
}

.footer-section:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
}

.footer-section h3 {
  margin-top: 0;
  margin-bottom: var(--s-xs);
  color: var(--canvas-white);
}

.footer-section p {
  font-size: var(--text-sm);
  margin-top: 0;
  color: rgba(255, 255, 255, 0.6);
  max-width: none;
}

.footer-legal-strip {
  background: rgba(0, 0, 0, 0.28);
  padding-block: var(--s-s);
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-s);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.45);
}

.footer-legal-strip a {
  color: rgba(255, 255, 255, 0.65);
}

.footer-copyright {
  max-width: none;
}

/* ─── Posts ───────────────────────────────────────────────────── */

.post-header {
  margin-bottom: var(--s-l);
  padding-bottom: var(--s-m);
  border-bottom: var(--border-width) solid var(--border);
}

.post-meta {
  display: flex;
  gap: var(--s-m);
  margin-top: var(--s-s);
}

/* ─── Page hero image ────────────────────────────────────────── */

.page-hero {
  width: 100%;
  max-height: 55vh;
  overflow: hidden;
}

.page-hero img {
  width: 100%;
  height: 55vh;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ─── Letter (home page) ─────────────────────────────────────── */

.letter-section {
  padding-inline: var(--gutter);
  padding-bottom: var(--s-xl);
}

.letter {
  max-width: 68ch;
  margin-inline: auto;
  background: #fff;
  border-top: 3px solid var(--natural-green);
  box-shadow: var(--shadow-m);
  padding: var(--s-l);
}

.letter__header {
  margin-bottom: var(--s-m);
}

.letter__from {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-s);
  padding-bottom: var(--s-s);
  border-bottom: var(--border-width) solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.letter__from-name {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.letter__date {
  color: var(--muted);
}

.letter__title {
  font-size: var(--text-lg);
  margin-top: 0;
}

.letter__body p {
  max-width: none;
}

.letter__signature {
  margin-top: var(--s-m);
  font-style: italic;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  max-width: none;
}

.letter__permalink {
  text-decoration: none;
  color: inherit;
}

.letter__permalink:hover {
  text-decoration: underline;
}

/* ─── Paper (legal pages) ────────────────────────────────────── */

main.paper {
  max-width: 82ch;
  background: #fff;
  border-radius: var(--r-m);
  box-shadow: var(--shadow-m);
  padding: clamp(var(--s-s), 5vw, var(--s-l));
  margin-block: var(--s-l);
}

.legal-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-m);
  margin-bottom: var(--s-m);
  padding-bottom: var(--s-s);
  border-bottom: var(--border-width) solid var(--border);
}

/* ─── Transparent header ─────────────────────────────────────── */

.transparent-header .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
}

.transparent-header .nav-list a {
  color: var(--text);
}

.transparent-header .nav-list a:hover,
.transparent-header .nav-list a[aria-current] {
  color: var(--accent);
}

/* Darken top and left of hero so nav and text are legible */
.transparent-header .hero__overlay {
  background:
    linear-gradient(to right,
      rgba(20, 16, 15, 0.72) 0%,
      rgba(20, 16, 15, 0.45) 45%,
      transparent 72%),
    linear-gradient(to bottom,
      rgba(26, 21, 20, 0.35) 0%,
      transparent 25%,
      transparent 45%,
      rgba(26, 21, 20, 0.88) 100%);
}

body.nav-open {
  overflow: hidden;
}

/* ─── Mobile ──────────────────────────────────────────────────── */

@media (max-width: 52rem) {

  .site-header > a {
    position: relative;
    z-index: 60;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 60;
  }

  .nav-list {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s-l);
    padding: 0;
    list-style: none;
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-list a {
    font-size: var(--text-xl);
    padding: var(--s-xs) var(--s-m);
  }

  .footer-sections {
    grid-template-columns: 1fr 1fr;
  }

  .footer-legal-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .letter-section {
    padding-inline: 0;
  }

  .letter {
    max-width: none;
    padding-inline: var(--gutter);
    box-shadow: none;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .split--reverse .split__image,
  .split--reverse .split__text {
    order: unset;
  }

  .split--mobile-reverse .split__image {
    order: 2;
  }

  .split--mobile-reverse .split__text {
    order: 1;
  }

  .hero {
    min-height: 50vh;
  }
}

@media (max-width: 30rem) {
  .footer-sections {
    grid-template-columns: 1fr;
  }
}
