@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #173b42;
  --deep: #073e49;
  --deepest: #052f39;
  --teal: #087b98;
  --bright: #0e8e9f;
  --mist: #eaf4f1;
  --paper: #f4f7f4;
  --line: #dbe6e2;
  --muted: #526e71;
  --heading: 'Manrope', 'Segoe UI', sans-serif;
  --body: 'DM Sans', 'Segoe UI', sans-serif;
  --shadow: 0 24px 70px rgba(6, 53, 61, .09), 0 2px 8px rgba(6, 53, 61, .035);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse 70% 850px at 100% 500px, #e8f1ed 0%, transparent 70%), var(--paper);
  font: 400 16px/1.72 var(--body);
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { color: #fff; background: var(--teal); }
:focus-visible { outline: 3px solid #e3b568; outline-offset: 4px; }
[id] { scroll-margin-top: 120px; }
.wrap { width: min(100% - 64px, 1240px); margin-inline: auto; }
.skip-link {
  position: fixed; z-index: 100; top: -70px; left: 18px;
  border-radius: 12px; padding: 10px 16px; color: #fff; background: var(--deep);
}
.skip-link:focus { top: 12px; }

/* Familiar navigation with larger targets and a quieter frame. */
.site-header {
  position: sticky; z-index: 50; top: 0;
  border-bottom: 1px solid rgba(198, 217, 213, .8);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 9px 32px rgba(4, 44, 52, .045);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 92px; gap: 20px;
}
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; }
.brand img { width: 138px; height: 69px; object-fit: contain; }
.primary-nav { display: flex; align-items: center; gap: 2px; }
.primary-nav > a, .nav-group > summary {
  display: flex; align-items: center; justify-content: center;
  min-height: 45px; border-radius: 999px; padding: 11px 12px;
  color: #294d55; font: 800 .74rem/1.25 var(--heading);
  letter-spacing: .025em; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: color .2s, background-color .2s, transform .2s;
}
.primary-nav > a:hover, .nav-group > summary:hover,
.primary-nav > a[aria-current="page"], .nav-group[data-current="true"] > summary {
  color: var(--deep); background: var(--mist);
}
.primary-nav > a:active, .nav-group > summary:active { transform: scale(.97); }
.nav-group { position: relative; }
.nav-group > summary { list-style: none; gap: 8px; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
  width: 6px; height: 6px; margin-top: -4px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); content: '';
  transition: transform .2s;
}
.nav-group[open] > summary::after { transform: translateY(3px) rotate(225deg); }
.nav-group > div {
  position: absolute; top: calc(100% + 9px); left: 0; display: none;
  min-width: 205px; border: 1px solid var(--line); border-radius: 16px;
  padding: 8px; background: #fff; box-shadow: 0 22px 55px rgba(4, 48, 57, .14);
}
.nav-group[open] > div, .nav-group:hover > div, .nav-group:focus-within > div { display: block; }
.nav-group > div a {
  display: block; border-radius: 10px; padding: 12px 13px;
  color: var(--ink); font: 700 .82rem/1.35 var(--heading);
  text-decoration: none; white-space: nowrap;
}
.nav-group > div a:hover, .nav-group > div a[aria-current="page"] {
  color: var(--deep); background: var(--mist);
}
.menu-toggle {
  display: none; width: 48px; height: 48px;
  border: 1px solid var(--line); border-radius: 14px;
  background: #f7faf9; cursor: pointer;
}
.menu-toggle span {
  display: block; width: 21px; height: 2px; margin: 4px auto;
  border-radius: 2px; background: var(--deep);
  transition: transform .2s, opacity .2s;
}

/* The original coastal image remains the visual anchor. */
.home-hero, .page-hero {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: 0 0 38px 38px; color: #fff; background: var(--deepest);
}
.home-hero { min-height: 550px; }
.page-hero { min-height: 330px; }
.page-hero.untitled { min-height: 205px; }
.hero-photo {
  position: absolute; z-index: -1; inset: 0;
  background:
    linear-gradient(92deg, rgba(3, 44, 53, .94) 3%, rgba(3, 48, 57, .8) 47%, rgba(4, 47, 54, .29) 100%),
    url('/assets/ruissalo-ranta.jpg') center 49% / cover no-repeat;
  transform: scale(1.025);
}
.page-hero .hero-photo {
  background:
    linear-gradient(90deg, rgba(3, 44, 53, .84), rgba(3, 49, 57, .48)),
    url('/assets/ruissalo-ranta.jpg') center 42% / cover no-repeat;
}
.hero-inner {
  position: relative; display: flex; align-items: center;
  min-height: inherit; padding-block: 88px 130px;
}
.hero-inner::before {
  position: absolute; top: max(70px, calc(50% - 165px)); left: 0;
  width: 56px; height: 4px; border-radius: 999px;
  background: #a9d9cb; content: '';
}
.hero-inner h1 {
  max-width: 960px; margin: 0; padding-top: 26px;
  font: 700 clamp(3.1rem, 5.3vw, 5.2rem)/1.1 var(--heading);
  letter-spacing: -.065em; text-wrap: balance;
  text-shadow: 0 3px 20px rgba(0, 31, 40, .1);
  animation: rise-in .65s both;
}
.page-hero .hero-inner { padding-block: 60px 95px; }
.page-hero .hero-inner::before { top: max(40px, calc(50% - 93px)); }
.page-hero .hero-inner h1 { font-size: clamp(2.6rem, 4.4vw, 4.3rem); }

/* Generous reading surfaces; the text itself is untouched. */
.content-section { position: relative; z-index: 1; margin-top: -58px; padding-bottom: 105px; }
.content-layout {
  display: grid; grid-template-columns: minmax(0, 820px) minmax(240px, 1fr);
  align-items: start; gap: 24px;
}
.content-layout.wide { display: block; }
.content-layout.wide > .source-content { max-width: 1040px; margin-inline: auto; }
.content-layout > .source-content, .news-entry {
  position: relative; overflow: hidden; border: 1px solid #e2eae5;
  border-radius: 27px; padding: clamp(30px, 4.4vw, 62px);
  background: #fff; box-shadow: var(--shadow);
}
.content-layout > .source-content::before, .news-entry::before {
  position: absolute; top: 0; left: clamp(30px, 4.4vw, 62px);
  width: 56px; height: 4px; border-radius: 0 0 5px 5px;
  background: var(--bright); content: '';
}
.content-visual {
  position: sticky; top: 112px; overflow: hidden;
  min-height: 470px; border-radius: 27px;
  background: #dce8e2; box-shadow: var(--shadow);
}
.content-visual img {
  width: 100%; height: 470px; object-fit: cover;
  filter: saturate(.82); transition: transform .65s, filter .65s;
}
.content-visual:hover img { transform: scale(1.045); filter: saturate(1); }
.source-content {
  color: #314d50; font-size: 1.06rem; line-height: 1.83;
  overflow-wrap: anywhere;
}
.source-content > :first-child { margin-top: 0; }
.source-content p { margin: 0 0 1.45em; }
.source-content p:last-child { margin-bottom: 0; }
.home-hero + .content-section .source-content > p:first-child {
  color: var(--ink); font-size: 1.17rem; font-weight: 600;
}
.source-content h3 {
  margin: 2.6rem 0 1.1rem; border-top: 1px solid var(--line);
  padding-top: 1.7rem; color: var(--deep);
  font: 700 clamp(1.5rem, 2.5vw, 2.15rem)/1.25 var(--heading);
  letter-spacing: -.045em;
}
.source-content h4 {
  margin: 1.8rem 0 .7rem; color: var(--deep);
  font: 700 1.19rem/1.4 var(--heading); letter-spacing: -.025em;
}
.source-content strong { color: var(--ink); }
.source-content a {
  color: #077d91; text-decoration: underline;
  text-decoration-color: #8cc2c6; text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: color .2s, text-decoration-color .2s;
}
.source-content a:hover { color: var(--deep); text-decoration-color: currentColor; }
.source-content ul { padding-left: 1.4rem; }
.source-content li { padding-left: .25rem; margin-bottom: .6rem; }
.source-content hr { height: 1px; margin: 2.8rem 0; border: 0; background: var(--line); }
.source-content p:has(> .fa-file-pdf-o) {
  border: 1px solid #dbeae6; border-radius: 17px;
  padding: 18px 21px; background: linear-gradient(115deg, #f1f8f5, #fafcfb);
}
.source-content .fa-file-pdf-o {
  display: inline-grid; place-items: center; width: 25px; height: 28px;
  margin-right: 8px; border: 1.7px solid var(--teal); border-radius: 5px;
  vertical-align: -7px;
}
.source-content .fa-file-pdf-o::before {
  display: block; width: 11px; height: 2px;
  background: var(--teal); box-shadow: 0 -5px 0 var(--teal); content: '';
}

/* Galleries and notices use the same soft geometry. */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.gallery-item {
  min-width: 0; margin: 0; border: 1px solid var(--line);
  border-radius: 17px; padding: 8px; background: #f7faf8;
  transition: transform .25s, box-shadow .25s;
}
.gallery-item:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(6, 53, 61, .1); }
.gallery-icon { overflow: hidden; border-radius: 11px; aspect-ratio: 4/3; }
.gallery-icon a, .gallery-icon img { display: block; width: 100%; height: 100%; }
.gallery-icon img { object-fit: cover; transition: transform .45s; }
.gallery-item:hover img { transform: scale(1.055); }
.gallery-caption { padding: 11px 7px 5px; color: var(--muted); font-size: .84rem; line-height: 1.4; }
.news-list { max-width: 1040px; margin-inline: auto; }
.news-entry { margin-bottom: 24px; }
.news-entry:last-child { margin-bottom: 0; }
.entry-header { margin-bottom: 26px; border-bottom: 1px solid var(--line); padding-bottom: 22px; }
.entry-header h2 {
  margin: 0 0 14px; color: var(--deep);
  font: 700 clamp(1.8rem, 3vw, 2.55rem)/1.2 var(--heading);
  letter-spacing: -.05em;
}
.entry-header h2 a { text-decoration: none; }
.entry-header h2 a:hover { color: var(--teal); }
.entry-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  color: var(--muted); font: 700 .76rem/1.35 var(--heading);
}
.entry-meta > * + *::before {
  display: inline-block; width: 4px; height: 4px;
  margin: 0 18px 2px 0; border-radius: 50%;
  background: #8da6a5; content: '';
}
.news-entry .source-content h3:first-child { margin-top: 0; padding-top: 0; border: 0; }
.entry-footer { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 18px; color: var(--muted); font-size: .84rem; }
.entry-footer a, .post-navigation a { color: var(--teal); text-decoration: none; }
.entry-footer a:hover, .post-navigation a:hover { text-decoration: underline; }
.post-navigation { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 25px; }
.post-navigation h2 { margin: 0 0 16px; font: 700 1.17rem/1.3 var(--heading); }
.post-navigation > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; }
.post-navigation a { font: 700 .92rem/1.5 var(--heading); }

/* Form labels and wording stay as published on rvok.fi. */
.screen-reader-response {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.wpcf7-form { max-width: 640px; }
.wpcf7-form label { display: block; color: var(--ink); font: 700 .91rem/1.5 var(--heading); }
.wpcf7-form-control-wrap { display: block; margin-top: 8px; }
.wpcf7-form input:not([type=hidden]):not([type=submit]),
.wpcf7-form textarea, .post-password-form input[type=password] {
  width: 100%; max-width: 100%; border: 1px solid #bbd1cb;
  border-radius: 12px; padding: 13px 15px; color: var(--ink);
  background: #fbfdfc; font: 400 1rem/1.4 var(--body);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.wpcf7-form input:focus, .wpcf7-form textarea:focus,
.post-password-form input[type=password]:focus {
  border-color: var(--teal); outline: none; background: #fff;
  box-shadow: 0 0 0 4px rgba(8, 123, 152, .12);
}
.wpcf7-form textarea { min-height: 160px; resize: vertical; }
.wpcf7-form input[type=submit], .post-password-form input[type=submit] {
  border: 0; border-radius: 12px; padding: 15px 25px;
  color: #fff; background: var(--deep);
  box-shadow: 0 8px 18px rgba(4, 58, 69, .16);
  font: 800 .9rem/1 var(--heading); cursor: pointer;
  transition: background-color .2s, transform .2s, box-shadow .2s;
}
.wpcf7-form input[type=submit]:hover, .post-password-form input[type=submit]:hover {
  background: var(--teal); transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(4, 58, 69, .22);
}
.post-password-form input[type=password] { width: 240px; margin-inline: 10px; }

/* Source footer details remain intact. */
.site-footer {
  overflow: hidden; border-radius: 38px 38px 0 0;
  color: #dce9e6;
  background: radial-gradient(circle at 85% 0%, #125e67 0%, transparent 43%), var(--deepest);
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: end; gap: 30px;
  padding-block: 62px 67px; font-size: .91rem;
}
.footer-address { line-height: 1.9; }
.footer-address a { color: #b5e2dc; text-decoration: underline; text-underline-offset: 3px; }
.footer-inner > div:last-child { color: #a1c2bd; font-size: .78rem; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .primary-nav > a, .nav-group > summary { padding-inline: 9px; font-size: .7rem; }
  .brand img { width: 124px; height: 63px; }
}
@media (max-width: 1080px) {
  .wrap { width: min(100% - 44px, 1240px); }
  .header-inner { min-height: 80px; }
  .menu-toggle { display: block; }
  .menu-toggle[aria-expanded=true] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded=true] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded=true] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .primary-nav {
    position: absolute; top: 100%; right: 0; left: 0;
    display: none; flex-direction: column; align-items: stretch; gap: 2px;
    max-height: calc(100vh - 80px); overflow-y: auto;
    border-top: 1px solid var(--line); border-radius: 0 0 22px 22px;
    padding: 12px 22px 22px; background: #fff;
    box-shadow: 0 24px 35px rgba(4, 48, 57, .16);
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav > a, .nav-group > summary {
    justify-content: flex-start; min-height: 48px; border-radius: 11px;
    padding: 13px 15px; font-size: .82rem;
  }
  .nav-group > div {
    position: static; min-width: 0; border: 0; border-radius: 0;
    padding: 2px 0 8px 17px; box-shadow: none;
  }
  .nav-group:not([open]) > div { display: none; }
  .nav-group[open] > div { display: block; }
  .nav-group > div a { padding: 11px 13px; }
  .content-layout { grid-template-columns: minmax(0, 1fr) 260px; }
  .content-visual, .content-visual img { min-height: 380px; height: 380px; }
}
@media (max-width: 720px) {
  .wrap { width: min(100% - 32px, 1240px); }
  .brand img { width: 122px; height: 61px; }
  .home-hero { min-height: 475px; }
  .page-hero { min-height: 255px; }
  .page-hero.untitled { min-height: 155px; }
  .home-hero, .page-hero { border-radius: 0 0 25px 25px; }
  .hero-inner { padding-block: 65px 103px; }
  .hero-inner::before { top: 62px; width: 44px; }
  .hero-inner h1 { font-size: clamp(2.65rem, 9vw, 4.1rem); letter-spacing: -.055em; }
  .page-hero .hero-inner { padding-block: 46px 80px; }
  .page-hero .hero-inner::before { top: 42px; }
  .page-hero .hero-inner h1 { font-size: clamp(2.35rem, 8vw, 3.6rem); }
  .hero-photo {
    background:
      linear-gradient(90deg, rgba(3, 44, 53, .92), rgba(3, 48, 57, .54)),
      url('/assets/ruissalo-ranta.jpg') center / cover no-repeat;
  }
  .content-section { margin-top: -38px; padding-bottom: 73px; }
  .content-layout { display: block; }
  .content-layout > .source-content, .news-entry { border-radius: 21px; padding: 30px 25px; }
  .content-layout > .source-content::before, .news-entry::before { left: 25px; }
  .content-visual {
    position: static; min-height: 0; margin-top: 21px; border-radius: 21px;
  }
  .content-visual img { height: 280px; }
  .source-content { font-size: 1.01rem; line-height: 1.76; }
  .gallery { gap: 12px; }
  .gallery-item { padding: 6px; }
  .gallery-caption { font-size: .74rem; }
  .entry-meta > * + *::before { margin-right: 9px; }
  .footer-inner {
    flex-direction: column; align-items: flex-start; gap: 30px;
    padding-block: 48px 54px;
  }
}
@media (max-width: 430px) {
  .home-hero { min-height: 450px; }
  .hero-inner h1 { font-size: 2.5rem; }
  .gallery { grid-template-columns: 1fr; }
  .source-content p:has(> .fa-file-pdf-o) { padding: 15px 16px; }
  .post-password-form input[type=password] { display: block; width: 100%; margin: 8px 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
