/* =====================================================================
   S/S Karjalankoski — tyylit. Yksi tiedosto, ei kirjastoja.
   Värit: laivan tummansininen, kermanvalkoinen runko, messinki ja puu.
   ===================================================================== */

:root {
  --navy: #10263f;
  --navy-deep: #0a1a2c;
  --navy-soft: #1d3a5c;
  --cream: #f4efe4;
  --cream-deep: #e9e1d0;
  --paper: #fbf9f3;
  --ink: #1b1f26;
  --ink-soft: #4b5563;
  --brass: #c8973c;
  --brass-deep: #a7792a;
  --wood: #6b3e22;
  --line: rgba(16, 38, 63, .14);
  --line-light: rgba(255, 255, 255, .18);

  --font-head: "Bahnschrift", "Oswald", "Roboto Condensed", "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1180px;
  --radius: 4px;
  --shadow: 0 10px 30px rgba(10, 26, 44, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}
body.nav-open, body.lightbox-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); }
a:hover { color: var(--brass-deep); }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }

h1, h2, h3, .eyebrow, .btn, .nav, .wordmark__text, .timeline__year, .spec dt {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .04em;
}
h1, h2, h3 { line-height: 1.08; margin: 0 0 .6em; font-weight: 600; color: var(--navy); }
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); letter-spacing: .02em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.1em; }
.eyebrow {
  font-size: .8rem;
  letter-spacing: .22em;
  color: var(--brass-deep);
  margin: 0 0 .9rem;
}
.section--navy .eyebrow, .hero .eyebrow, .page-head--image .eyebrow { color: var(--brass); }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.center { text-align: center; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--brass); color: var(--navy);
  padding: .6rem 1rem; z-index: 100; font-family: var(--font-ui);
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* --- Painikkeet ------------------------------------------------------ */
.btn {
  display: inline-block;
  padding: .85rem 1.6rem;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.btn--sm { padding: .55rem 1.1rem; font-size: .82rem; }
.btn--accent { background: var(--brass); color: var(--navy-deep); border-color: var(--brass); }
.btn--accent:hover { background: #d9a94c; color: var(--navy-deep); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn--navy { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn--navy:hover { background: var(--navy-soft); color: #fff; }
.link-arrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--brass);
  padding-bottom: 2px;
}
.link-arrow::after { content: " \2192"; }
.section--navy .link-arrow { color: #fff; }

/* --- Ylätunniste ----------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  color: #fff;
  border-bottom: 1px solid var(--line-light);
  transition: box-shadow .2s;
}
.site-header.is-scrolled { box-shadow: 0 4px 20px rgba(0,0,0,.25); }
.site-header__inner {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 74px;
}
.wordmark {
  display: flex; align-items: center; gap: .7rem;
  color: #fff; text-decoration: none; margin-right: auto;
}
.wordmark__mark { width: 44px; height: auto; }
.wordmark__text { display: flex; flex-direction: column; line-height: 1; font-size: 1.15rem; }
.wordmark__text strong { font-weight: 700; letter-spacing: .06em; }
.wordmark__text small {
  font-size: .62rem; letter-spacing: .2em; color: var(--brass); margin-top: .3rem;
  text-transform: uppercase;
}
.nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: .2rem; }
.nav__link {
  display: block; padding: .6rem .75rem; color: #fff; text-decoration: none;
  font-size: .85rem; letter-spacing: .14em; border-bottom: 2px solid transparent;
}
.nav__link:hover { color: var(--brass); }
.nav__link[aria-current="page"] { border-bottom-color: var(--brass); color: var(--brass); }
.nav-toggle {
  display: none; align-items: center; gap: .6rem;
  background: none; border: 1px solid var(--line-light); color: #fff;
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .14em; font-size: .8rem;
  padding: .55rem .9rem; border-radius: var(--radius); cursor: pointer;
}
.nav-toggle__bars { width: 20px; height: 2px; background: #fff; position: relative; display: block; }
.nav-toggle__bars::before, .nav-toggle__bars::after {
  content: ""; position: absolute; left: 0; width: 100%; height: 2px; background: #fff;
}
.nav-toggle__bars::before { top: -6px; } .nav-toggle__bars::after { top: 6px; }
.mobile-nav {
  position: fixed; inset: 74px 0 0 0; z-index: 40;
  background: var(--navy-deep); padding: 1.5rem;
  display: flex; flex-direction: column; gap: .25rem;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav a {
  color: #fff; text-decoration: none; font-family: var(--font-head); text-transform: uppercase;
  letter-spacing: .14em; font-size: 1.2rem; padding: .8rem 0; border-bottom: 1px solid var(--line-light);
}
.mobile-nav a[aria-current="page"] { color: var(--brass); }
.mobile-nav .btn { margin-top: 1.5rem; text-align: center; border-bottom: 0; }

@media (max-width: 900px) {
  .nav, .header-cta { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* --- Hero ------------------------------------------------------------ */
.hero {
  position: relative; min-height: min(88vh, 820px);
  display: flex; align-items: flex-end;
  color: #fff; background: var(--navy-deep);
  overflow: hidden;
}
.hero__media, .hero__media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.hero__media img { object-position: 50% 45%; }
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,26,44,.25) 0%, rgba(10,26,44,.05) 35%, rgba(10,26,44,.78) 100%);
}
.hero__content { position: relative; padding: 5rem 0 4rem; max-width: 760px; }
.hero h1 { color: #fff; text-shadow: 0 2px 20px rgba(0,0,0,.35); margin-bottom: .4em; }
.hero__lead { font-size: clamp(1.1rem, 2vw, 1.4rem); max-width: 34em; margin-bottom: 1.8rem; text-shadow: 0 1px 10px rgba(0,0,0,.4); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* --- Sivun otsikkoalue ----------------------------------------------- */
.page-head { background: var(--cream); padding: 3.5rem 0 2.5rem; }
.page-head__lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 40em; }
.page-head--image {
  position: relative; min-height: 46vh; display: flex; align-items: flex-end;
  color: #fff; background: var(--navy-deep); padding: 0; overflow: hidden;
}
.page-head--image > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.page-head__img--bw { filter: grayscale(1) contrast(1.05); opacity: .85; }
.page-head__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,26,44,.15), rgba(10,26,44,.8)); }
.page-head--image .page-head__content { position: relative; padding: 5rem 0 2.8rem; }
.page-head--image h1 { color: #fff; margin-bottom: 0; }

/* --- Osiot ----------------------------------------------------------- */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section--tight { padding-top: 2.5rem; }
.section--cream { background: var(--cream); }
.section--navy { background: var(--navy); color: #fff; }
.section--navy h2, .section--navy h3 { color: #fff; }
.section--navy a { color: #fff; }
.section-head { max-width: 46em; margin-bottom: 2.5rem; }
.section-head p:last-child { font-size: 1.15rem; color: var(--ink-soft); }
.section--navy .section-head p:last-child { color: rgba(255,255,255,.8); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); }
.align-center { align-items: center; }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2--flip > :first-child { order: 2; }
}
.prose { max-width: 38em; }
.prose--wide { max-width: 46em; }
.prose--light p { color: rgba(255,255,255,.88); }
.prose h2 { margin-top: 0; }

.figure { margin: 0; }
.figure img { border-radius: var(--radius); box-shadow: var(--shadow); }
.figure figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: .7rem; font-family: var(--font-ui); }
.figure--portrait { max-width: 420px; margin-inline: auto; }
.figure--portrait a { display: block; }
.figure--logo { background: var(--navy); padding: 2.5rem; border-radius: var(--radius); }
.figure--logo img { box-shadow: none; }

/* --- Kortit ---------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.card {
  background: rgba(255,255,255,.06); border: 1px solid var(--line-light);
  padding: 1.8rem; border-radius: var(--radius);
  display: flex; flex-direction: column;
}
.card p { flex: 1; }
.cards--plain .card { background: #fff; border-color: var(--line); }
.card h3 { margin-bottom: .6rem; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }

/* --- Tekniset tiedot ------------------------------------------------- */
.spec { background: var(--navy); color: #fff; padding: 2rem; border-radius: var(--radius); align-self: start; }
.spec__title { color: var(--brass); font-size: 1.1rem; letter-spacing: .2em; margin-bottom: 1.2rem; }
.spec__list { margin: 0; }
.spec__list > div {
  display: grid; grid-template-columns: 9rem 1fr; gap: 1rem;
  padding: .6rem 0; border-bottom: 1px solid var(--line-light);
}
.spec__list > div:last-child { border-bottom: 0; }
.spec dt { font-size: .78rem; letter-spacing: .14em; color: var(--brass); padding-top: .15rem; }
.spec dd { margin: 0; }
.spec__list--plain > div { border-color: var(--line); grid-template-columns: 8rem 1fr; }
.spec__list--plain dt { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--brass-deep); }
.spec__list--plain dd { margin: 0; }

/* --- Aikajana -------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; max-width: 52em; }
.timeline::before {
  content: ""; position: absolute; left: 5.4rem; top: .4rem; bottom: .4rem; width: 2px; background: var(--brass);
}
.timeline li { display: grid; grid-template-columns: 4.6rem 1fr; gap: 2.2rem; padding: 0 0 2rem; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: 5.4rem; top: .55rem; width: 12px; height: 12px; margin-left: -5px;
  background: var(--cream); border: 2px solid var(--brass); border-radius: 50%;
}
.timeline__year { font-size: 1.6rem; font-weight: 700; color: var(--navy); line-height: 1; padding-top: .15rem; text-align: right; }
.timeline h3 { margin-bottom: .3rem; }
.timeline p { margin: 0; color: var(--ink-soft); }
@media (max-width: 600px) {
  .timeline::before, .timeline li::before { left: 1rem; }
  .timeline li { grid-template-columns: 1fr; gap: .3rem; padding-left: 2.4rem; }
  .timeline__year { text-align: left; }
}

/* --- Kuvaruudukot ---------------------------------------------------- */
.photo-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.photo-grid { display: grid; gap: 1rem; margin-bottom: 3rem; }
.photo-grid--2 { grid-template-columns: repeat(2, 1fr); }
.photo-grid--3 { grid-template-columns: repeat(3, 1fr); }
.photo-strip a, .photo-grid a { display: block; overflow: hidden; border-radius: var(--radius); background: var(--navy); }
.photo-strip img, .photo-grid img { width: 100%; height: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .35s ease, opacity .35s; }
.photo-grid--2 img { aspect-ratio: 4 / 3; }
.photo-strip a:hover img, .photo-grid a:hover img { transform: scale(1.03); opacity: .92; }
.gallery-title { margin-top: 1rem; font-size: 1.1rem; letter-spacing: .2em; color: var(--brass-deep); }
@media (max-width: 900px) {
  .photo-strip, .photo-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .photo-grid--3, .photo-grid--2 { grid-template-columns: 1fr; }
}

/* --- Risteilysivun laatikot ------------------------------------------ */
.notice { background: var(--cream); border-left: 4px solid var(--brass); padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; }
.notice p { margin: 0; }
.infobox { background: var(--cream); padding: 2rem; border-radius: var(--radius); align-self: start; }
.infobox__title { font-size: 1.05rem; letter-spacing: .2em; color: var(--brass-deep); }
.checklist { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.checklist li { padding: .35rem 0 .35rem 1.8rem; position: relative; }
.checklist li::before { content: "\2713"; position: absolute; left: 0; color: var(--brass); font-weight: 700; }
.contact-card { background: #fff; color: var(--ink); padding: 2.2rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-card h3 { margin-bottom: .5rem; }
.contact-card__big { font-size: 1.3rem; font-family: var(--font-head); letter-spacing: .04em; word-break: break-all; }
.section--navy .contact-card a { color: var(--navy); }
.contact-card__list { list-style: none; padding: 0; margin: 0; color: var(--ink-soft); font-size: .95rem; }
.contact-card__list li { padding: .2rem 0; }

.cta { text-align: center; }
.cta__inner { max-width: 40em; }
.cta p { color: rgba(255,255,255,.85); font-size: 1.15rem; }

.sources { padding-left: 1.2rem; }
.sources li { margin-bottom: .4rem; }

/* --- Alatunniste ----------------------------------------------------- */
.site-footer { background: var(--navy-deep); color: rgba(255,255,255,.85); padding: 3.5rem 0 2rem; font-family: var(--font-ui); font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--brass); }
.site-footer h2 { font-size: .8rem; letter-spacing: .22em; color: var(--brass); margin-bottom: .9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer__grid { display: grid; grid-template-columns: 1.1fr 1fr 1.3fr 1.1fr; gap: 2.5rem; }
.site-footer__brand img { width: 200px; }
.site-footer__bottom { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line-light); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: rgba(255,255,255,.6); }
.site-footer__bottom p { margin: 0; }
@media (max-width: 900px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .site-footer__grid { grid-template-columns: 1fr; } }

/* --- Kuvan suurennus ------------------------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,26,44,.94);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox__figure { margin: 0; max-width: min(92vw, 1600px); max-height: 92vh; text-align: center; }
.lightbox__figure img { max-width: 100%; max-height: 84vh; width: auto; height: auto; margin: 0 auto; box-shadow: var(--shadow); }
.lightbox__figure figcaption { color: rgba(255,255,255,.8); font-family: var(--font-ui); font-size: .9rem; margin-top: .8rem; }
.lightbox button {
  position: absolute; background: none; border: 0; color: #fff; cursor: pointer;
  font-size: 2.6rem; line-height: 1; padding: .5rem .8rem; opacity: .8;
}
.lightbox button:hover { opacity: 1; color: var(--brass); }
.lightbox__close { top: .8rem; right: 1rem; }
.lightbox__prev { left: .5rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: .5rem; top: 50%; transform: translateY(-50%); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .photo-strip img, .photo-grid img { transition: none; }
}
@media print {
  .site-header, .mobile-nav, .hero__actions, .cta, .site-footer { display: none; }
}
