/* TomoScand web: shared styles. FMI visual identity: primary blue #303193, dark blue #1F2060, Arial. */
:root {
  --blue: #303193; --dark: #1F2060; --text: #1F2060; --muted: #4A5B6C; --body: #33475B;
  --line: #C5CED8; --line-light: #DDE3EA; --border: #8FA3B8; --panel: #F4F6F8; --banner: #EEF0FA;
  --nav-dim: #D5E2EE; --chip: #E7F0FA; --warn: #9A4A00; --missing: #D9E0E7; --missing-border: #6B7F93;
  --mono: Consolas, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; display: flex; flex-direction: column; background: #fff; color: var(--text);
  font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.4; }
a { color: var(--blue); } a:hover { color: var(--dark); }
h1 { margin: 0; font-size: 26px; font-weight: 700; }
h2 { margin: 0; font-size: 18px; font-weight: 600; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); font-size: 14px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header and footer: as on ilmatieteenlaitos.fi, a white top bar with the blue logo and a navigation row
   below it, blue text with an underline on the current page */
header.site { background: #fff; border-bottom: 1px solid var(--line-light); }
header.site .inner { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
header.site .top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; padding-top: 14px; padding-bottom: 10px; }
header.site .logo { display: flex; padding: 4px 0; }
header.site .logo img { height: 48px; width: auto; display: block; }
header.site .brand { color: var(--blue); text-decoration: none; font-size: 24px; font-weight: 700; letter-spacing: 0.01em; padding: 4px 0 4px 28px; border-left: 1px solid var(--line-light); }
header.site .tagline { color: var(--muted); font-size: 14px; }
header.site nav { display: flex; flex-wrap: wrap; gap: 0 8px; border-top: 1px solid var(--line-light); }
header.site nav a { color: var(--blue); text-decoration: none; font-weight: 700; font-size: 17px; padding: 14px 8px 10px; border-bottom: 3px solid transparent; }
header.site nav a:hover { border-bottom-color: var(--nav-dim); }
header.site nav a.active { border-bottom-color: var(--blue); }
footer.site { border-top: 1px solid var(--line); margin-top: auto; }
footer.site .inner { max-width: 1320px; margin: 0 auto; padding: 10px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 32px; font-size: 13px; color: var(--muted); }
footer.site .links { display: flex; flex-wrap: wrap; gap: 4px 20px; }

main { flex: 1 1 auto; width: 100%; max-width: 1320px; margin: 0 auto; padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 20px; }
main.nowcast { padding-bottom: 16px; gap: 14px; }
main.narrow { max-width: 1240px; padding: 32px 24px; gap: 32px; }
.titlebar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; }
.titlebar .left { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; }
.titlebar .stamp { font-family: var(--mono); font-size: 17px; }
.titlebar .status { font-size: 15px; color: var(--muted); }
.titlebar a.strong { padding: 12px 0; font-weight: 700; }

/* buttons */
.btn { min-height: 44px; padding: 0 18px; font: inherit; font-weight: 700; color: var(--blue); background: #fff; border: 2px solid var(--blue); border-radius: 22px; cursor: pointer; }
.btn.primary { color: #fff; background: var(--blue); border-color: var(--blue); min-width: 120px; }
.btn.icon { min-width: 44px; padding: 0 12px; }
.btn.small { font-size: 14px; font-weight: 400; padding: 0 14px; min-height: 40px; background: var(--chip); border-color: var(--chip); border-radius: 20px; }
.btn[aria-pressed="true"] { color: #fff; background: var(--blue); border-color: var(--blue); font-weight: 700; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 4px; }
select.field, input.field { min-height: 44px; padding: 0 10px; font: inherit; font-family: var(--mono); color: var(--text); background: #fff; border: 1px solid var(--border); }
.field-label { font-size: 13px; color: var(--muted); }
.field-group { display: flex; flex-direction: column; gap: 2px; }

/* nowcast */
/* The two figures size themselves from the image's aspect ratio (1650 x 1200), capped so that the page fits
   one window: no flex-grown heights, which Safari resolves differently from Chrome. */
.nowcast-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.nowcast-grid figure { margin: 0; display: block; }
.nowcast-grid figure a { display: block; }
.nowcast-grid figure img { display: block; width: 100%; height: auto; aspect-ratio: 1650 / 1200; max-height: calc(100vh - 440px); min-height: 220px; object-fit: contain; }
.nowcast-grid figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
.nowcast-grid figcaption { font-size: 14px; color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 32px; }
.player { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; flex: 1 1 520px; }
.player input[type="range"] { flex: 1 1 200px; min-width: 160px; height: 44px; accent-color: var(--blue); }
.player .frame { font-family: var(--mono); font-size: 14px; min-width: 120px; }
.dataline { margin: 0; font-size: 15px; color: var(--body); }
.notice { border: 1px solid var(--blue); background: var(--banner); color: var(--text); padding: 10px 14px; font-size: 15px; }
.notice.warn { border-color: var(--warn); }

/* time selector (products, product page) */
.timebar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line-light); }
.timebar .note { font-size: 13px; color: var(--muted); align-self: center; }
.timebar .player.day { flex: 1 1 100%; gap: 6px 12px; }
.timebar .player.day .frame { min-width: 190px; }

/* product tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 28px 20px; }
.tiles figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tiles img, .placeholder { width: 100%; height: auto; aspect-ratio: 1650 / 1200; object-fit: contain; display: block; border: 1px solid var(--line-light); }
.placeholder { background: #EEF1F5; border: 1px dashed var(--missing-border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; text-align: center; }
.tiles figcaption { display: flex; flex-direction: column; gap: 6px; }
.tiles figcaption .name { font-weight: 700; }
.tiles figcaption .desc { font-size: 14px; color: var(--muted); }

/* product page */
.product-main { display: flex; flex-direction: column; gap: 12px; }
.product-main .large { width: 100%; max-width: 1100px; height: auto; aspect-ratio: 1650 / 1200; display: block; border: 1px solid var(--line-light); }
.breadcrumb { font-size: 14px; color: var(--muted); }
.product-text { max-width: 760px; color: var(--body); }
.product-text dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 15px; }
.product-text dd { margin: 0; }

/* archive */
.archive-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.archive-head .pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.archive-head .fields { display: flex; flex-direction: column; gap: 4px; }
.archive-body { display: flex; flex-wrap: wrap; gap: 24px; }
.archive-body .slots-col { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 4px; }
.slot { min-height: 44px; padding: 0; font: inherit; font-family: var(--mono); font-size: 14px; color: var(--text); background: #fff; border: 1px solid var(--border); cursor: pointer; }
.slot[aria-pressed="true"] { color: #fff; background: var(--blue); border-color: var(--blue); }
.slot.q1, .slot.q2, .slot.q3 { border: 3px solid var(--warn); }
.slot.missing { background: var(--missing); border: 1px dashed var(--missing-border); color: var(--muted); cursor: default; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--body); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 18px; height: 18px; display: inline-block; background: #fff; border: 1px solid var(--border); }
.legend i.q1 { border: 3px solid var(--warn); }
.legend i.missing { background: var(--missing); border: 1px dashed var(--missing-border); }
.archive-body aside { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.card h2.mono { font-family: var(--mono); }
.card img.quicklook { width: 100%; height: auto; aspect-ratio: 1650 / 1200; display: block; border: 1px solid var(--line-light); }
.card dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 15px; }
.card dd { margin: 0; font-family: var(--mono); text-align: right; }
.card .files a { display: block; padding: 8px 0; }
.access { border-top: 3px solid var(--dark); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.access p { margin: 0; color: var(--body); max-width: 760px; }
.access pre { margin: 0; overflow-x: auto; background: var(--dark); color: #F4F6F8; padding: 16px 20px; font-family: var(--mono); font-size: 14px; line-height: 1.7; }

/* text pages */
.prose { max-width: 760px; color: var(--body); display: flex; flex-direction: column; gap: 12px; }
.prose p { margin: 0; }
