/* Gezeiten Irland — Küsten-Almanach-Look */
:root {
  --foam: #f2f7f5;        /* Hintergrund: helles Gischt-Weiß */
  --deep: #0b2b33;        /* Text: dunkles See-Schiefer */
  --sea: #10545e;         /* Akzent: tiefes Seegrün (Hochwasser) */
  --sea-soft: #d7e9e6;    /* Karten-Ton */
  --amber: #b96a24;       /* Niedrigwasser */
  --amber-soft: #f3e4d3;
  --card: #ffffff;
  --line: #cfe0dc;
  --muted: #56716e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Instrument Sans", system-ui, sans-serif;
  background: var(--foam);
  color: var(--deep);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Kopf ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.5rem;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.brand { display: flex; align-items: baseline; gap: 0.5rem; }
.brand-wave { font-size: 1.3rem; }

.brand h1 {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}

.lang-toggle {
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--sea);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
}
.lang-toggle:hover { border-color: var(--sea); }

/* ---------- Stationswahl ---------- */
.station-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem 1rem;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

#stationSelect {
  flex: 1;
  font: inherit;
  font-weight: 500;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--deep);
  min-width: 0;
}

.geo-btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 0.9rem;
  border: none;
  border-radius: 12px;
  background: var(--sea);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.geo-btn:hover { background: #0d4650; }
.geo-btn:disabled { opacity: 0.6; cursor: wait; }

/* ---------- Layout ---------- */
main {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  flex: 1;
}

.status-msg {
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 500;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

section { margin-bottom: 1.25rem; }

h3 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--sea) 0%, #0b3a42 100%);
  color: #f2faf8;
  border-radius: 20px;
  padding: 1.5rem 1.5rem 1.25rem;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #bcdcd6;
  margin-bottom: 0.5rem;
}

.trend-arrow { font-size: 1rem; }

.hero-level { margin-left: auto; font-variant-numeric: tabular-nums; }

.hero-countdown {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
  min-height: 1.2em;
}

.hero-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.next-event {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chip {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.chip-high { background: #bcdcd6; color: #0b3a42; }
.chip-low  { background: #f0cfa6; color: #6e3c0e; }

.next-time {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.next-height { font-size: 0.85rem; color: #bcdcd6; font-variant-numeric: tabular-nums; }

/* ---------- Kurve ---------- */
.curve-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 1.25rem 1rem 0.75rem;
}
.curve-card h3 { padding-left: 0.25rem; }

.curve-wrap { width: 100%; }
#tideCanvas { width: 100%; height: 190px; display: block; }

/* ---------- Wetter ---------- */
.weather-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 1.25rem 1.25rem 0.75rem;
}

.weather-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.weather-tile {
  background: var(--sea-soft);
  border-radius: 16px;
  padding: 0.9rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
}

.weather-icon { font-size: 1.2rem; }

.weather-value {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}

.weather-label {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.hourly-wrap { overflow-x: auto; }

.hourly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.hourly-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0.35rem 0.5rem;
  border-bottom: 1.5px solid var(--line);
}

.hourly-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

.hourly-table tr:last-child td { border-bottom: none; }
.hourly-table tr:nth-child(even) td { background: rgba(215, 233, 230, 0.35); }

/* ---------- 7 Tage ---------- */
.week-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 1.25rem 1.25rem 0.75rem;
}

.week-day {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.75rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}
.week-day:first-child { border-top: none; }

.week-day-name {
  flex: 0 0 5.2rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.week-events { display: flex; flex-wrap: wrap; gap: 0.4rem; flex: 1; }

.tide-pill {
  font-size: 0.8rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  white-space: nowrap;
}
.tide-pill.high { background: var(--sea-soft); color: var(--sea); }
.tide-pill.low  { background: var(--amber-soft); color: var(--amber); }

/* ---------- Fußzeile ---------- */
.footer {
  text-align: center;
  padding: 1rem 1.25rem 2rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.disclaimer { margin-top: 0.25rem; }

/* ---------- Fokus & Motion ---------- */
button:focus-visible, select:focus-visible {
  outline: 3px solid var(--sea);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .hero, .curve-card, .weather-card, .week-card {
    animation: rise 0.5s ease both;
  }
  .curve-card { animation-delay: 0.08s; }
  .weather-card { animation-delay: 0.16s; }
  .week-card { animation-delay: 0.24s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
  }
}

@media (max-width: 420px) {
  .hero-next { grid-template-columns: 1fr; }
  .geo-btn span[data-i18n] { display: none; } /* nur 📍 auf sehr schmalen Screens */
}
