/* The tide planner shares the club's typography and colours. */
.tide-page {
  --sea: #317775;
  --sea-soft: #e8f1ed;
  --sand: #f1e7d5;
  --tide-line: #dce3dd;
  background: #f7f8f4;
}

.tide-page .tide-main {
  max-width: 1160px;
  padding-top: clamp(28px, 5vw, 64px);
  padding-bottom: 72px;
}

.tide-page .tide-intro,
.tide-page .tide-description {
  margin-bottom: 34px;
}

.tide-page .tide-intro .eyebrow {
  margin-bottom: 14px;
}

.tide-page .tide-description h1 {
  max-width: 680px;
  margin: 0;
  font-family: inherit;
  font-size: clamp(1rem, 1.7vw, 1.16rem);
  font-weight: 400;
  letter-spacing: normal;
  color: var(--muted);
  line-height: 1.65;
}

.tide-page .tide-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-bottom: 18px;
}

.tide-page .date-control,
.tide-page .date-navigation,
.tide-page .date-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.tide-page .port-control,
.tide-page .tide-controls label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 650;
}

.tide-page .port-control select {
  min-width: 195px;
}

.tide-page .tide-controls button,
.tide-page .tide-controls input,
.tide-page .tide-controls select {
  min-height: 46px;
  border: 1px solid var(--tide-line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 600;
  padding: 10px 14px;
}

.tide-page .tide-controls button {
  min-width: 46px;
  transition: background 160ms ease, border-color 160ms ease;
}

.tide-page .tide-controls button:hover:not(:disabled) {
  background: var(--sea-soft);
  border-color: #a7c0b7;
}

.tide-page button:disabled {
  opacity: .4;
  cursor: default;
}

.tide-page #load-status {
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: .83rem;
}

.tide-page #load-status:empty {
  display: none;
}

.tide-page #load-status[role="alert"] {
  color: #8d342e;
}

.tide-page .tide-overview {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}

.tide-page .tide-card {
  display: flex;
  flex-direction: column;
  align-items: start;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--tide-line);
  border-radius: 22px;
  background: #fff;
  min-width: 0;
}

.tide-page .water-card {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.tide-page .metric-label {
  font-size: .79rem;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.4;
}

.tide-page .metric-value {
  margin-top: 15px;
  font-size: clamp(2.35rem, 4vw, 3.55rem);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}

.tide-page .metric-value small {
  font-size: .48em;
  letter-spacing: -.015em;
  font-weight: 400;
}

.tide-page .metric-sub {
  margin-top: 12px;
  color: var(--muted);
  font-size: .83rem;
  line-height: 1.5;
}

.tide-page .water-card .metric-label,
.tide-page .water-card .metric-sub {
  color: #c8dcd9;
}

.tide-page .chart-panel,
.tide-page .window-panel,
.tide-page .week-panel {
  border: 1px solid var(--tide-line);
  border-radius: 22px;
  padding: clamp(20px, 3vw, 32px);
  background: #fff;
  min-width: 0;
}

.tide-page .chart-panel {
  margin-bottom: 22px;
}

.tide-page .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tide-page .panel-head h2,
.tide-page .window-panel h2,
.tide-page .week-panel > h2 {
  font-family: var(--sans);
  font-size: 1.18rem;
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.35;
}

.tide-page .panel-head p,
.tide-page .window-panel > p,
.tide-page .week-panel > p {
  color: var(--muted);
  font-size: .83rem;
  line-height: 1.6;
  margin-top: 6px;
}

.tide-page .chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  font-size: .75rem;
  color: var(--muted);
}

.tide-page .chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tide-page .chart-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sea);
}

.tide-page .chart-legend .walk-key,
.tide-page .chart-legend .walking-key {
  background: #c4a46c;
}

.tide-page #tide-chart {
  display: block;
  width: 100%;
  height: 300px;
}

.tide-page .chart-caption {
  color: var(--muted);
  margin-top: 12px;
  font-size: .76rem;
  line-height: 1.6;
}

.tide-page .window-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.tide-page .sailing-panel {
  background: var(--sea-soft);
  border-color: #d2e3d9;
}

.tide-page .walking-panel {
  background: #f6f0e5;
  border-color: #e9ddc8;
}

.tide-page .window-list {
  margin-top: 16px;
}

.tide-page .window-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 16px 0;
  border-top: 1px solid #102d3917;
}

.tide-page .window-row:last-child {
  padding-bottom: 0;
}

.tide-page .window-times strong {
  display: block;
  font-size: clamp(1.25rem, 2.3vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.tide-page .window-times small,
.tide-page .window-detail {
  display: block;
  color: var(--muted);
  font-size: .79rem;
  line-height: 1.55;
}

.tide-page .window-times small {
  margin-top: 5px;
}

.tide-page .window-detail {
  max-width: 230px;
}

.tide-page .tide-events {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--tide-line);
  padding-top: 20px;
  margin-top: 18px;
  gap: 18px;
}

.tide-page .tide-event {
  min-width: 0;
}

.tide-page .tide-event label,
.tide-page .tide-event .event-label,
.tide-page .tide-event > span,
.tide-page .tide-event small {
  display: block;
  color: var(--muted);
  font-size: .78rem;
}

.tide-page .tide-event strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 2px;
}

.tide-page .week-panel {
  margin-top: 22px;
}

.tide-page .day-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 5px 4px 12px;
  margin: 16px -4px -12px;
  scrollbar-width: thin;
  scrollbar-color: #bacbc1 transparent;
  scroll-snap-type: x proximity;
}

.tide-page .day-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 0 86px;
  min-height: 100px;
  padding: 13px 10px;
  border: 1px solid var(--tide-line);
  border-radius: 13px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: .76rem;
  scroll-snap-align: start;
  transition: background 160ms ease, border-color 160ms ease;
}

.tide-page .day-choice strong {
  font-size: 1.2rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.15;
}

.tide-page .day-choice small {
  font-size: .73rem;
}

.tide-page .day-choice:hover:not(:disabled) {
  border-color: #a7c0b7;
  background: var(--sea-soft);
}

.tide-page .day-choice[aria-pressed="true"] {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.tide-page .day-choice[aria-pressed="true"] strong,
.tide-page .day-choice[aria-pressed="true"] small {
  color: inherit;
}

.tide-page .planning-note {
  max-width: 830px;
  margin-top: 22px;
  color: var(--muted);
  font-size: .79rem;
  line-height: 1.7;
}

@media (max-width: 1100px) {
  .tide-page .menu {
    display: block;
    min-height: 44px;
  }

  .tide-page .nav nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    padding: 10px 24px 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    align-items: stretch;
  }

  .tide-page .nav nav.open {
    display: grid;
  }

  .tide-page .nav nav a {
    padding: 10px;
    min-height: 44px;
  }

  .tide-page .nav .join {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .tide-page .tide-main {
    padding-top: 30px;
    padding-bottom: 48px;
  }

  .tide-page .tide-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .tide-page .water-card {
    grid-column: 1 / -1;
  }

  .tide-page .tide-card {
    padding: 22px;
  }

  .tide-page .window-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tide-page #tide-chart {
    height: 270px;
  }

  .tide-page .tide-events {
    gap: 12px;
  }

  .tide-page .tide-event strong {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .tide-page .tide-intro,
  .tide-page .tide-description {
    margin-bottom: 26px;
  }

  .tide-page .tide-controls {
    align-items: stretch;
    gap: 16px;
  }

  .tide-page .port-control {
    width: 100%;
  }

  @media (forced-colors: none) {
    .tide-page .port-control select {
      appearance: none;
      padding-inline-end: 38px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23142d39' stroke-width='1.5'/%3E%3C/svg%3E");
      background-position: right 15px center;
      background-repeat: no-repeat;
      background-size: 12px 8px;
    }
  }

  .tide-page .date-control,
  .tide-page .date-navigation,
  .tide-page .date-nav {
    gap: 6px;
    width: 100%;
  }

  .tide-page .tide-controls input {
    padding-inline: 10px;
    max-width: 180px;
  }

  .tide-page .tide-controls button {
    padding-inline: 11px;
  }

  .tide-page .tide-card {
    padding: 20px;
    border-radius: 18px;
  }

  .tide-page .metric-value {
    font-size: 2.35rem;
  }

  .tide-page .water-card .metric-value {
    font-size: 3.4rem;
  }

  .tide-page .chart-panel,
  .tide-page .window-panel,
  .tide-page .week-panel {
    padding: 20px 17px;
    border-radius: 18px;
  }

  .tide-page .tide-events {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .tide-page .window-row {
    align-items: start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tide-page .day-choice,
  .tide-page .tide-controls button {
    transition: none;
  }
}

.tide-page .chart-legend span::before{content:"";width:10px;height:10px;border-radius:50%;background:#2c7087}
.tide-page .chart-legend .legend-sail::before{background:#3b8077}
.tide-page .chart-legend .legend-walk::before{background:#b8894f}
.tide-page #tide-chart{height:320px}
.tide-page .height-note,.tide-page .chart-footnote{color:var(--muted);font-size:.8rem;line-height:1.6}
.tide-page .chart-scrubber{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:10px 0;font-size:.84rem}
.tide-page .chart-scrubber input{flex:1;min-width:120px;accent-color:#2c7087;padding:0;height:36px;border:0;background:none}
.tide-page .chart-scrubber output{font-variant-numeric:tabular-nums;min-width:175px}
.tide-page .window-row{display:block}
.tide-page .window-times{display:flex;align-items:center;gap:18px;justify-content:space-between}
.tide-page .window-times>div{flex:1}
.tide-page .window-times>div:last-child{text-align:right}
.tide-page .window-detail{max-width:none;margin-top:10px}
.tide-page .window-panel .window-footnote{margin-top:18px}
.tide-page .chart-footnote{max-width:85ch}
