/*
Theme Name: Suupohjan Latu
Theme URI: https://suupohjanlatu.fi
Author: Suupohjan Latu ry
Description: Suupohjan Latu ry:n verkkosivuteema. Etusivun kaikki osiot ovat muokattavia lohkoja (Sivut → Etusivu): osioita voi muokata, siirtää ja poistaa. Hallitus omana sisältötyyppinään, tiedotteet artikkeleina, Hukan kämpällä oma sivu.
Version: 2.1.0
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: suupohjanlatu
*/

:root {
  --navy: #023769;
  --navy-2: #0b4a8a;
  --blue: #2f6fb0;
  --blue-dark: #1d5c9c;
  --blue-light: #a9cdec;
  --sky: #7bb5e3;
  --lake: #65aae1;
  --snow: #f2f7fc;
  --white: #ffffff;
  --text: #16263a;
  --muted: #52657a;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.65;
}
a { color: var(--blue-dark); }
img { max-width: 100%; height: auto; }
.screen-reader-text { position: absolute; left: -9999px; }
p, ul, ol, h1, h2, h3, figure { margin-top: 0; }

/* HEADER */
.site-header { background: var(--navy); color: var(--white); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.admin-bar .site-header { top: 32px; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.site-logo { display: flex; align-items: center; gap: 12px; color: var(--white); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: .02em; }
.logo-icon { width: 54px; height: 54px; border-radius: 50%; background: var(--white); padding: 2px; display: flex; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.logo-icon img { width: 100%; height: 100%; border-radius: 50%; object-fit: contain; display: block; }
.logo-text span { color: var(--blue-light); }
.main-nav ul { list-style: none; display: flex; gap: 2px; flex-wrap: wrap; margin: 0; padding: 0; }
.main-nav a { color: var(--white); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 6px; transition: background .2s; display: block; }
.main-nav a:hover { background: var(--navy-2); }
.main-nav li.cta > a { background: var(--blue); }
.main-nav li.cta > a:hover { background: var(--blue-dark); }
.nav-toggle { display: none; background: none; border: 2px solid rgba(255,255,255,.4); color: var(--white); border-radius: 6px; padding: 6px 10px; font-size: 1rem; cursor: pointer; }

/* BUTTONS (painike-lohko + teeman omat) */
.btn, .wp-block-button__link { display: inline-block; padding: 14px 28px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 1rem; line-height: 1.3; transition: all .2s; border: 2px solid var(--blue); background: var(--blue); color: var(--white); cursor: pointer; }
.btn:hover, .wp-block-button__link:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--white); }
.btn-outline, .is-style-outline .wp-block-button__link { background: transparent; color: var(--blue-dark); border-color: var(--blue); }
.btn-outline:hover, .is-style-outline .wp-block-button__link:hover { background: var(--blue); color: var(--white); }
.wp-block-buttons { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }

/* OSIOT (Ryhmä-lohkot luokalla section / section-alt) */
.section { padding: 80px 24px; }
.section-alt { background: var(--snow); }
.section-title { font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 900; color: var(--navy); line-height: 1.2; margin-bottom: 8px; position: relative; padding-bottom: 14px; }
.section-title { padding-bottom: 40px; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 84px; height: 28px; background: url("assets/title-trees.svg") left bottom / contain no-repeat; }
.section-subtitle { color: var(--muted); font-size: 1.1rem; margin-top: 14px; margin-bottom: 30px; }
.front-content .section p { margin-bottom: 1em; }
.front-content .wp-block-columns { display: flex; gap: 32px; }
.front-content .wp-block-column { flex: 1; min-width: 0; }

/* HERO (Ryhmä-lohko luokalla hero – taustakuvan voi lisätä lohkon asetuksista) */
.hero { background-color: var(--navy); background-image: linear-gradient(180deg, #022c55 0%, var(--navy) 30%, var(--blue-dark) 70%, #4f8fcb 100%); background-size: cover; background-position: center; color: var(--white); padding: 90px 24px 250px; position: relative; overflow: hidden; }
.hero[style*="background-image"]::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2,44,85,.85), rgba(2,55,105,.45)); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 240px; background: url("assets/hero-landscape.svg") center bottom / cover no-repeat; pointer-events: none; }
.hero > * { position: relative; z-index: 2; }
.front-content .hero-grid { align-items: center; gap: 48px; }
.hero-kicker { text-transform: uppercase; letter-spacing: .18em; font-size: .85rem; font-weight: 700; color: var(--sky); margin-bottom: 14px; }
.hero-title { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 900; line-height: 1.05; margin-bottom: 18px; color: var(--white); letter-spacing: -.01em; }
.hero-title span { color: var(--sky); }
.hero-text { font-size: 1.18rem; margin-bottom: 32px; opacity: .93; max-width: 40em; }
.hero .is-style-outline .wp-block-button__link { color: var(--white); border-color: rgba(255,255,255,.75); }
.hero .is-style-outline .wp-block-button__link:hover { background: var(--white); color: var(--navy); }
.hero-logo { margin: 0; text-align: center; }
.hero-logo img { width: 100%; max-width: 340px; border-radius: 50%; box-shadow: 0 18px 50px rgba(0,20,50,.45); background: var(--white); }
.front-content .hero-grid > .wp-block-column:last-child { flex: 0 0 38%; }

/* TAULUKOT */
.wp-block-table { overflow-x: auto; margin: 0 0 1.2em; }
.wp-block-table table, .data-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 10px rgba(19,41,61,.07); border: 0; }
.wp-block-table th, .wp-block-table td, .data-table td { padding: 12px 16px; text-align: left; border: 0; border-bottom: 1px solid #e3e9ef; vertical-align: top; }
.wp-block-table th { background: var(--navy); color: var(--white); font-weight: 700; white-space: nowrap; }
.wp-block-table thead { border-bottom: 0; }
.wp-block-table tr:last-child td, .data-table tr:last-child td { border-bottom: 0; }
.wp-block-table small { color: var(--muted); }
.price-table td:last-child, .price-table th:last-child { text-align: right; }
.price-table td:last-child { font-weight: 800; color: var(--navy); white-space: nowrap; }

/* AJANKOHTAISTA */
.some-placeholder { background: var(--white); border: 2px dashed var(--blue-light); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); margin-bottom: 30px; }
.news-heading { font-size: 1.3rem; color: var(--navy); margin: 30px 0 18px; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.news-card { background: var(--white); border-radius: var(--radius); box-shadow: 0 2px 10px rgba(19,41,61,.07); padding: 22px; display: flex; flex-direction: column; }
.news-card .date { font-size: .85rem; color: var(--blue-dark); font-weight: 700; letter-spacing: .05em; }
.news-card h3 { font-size: 1.15rem; margin: 6px 0 10px; color: var(--navy); }
.news-card h3 a { color: inherit; text-decoration: none; }
.news-card p { color: var(--muted); flex: 1; }
.news-card .more { margin-top: 14px; font-weight: 700; text-decoration: none; }
.news-all { margin-top: 24px; }
.news-empty { color: var(--muted); }

/* TOIMINTA */
.activity-list { list-style: none; padding: 0; margin: 30px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.activity-list li { background: linear-gradient(180deg, var(--snow), #e3eef9); border-radius: var(--radius); padding: 20px 14px; text-align: center; font-weight: 700; color: var(--navy); border-bottom: 4px solid var(--lake); }
.front-content .facts { gap: 18px; }
.fact { border-left: 4px solid var(--blue); padding: 6px 16px; color: var(--muted); margin: 0; }
.fact strong { display: block; font-size: 1.9rem; color: var(--navy); line-height: 1.15; }

/* HUKAN KÄMPPÄ */
.hukka { background: var(--navy); color: var(--white); position: relative; padding-bottom: 170px; overflow: hidden; }
.hukka::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 120px; background: url("assets/hukka-forest.svg") center bottom / cover no-repeat; pointer-events: none; }
.hukka > * { position: relative; z-index: 1; }
.hukka .section-title::after { filter: brightness(1.8); }
.hukka .section-title { color: var(--white); }
.hukka .section-subtitle { color: var(--sky); }
.front-content .hukka-grid { gap: 40px; align-items: stretch; }
.hukka-card { background: var(--navy-2); border-radius: var(--radius); padding: 18px 20px; }
.hukka a:not(.wp-block-button__link) { color: var(--blue-light); }
.hukka-image { border-radius: var(--radius); min-height: 300px; height: 100%; background-color: var(--navy-2); background-size: cover; background-position: center; }
.hukka-image:not([style*="background-image"]) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 140'%3E%3Cg fill='none' stroke='%23a9c6e4' stroke-opacity='.5' stroke-width='4'%3E%3Cpath d='M30 120V70l70-45 70 45v50z' stroke-linejoin='round'/%3E%3Cpath d='M85 120V88h30v32M135 50V28h14v31M10 120h180'/%3E%3C/g%3E%3C/svg%3E"); background-size: 55%; background-repeat: no-repeat; }
.hukka-image img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); display: block; }

/* JÄSENYYS */
.front-content .join-grid { gap: 48px; }
.check-list { list-style: none; padding: 0; margin: 0 0 28px; }
.check-list li { padding: 8px 0 8px 32px; position: relative; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 9px; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: var(--white); font-size: .8rem; display: flex; align-items: center; justify-content: center; font-weight: 900; }

/* HALLITUS */
.board-table td.board-name { font-weight: 700; color: var(--navy); }
.board-table td.board-role { color: var(--muted); }
.board-table a { text-decoration: none; }

/* YHTEYSTIEDOT */
.front-content .contact-grid { gap: 20px; flex-wrap: wrap; }
.contact-grid .wp-block-column { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: 0 2px 10px rgba(19,41,61,.07); flex: 1 1 200px; }
.contact-label { font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--blue-dark); margin-bottom: 8px; }
.section:not(.section-alt) .contact-grid .wp-block-column { background: var(--snow); box-shadow: none; }

/* SIVUT JA ARTIKKELIT */
.page-hero { background: linear-gradient(180deg, #022c55, var(--navy) 40%, var(--blue-dark)); color: var(--white); padding: 64px 24px 150px; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 130px; background: url("assets/hero-landscape.svg") center bottom / cover no-repeat; }
.page-hero > * { position: relative; z-index: 1; }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 900; max-width: 1100px; margin: 0 auto; }
.page-hero .meta { max-width: 1100px; margin: 8px auto 0; color: var(--blue-light); }
.page-body { padding: 40px 24px 190px; background: var(--snow); }
.page-body .container, .container { max-width: 1100px; margin: 0 auto; }
.page-body .container { max-width: 820px; }
.entry-content > * + * { margin-top: 1em; }
.entry-content h2, .entry-content h3 { color: var(--navy); margin-top: 1.6em; }
.wp-block-file { background: var(--snow); padding: 12px 16px; border-radius: 8px; }
.back-link { display: inline-block; margin-top: 36px; font-weight: 700; text-decoration: none; }

/* FOOTER */
.site-footer { background: var(--navy); color: rgba(255,255,255,.82); text-align: center; padding: 20px 24px 34px; font-size: .95rem; position: relative; margin-top: 0; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: 130px; background: url("assets/footer-forest.svg") center bottom / auto 130px repeat-x; pointer-events: none; }
.front-content > .section:last-child, .page-body, .section.archive-list { padding-bottom: 190px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--blue-light); }
.site-footer .footer-latu { margin-top: 6px; font-size: .85rem; opacity: .75; }

/* EDITORI: näytetään osioiden rajat, jotta ne on helppo valita ja poistaa */
.editor-styles-wrapper .section, .editor-styles-wrapper .hero { outline: 1px dashed rgba(62,120,178,.35); outline-offset: -6px; }

/* RESPONSIIVISUUS */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; width: 100%; }
  .main-nav.open { display: block; }
  .nav-container { flex-wrap: wrap; }
  .main-nav ul { flex-direction: column; padding: 8px 0; }
  .front-content .wp-block-columns { flex-direction: column; }
  .section { padding: 60px 20px; }
  .board-table td.board-phone { display: none; }
}
@media (max-width: 600px) {
  .board-table, .board-table tbody, .board-table tr, .board-table td { display: block; width: 100%; }
  .board-table tr { padding: 10px 0; border-bottom: 1px solid #e3e9ef; }
  .board-table td { border: 0; padding: 2px 16px; }
  .board-table td.board-phone { display: block; }
}

/* Painikkeiden yhtenäinen koko (ohittaa WP:n oletukset) */
.wp-block-button .wp-block-button__link, .wp-block-button.is-style-outline > .wp-block-button__link { padding: 14px 28px; border-width: 2px; font-size: 1rem; }
@media (max-width: 860px) {
  .front-content .hero-grid > .wp-block-column:last-child { flex-basis: auto; order: -1; }
  .hero-logo img { max-width: 180px; }
  .hero { padding-bottom: 200px; }
  .hero::after { height: 170px; }
  .logo-text { font-size: 1rem; }
}
