/* Content pages (book pages, start page). The colouring tool has its own colouring.css. */
:root {
  --sea: #1d5f8f;
  --sea-dark: #144566;
  --sea-tint: #e6f0f7;
  --sun: #f2b632;
  --sun-tint: #fff4d6;
  --ink: #1b1b1b;
  --muted: #5b6470;
  --paper: #ffffff;
  --bg: #f4f1ea;
  --line: #d9d4c7;
  --radius: 16px;
  --wrap: 1080px;
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink);
  line-height: 1.55;
}

/* Show only the active language */
html:not([lang="sv"]) body [lang="sv"],
html:not([lang="fi"]) body [lang="fi"],
html:not([lang="en"]) body [lang="en"] { display: none !important; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }                         /* short pages: the footer still sits at the bottom */
img { max-width: 100%; height: auto; display: block; }
[id] { scroll-margin-top: 80px; }
a { color: var(--sea); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: block; flex: none; line-height: 0; }
.brand img { display: block; height: 40px; width: auto; }
@media (max-width: 560px) { .brand img { height: 30px; } }
@media (max-width: 360px) { .brand img { height: 28px; } }
.top nav { margin-left: auto; display: flex; gap: 22px; }
.top nav a { font-weight: 700; color: var(--ink); text-decoration: none; }
.top nav a:hover { color: var(--sea); }
.lang { display: flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; flex: none; }
.lang button {
  min-width: 44px; min-height: 44px; border: 0; background: transparent;
  font: inherit; font-weight: 800; cursor: pointer; color: inherit;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
@media (max-width: 520px) { .top nav { display: none; } .lang { margin-left: auto; } }
/* Three language buttons: make room for them on narrow phones */
@media (max-width: 400px) { .top .wrap { gap: 10px; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 10px 20px;
  border: 2.5px solid var(--ink); border-radius: 14px;
  background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 800; text-decoration: none; white-space: nowrap;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { background: var(--sun-tint); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--sea); color: var(--paper); }
.btn.primary:hover { background: var(--sea-dark); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

/* Hero */
.hero { background: var(--bg); border-bottom: 3px solid var(--ink); overflow: hidden; }
.hero .wrap {
  display: grid; gap: 40px; align-items: center;
  grid-template-columns: 1fr;
  padding-block: 48px 56px;
}
.kicker {
  display: inline-block; margin-bottom: 14px; padding: 4px 12px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--sun);
  font-size: .85rem; font-weight: 800;
}
.hero h1 { font-size: clamp(2.2rem, 1.6rem + 3vw, 3.6rem); margin-bottom: .15em; }
.hero .subtitle { display: block; font-size: .5em; font-style: italic; font-weight: 700; color: var(--muted); margin-top: .35em; }
.hero .lead { font-size: 1.15rem; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }

/* Three pages fanned out: about half of each side page shows (span ≈ 2 × the width) */
.stack { position: relative; width: min(46%, 220px); aspect-ratio: 784 / 1094; margin-inline: auto; }
.stack img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: 0 8px 0 rgba(0,0,0,.08);
}
.stack img:nth-child(1) { transform: translate(-54%, 6%) rotate(-9deg) scale(.9); }
.stack img:nth-child(2) { transform: translate(54%, 5%) rotate(8deg) scale(.9); }
.stack img:nth-child(3) { transform: rotate(-1deg); }

@media (min-width: 860px) {
  .hero .wrap { grid-template-columns: 1.15fr .85fr; padding-block: 72px 80px; }
}

/* Sections */
.section { padding-block: 64px; }
.section.alt { background: var(--bg); border-block: 3px solid var(--ink); }
.section-head { max-width: 40em; margin-bottom: 28px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 0; padding: 0; list-style: none; }
.features li {
  padding: 18px 20px; border: 2.5px solid var(--ink); border-radius: var(--radius); background: var(--paper);
}
.features strong { display: block; margin-bottom: 4px; font-size: 1.05rem; }
.features span { color: var(--muted); }

/* Sample pages */
.samples { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin: 0; padding: 0; list-style: none; }
@media (min-width: 700px) { .samples { grid-template-columns: repeat(3, 1fr); } }
.sample a { display: block; color: inherit; text-decoration: none; }
.sample img {
  width: 100%; aspect-ratio: 784 / 1094; object-fit: cover;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 12px;
  transition: transform .15s;
}
.sample a:hover img { transform: rotate(-1.5deg) translateY(-4px); }
.sample .cap { display: block; margin-top: 10px; font-size: .95rem; font-weight: 800; line-height: 1.3; }
.sample .cap i { display: block; font-weight: 600; color: var(--muted); }
.sample .go { display: inline-block; margin-top: 4px; font-size: .9rem; font-weight: 800; color: var(--sea); }
.more { margin-top: 28px; color: var(--muted); }

/* Buy + free page */
.two { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .two { grid-template-columns: 1fr 1fr; } }
.card { padding: 28px; border: 3px solid var(--ink); border-radius: var(--radius); background: var(--paper); }
.card.sun { background: var(--sun-tint); }
.price { font-size: 1.4rem; font-weight: 800; margin-bottom: .4em; }
.places { margin: 0 0 1em; padding: 0; list-style: none; }
.places li { padding: 10px 0 10px 34px; border-bottom: 2px dashed var(--line); position: relative; }
.places li:last-child { border-bottom: 0; }
.places li::before {
  content: ""; position: absolute; left: 4px; top: 15px; width: 14px; height: 14px;
  border: 2.5px solid var(--ink); border-radius: 50%; background: var(--sun);
}
.places small { color: var(--muted); }
.free { display: grid; gap: 20px; grid-template-columns: 90px minmax(0, 1fr); align-items: start; }
@media (max-width: 380px) { .card { padding: 18px; } .free { gap: 14px; grid-template-columns: 64px minmax(0, 1fr); } }
@media (min-width: 480px) { .free { grid-template-columns: 110px minmax(0, 1fr); } }
.free img { border: 2.5px solid var(--ink); border-radius: 8px; background: var(--paper); transform: rotate(-3deg); }
.note { color: var(--muted); font-size: .95rem; }

/* Footer */
.foot { padding-block: 36px; background: var(--ink); color: #e9e6df; }
.foot a { color: #fff; }
.foot p { margin: 0 0 .4em; }

/* Start page: towns in the series */
.towns { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 0; padding: 0; list-style: none; }
@media (min-width: 860px) { .towns { grid-template-columns: repeat(4, 1fr); } }
.town { position: relative; }
.town a, .town > div { display: block; color: inherit; text-decoration: none; }
.town .page {
  display: grid; place-items: center;
  aspect-ratio: 784 / 1094; overflow: hidden;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 12px;
}
.town .page img { width: 100%; height: 100%; object-fit: cover; }
.town a .page { transition: transform .15s; box-shadow: 0 6px 0 var(--ink); }
.town a:hover .page { transform: rotate(-1.5deg) translateY(-4px); }
.town.soon .page { border-style: dashed; border-color: #9a9488; background: transparent; color: #9a9488; }
.town.soon .page svg { width: 40%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.town .name { display: block; margin-top: 12px; font-weight: 800; font-size: 1.1rem; line-height: 1.2; }
.town .name i { display: block; font-size: .9rem; font-weight: 600; color: var(--muted); }
.badge {
  position: absolute; top: -10px; left: 10px; z-index: 1;
  padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--sun); font-size: .75rem; font-weight: 800;
}
.town.soon .badge { background: var(--paper); border-color: #9a9488; color: var(--muted); }

.split { display: grid; gap: 32px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } }
.split .shot {
  width: min(100%, 300px); margin-inline: auto;
  border: 3px solid var(--ink); border-radius: 12px; background: var(--paper);
  box-shadow: 0 8px 0 rgba(0,0,0,.08); transform: rotate(2deg);
}
@media (max-width: 599px) {
  .towns { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .town.soon .page { aspect-ratio: 3 / 2; }
  .town.soon .page svg { width: 28%; }
  .town.soon .name { font-size: 1rem; }
  .town.soon .badge { font-size: .65rem; padding: 1px 7px; left: 6px; }
}

/* Adult pictures (generated pages <town>/vuxna/, <fi-town>/aikuisille/ and the galleries) */
.adult-hero { display: grid; gap: 36px; align-items: center; }
@media (min-width: 860px) { .adult-hero { grid-template-columns: 1fr 1fr; } }
.adult-shot {
  width: min(100%, 460px); margin-inline: auto;
  border: 3px solid var(--ink); border-radius: 10px; background: var(--paper);
  box-shadow: 0 10px 0 rgba(0,0,0,.08);
}
@media (min-width: 700px) { .samples.adult-grid { grid-template-columns: repeat(4, 1fr); } }
.samples.adult-grid img { border-radius: 8px; }

/* About page */
.prose { max-width: 42em; }
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.foot a.about { color: inherit; }

/* Pages that show every language at once (404 and the root chooser) */
html body main.all-langs [lang] { display: revert !important; }

/* Start page search (assets/js/search.js) */
.search { max-width: 34em; margin: -8px 0 28px; }
.search label { display: block; font-weight: 800; margin-bottom: 8px; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 14px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%);
  fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }
.search input {
  width: 100%; box-sizing: border-box; min-height: 52px; padding: 10px 16px 10px 46px;
  font: inherit; font-size: 1.1rem; color: var(--ink); background: var(--paper);
  border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 4px 0 var(--ink);
}
.search input:focus { outline: 3px solid var(--sun); outline-offset: 2px; }
.search-results { margin-bottom: 40px; }
.search-count { margin: 0 0 16px; font-size: 1.15rem; }
.search-none { font-weight: 700; color: var(--muted); }
.sample .town-of { display: block; font-size: .9rem; font-weight: 600; color: var(--muted); }
.search-results .samples { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 14px; }
@media (min-width: 860px) { .search-results .samples { grid-template-columns: repeat(4, 1fr); gap: 24px; } }
