/* ============================================================
   Metalli 195 – sivuston tyylit
   Tumma teräksinen yläpalkki, vaalea helppolukuinen sisältö.
   ============================================================ */

:root {
  --steel-900: #0f1216;
  --steel-800: #171b21;
  --steel-700: #22282f;
  --steel-500: #4a5260;
  --steel-300: #aab2be;
  --steel-100: #e6e9ee;
  --paper: #f5f6f8;
  --white: #ffffff;
  --ink: #1c1f24;
  --ink-soft: #4a5260;
  --ember: #f0641e;      /* sula metalli – toimintapainikkeet */
  --ember-dark: #c94d10;
  --arc: #3a8fe0;        /* hitsauskaari – linkit, korostukset */
  --arc-dark: #2a6fb3;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(15, 18, 22, .08);
  --wrap: 1120px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Barlow Condensed", "Barlow", "Arial Narrow", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

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

a { color: var(--arc-dark); }
a:hover { color: var(--ember-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.1;
  margin: 0 0 .5em;
  letter-spacing: .01em;
  text-transform: uppercase;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 700; }

p { margin: 0 0 1em; }
.lead { font-size: 1.2rem; color: var(--ink-soft); }
.small { font-size: .9rem; color: var(--ink-soft); }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ember); color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,0) 40%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px),
    var(--steel-800);
  border-bottom: 3px solid var(--ember);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: stretch; justify-content: space-between; gap: 1rem;
  min-height: 72px;
}
.brand { display: flex; align-items: center; flex: none; padding: 5px 0; }
.brand img { width: 62px; height: 62px; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,.55); }
.brand:hover img { box-shadow: 0 0 0 2px var(--ember), 0 2px 10px rgba(0,0,0,.55); }

.site-nav { display: flex; align-items: stretch; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .15rem; }
.site-nav a {
  display: flex; align-items: center; height: 100%; padding: 0 .75rem;
  color: var(--steel-100); text-decoration: none; font-weight: 600;
  font-family: var(--font-head); text-transform: uppercase; font-size: 1rem; letter-spacing: .02em;
  border-bottom: 3px solid transparent; margin-bottom: -3px; white-space: nowrap;
}
.site-nav a:hover { background: var(--steel-700); color: #fff; }
.site-nav a.active { color: #fff; border-bottom-color: #fff; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--steel-500); border-radius: 6px;
  width: 44px; height: 40px; padding: 8px; cursor: pointer; flex-direction: column; justify-content: space-between;
  align-self: center;
}
.nav-toggle span { display: block; height: 3px; background: var(--steel-100); border-radius: 2px; }

@media (max-width: 1000px) {
  .site-nav a { padding: 0 .5rem; font-size: .95rem; }
}
@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; align-items: center; padding: .35rem 0; min-height: 0; }
  .brand img { width: 50px; height: 50px; }
  .nav-toggle { display: flex; }
  .site-nav { display: none; width: 100%; margin-top: .5rem; border-top: 1px solid var(--steel-700); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: .3rem 0; gap: 0; }
  .site-nav a { height: auto; padding: .7rem .6rem; border-bottom: 0; margin: 0; border-left: 3px solid transparent; }
  .site-nav a.active { border-left-color: var(--ember); background: var(--steel-700); }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(ellipse at 20% 30%, rgba(58,143,224,.25), transparent 50%),
    radial-gradient(ellipse at 85% 80%, rgba(240,100,30,.28), transparent 45%),
    var(--steel-900);
  color: #fff;
  padding: clamp(3rem, 8vw, 6rem) 0;
}
/* Etusivun pääkuva: koko leveys, tekstit sen alla */
.hero-has-image { padding-top: clamp(1.25rem, 3vw, 2rem); }
.hero-image { width: min(80%, var(--wrap)); margin: 0 auto clamp(1.5rem, 4vw, 2.75rem); }
.hero-image img { width: 100%; border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.5); }
@media (max-width: 700px) { .hero-image { width: min(100% - 2.5rem, var(--wrap)); } }
.hero h1 { color: #fff; max-width: 22ch; }
.hero .lead { color: var(--steel-300); max-width: 60ch; font-size: 1.25rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

.page-hero {
  background: var(--steel-800); color: #fff; padding: 2.5rem 0 2.2rem;
  border-bottom: 1px solid var(--steel-700);
}
.page-hero h1 { color: #fff; margin-bottom: .2em; }
.page-hero .lead { color: var(--steel-300); margin: 0; max-width: 65ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.4rem; border-radius: 8px; font-weight: 700; text-decoration: none;
  font-family: var(--font-head); text-transform: uppercase; font-size: 1.1rem; letter-spacing: .04em;
  border: 2px solid transparent; cursor: pointer; transition: transform .1s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ember); color: #fff; }
.btn-primary:hover { background: var(--ember-dark); color: #fff; }
.btn-secondary { background: var(--arc); color: #fff; }
.btn-secondary:hover { background: var(--arc-dark); color: #fff; }
.btn-outline { border-color: var(--steel-300); color: #fff; background: rgba(255,255,255,.06); }
.btn-outline:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn-light { border-color: var(--steel-300); color: var(--ink); background: #fff; }
.btn-light:hover { border-color: var(--ink); color: var(--ink); }
.btn-lg { padding: 1.1rem 1.8rem; font-size: 1.25rem; }

/* ---------- Sections & grids ---------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-alt { background: var(--white); border-block: 1px solid var(--steel-100); }
.section-dark { background: var(--steel-800); color: var(--steel-100); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-title h2 { margin: 0; }
.section-title a { font-weight: 600; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.card {
  background: var(--white); border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow); border-top: 4px solid var(--steel-300);
  display: flex; flex-direction: column;
}
.card h3 { margin-top: .2em; }
.card p:last-child { margin-bottom: 0; }
.card .card-cta { margin-top: auto; padding-top: 1rem; font-weight: 600; }
.card-ember { border-top-color: var(--ember); }
.card-arc { border-top-color: var(--arc); }
.card-link { text-decoration: none; color: inherit; }
.card-link:hover { color: inherit; box-shadow: 0 10px 30px rgba(15,18,22,.14); }

.icon {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: var(--steel-100); color: var(--steel-700); font-size: 1.4rem; margin-bottom: .8rem;
}

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem;
}
.stat { text-align: center; padding: 1.5rem 1rem; }
.stat .num {
  font-family: var(--font-head); font-weight: 800; font-size: clamp(2.6rem, 6vw, 3.8rem);
  line-height: 1; color: #fff; letter-spacing: .01em;
}
.stat .label { color: var(--steel-300); text-transform: uppercase; font-weight: 600; letter-spacing: .08em; font-size: .9rem; margin-top: .4rem; }

/* ---------- Events ---------- */
.event-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.event {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 78px 1fr; overflow: hidden;
}
.event .date {
  background: var(--steel-800); color: #fff; text-align: center; padding: 1rem .5rem;
  font-family: var(--font-head); display: flex; flex-direction: column; justify-content: center;
}
.event .date .d { font-size: 2rem; font-weight: 800; line-height: 1; }
.event .date .m { font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; color: var(--steel-300); }
.event .body { padding: 1rem 1.1rem; }
.event h3 { font-size: 1.2rem; margin: 0 0 .3em; text-transform: none; font-family: var(--font); font-weight: 700; }
.event .meta { color: var(--ink-soft); font-size: .92rem; margin: 0 0 .4em; }
.event .tag {
  display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .15em .55em; border-radius: 999px; background: var(--steel-100); color: var(--steel-700); margin-right: .3em;
}
.event .tag-nuoret { background: #e2f0fc; color: #1d5a94; }
.event .tag-elakelaiset { background: #fdeadb; color: #9a3d0c; }
.event .tag-koulutus { background: #e5f4e8; color: #1f6b34; }
.event .tag-virkistys { background: #f3e8fb; color: #6b2d9a; }
.event .tag-naiset { background: #fbe5ee; color: #9a1f55; }
.event .actions { margin-top: .6rem; display: flex; gap: .8rem; flex-wrap: wrap; font-size: .92rem; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filters button {
  border: 1px solid var(--steel-300); background: #fff; border-radius: 999px; padding: .4rem 1rem;
  font: inherit; font-weight: 600; cursor: pointer; color: var(--ink-soft);
}
.filters button[aria-pressed="true"] { background: var(--steel-800); color: #fff; border-color: var(--steel-800); }

.calendar-embed { border: 0; width: 100%; height: 640px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }

.notice {
  background: #fff7ed; border-left: 4px solid var(--ember); padding: 1rem 1.2rem; border-radius: 6px; margin: 1rem 0;
}
.notice-info { background: #eaf3fc; border-left-color: var(--arc); }

/* ---------- Help chooser ---------- */
.help-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.help-item {
  background: #fff; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
  text-decoration: none; color: inherit; border-left: 5px solid var(--arc); transition: transform .1s;
}
.help-item:hover { transform: translateY(-2px); color: inherit; border-left-color: var(--ember); }
.help-item h3 { font-size: 1.2rem; margin-bottom: .3em; }
.help-item p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

details.faq { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: .8rem; }
details.faq summary {
  cursor: pointer; padding: 1rem 1.25rem; font-weight: 700; font-size: 1.1rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
details.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--ember); }
details.faq[open] summary::after { content: "–"; }
details.faq .faq-body { padding: 0 1.25rem 1.25rem; }
details.faq .faq-body p:last-child { margin-bottom: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.steps li { position: relative; padding-left: 3.4rem; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--ember); color: #fff; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 800; font-size: 1.3rem;
}

/* ---------- People ---------- */
.people { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.person { background: #fff; border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.person .role { color: var(--ember-dark); font-weight: 700; text-transform: uppercase; font-size: .8rem; letter-spacing: .06em; }
.person .name { font-weight: 700; font-size: 1.1rem; }
.person .contact { font-size: .92rem; color: var(--ink-soft); }
.name-list { columns: 2; column-gap: 2rem; padding-left: 1.2rem; }
@media (min-width: 700px) { .name-list { columns: 3; } }
.name-list li { break-inside: avoid; padding: .15rem 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--steel-100); }
th { background: var(--steel-800); color: #fff; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.map { border: 0; width: 100%; height: 320px; border-radius: var(--radius); box-shadow: var(--shadow); }
form.contact { display: grid; gap: 1rem; }
form.contact label { font-weight: 600; display: grid; gap: .3rem; }
form.contact input, form.contact textarea, form.contact select {
  font: inherit; padding: .7rem .9rem; border: 1px solid var(--steel-300); border-radius: 6px; width: 100%; background: #fff;
}
form.contact textarea { min-height: 140px; resize: vertical; }
form.contact .consent { font-weight: 400; display: flex; gap: .6rem; align-items: start; font-size: .95rem; }
form.contact .consent input { width: auto; margin-top: .3rem; }

.office-hours { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.5rem; }
.office-hours dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1.2rem; margin: 0; }
.office-hours dt { font-weight: 700; }
.office-hours dd { margin: 0; }

/* ---------- Draft markers (poistetaan ennen julkaisua) ---------- */
.todo {
  display: inline-block; background: #fff3c4; color: #7a5a00; border: 1px dashed #d4a800;
  padding: .05em .5em; border-radius: 4px; font-size: .85rem; font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--steel-900); color: var(--steel-300); margin-top: 3rem; border-top: 3px solid var(--ember); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); padding: 3rem 0 2rem; }
.footer-title { font-size: 1.2rem; color: #fff; margin-bottom: .6em; }
.site-footer a { color: var(--steel-100); }
.site-footer a:hover { color: var(--ember); }
.site-footer address { font-style: normal; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.footer-bottom { border-top: 1px solid var(--steel-700); padding: 1rem 0; font-size: .9rem; }
.footer-bottom p { margin: 0; }
.fb::before { content: "f"; display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; border-radius: 4px; background: #1877f2; color: #fff; font-weight: 800; margin-right: .5em; font-family: var(--font-head); }

@media print {
  .site-header, .site-footer, .hero-actions, .nav-toggle { display: none; }
}

/* ---------- Facebook-nosto etusivulla ---------- */
.fb-band { padding: 2.5rem 0; border-top: 3px solid #1877f2; }
.fb-band-inner { display: flex; align-items: center; gap: 1.75rem; flex-wrap: wrap; }
.fb-band-logo { width: 84px; height: 84px; border-radius: 50%; flex: none; box-shadow: 0 4px 16px rgba(0,0,0,.5); }
.fb-band-text { flex: 1 1 320px; }
.fb-band-text h2 { margin-bottom: .3em; }
.fb-band-text p { margin: 0; color: var(--steel-300); max-width: 60ch; }
.btn-facebook { background: #1877f2; color: #fff; flex: none; }
.btn-facebook:hover { background: #0f5fc7; color: #fff; }
@media (max-width: 700px) {
  .fb-band-inner { flex-direction: column; align-items: flex-start; }
  .btn-facebook { width: 100%; justify-content: center; }
}

/* ---------- Hallituksen kuvakortit ---------- */
.board { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.member { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.member .photo { aspect-ratio: 1 / 1; background: var(--steel-700); position: relative; flex: none; }
.member .photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.member .photo .initials {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--steel-300);
  font-family: var(--font-head); font-weight: 800; font-size: 3.5rem; letter-spacing: .05em;
}
.member .photo img + .initials { display: none; }
.member .info { padding: 1rem 1.1rem 1.2rem; flex: 1; display: flex; flex-direction: column; }
.member .contact { margin-top: auto; padding-top: .4rem; }
.member .role { color: var(--ember-dark); font-weight: 700; text-transform: uppercase; font-size: .78rem; letter-spacing: .06em; }
.member .name { font-weight: 700; font-size: 1.15rem; line-height: 1.25; margin: .15rem 0 .2rem; }
.member .work { color: var(--ink-soft); font-size: .9rem; margin-bottom: .5rem; }
.member .contact { font-size: .88rem; line-height: 1.5; overflow-wrap: anywhere; }
.member .contact a { text-decoration: none; }
.member .contact a:hover { text-decoration: underline; }
.member-lead { grid-column: span 1; }
.deputies td:first-child { font-weight: 600; white-space: nowrap; }
