body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* brightness(1.1) is baked into these files */
  background-image: url("../images/board_background-2304.a1c955139f24.jpg");
  background-image: image-set(url("../images/board_background-2304.75cb12b5badd.webp") type("image/webp"), url("../images/board_background-2304.a1c955139f24.jpg") type("image/jpeg"));
  background-size: cover;
  background-position: center;
  z-index: -1;
}

/* Phones in portrait only ever see a narrow centre strip of the boards */
@media (max-width: 767.98px) and (orientation: portrait) {
  body::before {
    background-image: url("../images/board_background-mobile.387b6908b5b9.jpg");
    background-image: image-set(url("../images/board_background-mobile.6e4d96fc1dc2.webp") type("image/webp"), url("../images/board_background-mobile.387b6908b5b9.jpg") type("image/jpeg"));
  }
}

.content {
  padding: 1rem;
  margin: 0.5rem;
  background-color: rgba(50, 50, 50, 0.9);
  border-radius: 15px;
}

/* base.css loads after Bootstrap: keep .container centred with its own gutters */
.container.content {
  margin-inline: auto;
  padding-inline: calc(var(--bs-gutter-x) * 0.5);
}

/* MARK: Skip link */
.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2000;
  padding: 0.5rem 1rem;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-radius: 0.5rem;
}

main:focus {
  outline: none;
}

/* MARK: Header
   One sticky element. On lg+ the brand row (height --brand-h) scrolls away
   and the nav + tree band stay pinned. The banner covers the whole header. */
.site-header {
  --brand-h: clamp(140px, 13.5vw, 200px);
  position: sticky;
  top: 0;
  z-index: 1020;
  isolation: isolate;
}

/* Keep the open offcanvas above Bootstrap's backdrop (z 1040), which lives on <body> */
.site-header:has(.offcanvas.show, .offcanvas.showing, .offcanvas.hiding) {
  z-index: 1045;
}

.site-banner {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  pointer-events: none;
}

.site-banner-band {
  height: 1.5rem;
}

.site-brand {
  height: var(--brand-h);
  padding: 0.5rem 1.25rem 0;
}

.site-brand-link {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  height: 100%;
}

/* Let the images size against the fixed-height link, not the <picture> wrapper */
.site-brand-link > picture {
  display: contents;
}

.site-brand-logo {
  width: auto;
  height: 100%;
}

.site-brand-name {
  width: auto;
  height: 75%;
  max-width: 55vw;
  object-fit: contain;
  object-position: left top;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.25rem;
}

.navbar-brand-logo {
  width: auto;
  height: 44px;
}

.navbar-brand-name {
  width: auto;
  height: 28px;
}

.site-header .navbar-toggler {
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.site-nav .nav-link {
  font-size: 1.25rem;
}

.external-icon {
  width: 0.7em;
  height: 0.7em;
  vertical-align: 0.1em;
}

.account-icon {
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.2em;
}

@media (min-width: 992px) {
  .site-header {
    top: calc(-1 * var(--brand-h));
  }

  .site-banner-band {
    height: 75px;
  }

  .site-nav .nav-link {
    font-size: 1.5rem;
  }

  /* Links centred on the page; account menu at the right edge */
  /* Must out-rank Bootstrap's .navbar-expand-lg .offcanvas .offcanvas-body */
  .site-header .navbar-expand-lg .offcanvas .offcanvas-body {
    display: grid;
    flex-grow: 1;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .site-header .offcanvas-body > .site-nav:first-child {
    grid-column: 2;
  }

  .site-nav-account {
    grid-column: 3;
    justify-self: end;
  }
}

/* MARK: Plan your stay subnav
   Phones: one horizontally scrollable strip. md+: vertical panel. */
.plan-nav {
  margin: 0.5rem 0;
}

.plan-nav-title {
  display: none;
}

.plan-nav-list {
  position: relative; /* offsetParent for the active-pill scroll script */
  flex-wrap: nowrap;
  gap: 0.25rem;
  padding: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  background-color: rgba(50, 50, 50, 0.9);
  border-radius: 15px;
}

.plan-nav-list .nav-link {
  white-space: nowrap;
}

.plan-nav-list .nav-link:not(.active) {
  color: var(--bs-body-color);
}

@media (min-width: 768px) {
  .plan-nav {
    padding: 1rem;
    background-color: rgba(50, 50, 50, 0.9);
    border-radius: 15px;
  }

  .plan-nav-title {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-align: center;
  }

  .plan-nav-list {
    flex-direction: column;
    padding: 0;
    overflow: visible;
    background: none;
  }

  .plan-nav-list .nav-link {
    white-space: normal;
    text-align: center;
  }
}

/* MARK: Footer */
.site-footer {
  margin-top: 2rem;
  padding-bottom: 1rem;
}

/* MARK: Page content (Phase 4) */
.page-section + .page-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--bs-border-color);
}

.page-section > :last-child {
  margin-bottom: 0;
}

.page-section > .table-responsive:last-child > .table,
.page-section > .schedule-list:last-child > :nth-last-child(-n + 2) {
  margin-bottom: 0;
}

/* Rules lists: transparent rows on the panel, like the old borderless tables */
.rules-list {
  --bs-list-group-bg: transparent;
}

.rules-list .list-group-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.schedule-list {
  max-width: 32rem;
}

.schedule-list dd {
  text-align: end;
}

@media (min-width: 576px) {
  .schedule-list dd {
    text-align: start;
  }
}

/* F.A.Q. accordion sits on the dark panel */
.accordion {
  --bs-accordion-bg: transparent;
}

.accordion-button {
  font-size: 1.15rem;
}

/* Rates: proper table on md+, stacked cards on phones
   (name + price, then unit, then description) */
@media (max-width: 767.98px) {
  .rate-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .rate-table,
  .rate-table tbody {
    display: block;
  }

  .rate-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 0.75rem;
    border-bottom: 1px solid var(--bs-border-color);
  }

  .rate-table tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.05);
  }

  .rate-table > tbody > tr > td {
    display: block;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .rate-table .rate-name,
  .rate-table .rate-price {
    font-weight: 600;
  }

  .rate-table .rate-price {
    padding-left: 1rem;
    text-align: end;
  }

  .rate-table .rate-unit {
    grid-column: 1 / -1;
    color: var(--bs-secondary-color);
  }

  .rate-table .rate-desc {
    grid-column: 1 / -1;
    margin-top: 0.25rem;
  }
}

/* MARK: Account pages (Phase 6) */
.auth-panel {
  max-width: 34rem;
}

/* Reservation status bars (camper_reservations). Class = status-<status|slugify> */
.reservation-status {
  color: #000;
}

.status-inquiry,
.status-submitted {
  background-color: #d3d3d3;
}

.status-pending {
  background-color: #f1c40f;
}

.status-card-submitted {
  background-color: #7fb3d5;
}

.status-confirmed {
  background-color: #2ecc71;
}

.status-denied {
  background-color: #e74c3c;
}

.status-cancelled-request {
  background-color: #f0b27a;
}

.status-cancelled {
  background-color: #95a5a6;
}

/* MARK: Accessibility (Phase 7) */

/* A focus ring that stays visible over the banner and wood background */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible,
.nav-link:focus-visible,
.btn:focus-visible,
.accordion-button:focus-visible,
.btn-close:focus-visible {
  outline: 3px solid #ffc107;
  outline-offset: 2px;
  box-shadow: none;
}

/* Header nav sits on a pale image: brighter links plus a shadow for legibility.
   The current page is shown in the logo orange (aria-current marks it for screen readers). */
.site-header .site-nav .nav-link {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.site-header .site-nav .nav-link:hover {
  color: #fff;
}

/* Current page: the logo's orange (sampled from logo_name.png), with a matching
   underline so it is not marked by colour alone */
.site-header .site-nav .nav-link.active,
.site-header .site-nav .nav-link.active:hover {
  color: #db8a4b;
  text-decoration: underline;
  text-decoration-color: #db8a4b;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

/* Inside the open offcanvas (dark panel) no shadow is needed */
.site-header .offcanvas.show .site-nav .nav-link,
.site-header .offcanvas.showing .site-nav .nav-link {
  text-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
