/* Saaren Sää - shared styles */
:root {
  --bg: #eef5fc;
  --bg-alt: #dcebf9;
  --card-bg: #ffffff;
  --accent: #0284c7;
  --accent-dark: #075985;
  --text: #1e293b;
  --text-muted: #5b6b7d;
  --border: #d7e6f5;
  --shadow: 0 1px 3px rgba(15, 60, 100, 0.08), 0 1px 2px rgba(15, 60, 100, 0.06);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 320px);
  color: var(--text);
  font-family: "Segoe UI", Verdana, Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a { color: var(--accent-dark); }
a:hover { color: var(--accent); }

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* Header */
header.site-header {
  background: var(--accent-dark);
  color: #fff;
  padding: 14px 0;
}

.site-header .wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 0;
  padding-right: 90px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.brand img {
  width: 120px;
  height: 80px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  padding: 2px;
}

.brand-text { line-height: 1.2; }
.brand-text strong { font-size: 1.25rem; display: block; }
.brand-text span { font-size: 0.8rem; opacity: 0.85; }

nav.main-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

nav.main-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

nav.main-nav a:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.35);
  transform: translateY(-1px);
}

nav.main-nav a.active {
  background: #fff;
  color: var(--accent-dark);
  border-color: #fff;
}

/* Language switch (flag buttons) */
.lang-switch {
  position: absolute;
  top: 0;
  right: 16px;
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

button.lang-btn {
  width: 34px;
  height: 23px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 4px;
  cursor: pointer;
  background-color: rgba(255,255,255,0.15);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: 0.55;
  transition: opacity 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

button.lang-btn:hover { opacity: 0.9; transform: translateY(-1px); }

button.lang-btn.lang-fi {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 11'%3E%3Crect width='18' height='11' fill='%23fff'/%3E%3Crect y='4' width='18' height='3' fill='%23003580'/%3E%3Crect x='5' width='3' height='11' fill='%23003580'/%3E%3C/svg%3E");
}

button.lang-btn.lang-en {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='uk'%3E%3Cpath d='M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z'/%3E%3C/clipPath%3E%3Crect width='60' height='30' fill='%23012169'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' clip-path='url(%23uk)' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E");
}

html[data-lang="fi"] button.lang-btn.lang-fi,
html[data-lang="en"] button.lang-btn.lang-en {
  opacity: 1;
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.55);
}

/* Hero */
.hero {
  padding: 28px 0 8px;
}
.hero h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
  color: var(--accent-dark);
}
.hero p.subtitle {
  margin: 0;
  color: var(--text-muted);
}

/* Cards / grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card .icon-photo {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

.card .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.card .value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.card .value small {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}

.card .icon {
  font-size: 1.4rem;
  margin-bottom: 6px;
  display: block;
}

/* Section blocks */
section.block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 20px 0;
}

section.block h2 {
  margin-top: 0;
  color: var(--accent-dark);
  font-size: 1.15rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.data-table th, table.data-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
table.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table td.num { text-align: right; font-weight: 600; color: var(--accent-dark); }

.link-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.link-list li a {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.9rem;
}
.link-list li a:hover { background: #fff; border-color: var(--accent); }

.history-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.history-images img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}
.history-images figure { margin: 0; }
.history-images figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
}

footer.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 24px 16px 40px;
}
footer.site-footer a { color: var(--text-muted); }

.updated-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 10px;
}

/* Language toggle visibility */
html[data-lang="fi"] .en { display: none; }
html[data-lang="en"] .fi { display: none; }

@media (max-width: 560px) {
  .site-header .wrap {
    flex-direction: column;
    align-items: stretch;
    padding-right: 80px;
  }
  nav.main-nav { justify-content: center; }
  button.lang-btn { width: 30px; height: 20px; }
}
