/* Main-site identity: charcoal, slate, lime, and live-matching 3-column editorial layout. */
:root {
  --bm-ink: #1e2830;
  --bm-slate: #5d6772;
  --bm-lime: #c1d300;
  --bm-lime-ink: #727d00;
  --bm-link: #1b4f72;
  --bm-link-hover: #566000;
  --bm-link-focus: var(--bm-link-hover);
  --bm-paper: #f2f4f4;
  --bm-cal-bg: #dbe4ee;
  --bm-soc-bg: #dfe1e3;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--bm-ink);
  background: var(--bm-paper);
  font: 17px/1.6 'Titillium Web', Arial, sans-serif;
}

/* Two-tier Header (#4860 / #4169) */
.bm-header { background: var(--bm-paper); width: 100%; }
.bm-header-top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.bm-logo { width: 250px; max-width: 100%; height: auto; display: block; }
.bm-search-form {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid var(--bm-lime);
  border-radius: 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  padding: 4px 10px;
  width: 240px;
  max-width: 100%;
}
.bm-search-btn {
  background: none;
  border: 0;
  color: var(--bm-slate);
  padding: 4px 6px 4px 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.bm-search-input {
  border: 0;
  outline: 0;
  background: transparent;
  font: 16px/1.3 'Titillium Web', Arial, sans-serif;
  color: var(--bm-ink);
  width: 100%;
  min-width: 0;
}
.bm-header-bar {
  background: var(--bm-slate);
  width: 100%;
}
.bm-nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  align-items: center;
}
.bm-nav a {
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}
.bm-mobile-navigation { display: none; }

/* Hero Banner (#8008 / #4169) */
.bm-intro,
.bm-intro--archive {
  text-align: center;
  padding: 96px 24px;
  background: var(--bm-hero-image, url('/wp-content/uploads/2022/05/birch-6159054-scaled.jpg')) center 28%/cover no-repeat;
  background-color: var(--bm-slate);
  color: #fff;
}
.bm-intro h1,
.bm-hero-title {
  color: rgb(255, 255, 255);
  font-size: clamp(26px, 3.4vw, 42px);
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.2;
  max-width: 1000px;
  margin: 0 auto;
  text-shadow: 0 2px 10px rgba(0,0,0,.7), 0 0 24px rgba(0,0,0,.55);
}
.bm-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bm-slate);
  margin: 0 0 8px;
}

/* Lime Category Bar (avainsana-valikko) */
.bm-categories {
  background: var(--bm-lime);
  display: flex;
  gap: 20px 44px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 15px 24px;
}
.bm-categories a {
  color: var(--bm-ink);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}

/* 3-Column Layout (Homepage & Category Archives) */
.bm-three-col {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 20px 56px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 210px;
  gap: 28px;
  align-items: start;
}

/* Left Sidebar: Calendar Card & Social Card */
.bm-left-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.bm-calendar-card {
  background: var(--bm-cal-bg);
  padding: 20px 16px;
}
.bm-calendar-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.bm-calendar-icon { width: 42px; height: 42px; flex-shrink: 0; }
.bm-calendar-head h2 {
  font-size: 19px;
  line-height: 1.2;
  font-weight: 700;
  margin: 0;
  color: #111;
}
/* Compact stacked sidebar styling for [baptisti_calendar] */
.bm-calendar-card .vk-gcal-wrap { font-size: 15px; line-height: 1.45; }
.bm-calendar-card .vk-gcal-empty { margin: 0 0 10px; color: #26333c; }
.bm-calendar-card .vk-gcal-empty a { color: var(--bm-link); font-weight: 700; }
.bm-calendar-card .gcal-event {
  width: 100%;
  border-collapse: collapse;
  display: block;
}
.bm-calendar-card .gcal-event tbody { display: flex; flex-direction: column; gap: 10px; }
.bm-calendar-card .gcal-event__tr {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  background: rgba(255,255,255,.65);
  padding: 10px 12px;
  border-left: 3px solid var(--bm-slate);
}
.bm-calendar-card .gcal-event__tr--su { border-left-color: var(--bm-lime); }
.bm-calendar-card .gcal-event td { padding: 0; border: 0; font-size: 14px; }
.bm-calendar-card .gcal-event__td-day,
.bm-calendar-card .gcal-event__td-day-su,
.bm-calendar-card .gcal-event__td-day-month,
.bm-calendar-card .gcal-event__td-day-month-su,
.bm-calendar-card .gcal-event__td-hour-minutes,
.bm-calendar-card .gcal-event__td-hour-minutes-su {
  font-weight: 700;
  color: var(--bm-slate);
}
.bm-calendar-card .gcal-event__td-event-name {
  flex: 1 0 100%;
  font-size: 15px;
  font-weight: 600;
  color: #111;
}
.bm-calendar-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--bm-link);
  text-decoration: none;
}

.bm-social-card {
  background: var(--bm-soc-bg);
  padding: 20px 16px;
}
.bm-social-card h2 {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 16px;
  color: #111;
}
.bm-social-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bm-social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #111;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.bm-social-link img { width: 32px; height: 32px; flex-shrink: 0; }

/* Center Feed Column: 2-Column Live Cards (#5160) */
.bm-center-col { min-width: 0; }
#bm-feed { scroll-margin-top: 24px; }
.bm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.bm-card {
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.bm-center-col .bm-grid { align-items: stretch; }
.bm-card-thumb {
  --bm-card-thumbnail-height: 235px;
  display: block;
}
.bm-card-thumb img {
  display: block;
  width: 100%;
  height: var(--bm-card-thumbnail-height);
  object-fit: cover;
}
.bm-card-thumb--fallback {
  display: grid;
  place-items: center;
  height: var(--bm-card-thumbnail-height);
  background: var(--bm-paper);
}
.bm-card-thumb--fallback img {
  width: min(70%, 240px);
  height: auto;
}
.bm-card-text { padding: 14px 20px 22px; }
.bm-card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 14px;
}
.bm-card-cats,
.bm-card-cats a {
  color: var(--bm-lime-ink);
  font-weight: 600;
  text-decoration: none;
}
.bm-meta { font-size: 14px; color: #55626b; margin: 0; }
.bm-card h2,
.bm-card h3 {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
}
.bm-card h2 a,
.bm-card h3 a {
  color: #111;
  text-decoration: none;
}

/* Right Sidebar Utility Menu (oikealaita-valikko) */
.bm-right-col { min-width: 0; padding-top: 8px; }
.bm-side-nav {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.bm-side-nav a {
  color: #111;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.3;
}

/* Single Article & Page Layout (#4140 / #7057) */
.bm-article-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  align-items: start;
}
.bm-page-layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 48px;
  align-items: start;
}
.bm-reading {
  background: #fff;
  padding: 36px 40px;
  min-width: 0;
}
.bm-reading > .bm-meta {
  font-size: 15px;
  font-weight: 600;
  color: var(--bm-slate);
  margin: 0 0 12px;
}
.bm-reading h1,
.bm-archive-feed h1 {
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.2;
  margin: 0 0 24px;
  color: #111;
  overflow-wrap: anywhere;
}
.bm-article-sidebar h2 {
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 16px;
  color: #111;
}
.bm-article-sidebar .bm-grid {
  grid-template-columns: 1fr;
  gap: 20px;
}
.bm-article-sidebar .bm-card-thumb { --bm-card-thumbnail-height: 175px; }

/* Prose & Archive Controls */
.bm-prose { display: flow-root; font-size: 18px; line-height: 1.75; overflow-wrap: anywhere; }
.bm-prose p { margin: 0 0 1.2em; }
.bm-prose .wp-block-verse { white-space: pre-wrap; font: inherit; margin: 0 0 1.2em; }
.bm-prose h2, .bm-prose h3 { margin: 1.4em 0 .6em; line-height: 1.3; }
.bm-prose h2 { font-size: clamp(22px, 2.4vw, 28px); }
.bm-prose h3 { font-size: clamp(20px, 2vw, 24px); }
.bm-prose ul, .bm-prose ol { padding-left: 1.5em; margin: 1em 0; }
.bm-prose blockquote { border-left: 4px solid var(--bm-lime); padding-left: 24px; margin: 24px 0; }
.bm-prose img { max-width: 100%; height: auto; }
.bm-prose figure { max-width: 100%; margin: 24px 0; }
.bm-prose .wp-block-gallery.has-nested-images {
  display: grid;
  grid-template-columns: repeat(var(--bm-gallery-columns, 2), minmax(0, 1fr));
  gap: 24px;
}
.bm-prose .wp-block-gallery.columns-1 { --bm-gallery-columns: 1; }
.bm-prose .wp-block-gallery.columns-2 { --bm-gallery-columns: 2; }
.bm-prose .wp-block-gallery.columns-3 { --bm-gallery-columns: 3; }
.bm-prose .wp-block-gallery.columns-4 { --bm-gallery-columns: 4; }
.bm-prose .wp-block-gallery.columns-5 { --bm-gallery-columns: 5; }
.bm-prose .wp-block-gallery.columns-6 { --bm-gallery-columns: 6; }
.bm-prose .wp-block-gallery.columns-7 { --bm-gallery-columns: 7; }
.bm-prose .wp-block-gallery.columns-8 { --bm-gallery-columns: 8; }
.bm-prose .wp-block-gallery.columns-default:has(> .wp-block-image:nth-of-type(3)) { --bm-gallery-columns: 3; }
.bm-prose .wp-block-gallery > .wp-block-image { min-width: 0; margin: 0; }
.bm-prose .wp-block-gallery > .wp-block-image:only-of-type { grid-column: 1 / -1; }
.bm-prose .wp-block-gallery > .wp-block-image > a { display: block; }
.bm-prose .wp-block-gallery img { display: block; width: 100%; }
.bm-prose .wp-block-gallery.is-cropped img { aspect-ratio: 1; object-fit: cover; }
.bm-prose .wp-block-gallery > figcaption { grid-column: 1 / -1; }
.bm-prose .wp-block-gallery figcaption { margin-top: 8px; font-size: 15px; line-height: 1.5; }
.bm-prose .bm-legacy-caption img { display: block; }
.bm-prose .bm-legacy-caption figcaption { margin-top: 8px; font-size: 15px; line-height: 1.5; color: #55626b; }
.bm-prose .bm-legacy-caption.alignright { float: right; margin: 0 0 24px 24px; }
.bm-prose .bm-legacy-caption.alignleft { float: left; margin: 0 24px 24px 0; }
.bm-prose .bm-legacy-caption.aligncenter { margin-inline: auto; }
.bm-prose table { display: block; max-width: 100%; overflow: auto; }
.bm-prose a { color: var(--bm-link); text-decoration: underline; text-underline-offset: 3px; }
.bm-about-section { border-top: 1px solid #dbe1e5; margin-top: 28px; padding-top: 8px; }
.bm-details summary {
  cursor: pointer;
  color: var(--bm-link);
  font-weight: 700;
  padding: 10px 0;
  min-height: 44px;
}
.bm-details[open] summary { margin-bottom: 12px; }
.bm-details > div { padding-left: 16px; border-left: 3px solid var(--bm-lime); }
.vk-calendar-iframe-wrap { margin-top: 24px; width: 100%; overflow: hidden; }
.vk-calendar-iframe { width: 100%; min-height: 560px; border: 0; }

.bm-archive-feed form.search-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 24px;
}
.bm-archive-feed input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid #bbc4ca;
  background: #fff;
  max-width: 100%;
}
.bm-archive-feed input[type="submit"] {
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  background: var(--bm-slate);
  color: #fff;
  border: 0;
  cursor: pointer;
}
.bm-pagination { margin-top: 28px; }
.bm-pagination .page-numbers {
  display: inline-block;
  padding: 8px 14px;
  margin-right: 4px;
  background: #fff;
  color: var(--bm-ink);
  text-decoration: none;
  font-weight: 700;
}
.bm-pagination .page-numbers.current {
  background: var(--bm-lime);
  color: #111;
}

/* 4-Column Dark Slate Footer (#4135) */
.bm-footer {
  background: var(--bm-slate);
  color: #fff;
  padding: 48px 24px;
  margin-top: 40px;
}
.bm-footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.5fr 1.2fr;
  gap: 32px;
  align-items: start;
}
.bm-footer-col { min-width: 0; font-size: 15px; line-height: 1.65; }
.bm-footer-col h2 {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--bm-lime);
  margin: 0 0 12px;
}
.bm-footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bm-footer-col a {
  color: #fff;
  text-decoration: none;
}
.bm-footer-col p { margin: 0 0 12px; }
.bm-footer-logo { width: 210px; max-width: 100%; height: auto; display: block; margin-bottom: 16px; }

/* Retain Oxygen's attribution after the footer without covering page content. */
body .oxygen-built-with-badge { position: static; margin: 16px; }

/* Interaction colors follow the background; explicitly override Oxygen's
   generic link hover so each component follows the same rules. */
.bm-header-bar, .bm-footer {
  --bm-link-hover: var(--bm-lime);
  --bm-link-focus: var(--bm-lime);
}
.bm-categories {
  --bm-link-hover: var(--bm-ink);
  --bm-link-focus: var(--bm-ink);
}
:is(.bm-nav, .bm-mobile-navigation, .bm-categories, .bm-side-nav,
    .bm-card, .bm-calendar-card, .bm-social-card, .bm-prose,
    .bm-pagination, .bm-footer) a:is(:hover, :focus-visible),
:is(.bm-details, .bm-mobile-menu) summary:is(:hover, :focus-visible) {
  color: var(--bm-link-hover);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}
:is(.bm-nav, .bm-mobile-navigation) a[aria-current="page"] {
  color: var(--bm-lime);
  text-decoration-line: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: .3em;
}
a:focus-visible, input:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--bm-link-focus);
  outline-offset: 3px;
}

@media (max-width: 1119px) {
  .bm-nav { display: none; }
  .bm-mobile-navigation {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
  }
  .bm-mobile-navigation a,
  .bm-mobile-menu summary {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 4px;
    min-height: 44px;
    text-decoration: none;
  }
  .bm-mobile-menu summary { cursor: pointer; }
  .bm-mobile-menu nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 20px;
    padding: 12px 16px 20px;
    background: var(--bm-slate);
    box-shadow: 0 8px 12px rgba(0,0,0,.15);
  }
  .bm-quick-links { display: flex; gap: 16px; }
  .bm-three-col { grid-template-columns: 230px minmax(0, 1fr); }
  .bm-right-col { grid-column: 1 / -1; }
  .bm-side-nav { flex-direction: row; flex-wrap: wrap; gap: 14px 24px; }
  /* These destinations already have persistent mobile header shortcuts. */
  .bm-side-nav a:is([href$="/ota-yhteytta/"], [href$="/kalenteri/"]) { display: none; }
  .bm-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .bm-three-col,
  .bm-article-layout,
  .bm-page-layout { grid-template-columns: minmax(0, 1fr); }
  .bm-left-col { order: 2; }
  .bm-center-col { order: 1; }
  .bm-right-col { order: 3; }
}
@media (max-width: 767px) {
  .bm-mobile-navigation { align-items: flex-start; }
  .bm-mobile-menu { width: 100%; }
  .bm-mobile-menu summary { width: fit-content; }
  .bm-quick-links { position: absolute; top: 6px; right: 16px; }
  .bm-mobile-menu nav {
    position: static;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 4px 0 12px;
    box-shadow: none;
  }
  .bm-mobile-menu nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    border-top: 1px solid rgba(255, 255, 255, .2);
    padding: 12px 4px;
  }
  .bm-side-nav {
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-top: 3px solid var(--bm-lime);
    padding: 0 16px;
  }
  .bm-side-nav a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 56px;
    padding: 16px 0;
    border-bottom: 1px solid #e1e4e6;
    font-size: 17px;
    text-transform: none;
  }
  .bm-side-nav a:last-child { border-bottom: 0; }
  .bm-side-nav a::after {
    content: '';
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    margin-right: 3px;
  }
  .bm-prose .wp-block-gallery.has-nested-images { grid-template-columns: minmax(0, 1fr); }
  .bm-prose .bm-legacy-caption:is(.alignleft, .alignright) { float: none; margin: 24px auto; }
  .bm-header-top { padding: 14px 16px; }
  .bm-logo { width: 200px; }
  .bm-header-top > :last-child { width: 100%; }
  .bm-search-form { width: 100%; }
  .bm-nav { padding: 12px 16px; gap: 12px 20px; font-size: 16px; }
  .bm-intro, .bm-intro--archive { padding: 32px 16px; }
  .bm-categories { gap: 10px 20px; padding: 12px 16px; }
  .bm-three-col, .bm-article-layout, .bm-page-layout { padding: 20px 16px 40px; gap: 24px; }
  .bm-grid { grid-template-columns: 1fr; }
  .bm-reading { padding: 24px 18px; }
  .bm-footer { padding: 36px 16px; }
  .bm-footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
