/* ==========================================================================
   Lapuan Teollisuustyöntekijät ry
   Pelkkä CSS – ei riippuvuuksia, ei ulkoisia fontteja.
   ========================================================================== */

:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #eeece7;
  --text: #16191f;
  --muted: #5b616c;
  --line: #dedbd4;
  --brand: #13233d;        /* teräksen sininen */
  --brand-2: #1d3557;
  --accent: #d9550b;       /* hehkuva metalli */
  --accent-strong: #b8460a;
  --accent-soft: #fbe9dd;
  --on-brand: #ffffff;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #151b24;
    --surface-2: #1c2430;
    --text: #e8eaee;
    --muted: #9aa3b1;
    --line: #2a3340;
    --brand: #0a1424;
    --brand-2: #13233d;
    --accent: #ff7a2e;
    --accent-strong: #ff9354;
    --accent-soft: #2c1d14;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

/* ---------- Perusasetukset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-strong); text-underline-offset: .18em; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Ylätunniste ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--brand) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  color: var(--on-brand);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.brand:hover { color: inherit; }
.brand-mark {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #f08a3c 100%);
  color: #fff; font-weight: 900; font-size: 1rem; letter-spacing: -.02em;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: clamp(.7rem, 3.4vw, 1rem); font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: clamp(.65rem, 2.9vw, .8rem); opacity: .7; }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 10px;
  background: transparent; color: inherit; cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav a {
  display: block; padding: 8px 14px; border-radius: 999px;
  color: rgba(255, 255, 255, .82); text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: background-color .15s, color .15s;
}
.site-nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.site-nav a[aria-current="page"] { background: #fff; color: var(--brand); }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--brand); border-bottom: 1px solid rgba(255, 255, 255, .08);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding: 8px var(--gutter) 16px; gap: 2px; }
  .site-nav a { padding: 12px 14px; border-radius: 10px; font-size: 1.05rem; }
  .no-js .site-nav { position: static; display: block; }
  .no-js .nav-toggle { display: none; }
  .no-js .header-inner { flex-wrap: wrap; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--brand); color: var(--on-brand);
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: center 60%;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(100deg, rgba(10, 20, 36, .94) 0%, rgba(10, 20, 36, .82) 45%, rgba(10, 20, 36, .35) 100%);
}
.hero-inner { padding: clamp(64px, 11vw, 140px) 0 clamp(56px, 9vw, 112px); max-width: 700px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #ffb27d; margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.hero h1 { color: #fff; }
.hero h1 .accent { color: #ff8a45; }
.hero .lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: rgba(255, 255, 255, .85); max-width: 600px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Sivujen pienempi otsikkoalue */
.page-hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--brand); color: var(--on-brand);
  padding: clamp(48px, 8vw, 88px) 0 clamp(40px, 6vw, 64px);
}
.page-hero::after {
  content: ""; position: absolute; z-index: -1; right: -120px; top: -120px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 122, 46, .35) 0%, rgba(255, 122, 46, 0) 70%);
}
.page-hero h1 { color: #fff; margin-bottom: .25em; }
.page-hero p { color: rgba(255, 255, 255, .8); font-size: 1.15rem; margin: 0; max-width: 640px; }
.page-hero--photo .hero-bg { object-position: center 70%; }
.page-hero--photo::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(10, 20, 36, .95) 0%, rgba(10, 20, 36, .75) 60%, rgba(10, 20, 36, .55) 100%);
}

/* ---------- Painikkeet ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: transform .15s, background-color .15s, border-color .15s, color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-ghost { border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); border-color: #fff; color: #fff; }
.btn-outline { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Osiot ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--alt { background: var(--surface-2); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 32px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); }
.kicker { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-strong); margin-bottom: 8px; }

/* Tilastot */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-top: -48px; position: relative; z-index: 2;
}
.stat { padding: 24px 28px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat strong { display: block; font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; color: var(--accent-strong); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .95rem; }
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; margin-top: -32px; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat { padding: 18px 22px; }
}

/* Kaksipalstainen */
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.figure { margin: 0; }
.figure img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.figure figcaption { font-size: .9rem; color: var(--muted); margin-top: 10px; }

/* Kortit */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
@media (max-width: 400px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.card p { margin: 0; color: var(--muted); }
.card .icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 6px;
}
.card .icon svg { width: 24px; height: 24px; }
.card-link { text-decoration: none; color: inherit; transition: transform .15s, border-color .15s; }
.card-link:hover { color: inherit; transform: translateY(-2px); border-color: var(--accent); }
.card-link .more { margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--accent-strong); }

/* Ilmoitukset */
.post {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(22px, 4vw, 36px); box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
}
.post + .post { margin-top: 20px; }
.post h2, .post h3 { margin-bottom: .35em; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: .8rem;
}
.post p:last-child { margin-bottom: 0; }

/* CTA-banneri */
.cta {
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; border-radius: calc(var(--radius) + 6px);
  padding: clamp(28px, 5vw, 56px);
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  position: relative; overflow: hidden; isolation: isolate;
}
.cta::after {
  content: ""; position: absolute; z-index: -1; right: -80px; bottom: -140px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 122, 46, .45) 0%, rgba(255, 122, 46, 0) 70%);
}
.cta h2 { color: #fff; margin-bottom: .3em; }
.cta p { color: rgba(255, 255, 255, .82); margin: 0; }
@media (max-width: 700px) { .cta { grid-template-columns: 1fr; } }

/* ---------- Henkilökortit ---------- */
.person {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: center; min-width: 0;
}
.avatar {
  grid-row: span 2; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
  background: var(--brand-2); color: #fff;
}
.person .role { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-strong); }
.person .name { font-size: 1.15rem; font-weight: 750; margin: 0; line-height: 1.25; }
.person .org { color: var(--muted); font-size: .95rem; }
.contact { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.contact a {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  color: var(--text); text-decoration: none; font-size: .95rem;
}
.contact a span { overflow-wrap: anywhere; }
.contact a:hover { color: var(--accent-strong); }
.contact svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.contact .na { color: var(--muted); font-size: .9rem; font-style: italic; }

.name-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.name-list li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 16px; font-weight: 600;
}


/* ---------- Aikajana ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 36px 56px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 4px solid var(--accent);
}
.timeline .year { display: inline-block; font-weight: 800; font-size: 1.1rem; color: var(--accent-strong); margin-bottom: 4px; }
.timeline h3 { margin-bottom: .35em; }
.timeline p { color: var(--muted); }
.timeline .memorial::before { border-color: var(--muted); background: var(--muted); }
.timeline .memorial .year { color: var(--muted); }

/* ---------- Sivupalkki ---------- */
.aside-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.aside-box h3 { margin-bottom: .6em; }
.aside-box ul { margin: 0; padding-left: 1.1em; color: var(--muted); }
.aside-box li + li { margin-top: 6px; }

.layout-aside { display: grid; grid-template-columns: 1fr 320px; gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (max-width: 900px) { .layout-aside { grid-template-columns: 1fr; } }

/* ---------- Alatunniste ---------- */
.site-footer { background: var(--brand); color: rgba(255, 255, 255, .78); padding: 56px 0 28px; margin-top: auto; font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: #ffb27d; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #ffb27d; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 40px; padding-top: 22px; font-size: .85rem; color: rgba(255, 255, 255, .6);
}

/* Takaisin ylös */
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; box-shadow: var(--shadow);
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top svg { width: 22px; height: 22px; }

/* Esiin liukuminen */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

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

/* ---------- Tulostus ---------- */
@media print {
  .site-header, .site-footer, .to-top, .hero-actions, .nav-toggle { display: none !important; }
  .hero, .page-hero { background: none !important; color: #000 !important; padding: 0 0 16px; }
  .hero::before, .page-hero::before, .page-hero::after, .hero-bg { display: none !important; }
  .page-hero h1, .page-hero p, .hero h1, .hero .lead { color: #000 !important; }
  .card, .person, .post { box-shadow: none; break-inside: avoid; }
  .reveal { opacity: 1 !important; transform: none !important; }
  body { background: #fff; color: #000; }
}
