/* Männäisten tori - julkinen sivusto. Oma kevyt teema (ei alkuperäisen sivuston teemaa). */
:root {
  --red-800: #7d1406;
  --red-700: #a41b08;
  --red-100: #fbe9e5;
  --cream-50: #fffaf3;
  --cream-100: #f7efe2;
  --cream-200: #eadcc5;
  --ink: #2a211c;
  --ink-soft: #6b5d53;
  --radius: 12px;
  --serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 17px/1.65 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--cream-50);
}
h1, h2, h3, h4, h5 { font-family: var(--serif); line-height: 1.2; color: var(--red-800); margin: 1.4em 0 0.5em; }
h1 { font-size: clamp(32px, 5vw, 48px); margin: 0; }
h2 { font-size: clamp(26px, 3.4vw, 34px); }
h3 { font-size: 22px; }
h4, h5 { font-size: 18px; }
p { margin: 0 0 1em; }
a { color: var(--red-700); }
img { max-width: 100%; height: auto; }
iframe { max-width: 100%; border: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: #fff; padding: 8px 12px; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section--tint { background: var(--cream-100); }

.button {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--red-700);
  color: #fff !important;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: var(--red-800); }

/* Yläpalkki ja valikko */
.site-header { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 3px solid var(--red-700); }
.site-header__inner { display: flex; align-items: center; gap: 24px; max-width: 1240px; margin: 0 auto; padding: 10px clamp(16px, 3vw, 32px); }
.brand { display: flex; align-items: center; color: var(--red-800); font: 700 20px var(--serif); text-decoration: none; }
.brand img { height: 56px; width: auto; display: block; }
.nav-toggle { display: none; margin-left: auto; padding: 8px 14px; border: 1px solid var(--cream-200); border-radius: 999px; background: #fff; font: inherit; }
.site-nav { margin-left: auto; }
.site-nav > ul { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; list-style: none; }
.site-nav li { position: relative; list-style: none; }
.site-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); font-size: 15.5px; text-decoration: none; white-space: nowrap; }
.site-nav a:hover, .site-nav .is-active > a { color: var(--red-700); background: var(--red-100); }
.site-nav ul ul {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  margin: 0;
  padding: 6px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(42, 33, 28, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: 0.15s;
}
.site-nav li:hover > ul, .site-nav li:focus-within > ul { opacity: 1; visibility: visible; transform: none; }

/* Etusivun iso kuva */
.hero {
  display: grid;
  align-items: end;
  min-height: min(56vh, 520px);
  padding: 48px 0;
  background: linear-gradient(135deg, var(--red-800), var(--red-700));
  color: #fff;
}
.hero--image {
  background: linear-gradient(0deg, rgba(30, 12, 6, 0.72), rgba(30, 12, 6, 0.05) 70%), var(--image) var(--focus, 50% 50%) / cover no-repeat;
}
.hero__title { margin: 0 0 8px; color: inherit; font: 700 clamp(34px, 6vw, 60px) / 1.1 var(--serif); text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35); }
.hero__place { margin: 0; font-size: 18px; }
.hero a { color: #fff; }

/* Alasivun otsikkoalue */
.page-title { padding: clamp(36px, 6vw, 64px) 0; background: var(--cream-100); border-bottom: 1px solid var(--cream-200); }
.page-title--image { background: linear-gradient(0deg, rgba(30, 12, 6, 0.6), rgba(30, 12, 6, 0.2)), var(--image) var(--focus, 50% 50%) / cover; }
.page-title--image h1 { color: #fff; }

/* Tekstisisältö */
.prose { max-width: 820px; }
.prose > :first-child { margin-top: 0; }
.prose img { display: block; margin: 16px 0; border-radius: 8px; }
.prose iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; margin: 16px 0; border-radius: 8px; }
.prose iframe[src*='docs.google.com'] { aspect-ratio: auto; min-height: 900px; }
.prose iframe[src*='google.com/maps'] { aspect-ratio: auto; height: 340px; }
.prose ul { padding-left: 1.3em; }
.prose blockquote { margin: 1em 0; padding: 4px 20px; border-left: 4px solid var(--red-700); color: var(--ink-soft); }
.prose table { width: 100%; border-collapse: collapse; }
.prose td, .prose th { padding: 6px 8px; border-bottom: 1px solid var(--cream-200); text-align: left; }
.prose .button { margin: 4px 0 18px; }
/* Tekstin perään kirjoitettu painike omalle rivilleen tekstin alle */
.prose p > a.button { display: table; margin: 12px 0 0; }
.prose--home { max-width: 1080px; }
.prose--home h2 { margin-top: 0; font-size: 28px; }
.home-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px 40px; }
.home-col { display: flex; flex-direction: column; }
.home-col__action { margin: auto 0 0; padding-top: 8px; }
.prose .home-col__action .button { margin: 0; }
.post-date { color: var(--ink-soft); }
.back { margin-top: 32px; }

.subpages { display: grid; gap: 8px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--cream-200); }
.subpages a { font-weight: 600; text-decoration: none; }

/* Etusivun tukijapalkki */
.sponsors-strip { padding: 40px 0; border-top: 1px solid var(--cream-200); text-align: center; }
.sponsors-strip h2 { margin: 0 0 16px; font-size: 20px; }
.sponsors-strip ul { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 36px; margin: 0; padding: 0; list-style: none; }
.sponsors-strip ul + h2 { margin-top: 32px; }
.sponsors-strip li { display: grid; justify-items: center; gap: 4px; font-size: 15px; color: var(--ink-soft); }
/* Logottoman tukijan nimi sen omalla fontilla (Länsi-Suomen Maarakennus: Epilogue 300, SIL OFL). */
@font-face {
  font-family: 'Epilogue'; font-weight: 300; font-display: swap;
  src: url('fonts/epilogue-latin-300.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Epilogue'; font-weight: 300; font-display: swap;
  src: url('fonts/epilogue-latin-ext-300.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
.sponsors-strip a { text-decoration: none; }
.sponsors-strip span { font-family: 'Epilogue', sans-serif; font-weight: 300; font-size: 18px; color: var(--ink); }
.sponsors-strip img { max-width: 160px; max-height: 64px; width: auto; object-fit: contain; }

/* Uutiskortit */
.news { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; margin-top: 24px; }
.news__card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(42, 33, 28, 0.1);
  transition: transform 0.15s, box-shadow 0.15s;
}
.news__card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(42, 33, 28, 0.14); }
.news__card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.news__body { padding: 16px 20px 6px; }
.news__body h3 { margin: 4px 0 8px; font-size: 20px; }
.news__body time { font-size: 14px; color: var(--ink-soft); }
.news__body p { font-size: 15.5px; color: var(--ink-soft); }
.more { margin-top: 28px; }

.site-footer { padding: 40px 0; background: var(--red-800); color: #f7e6e1; font-size: 15px; }
.site-footer__inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.site-footer a { color: #fff; }
.site-footer p { margin: 4px 0; }
.site-footer__social { display: flex; gap: 18px; }
.site-footer__meta { opacity: 0.85; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-header__inner { flex-wrap: wrap; }
  .brand img { height: 44px; }
  .site-nav { display: none; width: 100%; margin: 0; }
  .site-nav.is-open { display: block; }
  .site-nav > ul { flex-direction: column; padding-bottom: 8px; }
  .site-nav ul ul { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; padding: 0 0 0 16px; }
  .site-nav a { white-space: normal; }
}
