/* Maritimum website. Dark, sea-coloured palette shared with the iOS app (Brand.swift / SkyTheme). */
:root {
  --bg: #071631;
  --bg-deep: #040c1e;
  --card: rgba(255, 255, 255, 0.07);
  --card-border: rgba(255, 255, 255, 0.10);
  --text: #f4f7fb;
  --muted: rgba(244, 247, 251, 0.68);
  --accent: #7fd4ff;
  /* Links: a calm sea blue that reads as a link without glowing against the navy. */
  --link: #a9c8e0;
  --link-hover: #d4e6f3;
  --warning: #ff9f43;
  --radius: 22px;
  --wrap: 1080px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%) fixed;
  color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; }
p { margin: 0 0 .5em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; color: #000; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { vertical-align: -3px; flex-shrink: 0; }
.wx { vertical-align: middle; flex-shrink: 0; }
.dir { display: inline-flex; vertical-align: middle; color: var(--accent); }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(7, 22, 49, 0.78); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--card-border); }
.topbar-inner { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 19px; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
.topbar .search { flex: 1; max-width: 420px; margin-left: auto; }
.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--card-border); font-weight: 600; font-size: 14px; }
.lang summary::-webkit-details-marker { display: none; }
.lang ul { position: absolute; right: 0; top: 40px; margin: 0; padding: 6px; list-style: none; background: #0d2146; border: 1px solid var(--card-border); border-radius: 14px; min-width: 160px; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.lang a { display: block; padding: 8px 12px; border-radius: 9px; color: var(--text); }
.lang a:hover, .lang a[aria-current] { background: rgba(255,255,255,.08); text-decoration: none; }

/* ---------- Search ---------- */
.search { position: relative; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.10); border: 1px solid var(--card-border); border-radius: 14px; padding: 0 12px; color: var(--muted); }
.search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: inherit; padding: 9px 0; outline: none; }
.search input::placeholder { color: var(--muted); }
.search:focus-within { border-color: var(--accent); }
.search-big { max-width: 560px; padding: 4px 6px 4px 16px; border-radius: 18px; background: rgba(255,255,255,.14); }
.search-big input { font-size: 18px; padding: 12px 0; }
.search button { border: 0; border-radius: 13px; background: var(--accent); color: #04223a; font: inherit; font-weight: 700; padding: 10px 18px; cursor: pointer; }
.suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: #0d2146; border: 1px solid var(--card-border); border-radius: 14px; box-shadow: 0 14px 34px rgba(0,0,0,.45); z-index: 30; max-height: 360px; overflow: auto; }
.suggestions a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--text); }
.suggestions a small { color: var(--muted); margin-left: 6px; }
.suggestions a:hover, .suggestions [aria-selected="true"] a { background: rgba(255,255,255,.10); text-decoration: none; }

/* ---------- Sky themes (same gradients as the app) ---------- */
.theme-sunny { --sky1: #0270b8; --sky2: #02367f; }
.theme-fair { --sky1: #2f6c9e; --sky2: #1d3f6e; }
.theme-cloudy { --sky1: #4f5d6e; --sky2: #2c3644; }
.theme-rainy { --sky1: #3d5468; --sky2: #1f2d3b; }
.theme-stormy { --sky1: #33334d; --sky2: #16162a; }
.theme-night { --sky1: #0e1f45; --sky2: #050b1e; }

/* ---------- Heroes ---------- */
.hero-home { padding: 72px 0 56px; background: radial-gradient(120% 90% at 50% 0%, #0b5ea8 0%, transparent 70%); text-align: center; }
.hero-home h1 { font-size: clamp(40px, 8vw, 64px); letter-spacing: -0.02em; }
.hero-lead { color: var(--muted); font-size: 20px; margin-bottom: 26px; }
.hero-home .search-big { margin: 0 auto; text-align: left; }

.hero-location { position: relative; overflow: hidden; padding: 28px 0 40px; background: linear-gradient(180deg, var(--sky1), var(--sky2) 70%, transparent); }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 100%); }
.hero-location::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.05) 40%, rgba(7,22,49,0) 70%); pointer-events: none; }
.hero-content { position: relative; z-index: 1; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.hero-location h1 { font-size: clamp(38px, 7vw, 60px); margin-top: 10px; }
.hero-place { color: var(--muted); font-size: 18px; }
.hero-now { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.hero-temp { font-size: clamp(76px, 14vw, 112px); font-weight: 200; line-height: 1; letter-spacing: -0.03em; }
.hero-sky { display: inline-flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 600; }
.hero-range { font-size: 18px; font-weight: 600; margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.chips li { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.14); font-weight: 600; font-size: 15px; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 4px; padding-bottom: 32px; }
.cards > *, .pair > * { min-width: 0; }
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.card-foot { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.label { color: var(--muted); font-size: 15px; margin-bottom: 2px; }
.big { font-size: 40px; font-weight: 500; line-height: 1.1; display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.big-sub { font-size: 20px; font-weight: 600; }
.medium { font-size: 26px; font-weight: 500; margin: 0 0 4px; }
.split { display: flex; flex-wrap: wrap; gap: 24px 48px; }
.split > div { min-width: 140px; }
.alert { display: flex; gap: 10px; align-items: flex-start; background: var(--warning); color: #1a1000; font-weight: 600; padding: 12px 14px; border-radius: 14px; }
.with-icon { display: flex; gap: 8px; align-items: flex-start; }
.pair { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.uv-bar { position: relative; height: 8px; border-radius: 99px; margin-top: 10px; max-width: 220px; background: linear-gradient(90deg, #3ec46d, #f5d300 35%, #ff8a00 60%, #e8343a 80%, #b36ad1); }
.uv-bar span { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid rgba(0,0,0,.3); transform: translate(-50%, -50%); }
.periods { display: grid; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--card-border); }
.period p { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.period-name { font-weight: 700; margin-bottom: 4px !important; }

/* Horizontal scrollers (hourly, coastal forecast) */
.scroller { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 0 16px; margin: 0 -6px; }
.cell { flex: 0 0 auto; min-width: 72px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 4px 6px; scroll-snap-align: start; text-align: center; }
.cell-day { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); min-height: 1em; }
.cell-time { font-weight: 600; }
.cell-temp { font-size: 20px; font-weight: 500; }
.cell-label { font-size: 13px; font-weight: 600; max-width: 84px; min-height: 2.6em; }
.cell-sub { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.cell-rain { font-size: 12px; color: var(--accent); font-weight: 600; }
.sea-good { color: #4cd9a0; } .sea-fair { color: #ffd54a; } .sea-poor { color: #ff9f43; } .sea-bad { color: #ff6b6b; } .sea-unknown { color: var(--muted); }

/* Horizontal scrollbars: thin, subtle, with room above them. */
.scroller, .tiles { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }
.scroller::-webkit-scrollbar, .tiles::-webkit-scrollbar { height: 6px; }
.scroller::-webkit-scrollbar-track, .tiles::-webkit-scrollbar-track { background: transparent; margin: 0 6px; }
.scroller::-webkit-scrollbar-thumb, .tiles::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 99px; }
.scroller::-webkit-scrollbar-thumb:hover, .tiles::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.38); }

/* Wave bars */
.bars { display: flex; justify-content: space-between; gap: 4px; margin-top: 18px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-height: 104px; }
.bar-fill { width: 10px; border-radius: 99px; background: linear-gradient(180deg, #7fd4ff, #1a8fe0); }
.bar-value { font-size: 11px; font-variant-numeric: tabular-nums; }
.bar-label { font-size: 11px; color: var(--muted); }

/* Beach lists */
.beach-list { list-style: none; margin: 0; padding: 0; }
.beach-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--card-border); }
.beach-list li:first-child { border-top: 0; }
.beach-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.beach-text .muted { font-size: 15px; }
.flag { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; color: #10151c; background: rgba(255,255,255,.15); }
.flag-green { background: #34c759; } .flag-yellow { background: #ffd60a; } .flag-red { background: #ff453a; }
.flag-off, .flag-unknown, .flag-closed { color: var(--text); }
.tag-warning { display: inline-flex; align-items: center; gap: 4px; background: var(--warning); color: #1a1000; font-size: 13px; font-weight: 700; padding: 4px 9px; border-radius: 99px; white-space: nowrap; }
.water { color: var(--accent); font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.more summary { cursor: pointer; color: var(--accent); font-weight: 600; padding-top: 10px; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more .when-open, .more[open] .when-closed { display: none; }
.more[open] .when-open { display: inline; }
.more[open] summary { order: 2; }
.more[open] { display: flex; flex-direction: column; }

/* Daily */
.days { list-style: none; margin: 0; padding: 0; }
.days li { display: grid; grid-template-columns: 5.5em 4.5em 2.6em 1fr 2.6em; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--card-border); }
.days li:first-child { border-top: 0; }
.day-name { font-weight: 600; }
.day-sky { display: flex; align-items: center; gap: 4px; }
.day-rain { font-size: 12px; font-weight: 700; color: var(--accent); }
.day-min { color: var(--muted); text-align: right; }
.range { position: relative; height: 6px; border-radius: 99px; background: rgba(255,255,255,.12); }
.range span { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #5fc4ff, #ffc531); }

/* Wind & sun */
.wind { display: flex; align-items: center; gap: 22px; }
.compass { position: relative; width: 104px; height: 104px; flex-shrink: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); display: grid; place-items: center; }
.compass > span:first-child { position: absolute; top: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.sun-row { display: flex; align-items: center; gap: 10px; font-size: 18px; }

.sources { padding: 8px 2px 0; font-size: 15px; }
.sources h2 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sources ul { padding-left: 18px; }

/* ---------- Home ---------- */
.section { margin: 36px 0; }
.section h2 { font-size: 24px; }
.tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 1fr); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 0 20px; }
.tile { position: relative; display: block; min-height: 200px; border-radius: 20px; overflow: hidden; color: #fff; background: linear-gradient(180deg, var(--sky1), var(--sky2)); border: 1px solid rgba(255,255,255,.16); scroll-snap-align: start; }
.tile:hover { text-decoration: none; transform: translateY(-2px); transition: transform .15s; }
.tile-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-photo + .tile-body { background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.25) 40%, rgba(0,0,0,.72)); }
.tile-body { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 14px; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.tile-name { font-weight: 700; font-size: 18px; flex: 1; }
.tile-temp { font-size: 36px; font-weight: 300; line-height: 1.1; }
.tile-water { font-size: 14px; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.tile-empty { font-size: 14px; color: rgba(255,255,255,.85); }
.section-lead { margin-top: -4px; margin-bottom: 14px; max-width: 70ch; }
/* About: plain reading text at a comfortable line length. */
.about { color: var(--muted); }
.about p { margin-bottom: .8em; }
.about-lead { font-size: 20px; line-height: 1.4; font-weight: 600; color: var(--text); }
.press ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 44px; }
.press a { display: block; }
.press img { display: block; height: 48px; width: auto; opacity: .7; transition: opacity .15s; }
.press a:hover img { opacity: 1; }
/* Equal cards on one line each; wide enough for "Principado de Asturias" plus its count. */
.regions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.regions a { display: flex; align-items: center; gap: 10px; height: 100%; padding: 16px 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--card-border); color: var(--text); white-space: nowrap; }
.regions a:hover { background: rgba(255,255,255,.11); text-decoration: none; }
.region-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.region-count { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* ---------- Lists (search, region) ---------- */
.page { padding-top: 28px; padding-bottom: 40px; }
.page h1 { font-size: 34px; }
.rows { list-style: none; margin: 16px 0 0; padding: 4px 16px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--text); border-top: 1px solid var(--card-border); }
.rows li:first-child .row { border-top: 0; }
.row:hover { text-decoration: none; }
.row:hover .row-name { color: var(--accent); }
.row-photo { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.row-photo-empty { display: grid; place-items: center; background: rgba(255,255,255,.08); color: var(--muted); }
.row-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row-name { font-weight: 600; }
.row-sub { color: var(--muted); font-size: 15px; }
.row-wx { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(180deg, var(--sky1), var(--sky2)); }
.row-temp { font-size: 20px; font-weight: 500; min-width: 2.4em; text-align: right; font-variant-numeric: tabular-nums; }
.row-chevron { color: var(--muted); }

.message { text-align: center; }
.message img { border-radius: 16px; margin-bottom: 12px; }
.button { display: inline-block; padding: 11px 20px; border-radius: 14px; background: var(--accent); color: #04223a; font-weight: 700; }
.button:hover { text-decoration: none; filter: brightness(1.05); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--card-border); padding: 28px 0 40px; color: var(--muted); font-size: 15px; margin-top: 24px; }
.footer-brand { display: flex; align-items: center; gap: 8px; color: var(--text); margin-bottom: 8px; }
.footer-brand img { border-radius: 7px; }
.footer-langs { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar-inner { gap: 8px; }
  .brand span { display: none; }
  .hero-home { padding: 48px 0 36px; }
  .days li { grid-template-columns: 4.6em 4.2em 2.4em 1fr 2.4em; gap: 8px; }
  .search-big button { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tile:hover { transform: none; } }
@media (prefers-reduced-transparency: reduce) { .card, .topbar { backdrop-filter: none; background: #0d2146; } .hero-photo { display: none; } }
