/* =====================================================================
   Piece 7 — Field Guide photos + Tide chart styles
   Loaded AFTER site.css so it can adjust earlier rules.
   ===================================================================== */

/* ---------- Creature card with real photo ---------- */
/* The card itself becomes a flex column so the photo sits at the top
   edge-to-edge and the text below has consistent padding. We undo the
   parent .creature-card padding and add it back to the inner content. */
.creature-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.creature-photo {
  width: 100%;
  aspect-ratio: 4 / 3;        /* uniform height regardless of source crop */
  overflow: hidden;
  background: var(--paper);   /* shows while image is loading */
  border-bottom: 1px solid var(--rule);
}
.creature-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;          /* crop to fill, no squish */
  object-position: center;
  display: block;
  transition: transform 0.4s ease;
}
.creature-card:hover .creature-photo img {
  transform: scale(1.04);     /* tasteful zoom on hover */
}
/* Inner padding for the text below the photo */
.creature-card > h3,
.creature-card > .latin,
.creature-card > p {
  padding-left: 20px;
  padding-right: 20px;
}
.creature-card > h3 { padding-top: 16px; }
.creature-card > p  { padding-bottom: 22px; }

/* Hide the old icon if any old card still uses it */
.creature-icon { display: none; }

/* ---------- Tide chart (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; }

.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); }

.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; }

/* Date column */
.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);   /* faint gold for today */
}
.tide-row.is-today .tide-day .weekday { color: var(--coral-deep); }
.tide-row.is-today .tide-day::after {
  content: 'today';
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--coral-deep);
  margin-top: 2px;
}

/* Each tide event cell */
.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;
}

/* Footer note under the table */
.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; }

/* ---------- Tide chart on mobile ---------- */
@media (max-width: 720px) {
  .tide-table thead { display: none; }   /* labels would be too tight */
  .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;
  }
  /* Each event labels itself with H/L */
  .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;
    vertical-align: 0;
  }
  .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); }
}
