/* Small site-specific fixes on top of the Popular theme (loaded via SITE.customCSS). */

/* The theme's link colour (dark green here) is unreadable on the dark footer bar. */
.g-footer__bottom a { color: var(--ink-300); }
.g-footer__bottom a:hover { color: var(--white); }

/* Imported WordPress tables (cave timetable and price list). */
.g-prose table { border-collapse: collapse; margin: var(--space-4) 0; }
.g-prose td { padding: 0.4rem 1rem 0.4rem 0; border-bottom: 1px solid var(--border-subtle); }

/* ---------- Content pages (src/pages/[...path].astro) ---------- */

/* Text column + side column (pages of the same section, photos). */
.page { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: var(--space-6); align-items: start; }
.page--wide { grid-template-columns: minmax(0, 1fr); }
.page__aside { position: sticky; top: 5.5rem; display: grid; gap: var(--space-4); }
@media (max-width: 960px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .page__aside { position: static; }
}

/* The first paragraph of a text page reads as its lead. */
.page__body > p:first-child { font-size: var(--text-lg); line-height: var(--leading-normal); color: var(--text-strong); }
.page__body > h2 { margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
.page__body > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* Information card (side column, cave timetable). */
.info-card {
  padding: 1.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-slow) var(--ease-out), translate var(--duration-slow) var(--ease-out);
}
.info-card:hover { box-shadow: var(--shadow-md); translate: 0 -2px; }
.info-card--accent { background: var(--surface-wash-soft); border-color: var(--gold-100); }
.g-prose .info-card h2, .info-card h2, .info-card h3 {
  display: flex; gap: 0.6rem; align-items: center;
  margin: 0 0 0.75rem; padding: 0; border: 0;
  font-size: var(--text-lg); color: var(--text-strong);
}
.g-prose .info-card h2 i, .info-card h2 i, .info-card h3 i { color: var(--color-primary); font-size: 1rem; }
.info-card p { margin: 0 0 1rem; }
.info-card p:last-child { margin-bottom: 0; }

.side-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.1rem; font-size: var(--text-sm); }
.side-nav a { display: block; padding: 0.45rem 0.6rem; border-radius: var(--radius-md, 0.5rem); color: var(--text-body); text-decoration: none; }
.side-nav a:hover { background: var(--gold-50); color: var(--color-primary-active); }

.side-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-bottom: 0.9rem; }
.side-photos img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); display: block; transition: scale var(--duration-slow) var(--ease-out); }
.side-photos a { overflow: hidden; border-radius: var(--radius-lg); }
.side-photos a:hover img { scale: 1.06; }

/* Photos zoom slightly on hover everywhere. */
.g-gallery__item a { display: block; overflow: hidden; border-radius: var(--radius-lg); }
.g-gallery__item img { transition: scale var(--duration-slow) var(--ease-out); }
.g-gallery__item a:hover img { scale: 1.06; }

/* Cards, photos and info cards rise in as they scroll into view (browsers with scroll-driven animations;
   elsewhere everything is simply visible). Uses `translate` so it never fights the theme's hover transform. */
@keyframes rise-in { from { opacity: 0; translate: 0 1.25rem; } to { opacity: 1; translate: 0 0; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .g-card, .g-gallery__item, .info-card {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}
