/* =====================================================================
   Piece 8 — Logo update, collapsible tide charts, species circles,
            tour-date tide badges
   Loaded AFTER site.css and site-piece7.css.
   ===================================================================== */

/* ---------- Updated header logo sizing ---------- */
/* The new logo is wider than the old circular one (1.7:1 vs 1:1).
   Slightly smaller height keeps the header from feeling crowded. */
.brand img {
  height: 52px;
  width: auto;
  /* Drop shadow helps the logo stand out on the cream background
     without darkening the cream too much. */
  filter: drop-shadow(0 1px 1px rgba(31, 58, 68, 0.08));
}
@media (max-width: 720px) {
  /* Even smaller on mobile so brand-name text isn't crowded out */
  .brand img { height: 42px; }
}

/* ---------- Collapsible tide block (locations page) ---------- */
.tide-block {
  margin: 36px 0 0;
  padding-top: 28px;
  border-top: 1px dashed var(--rope);
}
.tide-block-head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 10px 16px;
  margin-bottom: 16px;
}
.tide-block-head h3 {
  font: 600 1.1rem/1.2 'Bitter', serif;
  margin: 0;
}
.tide-block-head .station {
  font-size: 13px;
  color: var(--ink-muted);
}
.tide-block-head .station strong { color: var(--ink-soft); font-weight: 500; }

/* The current/today summary card shown by default */
.tide-today {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  align-items: center;
}
.tide-today-label {
  font: 600 11.5px/1 'Work Sans', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral-deep);
  margin-bottom: 6px;
}
.tide-today-events {
  display: flex; flex-wrap: wrap;
  gap: 14px 22px;
  font-variant-numeric: tabular-nums;
}
.tide-today-event {
  display: flex; flex-direction: column;
  line-height: 1.25;
  white-space: nowrap;
}
.tide-today-event .label {
  font: 600 10.5px/1 'Work Sans', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 3px;
}
.tide-today-event .time {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.tide-today-event .height {
  font-size: 12px;
  color: var(--ink-muted);
}
.tide-today-event.is-low .height { color: var(--teal-deep); font-weight: 500; }
.tide-today-event.is-best .label { color: var(--coral-deep); }
.tide-today-event.is-best .height { color: var(--coral-deep); font-weight: 600; }

/* The "see 7 days" toggle */
.tide-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1.5px solid var(--rule);
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 100px;
  cursor: pointer;
  font: 500 13px/1 'Work Sans', sans-serif;
  white-space: nowrap;
  transition: all 0.15s;
  align-self: end;
}
.tide-toggle:hover { border-color: var(--teal); color: var(--ink); }
.tide-toggle:focus { outline: 2px solid var(--teal); outline-offset: 2px; }
.tide-toggle .chevron {
  display: inline-block;
  width: 12px; height: 12px;
  transition: transform 0.2s ease;
}
.tide-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}
.tide-toggle[aria-expanded="true"] .label-collapsed { display: none; }
.tide-toggle[aria-expanded="false"] .label-expanded { display: none; }

/* The 7-day expanded section */
.tide-week {
  margin-top: 14px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.25s ease;
}
.tide-week.is-open {
  max-height: 800px;
  opacity: 1;
}

.tide-loading,
.tide-error {
  padding: 14px 18px;
  background: var(--paper);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink-soft);
}
.tide-error { color: var(--coral-deep); border-left: 3px solid var(--coral); }

/* ---------- 7-day tide table (re-styled from piece7 base) ---------- */
.tide-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.tide-table thead th {
  background: var(--paper);
  font: 600 11.5px/1.4 'Work Sans', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.tide-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink);
}
.tide-table tbody tr:last-child td { border-bottom: none; }
.tide-day { width: 100px; min-width: 100px; font-weight: 500; }
.tide-day .weekday {
  font: 600 13px/1.2 'Work Sans', sans-serif;
  color: var(--ink); display: block;
}
.tide-day .monthday {
  font-size: 12px; color: var(--ink-muted); display: block;
}
.tide-row.is-today { background: rgba(244, 185, 66, 0.08); }
.tide-row.is-today .tide-day .weekday { color: var(--coral-deep); }
.tide-event {
  display: flex; flex-direction: column;
  gap: 1px;
  line-height: 1.25;
  white-space: nowrap;
}
.tide-event .time { font-weight: 600; font-size: 13.5px; }
.tide-event .height { font-size: 12px; color: var(--ink-muted); }
.tide-event.is-low .height { color: var(--teal-deep); font-weight: 500; }
.tide-event.is-low.is-best .height { color: var(--coral-deep); font-weight: 600; }
.tide-event.is-best::before {
  content: '★ ';
  color: var(--coral);
  font-size: 10px;
  margin-right: 2px;
}
.tide-event.is-empty { color: var(--ink-muted); font-size: 12px; }

.tide-footer {
  font-size: 12px;
  color: var(--ink-muted);
  text-align: right;
  margin-top: 8px;
  padding-right: 4px;
}
.tide-footer a { color: inherit; text-decoration: underline; }

@media (max-width: 720px) {
  .tide-today { grid-template-columns: 1fr; }
  .tide-toggle { width: 100%; justify-content: center; }
  .tide-table thead { display: none; }
  .tide-table,
  .tide-table tbody,
  .tide-table tr,
  .tide-table td { display: block; width: 100%; }
  .tide-table tbody tr {
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--rule);
    display: grid;
    grid-template-columns: 80px 1fr 1fr;
    column-gap: 12px;
    row-gap: 8px;
    align-items: start;
  }
  .tide-table tbody tr:last-child { border-bottom: none; }
  .tide-table tbody td { padding: 0; border: none; }
  .tide-day { grid-column: 1 / 2; grid-row: 1 / 3; align-self: center; width: auto; min-width: 0; }
  .tide-event::after {
    content: '';
    display: inline-block;
    width: 16px; height: 16px;
    margin-left: 4px;
    text-align: center;
    font-size: 10px; line-height: 16px;
    border-radius: 50%;
    color: #fff; font-weight: 700;
  }
  .tide-event.is-high::after { content: 'H'; background: var(--ink-soft); }
  .tide-event.is-low::after  { content: 'L'; background: var(--teal-deep); }
  .tide-event.is-low.is-best::after { background: var(--coral); }
}

/* ---------- Index species circles ---------- */
/* On the homepage, the 6 species cards use a small circular photo
   above the text label, instead of the icon used elsewhere.
   The Field Guide page keeps its full-width photos via piece7.css. */
.creature-card.creature-card--circle {
  text-align: center;
  padding: 28px 22px 26px;
  display: block;       /* override the column flex from piece7 */
  overflow: visible;
}
.creature-card--circle .creature-photo {
  width: 88px; height: 88px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 1px var(--rule), 0 4px 12px rgba(31, 58, 68, 0.08);
  aspect-ratio: auto;   /* override piece7 4:3 rule */
  background: var(--paper);
  overflow: hidden;
}
.creature-card--circle .creature-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.3s ease;
}
.creature-card--circle:hover .creature-photo img {
  transform: scale(1.06);
}
.creature-card--circle h3,
.creature-card--circle .latin,
.creature-card--circle p {
  padding: 0;        /* undo piece7 padding overrides */
}
.creature-card--circle h3 {
  font-size: 1.05rem;
  margin: 0 0 4px;
}
.creature-card--circle .latin { margin-bottom: 8px; }

/* ---------- Tour-date tide badge (book.php upcoming list) ---------- */
.tide-at-meeting {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
  white-space: nowrap;
}
.tide-at-meeting.is-loading { color: var(--ink-muted); }
.tide-at-meeting.is-excellent { background: rgba(14, 107, 122, 0.10); color: #0a4f5a; border-color: rgba(14, 107, 122, 0.25); }
.tide-at-meeting.is-great     { background: rgba(29, 138, 150, 0.10); color: #14606a; border-color: rgba(29, 138, 150, 0.25); }
.tide-at-meeting.is-good      { background: rgba(74, 135, 84, 0.10);  color: #355d3c; border-color: rgba(74, 135, 84, 0.25); }
.tide-at-meeting.is-okay      { background: rgba(201, 124, 44, 0.10); color: #8e561e; border-color: rgba(201, 124, 44, 0.25); }
.tide-at-meeting.is-high      { background: rgba(185, 74, 58, 0.10);  color: #823327; border-color: rgba(185, 74, 58, 0.25); }
.tide-at-meeting.is-error     { color: var(--ink-muted); font-style: italic; font-weight: 500; }
.tide-at-meeting .star { color: var(--coral); }
