/* ==========================================================================
   Victor Harbour Whale Sighting — Whale Sighting Log page
   Figma: LP - Whale Sighting Log Page (desktop 3175:219, mobile 3175:472,
   dropdown 3315:579/3315:1450, modal 3329:6093/3329:6302)
   Mobile-first: base = 520 frame stretched fluidly, desktop at >=1024px.
   ========================================================================== */

/* --------------------------------- Hero --------------------------------- */
.vh-log-hero {
  position: relative;
  min-height: 678px;
  display: flex;
}

.vh-log-hero__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 84% 50%;
}

/* Figma: linear white->black 90deg overlay at 55% (desktop frame only) */
.vh-log-hero__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
}

.vh-log-hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 210px;
  padding-bottom: 53px;
  text-align: center;
}

.vh-log-hero__title {
  color: var(--vh-white);
  font-size: 36px;
  line-height: 1.1;
}

.vh-log-hero__intro {
  margin-top: 32px;
  color: var(--vh-white);
  font-family: var(--vh-font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 26px;
}

.vh-log-hero__br {
  display: inline;
}

.vh-log-hero__cta {
  margin-top: 48px;
  padding: 30px 40px;
}

@media (min-width: 1024px) {
  .vh-log-hero {
    min-height: 620px;
  }

  .vh-log-hero__media {
    object-position: center;
  }

  .vh-log-hero__scrim {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #000000 100%);
    opacity: 0.55;
  }

  .vh-log-hero__inner {
    align-items: flex-start;
    padding-top: 206px;
    padding-bottom: 0;
    text-align: left;
  }

  .vh-log-hero__title {
    font-size: 50px;
    line-height: 1;
  }

  .vh-log-hero__intro {
    max-width: 800px;
    margin-top: 40px;
    font-size: 20px;
    line-height: 30px;
  }

  .vh-log-hero__br {
    display: none;
  }

  /* Design pins the CTA to the hero's bottom edge */
  .vh-log-hero__cta {
    position: absolute;
    left: 80px;
    bottom: 0;
    margin-top: 0;
    padding: 40px;
  }
}

/* ------------------------------ Main layout ----------------------------- */
.vh-log-main {
  padding-top: 56px;
  padding-bottom: 56px;
}

@media (min-width: 1024px) {
  .vh-log-main {
    padding-top: 100px;
    padding-bottom: 100px;
  }

  .vh-log-layout {
    display: grid;
    grid-template-columns: 305px minmax(0, 1fr);
    column-gap: 64px;
    align-items: start;
  }
}

@media (min-width: 1280px) {
  .vh-log-layout {
    column-gap: 128px;
  }
}

/* -------------------------------- Filters ------------------------------- */
.vh-log-filters__title {
  font-size: 24px;
  line-height: 34px;
  margin-bottom: 36px;
}

@media (min-width: 1024px) {
  .vh-log-filters__title {
    margin-bottom: 40px;
  }
}

.vh-field {
  margin-bottom: 20px;
}

.vh-field__label {
  display: block;
  margin-bottom: 8px;
  color: #21272A;
  font-family: var(--vh-font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 18px;
}

/* Shared shell for the date input and the dropdown toggles (Figma "Field") */
.vh-field__box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 8px 16px;
  background: var(--vh-gray-10);
  border: 1px solid #69727D;
  border-radius: var(--vh-radius);
}

/* Field value/placeholder typography comes from the frame (Roboto per Figma;
   system fallback — webfont deliberately not bundled, see DECISIONS) */
.vh-field__input,
.vh-dropdown__value,
.vh-dropdown__option {
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  text-transform: uppercase;
  color: #21272A;
}

.vh-field__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.vh-field__input:focus {
  outline: none;
}

.vh-field__box:focus-within {
  outline: 2px solid var(--vh-black);
  outline-offset: 2px;
}

/* Invalid date entry (e.g. 31/02/2026) — extrapolated, mirrors the report
   form's inline-alert language (see DECISIONS) */
.vh-field.is-invalid .vh-field__box {
  border-color: var(--vh-error);
}

.vh-field__msg {
  margin: 6px 0 0;
  color: var(--vh-error);
  font-family: var(--vh-font-body);
  font-size: 13px;
  line-height: 18px;
}

.vh-field__input::placeholder {
  color: #697077;
  opacity: 1;
  text-transform: uppercase;
}

.vh-field__icon {
  flex: 0 0 auto;
}

/* ------------------------------- Dropdown ------------------------------- */
.vh-dropdown {
  position: relative;
}

.vh-dropdown__toggle {
  cursor: pointer;
  text-align: left;
}

.vh-dropdown__toggle:focus-visible {
  outline: 2px solid var(--vh-black);
  outline-offset: 2px;
}

.vh-dropdown__value {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.vh-dropdown__value.is-placeholder {
  color: #697077;
}

.vh-dropdown__chevron {
  flex: 0 0 auto;
  transition: transform 120ms ease;
}

.vh-dropdown.is-open .vh-dropdown__chevron {
  transform: rotate(180deg);
}

/* Open state reads as one continuous panel — no divider under the toggle */
.vh-dropdown.is-open .vh-dropdown__toggle {
  border-bottom-color: transparent;
}

/* Open panel reads as one continuous box with the toggle (no divider) */
.vh-dropdown__list {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--vh-gray-10);
  border: 1px solid #69727D;
  border-top: 0;
}

.vh-dropdown__list:focus {
  outline: none;
}

.vh-dropdown__option {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  cursor: pointer;
}

.vh-dropdown__option.is-active,
.vh-dropdown__option:hover,
.vh-dropdown__option[aria-selected="true"] {
  text-decoration: underline;
}

/* Extrapolated clear-filters affordance (hidden until a filter is active) */
.vh-log-filters__clear {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--vh-font-display);
  font-weight: 400;
  font-size: 16px;
  line-height: 26px;
  text-transform: uppercase;
  text-decoration: underline;
}

/* ------------------------------- Log panel ------------------------------ */
.vh-log {
  margin-top: 60px;
  padding: 20px 20px 44px;
  background: var(--vh-card);
  border-radius: var(--vh-radius-panel-sm);
}

@media (min-width: 1024px) {
  .vh-log {
    margin-top: 0;
    padding: 38px 40px 52px;
    border-radius: var(--vh-radius-panel);
  }
}

/* ------------------------------- Log entry ------------------------------ */
.vh-log-entry {
  display: flex;
  flex-direction: column;
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--vh-black);
}

.vh-log-entry:last-child {
  margin-bottom: 0;
}

.vh-log-entry__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
  min-width: 0;
}

.vh-log-entry__details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-self: stretch;
}

/* Species icon keeps its native 20x13 proportions (base primitive is 16px) */
.vh-meta .vh-meta__icon--species {
  width: 20px;
  height: 13px;
  margin-top: 7px;
}

.vh-log-entry__desc {
  font-family: var(--vh-font-body);
}

.vh-log-spotter {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.vh-log-spotter img {
  width: 16px;
  height: 17px;
  margin-top: 4px;
}

.vh-log-entry__media {
  position: relative;
  margin: 30px 0 0;
  height: 248px;
  border-radius: var(--vh-radius);
  overflow: hidden;
}

.vh-log-entry__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vh-log-entry__zoom {
  position: absolute;
  top: 16px;
  right: 16px;
  display: block;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.vh-log-entry__zoom:focus-visible {
  outline: 2px solid var(--vh-white);
  outline-offset: 2px;
}

@media (min-width: 1024px) {
  .vh-log-entry {
    flex-direction: row;
    gap: 20px;
  }

  .vh-log-entry__body {
    flex: 1 1 auto;
    padding-right: 20px;
  }

  .vh-log-entry__media {
    flex: 0 0 265px;
    width: 265px;
    height: 248px;
    margin: 0;
  }
}

/* ------------------------------ Empty state ----------------------------- */
.vh-log__empty {
  padding: 40px 0;
  text-align: center;
}

.vh-log__empty-text {
  margin-bottom: 20px;
}

/* ------------------------------- Pagination ------------------------------ */
.vh-log__pagination {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 40px;
  font-family: var(--vh-font-display);
  font-size: 16px;
  line-height: 26px;
  text-transform: uppercase;
}

@media (min-width: 1024px) {
  .vh-log__pagination {
    margin-top: 52px;
  }
}

.vh-log__page,
.vh-log__next {
  display: inline-flex;
  align-items: center;
  gap: 21px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 400;
  font-size: inherit;
  line-height: inherit;
  text-transform: uppercase;
  color: var(--vh-black);
}

.vh-log__page:hover,
.vh-log__next:hover .vh-log__next-label {
  text-decoration: underline;
}

.vh-log__page[aria-current="page"] {
  font-weight: 600;
  text-decoration: underline;
}

.vh-log__next-label {
  text-decoration: underline;
}

.vh-log__next[aria-disabled="true"] {
  opacity: 0.4;
  cursor: default;
}

/* -------------------------------- Modal --------------------------------- */
.vh-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.vh-modal[hidden] {
  display: none;
}

/* Restore [hidden] for the flex containers below — an author `display`
   rule beats the UA `[hidden] { display: none }`, so JS toggling `.hidden`
   on the modal chevrons / pagination would otherwise leave them rendered.
   (form.css and home.css carry the same guard for their own flex/grid nodes.) */
.vh-modal__nav[hidden],
.vh-log__pagination[hidden] {
  display: none;
}

.vh-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.vh-modal__panel {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 52px 24px 56px;
  background: #D9D9D9;
  border-radius: 8px;
}

.vh-modal__panel:focus {
  outline: none;
}

.vh-modal__x {
  position: absolute;
  top: 14px;
  right: 20px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.vh-modal__stage {
  position: relative;
}

.vh-modal__media {
  margin: 0;
  border-radius: var(--vh-radius);
  overflow: hidden;
}

.vh-modal__photo {
  display: block;
  width: 100%;
  aspect-ratio: 432 / 491;
  object-fit: cover;
}

.vh-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

/* Mobile frame: white chevrons overlaid on the photo */
.vh-modal__nav img {
  filter: brightness(0) invert(1);
}

.vh-modal__nav--prev {
  left: 7px;
}

.vh-modal__nav--next {
  right: 7px;
}

.vh-modal__nav:focus-visible {
  outline: 2px solid var(--vh-white);
  outline-offset: 2px;
}

.vh-modal__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
  margin-top: 40px;
}

.vh-modal__rule {
  align-self: stretch;
  height: 0;
  margin: 8px 0 0;
  border: 0;
  border-top: 1px solid var(--vh-black);
}

@media (min-width: 1024px) {
  .vh-modal__panel {
    width: min(1053px, 100%);
    padding: 56px 53px 56px;
  }

  /* Desktop frame shows no close X — Esc / backdrop click close instead */
  .vh-modal__x {
    display: none;
  }

  .vh-modal__photo {
    aspect-ratio: 947 / 485;
  }

  /* Black chevrons in the panel gutters, outside the photo */
  .vh-modal__nav img {
    filter: none;
  }

  .vh-modal__nav--prev {
    left: -43px;
  }

  .vh-modal__nav--next {
    right: -43px;
  }

  .vh-modal__nav:focus-visible {
    outline-color: var(--vh-black);
  }

  .vh-modal__body {
    margin-top: 44px;
  }
}

/* Scroll lock while the modal is open */
body.vh-modal-open {
  overflow: hidden;
}
