/*
Theme Name: Ensiapukouluttaja Mikael
Theme URI: https://ensiapumikael.fi/
Author: Ensiapukouluttaja Mikael
Description: Kevyt ja muokattava lohkoteema ensiapukoulutuksille ja Ensiapukorttirekisterille.
Version: 1.1.1
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: ensiapumikael
*/

:root {
  --em-navy: #0b2942;
  --em-blue: #006f92;
  --em-teal: #008a9a;
  --em-green: #2f5536;
  --em-red: #e30613;
  --em-ice: #e8f7f8;
  --em-mist: #f5fafb;
  --em-white: #ffffff;
  --em-text: #10283d;
  --em-muted: #536b7c;
  --em-border: #cbe4e8;
  --em-radius: 24px;
  --em-shadow: 0 18px 50px rgba(11, 41, 66, .10);
}

html { scroll-behavior: smooth; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
body { min-width: 0; overflow-x: hidden; color: var(--em-text); background: var(--em-mist); }
img, svg { max-width: 100%; height: auto; }
a { text-underline-offset: .18em; }

.em-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(203, 228, 232, .85);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
}
.em-site-header .wp-block-navigation-item__content { font-weight: 700; }
.em-site-header .wp-block-navigation-item__content:hover { color: var(--em-teal); }
.em-brand-title { margin: 0 !important; font-size: clamp(1.05rem, 2vw, 1.35rem) !important; }
.em-brand-subtitle { margin: 0 !important; color: var(--em-teal); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.em-header-symbol {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  margin: 0;
}
.em-header-symbol a,
.em-header-symbol img {
  display: block;
  width: 100%;
  height: 100%;
}
.em-header-symbol img { object-fit: contain; border-radius: 50%; }

.em-hero {
  overflow: hidden;
  min-height: min(720px, 78vh);
  border-radius: 0 0 44px 44px;
  background:
    radial-gradient(circle at 15% 15%, rgba(0, 138, 154, .88), transparent 42%),
    linear-gradient(125deg, #08263f 0%, #0a4e68 55%, #2f5536 100%);
  color: var(--em-white);
}
.em-hero h1 { max-width: 840px; font-size: clamp(2.4rem, 6vw, 5.25rem); line-height: .98; letter-spacing: -.045em; }
.em-hero p { max-width: 700px; color: rgba(255,255,255,.90); font-size: clamp(1.05rem, 2vw, 1.3rem); }
.em-hero-media { min-height: 460px; overflow: hidden; border: 1px solid rgba(255,255,255,.24); border-radius: 32px; box-shadow: 0 22px 70px rgba(0,0,0,.28); }
.em-hero-media img { width: 100%; height: 100%; min-height: 460px; object-fit: cover; }
.em-kicker { margin-bottom: .7rem !important; color: var(--em-blue); font-size: .8rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.em-hero .em-kicker { color: #88eced; }

.em-button .wp-block-button__link,
.wp-block-button.em-button .wp-block-button__link {
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--em-blue);
  box-shadow: 0 10px 28px rgba(0, 138, 154, .24);
  color: #fff;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.em-button .wp-block-button__link:hover,
.wp-block-button.em-button .wp-block-button__link:hover { transform: translateY(-2px); background: #005b79; box-shadow: 0 14px 34px rgba(0, 111, 146, .30); }
.em-button--light .wp-block-button__link { border-color: rgba(255,255,255,.55); background: #fff; color: var(--em-navy); }
.em-button--outline .wp-block-button__link { border-color: var(--em-teal); background: transparent; color: var(--em-teal); box-shadow: none; }

.em-section { padding-top: clamp(4rem, 8vw, 7.5rem) !important; padding-bottom: clamp(4rem, 8vw, 7.5rem) !important; }
.em-section-title { max-width: 820px; font-size: clamp(2rem, 4vw, 3.5rem) !important; line-height: 1.05; letter-spacing: -.035em; }
.em-lead { max-width: 780px; color: var(--em-muted); font-size: 1.18rem; line-height: 1.7; }
.em-card-grid { align-items: stretch !important; }
.em-card-grid > .wp-block-column,
.em-card {
  border: 1px solid var(--em-border);
  border-radius: var(--em-radius);
  background: #fff;
  box-shadow: var(--em-shadow);
}
.em-card-grid > .wp-block-column { padding: clamp(1.5rem, 3vw, 2.25rem); }
.em-card h3 { margin-top: .35rem; }
.em-card p, .em-card-grid p { color: var(--em-muted); }
.em-number { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 13px; background: var(--em-ice); color: var(--em-teal); font-weight: 900; }

.em-band { border-radius: 34px; background: linear-gradient(115deg, var(--em-navy), #075b72 65%, var(--em-teal)); color: #fff; box-shadow: var(--em-shadow); }
.em-band p { color: rgba(255,255,255,.84); }
.em-band .em-kicker { color: #8ce7e6; }
.em-green-band { background: linear-gradient(120deg, #24472b, #3d6845); }
.em-stat { padding: 1.3rem; border: 1px solid rgba(255,255,255,.17); border-radius: 20px; background: rgba(255,255,255,.09); }
.em-stat strong { display: block; margin-bottom: .35rem; font-size: 1.08rem; }

.em-process { counter-reset: em-step; }
.em-process > .wp-block-column { position: relative; }
.em-process > .wp-block-column::before { counter-increment: em-step; content: counter(em-step, decimal-leading-zero); display: block; margin-bottom: 1rem; color: var(--em-teal); font-weight: 900; letter-spacing: .1em; }

.em-portrait img { border-radius: 32px; box-shadow: var(--em-shadow); }
.em-quote { border-left: 5px solid var(--em-teal); border-radius: 0 var(--em-radius) var(--em-radius) 0; background: #fff; box-shadow: var(--em-shadow); }
.em-quote p { font-size: 1.15rem; }
.em-registry-logo img { max-width: 330px; height: auto; }
.em-faq details { margin-bottom: .8rem; padding: 1.15rem 1.25rem; border: 1px solid var(--em-border); border-radius: 16px; background: #fff; }
.em-faq summary { cursor: pointer; color: var(--em-navy); font-weight: 800; }
.em-contact-card { border-radius: 34px; background: #fff; box-shadow: var(--em-shadow); }

.em-site-footer { margin-top: 0; border-top: 1px solid var(--em-border); background: var(--em-navy); color: #fff; }
.em-site-footer a { color: #fff; }
.em-site-footer p { color: rgba(255,255,255,.78); }

.em-blog-intro { max-width: 760px; margin-bottom: 2.5rem; }
.em-post-grid .wp-block-post-template { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.35rem; padding: 0; }
.em-post-grid .wp-block-post { display: flex; min-width: 0; overflow: hidden; border: 1px solid var(--em-border); border-radius: var(--em-radius); background: var(--em-white); box-shadow: var(--em-shadow); }
.em-post-card { display: flex; flex: 1; flex-direction: column; }
.em-post-card .wp-block-post-featured-image { margin: 0; }
.em-post-card .wp-block-post-featured-image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.em-post-card__body { display: flex; flex: 1; flex-direction: column; padding: 1.45rem; }
.em-post-card__body .wp-block-post-title { margin-top: .35rem; font-size: 1.35rem; line-height: 1.18; }
.em-post-card__body .wp-block-post-excerpt { color: var(--em-muted); }
.em-post-card__body .wp-block-read-more { margin-top: auto; color: var(--em-blue); font-weight: 800; }
.em-post-meta { color: var(--em-muted); font-size: .88rem; }
.em-article { max-width: 820px; }
.em-article .wp-block-post-featured-image img { border-radius: var(--em-radius); box-shadow: var(--em-shadow); }
.em-article-content { font-size: 1.08rem; line-height: 1.75; }
.em-share-box { margin-top: 3rem; padding: 1.35rem; border: 1px solid var(--em-border); border-radius: 18px; background: var(--em-ice); }
.em-share-box p { margin-top: 0; color: var(--em-navy); font-weight: 800; }
.em-linkedin-share { display: inline-flex; align-items: center; padding: .75rem 1.1rem; border-radius: 999px; background: #0a66c2; color: #fff !important; font-weight: 800; text-decoration: none; }
.em-linkedin-share:hover { background: #084f96; }

@media (max-width: 900px) {
  .em-post-grid .wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .em-site-header { position: relative; }
  .em-site-header .wp-block-navigation { width: auto; margin-left: auto; justify-content: flex-end; }
  .em-site-header .wp-block-navigation__responsive-container-open { display: flex !important; }
  .em-site-header .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
  .em-site-header .wp-block-navigation__responsive-container.is-menu-open {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 100000 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 4.5rem 1.25rem 1.5rem;
    overflow-y: auto;
    background: var(--em-white);
  }
  .em-site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .em-site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: .35rem;
  }
  .em-site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
    display: block;
    width: 100%;
  }
  .em-site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
    display: block;
    width: 100%;
    padding: .8rem 1rem;
    border: 1px solid var(--em-border);
    border-radius: 12px;
  }
  .em-site-header .wp-block-navigation__responsive-container-close {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--em-border);
    border-radius: 12px;
    background: var(--em-white);
  }
  .em-hero { min-height: auto; border-radius: 0 0 28px 28px; }
  .em-hero-media, .em-hero-media img { min-height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
@media (max-width: 781px) {
  .wp-site-blocks,
  .wp-site-blocks > *,
  .wp-block-group,
  .wp-block-columns,
  .wp-block-column { min-width: 0; max-width: 100%; }
  .wp-block-columns { flex-wrap: wrap !important; }
  .wp-block-columns > .wp-block-column { flex-basis: 100% !important; }
  .em-site-header > .wp-block-group { padding-left: 1rem; padding-right: 1rem; }
  .em-hero h1 { font-size: clamp(2.05rem, 10vw, 3rem); line-height: 1.02; }
  .em-hero p { font-size: 1rem; }
  .em-hero-media, .em-hero-media img { min-height: 250px; }
  .em-registry-logo img { width: 100%; max-width: 330px; }
}
@media (max-width: 600px) {
  .em-post-grid .wp-block-post-template { grid-template-columns: 1fr; }
  .em-section { padding-top: 3.4rem !important; padding-bottom: 3.4rem !important; }
  .em-card-grid { gap: 1rem !important; }
  .em-band, .em-contact-card { border-radius: 24px; }
  .em-header-symbol { width: 48px; height: 48px; flex-basis: 48px; }
  .em-brand-subtitle { display: none; }
  .em-brand-title { font-size: 1rem !important; line-height: 1.15; }
  .em-button,
  .em-button .wp-block-button__link { width: 100%; text-align: center; }
  .wp-block-buttons { width: 100%; }
}
