/* EVENTIDE SAFARIS — responsive site-wide layout + mega-menu correction
   Loaded after both the original layout and Stage 4 page styles.
   The site sections use 80% on desktops, widening progressively on smaller
   screens. The full-bleed hero media and full-width white header are retained.
   No visual frames, shadows or borders are introduced around the logo. */
:root {
  --ev-content-width: 80%;
  --ev-grid-gap: clamp(15px, 1.5vw, 23px);
  --ev-site-navy: #102A43;
  --ev-site-gold: #C8943E;
}
html, body { max-width: 100%; }
body { overflow-x: clip; }

/* One consistent width across homepage, page headers, listings, detail pages,
   destination pages, travel guides, accommodation and footer content. */
.shell, .tc-front-shell,
.eventide-section.shell,
.eventide-detail-grid.shell,
.ev-landing-layout.shell {
  width: var(--ev-content-width) !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
/* Hero image/video remains edge to edge; only the text/search align to shell. */
.tc-hero { width: 100% !important; max-width: none !important; }
.tc-hero .tc-hero-content {
  width: var(--ev-content-width) !important;
  max-width: none !important;
}

/* Keep typography and grid content from overflowing their columns. */
.eventide-main, .eventide-section, .eventide-article,
.ev-landing-article, .eventide-detail-grid, .ev-landing-layout { min-width: 0; }
.eventide-main img, .eventide-article img, .ev-landing-article img { max-width: 100%; }

/* Landing content and sidebar share the 80% site shell. */
.ev-landing-layout,
.eventide-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(265px, 300px) !important;
  column-gap: clamp(28px, 3.2vw, 54px) !important;
  align-items: start !important;
}
.ev-landing-article, .eventide-article { min-width: 0; width: 100%; }
.ev-landing-aside, .eventide-detail-aside {
  align-self: start;
  min-width: 0;
  top: 116px;
}

/* Cards fit the ACTUAL available column width, not a hard-coded 4 columns.
   At common desktop sizes the main column supports 2–3 readable cards;
   a full-width listing can show four without squeezing headings. */
.eventide-card-grid,
.ev-landing-layout .eventide-card-grid,
.ev-content-page .ev-detail-section .eventide-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 294px), 1fr)) !important;
  gap: var(--ev-grid-gap) !important;
  align-items: stretch;
}
.eventide-card { min-width: 0; height: 100%; }
.eventide-card-image,
.ev-content-page .ev-detail-section .eventide-card-image {
  width: 100%;
  height: auto !important;
  aspect-ratio: 16 / 10;
  min-height: 0;
  overflow: hidden;
}
.eventide-card-image img { width: 100%; height: 100%; object-fit: cover; }
.eventide-card-body { min-width: 0; padding: clamp(16px, 1.5vw, 22px); }
.eventide-card-body h3,
.ev-content-page .ev-detail-section .eventide-card h3 {
  font-size: clamp(19px, 1.6vw, 23px);
  line-height: 1.35;
  overflow-wrap: break-word;
}
.eventide-card-body p {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.7;
}
/* Landing-page secondary links and discovery cards adapt as space shrinks. */
.ev-link-collection { grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); }
.ev-discovery-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); }
.eventide-footer-inner { grid-template-columns: 1.55fr 1fr 1fr 1.2fr; min-width: 0; }
.eventide-footer-inner > * { min-width: 0; }

/* The header is full-bleed by design. Its balanced inner row is deliberately
   wider than 80% so the large borderless logo and navigation both fit. */
.eventide-header,
.eventide-header.is-floating {
  width: 100% !important;
  max-width: none !important;
  overflow: visible !important;
}
.eventide-header .eventide-header-inner,
.eventide-header.is-floating .eventide-header-inner {
  width: min(94%, 1680px) !important;
  max-width: 1680px !important;
}
.eventide-header .eventide-logo,
.eventide-header .eventide-logo img {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
.eventide-header .eventide-menu-button { color: var(--ev-site-navy); cursor: pointer; }
.eventide-header .eventide-menu-group[open] > .eventide-mega-panel { display: block; }

/* Earlier CSS switched at 1200 or 1340px; a large logo needs a 1500px
   threshold for reliable wrapping on 125%-zoom displays and small laptops. */
@media (max-width: 1500px) {
  .eventide-header .eventide-menu-button,
  .eventide-header.is-floating .eventide-menu-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    margin-left: auto;
    border: 0;
    background: transparent;
    font-size: 27px;
  }
  .eventide-header .eventide-nav,
  .eventide-header.is-floating .eventide-nav {
    display: none !important;
    position: absolute !important;
    z-index: 1200 !important;
    top: 100% !important;
    left: 50% !important;
    right: auto !important;
    width: 100vw !important;
    min-width: 0 !important;
    transform: translateX(-50%) !important;
    max-height: calc(100dvh - 100px);
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 18px max(5vw, 18px) 30px !important;
    background: #fff !important;
    box-shadow: 0 20px 28px rgba(16,42,67,.17) !important;
    border: 0 !important;
    border-radius: 0 !important;
  }
  .eventide-header .eventide-nav.is-open,
  .eventide-header.is-floating .eventide-nav.is-open { display: flex !important; }
  .eventide-header .eventide-nav > *,
  .eventide-header .eventide-menu-group { width: 100%; }
  .eventide-header .eventide-menu-group > summary,
  .eventide-header .eventide-nav > .eventide-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 15px 5px !important;
    border-bottom: 1px solid #e9edf0;
    white-space: normal;
  }
  .eventide-header .eventide-menu-group > summary { cursor: pointer; }
  .eventide-header .eventide-menu-group[open] > summary { color: #996b21; }
  .eventide-header .eventide-nav .eventide-nav-cta {
    justify-content: center;
    min-height: 50px;
    margin-top: 14px;
    white-space: normal;
  }
  /* Native <details> expands vertically INSIDE the open mobile panel. */
  .eventide-header .eventide-mega-panel {
    display: block;
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 13px 10px 20px !important;
    overflow: visible !important;
    background: #fbfaf7 !important;
    box-shadow: none !important;
    border: 0 !important;
  }
  .eventide-mega-grid,
  .eventide-mega-grid-destinations,
  .eventide-mega-grid-experiences {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 22px;
  }
  .eventide-mega-feature { grid-column: 1 / -1; min-height: 0; }
  .eventide-header .eventide-mega-column a {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
@media (min-width: 1501px) {
  .eventide-header .eventide-menu-button { display: none !important; }
  .eventide-header .eventide-nav,
  .eventide-header.is-floating .eventide-nav {
    display: flex !important;
    position: static !important;
    transform: none !important;
  }
}

@media (max-width: 1250px) {
  :root { --ev-content-width: 88%; }
  .eventide-footer-inner { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 1050px) {
  .ev-landing-layout,
  .eventide-detail-grid { grid-template-columns: minmax(0,1fr) !important; }
  .ev-landing-aside, .eventide-detail-aside { position: static !important; top: auto; }
}
@media (max-width: 900px) {
  :root { --ev-content-width: 92%; }
  .eventide-header .eventide-nav,
  .eventide-header.is-floating .eventide-nav { max-height: calc(100dvh - 80px); }
  .eventide-mega-grid,
  .eventide-mega-grid-destinations,
  .eventide-mega-grid-experiences { grid-template-columns: 1fr !important; gap: 15px !important; }
  .ev-link-collection, .ev-topic-links { grid-template-columns: 1fr; }
  .eventide-card-grid,
  .ev-landing-layout .eventide-card-grid,
  .ev-content-page .ev-detail-section .eventide-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)) !important;
  }
}
@media (max-width: 520px) {
  :root { --ev-content-width: 94%; }
  .eventide-card-grid,
  .ev-landing-layout .eventide-card-grid,
  .ev-content-page .ev-detail-section .eventide-card-grid { grid-template-columns: 1fr !important; }
  .eventide-filter { flex-direction: column; align-items: stretch; }
  .eventide-footer-inner { grid-template-columns: 1fr; }
  .eventide-header .eventide-nav,
  .eventide-header.is-floating .eventide-nav { max-height: calc(100dvh - 74px); }
}
@media (prefers-reduced-motion: reduce) {
  .eventide-header, .eventide-header.is-floating { transition: none !important; }
}
