/* ============================================================================
   LAYOUT ALIGNMENT OVERRIDE  —  non-destructive
   ----------------------------------------------------------------------------
   Loaded LAST (immediately before </head>) so these rules win over the older
   inline <style> blocks. Nothing existing was deleted or rewritten.

   WHAT THIS FIXES
   1. `padding: 0 5%` + `max-width:1300px` + border-box made the real content
      width SHRINK as the viewport grew (1156px @1440 -> 1044px @2560).
      Replaced with a fixed, clamped gutter.
   2. Navbar / footer / content all sat on different horizontal edges
      (up to 310px apart at 1920px). They now share ONE column.
   3. Six different container widths (960/1080/1100/1180/1200/1300).
      All unified to --shell-max.
   4. Navbar overflowed between ~900px and ~1700px (15+ items, no wrap).
      Now shrinks progressively, then collapses to the hamburger <=1100px.
   ========================================================================= */

:root {
    --shell-max: 1300px;              /* one content column for the whole site */
    --gutter: clamp(16px, 4vw, 48px); /* fixed gutter, never scales with width  */
}

/* ---------------------------------------------------------------------------
   1. THE SHARED COLUMN
   Every page-level band and every widget now resolves to the same box:
       left edge = (100% - 1300px) / 2  +  gutter
   ------------------------------------------------------------------------ */
.section,
.page-hero,
.hero-slider-container,
.events-section,
.featured-section,
.testimonials-section,
.container,
.pkg-section,
.pf-section,
.ts-band,
.ts-band-wrap,
.bd-section,
.grt-band,
.vs-section,
.mk-wrap,
.ss-wrap,
.ss-hero,
.cp-wrap,
.wl-wrap {
    max-width: var(--shell-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: var(--gutter) !important;
    padding-right: var(--gutter) !important;
}

/* Nested widget wrapper (.ts-band inside .ts-band-wrap) must not double-pad. */
.ts-band-wrap .ts-band,
/* ---------------------------------------------------------------------------
   2. NAVBAR + FOOTER — same column, so logo/footer align with the content.
   max() collapses to the plain gutter below 1300px, so mobile is untouched.
   ------------------------------------------------------------------------ */
.navbar,
.footer {
    padding-left: max(var(--gutter), calc((100% - var(--shell-max)) / 2 + var(--gutter))) !important;
    padding-right: max(var(--gutter), calc((100% - var(--shell-max)) / 2 + var(--gutter))) !important;
}

/* Footer bottom bar keeps the same inner rhythm as the grid above it. */
.footer-bottom {
    padding-left: var(--gutter) !important;
    padding-right: var(--gutter) !important;
}

/* Keep the existing vertical rhythm untouched (horizontal-only change). */

/* ---------------------------------------------------------------------------
   3. NAVBAR OVERFLOW FIX  (the ~900px-1700px band)
   15+ nav items at gap:25px needed ~1700px but the hamburger only appeared
   at 900px. Now: shrink -> tighten -> collapse.
   ------------------------------------------------------------------------ */

/* One single horizontal line — NEVER wrap.
   `flex-wrap: wrap` here is what pushed a few tabs onto a second row.

   CRITICAL: `justify-content: flex-end` together with `overflow-x: auto` is a
   flexbox trap — when the content is wider than the box, the overflow spills
   out the LEFT/start edge, so the first tabs (Home, Services, About Us) slide
   underneath the logo and become unreachable. We therefore align from the
   START and push the whole block to the right with `margin-left: auto`
   instead. Right-alignment is visually identical, but overflow now happens on
   the right where it can actually scroll. */

/* ---------------------------------------------------------------------------
   3b. NAV TABS CENTRED  (Digital Store & the other short-nav pages)
   WHY IT LOOKED "LEFT PLACED" ON SOME PAGES
   `flex: 1 1 auto` made the <ul> grow to fill ALL remaining width while the
   items stayed `justify-content: flex-start`. On pages with few tabs
   (Digital Store, calculator, training …) every tab therefore hugged the logo
   and a large empty gap appeared on the right.

   THE FIX (purely additive, nothing removed)
   `flex: 0 1 auto` + `margin-left/right: auto` => the strip is only as wide as
   its own content and is CENTRED in the free space between the logo and the
   right edge. The safety of the original overflow fix is preserved:
     * `flex-shrink: 1` + `min-width: 0` still let the box shrink when the tabs
       are wider than the bar, and `overflow-x: auto` still scrolls them.
     * `justify-content: flex-start` is kept on purpose — with `center` and
       `overflow-x: auto` the overflow spills out BOTH edges and the first tabs
       become unreachable. Auto margins do NOT have that problem: when there is
       no free space they resolve to 0 and the strip falls back to exactly the
       old start-aligned, scrollable behaviour.
   ------------------------------------------------------------------------ */
.nav-links {
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    min-width: 0;
    flex: 0 1 auto;
    /* Centre the tab strip in the space left over by the logo. */
    margin-left: auto;
    margin-right: auto;
    /* The navbar already has `column-gap: 14px`, so no extra padding is needed
       here — symmetric padding would push the centred strip off-centre. */
    padding-left: 0;
    padding-right: 0;
    /* Safety valve: if a screen is absurdly narrow, scroll instead of wrap. */
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.nav-links::-webkit-scrollbar { display: none; }

/* Items keep their natural width and never stretch/shrink unevenly. */
.nav-links > li { flex: 0 0 auto; }

/* Never let a long label break onto two lines. */
.nav-links a,
.nav-links button,
.nav-links input,
.nav-links label {
    white-space: nowrap;
}

.logo {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* Keep a real gap between the brand block and the first tab, so "Home" can
   never butt up against (or slide under) the logo. */
.navbar { column-gap: 14px; }

/* ---------------------------------------------------------------------------
   3c. TRUE PAGE-CENTRED TABS  (wide desktop only)
   `margin-left/right: auto` alone only centres the strip in the space that is
   LEFT OVER after the logo, so the tabs still sit right of the page centre
   (measured: strip centre ~922px vs page centre 800px on a 1600px screen).

   The fix: on wide screens take the logo OUT of the flex flow (absolute) so it
   no longer pushes the strip sideways, then centre the strip in the full
   navbar width.

   WHY SYMMETRIC PADDING IS SAFE: padding is included in the centred box, so
   equal padding on both sides does NOT shift the visual centre — but it does
   reserve `--logo-clear` of empty space on each side, which stops the first
   and last tabs from ever sliding under the now-absolutely-positioned logo
   when the strip overflows.

   SAFETY / NO DESTRUCTION:
     * Desktop only (>1400px). Between 1101px-1400px and on mobile the
       previous, already-working behaviour is left completely untouched.
     * `.navbar` is `position: fixed` on every page, so it is already the
       containing block for the absolutely-positioned strip — no new
       positioning context is introduced.
     * The logo is NOT touched: it stays in normal flow, so `.navbar`'s
       `justify-content: space-between` keeps pinning it to the left.
     * `.nav-links` keeps `overflow-x: auto`, so an over-wide nav still
       scrolls (nav-scroll.js arrows) rather than overlapping the logo.
   ------------------------------------------------------------------------ */
@media (min-width: 1401px) {
    /* True centring WITHOUT a magic pixel value.

       Problem with absolute centring + a fixed `--logo-clear`: the logo width
       is variable (icon vs uploaded image, long vs short brand text), so any
       fixed reservation either wastes space or lets the first tab slide under
       the logo. Measured on index.php: strip left edge landed at x=260 while
       the logo ran to ~x=438 => real overlap.

       Instead make `.navbar` a 3-column grid:
         [ 1fr logo ][ auto strip ][ 1fr empty spacer ]

       The two 1fr columns are always EQUAL, so the centre column is centred on
       the navbar no matter how wide the logo is — it measures itself, so no
       magic number. The right spacer also guarantees the strip can never reach
       the logo, and if the strip is too wide the 1fr columns collapse to 0
       and the existing `overflow-x: auto` scrolling takes over.

       `.hamburger` is display:none above 1100px, and the "Get Started" button
       is a child of `.nav-links`, so neither needs a grid slot. */
    .navbar {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }

    .logo {
        grid-column: 1;
        justify-self: start;
        min-width: 0;
    }

    .nav-links {
        grid-column: 2;
        justify-self: center;
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    /* The 3rd column is an invisible spacer so the strip stays centred. */
    .navbar::after {
        content: "";
        grid-column: 3;
    }
}

/* TIGHTEN — laptops 1281px-1500px */
@media (max-width: 1500px) {
    .nav-links { gap: 14px; }
    .nav-links a { font-size: 14px; }
    .logo { font-size: 20px; }
}

/* TIGHTEN MORE — small laptops / large tablets 1101px-1280px */
@media (max-width: 1280px) {
    .nav-links { gap: 9px; }
    .nav-links a { font-size: 13px; }
    .nav-links .btn-primary { padding: 7px 12px !important; }
    .logo { font-size: 19px; }
    .logo img { height: 34px; }
    .theme-toggle { width: 36px; height: 36px; }
}

/* Hide the inline search box in the bar only while the bar is cramped.
   It stays visible again inside the hamburger menu on small screens. */
/* COLLAPSE — tablets & small laptops (<=1100px).
   Mirrors the original 900px rules so behaviour is identical, just earlier. */
@media (max-width: 1100px) {
    .hamburger { display: flex !important; margin-left: auto; }

    .nav-links {
        display: none !important;
        flex-direction: column;
        align-items: stretch;
        flex: 0 0 auto;
        /* Reset desktop centring (auto left+right margins) + padding for the
           vertical dropdown, so the mobile menu is byte-for-byte as before. */
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: auto;
        order: 0;
        margin-top: 0;
        padding: 10px var(--gutter) 18px;
        gap: 0;
        /* Vertical dropdown: no horizontal scroll, items may wrap back normally. */
        overflow-x: hidden;
        overflow-y: auto;
        max-height: calc(100vh - 80px);
        -webkit-overflow-scrolling: touch;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
    }

    /* In the dropdown, labels are allowed to wrap again. */
    .nav-links > li { flex: 0 0 auto; }

    .nav-links.show { display: flex !important; }

    .nav-links li { width: 100%; }
    .nav-links form { display: flex !important; width: 100%; margin-top: 8px; }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 12px 0;
        font-size: 15px;
        border-bottom: 1px solid var(--border);
    }

    /* Login button must not stretch full-width like a text row. */
    .nav-links a.btn-primary,
    .nav-links .btn-primary {
        display: inline-block;
        width: auto;
        margin-top: 12px;
        text-align: center;
    }

    .nav-links .theme-toggle,
    .nav-links .theme-toggle-item { margin-top: 12px; }
}

/* ---------------------------------------------------------------------------
   3c-bis. BRAND LOGO — ALWAYS PINNED TO THE HEADER LEFT
   The uploaded logo (Admin -> Settings -> Brand Logo) must sit at the top-left
   of the navbar on EVERY page and at EVERY viewport width, while the nav tabs
   stay centred in the free space. This block makes that explicit rather than
   relying on `justify-content: space-between` alone, which can let the centred
   tab strip push the brand block away from the edge.

   WHY EACH DECLARATION IS NEEDED
     position/z-index : the logo must never slide under the centred strip.
     flex-shrink: 0    : the brand must never be squeezed to a sliver.
     max-width        : the image cannot widen the bar and shove the tabs out.
     margin-right:auto: reserves the free space the centred strip lives in.

   NO DESTRUCTION: purely additive overrides; no existing rule was removed.

   SCOPE: every selector is scoped to `.navbar .logo` on purpose. The same
   `class="logo"` is reused by the FOOTER brand column, and an unscoped
   `max-width: 46%` / `margin-right: auto` there would squash the footer mark.
   ------------------------------------------------------------------------ */
.navbar .logo {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 46%;
    margin-right: auto;
    /* CRITICAL: several pages (index.php, about.php) set `.logo {
       overflow: hidden; min-width: 0 }` for TEXT truncation. On an <img>
       child that clips the artwork away and the logo looks deleted.
       `visible` restores the picture while leaving text truncation intact
       on any brand that still falls back to text. */
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

/* The uploaded image must scale down gracefully, never overflow the bar. */
.navbar .logo img {
    height: 40px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    /* The .logo gradient/text-fill rule would otherwise hide the artwork. */
    -webkit-text-fill-color: initial;
    background: none;
}

/* Above 1400px the navbar becomes a 3-column grid; re-assert left placement
   there too so the grid + auto-margin combination cannot re-centre it. */
@media (min-width: 1401px) {
    .navbar .logo {
        grid-column: 1;
        justify-self: start;
        margin-right: 0;
        max-width: 100%;
    }
}

/* On mobile the bar is tight: keep the logo modest but still left-aligned. */
@media (max-width: 1100px) {
    .navbar .logo { max-width: 65%; margin-right: auto; }
    .navbar .logo img { height: 32px; }
}
@media (max-width: 600px) {
    .navbar .logo { max-width: 60%; }
    .navbar .logo img { height: 28px; }
}

/* ---------------------------------------------------------------------------
   3c-ter. AUTH PAGES — logo CENTRED in the form card
   login.php / register.php / forgot-password.php / reset-password.php all place
   `<a class="logo">` as the first child of `.auth-card`. Those pages already ask
   for `justify-content: center`, but a block-level flex box can still sit left
   when the card's own alignment differs, so the centring is pinned explicitly:

     width: fit-content  -> shrink-wrap the logo instead of filling the card
     margin-inline auto -> centre that box horizontally
     justify-content    -> centre the icon+image INSIDE the box

   Scoped to `.auth-card` so the header/navbar logo is never affected.
   ------------------------------------------------------------------------ */
.auth-card > .logo,
.auth-card .logo {
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.auth-card .logo img {
    height: 42px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    -webkit-text-fill-color: initial;
    background: none;
}

/* ---------------------------------------------------------------------------
   3c-quater. NAV TABS MUST NEVER SLIDE UNDER THE LOGO
   `.nav-links` is a horizontally scrollable box that is centred in the free
   space beside the logo. On a wide desktop the strip is wider than that free
   space, so it scrolls — and without protection its first/last tabs slide
   *underneath* the brand mark, which looks like a rendering bug.

   THE REAL CAUSE OF "TABS BEHIND THE LOGO"
   Above 1400px the navbar is a 3-column grid `[1fr logo][auto strip][1fr]`.
   When the tab strip is wider than the free space, BOTH 1fr columns collapse to
   ZERO width. The logo's artwork (≈160px) then overflows its zero-width column
   while the strip, now starting at x=0, renders behind/over it. That is exactly
   the reported symptom.

   THE FIX (geometric, so nothing is faked with a background chip):
     1. `min-width: min-content` on the logo stops its grid column collapsing,
        so the strip can never start underneath the brand mark.
     2. The strip keeps `overflow-x: auto` (it clips its own content), so it
        scrolls INSIDE its column instead of spilling over the logo.
     3. Strip padding clears both 32px scroll arrows.
     4. Arrows get a z-index above the logo so they stay clickable.
   ------------------------------------------------------------------------ */

/* Keep the strip clear of both 32px scroll arrows. */
.navbar .nav-links {
    padding-left: 10px;
    padding-right: 10px;
}

@media (min-width: 1401px) {
    /* THE key fix: the brand column keeps its natural width, so it can never
       collapse to 0 and let the centred strip slide underneath it. */
    .navbar .logo {
        min-width: min-content;
        max-width: 100%;
    }
}

/* The fade mask must not eat into the logo/arrow clearance. */
@media (min-width: 1101px) {
    .navbar.has-nav-scroll .nav-links {
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
    }
}

/* Arrows stay clickable and are never covered by the brand block. */
.navbar .nav-scroll-btn {
    z-index: 6;
}

/* ---------------------------------------------------------------------------
   4. FLUID TYPE — headings no longer jump at a single hard breakpoint.
   ------------------------------------------------------------------------ */
.section-title,
.page-hero h1 {
    font-size: clamp(22px, 3.4vw, 32px) !important;
    line-height: 1.25;
    overflow-wrap: break-word;
}

.main-headline h1 { font-size: clamp(26px, 4vw, 42px); line-height: 1.2; }

/* ---------------------------------------------------------------------------
   5. GENERIC RESPONSIVE SAFETY NET
   For the ~22 public pages that ship with zero @media rules.
   ------------------------------------------------------------------------ */
img { max-width: 100%; }

/* Long unbroken strings (URLs, emails, order ids) must never widen the page. */
body, p, h1, h2, h3, h4, td, th, li, a, span, div {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 900px) {
    .section { padding-top: 56px !important; padding-bottom: 56px !important; }
    .footer-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; }
}

@media (max-width: 768px) {
    /* Tables scroll inside their own box rather than widening the page. */
    table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .footer-bottom { flex-direction: column; text-align: center; gap: 10px; }
}

@media (max-width: 600px) {
    .section { padding-top: 44px !important; padding-bottom: 44px !important; }
    .card { padding: 18px !important; }
}
/* Hide the inline search box only in the desktop bar while it is genuinely
   cramped (1101px-1300px). It is NEVER hidden inside the <=1100px hamburger
   dropdown — Search stays reachable there. */
@media (min-width: 1101px) and (max-width: 1300px) {
    .nav-links form { display: none !important; }
}
.ts-band-wrap .pf-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
}

/* ---------------------------------------------------------------------------
   6. NAV HORIZONTAL SCROLL ARROWS  (desktop only, >=1101px)
   ---------------------------------------------------------------------------
   Brand-gradient arrows that let desktop visitors reach nav tabs beyond the
   right edge. Buttons are created at runtime by assets/js/nav-scroll.js.

   SAFETY:
   - Desktop only. Below 1100px the hamburger menu is untouched.
   - Purely additive: nothing here changes the navbar's layout or the links.
   - `.is-hidden` (set by JS at either end) keeps the bar clean when there is
     nothing to scroll to, so wide screens look exactly as before.
   - Pointer-events are off unless JS marks the navbar `.has-nav-scroll`, so an
     un-upgraded page can never have an invisible arrow swallowing clicks.
   ------------------------------------------------------------------------ */
.nav-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 4px 14px var(--primary-glow);
    opacity: .95;
    pointer-events: none;      /* inert until JS confirms it is scrollable */
    transition: opacity .25s ease, transform .25s ease, box-shadow .25s ease;
}

.navbar.has-nav-scroll .nav-scroll-btn { pointer-events: auto; }

.nav-scroll-btn:hover:not(:disabled) {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.nav-scroll-btn:active:not(:disabled) {
    transform: translateY(-50%) scale(.94);
}

/* Focus ring for keyboard users only. */
.nav-scroll-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* At either end of the strip the arrow is removed, not just greyed out. */
.nav-scroll-btn.is-hidden,
.nav-scroll-btn:disabled {
    display: none;
}

/* Only materialise the arrows on real desktop widths. */
@media (min-width: 1101px) {
    .nav-scroll-btn { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
    .nav-scroll-btn { transition: none; }
    .nav-scroll-btn:hover:not(:disabled),
    .nav-scroll-btn:active:not(:disabled) { transform: translateY(-50%); }
}

/* Soft fade on the strip edges so it reads as scrollable when it overflows. */
@media (min-width: 1101px) {
    .navbar.has-nav-scroll .nav-links {
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
    }
}