/* =========================================================================
   VOYARA GLOBAL CHROME OVERLAY  (loaded after the T4 optimize bundle)
   Fixes base-T4 structural leaks around the header→content and content→footer
   seams that appear on every page (pricing is representative):
     - the off-canvas header wrapper AND the header block BOTH draw a 1px
       bottom border → a doubled/thick divider under the header;
     - the breadcrumb band adds its own #E9ECEF (Bootstrap default) top border
       → a 3rd stacked line + a cream sliver between = "2 borders, rất dày";
     - .t4-main-body carries 48px block padding → an empty cream strip between
       the last full-bleed band (e.g. teal CTA) and the footer (and a redundant
       gap above the first band). Sections own their vertical rhythm.
   Loaded on every page via index.php addCustomTag.
   ========================================================================= */

/* Single clean header divider: keep the visible header-block's bottom border,
   drop the duplicate on the off-canvas wrapper. */
.t4-off-canvas-header,
.t4-off-canvas-header.voy-oc-header { border-bottom: 0 !important; }

/* The T4 base forces the (transparent) .t4-header SECTION to 80px, but the real
   painted bar (.voy-header, min-height 76 + 1px border = 77px) is shorter — so a
   ~3px strip of the transparent section shows the page bg as a thin line between
   the header's bottom border and the hero/first section. Collapse the section to
   its content so the header bar sits flush with the content below. */
.t4-section.t4-header { min-height: 0 !important; height: auto !important; }

/* Breadcrumb band shares the page bg and sits right under the header — no own
   top border (the header already provides the divider). */
.t4-breadcrumbs,
.t4-section.t4-breadcrumbs { border-top: 0 !important; }

/* Remove the empty cream strip the T4 default 48px main-body padding leaves
   between the last full-bleed section and the footer (and above the first one).
   All masthead/ACM sections carry their own vertical padding. */
.t4-main-body { padding-top: 0 !important; padding-bottom: 0 !important; }

/* On canvas (full-bleed) marketing pages the article-prose wrapper's 16px
   bottom margin now shows as a sliver between the last band (e.g. teal CTA) and
   the footer. Zero it for canvas pages only (single articles keep their margin). */
.voy-article-prose:has(.voy-canvas-page) { margin-bottom: 0 !important; }

/* =========================================================================
   OFF-CANVAS DRILLDOWN — parent-level bleed-through fix
   When you drill into a submenu, T4 translates the menu container by
   translateX(-level*100%) (= the nav's own width). But the drawer body's
   .module-inner adds a 32px horizontal gutter, so the parent level's right
   edge only reaches x≈93 while the drawer is visible from x≈61 — the parent
   rows' rightmost 32px (their drill chevrons) peek through the left gutter.
   The sliver sits INSIDE the visible drawer, so overflow-clipping can't hide
   it and the translate can't be increased (JS-inline). Instead: any menu
   level the user has drilled PAST (it has a direct-child submenu currently
   open — T4 marks it with inline `display:block`) hides its own rows; the
   open submenu is a deeper level and is re-shown. Generalises to every depth.
   Requires :has()/[style] (all evergreen browsers); degrades to prior look. */
.voy-offcanvas .t4-off-canvas-body ul:has(> li > ul.dropdown-menu[style*="display: block"]) > li {
  visibility: hidden;
}
.voy-offcanvas .t4-off-canvas-body ul:has(> li > ul.dropdown-menu[style*="display: block"]) > li > ul.dropdown-menu[style*="display: block"] {
  visibility: visible;
}

/* =========================================================================
   NAV DROPDOWN CARET — dark-mode / transparent-header visibility
   The caret triangle is drawn by `.item-caret::before { border-top: 4px solid
   #212529 }` — a hard-coded dark literal that never flips. Wherever the nav
   text goes light (dark mode, and the transparent header over the hero) the
   caret stays dark and disappears. Bind it to currentColor so it always tracks
   the link text colour. One rule fixes every light-text context. */
.t4-megamenu .navbar-nav > li > a .item-caret::before,
.t4-megamenu .navbar-nav > li > .nav-link .item-caret::before {
  border-top-color: currentColor;
}

/* =========================================================================
   GLOBAL PAGINATION — match the blog's pill pagination on every view
   Search, archive, tag, author, category-list etc. render Joomla's default
   Bootstrap pagination (white boxes, blue active, blue links) which clashes
   with the design. Style ul.pagination inside the main content to the same
   pill look the blog uses (.voy-blog-pagination): 42px rounded pills, surface
   bg + border, terracotta active, terracotta hover. Blog keeps its own (more
   specific) identical rules, so nothing regresses there. */
#t4-main-body ul.pagination,
#t4-main-body .pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}
#t4-main-body ul.pagination li a,
#t4-main-body ul.pagination li span,
#t4-main-body .pagination .page-item .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--voy-border);
  border-radius: var(--voy-r-sm, 10px);
  background: var(--voy-surface);
  color: var(--voy-text);
  font-family: var(--voy-font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
#t4-main-body ul.pagination li.active a,
#t4-main-body ul.pagination li.active span,
#t4-main-body .pagination .page-item.active .page-link {
  background: var(--voy-primary);
  border-color: var(--voy-primary);
  color: var(--voy-on-primary, #fff);
}
#t4-main-body ul.pagination li a:hover,
#t4-main-body .pagination .page-item .page-link:hover:not(.active) {
  border-color: var(--voy-primary);
  color: var(--voy-primary);
}
/* disabled / non-link boundary arrows: muted, non-interactive */
#t4-main-body ul.pagination li.disabled span,
#t4-main-body .pagination .page-item.disabled .page-link {
  opacity: .45;
  color: var(--voy-muted);
}
/* results counter beside the pager reads as muted meta */
#t4-main-body .voy-search-pagination .counter,
#t4-main-body .pagination-info,
#t4-main-body .counter { color: var(--voy-muted); font-size: 14px; }

/* =========================================================================
   SEARCH-FIELD AUTOFILL OVERLAY  (every "pill" search box)
   The theme search fields (hero, blog/taxonomy sidebar .voy-sw-search, Smart
   Search .voy-search-box) are flat/transparent so the rounded pill drives the
   shape. But when the browser autofills a saved value, Chrome paints its OWN
   overlay — a slate-blue box under color-scheme:dark — that ignores the CSS
   background and shows as an ugly second rectangle inside the pill. There is no
   `background` override for it; it must be neutralised via the autofill pseudo:
   an inset shadow + a ~forever background-color transition keep the field's own
   (transparent) background, and text-fill-color keeps the value in theme text.
   ========================================================================= */
.voy-sw-search input:-webkit-autofill,
.voy-sw-search input:-webkit-autofill:hover,
.voy-sw-search input:-webkit-autofill:focus,
.voy-sw-search input:-webkit-autofill:active,
.voy-search-box input:-webkit-autofill,
.voy-search-box input:-webkit-autofill:hover,
.voy-search-box input:-webkit-autofill:focus,
.voy-search-box input:-webkit-autofill:active,
.acm-hero-search .acm-hero-search-input:-webkit-autofill,
.acm-hero-search .acm-hero-search-input:-webkit-autofill:hover,
.acm-hero-search .acm-hero-search-input:-webkit-autofill:focus,
.acm-hero-search .acm-hero-search-input:-webkit-autofill:active,
.acm-hero-sm-inputwrap .acm-hero-search-input:-webkit-autofill,
.acm-hero-sm-inputwrap .acm-hero-search-input:-webkit-autofill:hover,
.acm-hero-sm-inputwrap .acm-hero-search-input:-webkit-autofill:focus,
.acm-hero-sm-inputwrap .acm-hero-search-input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--voy-text) !important;
  -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
          box-shadow: 0 0 0 1000px transparent inset !important;
  caret-color: var(--voy-text);
  transition: background-color 100000s ease 0s !important;
}

/* =========================================================================
   DISPLAY-HEADING FONT  (Playfair Display everywhere it belongs)
   The design uses Playfair Display (--voy-font-head) for ALL display/heading
   text. Class-styled titles (.acm-hero-title, .voy-card__title, …) already set
   it, but section-level heads that are a bare <h2>/<h3> carry no font-family
   rule and fall back to the Inter body default — so section titles across Home,
   About, Landing, Pricing and the raw T4 page masthead (.t4-masthead-title,
   used on the category pages) render in the wrong face. Pin them to the heading
   face. Targeted selectors (not a blanket h2/h3) so Geist-Mono widget/eyebrow
   heads keep their intended face.
   ========================================================================= */
.t4-masthead .t4-masthead-title,
.voy-section__head h2,
.voy-section__head h3,
.acm-dest-head h2,
.acm-fsplit-body h2,
h2.acm-cta-title,
.acm-feature h3,
.com-contact h2,
.com-contact h3 {
  font-family: var(--voy-font-head) !important;
}

/* T4 default page masthead title (visible on category pages) inherits the base
   1.65 line-height, so a one-line title sits in an oversized box and a long name
   like "Adventure & trekking" wraps into two far-apart lines that read as broken.
   Match the Voyara masthead's tight leading (1.1) so it looks like every other
   page's title. Padding (90/28) already matches the .pen and is left untouched. */
.t4-masthead .t4-masthead-title {
  line-height: 1.1;
}
/* A long category name ("Adventure & trekking" ≈ 764px) overflows the 760px
   masthead inner by a hair and wraps into an awkward 2-line title. The .pen
   masthead is full-width centered (no 760 cap), so at desktop let the raw T4
   title stay on one line; it still wraps normally on mobile. Scoped to the T4
   title only — the designed .voy-masthead pages are untouched. */
@media (min-width: 992px) {
  .t4-masthead .t4-masthead-title { white-space: nowrap; }
}

/* Centered page mastheads: the eyebrow and title fill the detail width and
   center their text, but the subtitle has a 680px max-width with no auto
   margins, so as a flex item it pins to the left edge — its centered text then
   lands ~24px left of the title, making the block look off-centre. Give the
   subtitle auto side-margins so all three share one axis. The left-aligned
   archive variant (.voy-masthead-detail--left) is excluded. */
.t4-masthead-detail:not(.voy-masthead-detail--left) .voy-masthead-sub {
  margin-left: auto;
  margin-right: auto;
}

/* =========================================================================
   HEADER — align to the shared content container on wide screens
   The header row (brand / nav / actions) sits in a full-width container-fluid,
   so past the ~1440 design width it keeps spreading (1824px+ at 1920) — the logo
   drifts to the far left, the actions to the far right, and the middle reads as a
   big empty gap that no longer lines up with the 1140 content container below.
   Clamp the header inner to the same --voy-container so brand/nav/actions ride
   the same grid as every page's content; the full-bleed dark header background
   (.voy-header) stays edge-to-edge. */
.voy-header .voy-header-inner {
  max-width: var(--voy-container, 1140px);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* =========================================================================
   HEADER EDGE — mirror the body content band at EVERY width (§5.16)
   The header container carries `padding-inline:48px` (template.css base) → its
   content edges inset 48px while the body band insets 20px (fluid) below the
   cap → the header runs ~28px narrower than the body in the ~1025–1236 range
   ("lúc ngắn lúc dài"). With the inner clamped to --voy-container (1140) above,
   setting the container gutter to 20px makes the header edges track the body
   band EXACTLY at every width: wide (container content ≥1140) → inner centered
   so logo-left = (vw−1140)/2 = body gutter (padding-independent); narrow →
   inner fills, logo-left = 20 = body gutter. One value covers all widths (the
   base was already 20 below 1024, so no change there). */
.voy-header-container {
  padding-inline: 20px !important;
}

/* =========================================================================
   CONTENT-BAND WIDTH — canonical 1140/20 band on plain com_content + hero (§5.14)
   Plain com_content section bands (blog / category / single article /
   Typography / Archive / Contact / Login / Register + the breadcrumb band) use
   `.t4-section-inner.container`, and the home/landing hero uses
   `.acm-hero-inner` — both fall back to the base `.container{max-width:1140}`
   plus Bootstrap's ~16px gutter → content 1108 / gutter 166 @1440 (32px
   narrower than the ACM marketing bands, which use
   `.ja-acm > .container{max-width:1180;padding-inline:20}` = content 1140).
   Give these bands the SAME canonical band so every page resolves to the same
   content width + gutter: max-width 1180 (=1140+40) + 20px gutter → content
   1140 @wide, fluid + 20px below the cap.
   SCOPE PROOF: the ACM content containers are direct children of `.ja-acm`
   (NOT `.t4-section-inner`), so the direct-child combinator below never touches
   them; they keep their existing (identical) 1180/20 band. The hero selector is
   class-specific to `.acm-hero-inner`. */
/* EXCLUDE the bespoke full-page views (com_tags tag/tags-index, com_content
   author list/detail, com_finder search, com_content all-categories). Each ships
   its OWN full-width passthrough (taxonomy.css / allcat.css:
   `:has(.voy-…-page) .t4-section-inner.container{max-width:100%}`) so their
   coloured CTA / related-tags / breadcrumb bands can bleed edge-to-edge (the band
   `__inner` re-caps content to 1140). Without the :not(:has()) guards, THIS rule
   (0,6,0 !important) out-specifies those passthroughs (0,3,0) and re-caps the
   wrapper to 1180 → the full-bleed bands get clipped to 1140 with dark side gaps.
   The specificity trap called out in the review guide §5.14. */
/* IMPORTANT — also exclude the nested-ACM canvas wrappers (About/Pricing/Landing:
   `.t4-section-inner.container` holding `.ja-acm > .container`). Those get the
   full-width PASSTHROUGH below. The 6 bespoke `:not(:has())` guards above pushed
   THIS rule to (0,12,0), which then out-specified the passthrough (0,8,0) and
   re-capped the ACM sections to 1180 → their coloured band backgrounds stopped
   bleeding edge-to-edge. Excluding `.ja-acm > .container` here makes the two rules
   mutually exclusive (specificity no longer decides). */
.t4-section:not(.t4-header):not(.t4-footer):not(.t4-footnav) > .t4-section-inner.container:not(:has(.voy-tag-page)):not(:has(.voy-tags-index-page)):not(:has(.voy-authors-page)):not(:has(.voy-author-detail)):not(:has(.voy-search-page)):not(:has(.voy-allcat-page)):not(:has(.ja-acm > .container)),
.container.acm-hero-inner {
  max-width: calc(var(--voy-container) + 40px) !important; /* 1180 */
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* NESTED-ACM PASSTHROUGH (§5.14) — canvas marketing articles (About, Pricing:
   voy-canvas-page in the introtext) nest the ACM band `.ja-acm > .container`
   (already the canonical 1180/20 = content 1140) INSIDE the com_content section
   wrapper `.t4-section-inner.container`. Applying the 1140 cap to the OUTER too
   (rule above) then double-gutters the inner (content 1100 / gutter 170) AND
   caps the section background at 1140 (not full-bleed like Home). When the
   wrapper holds an ACM band, make it a full-width passthrough so `.ja-acm`
   backgrounds span the viewport (matching Home) and the inner container is the
   SINGLE canonical 1140/150 band. `:has(.ja-acm > .container)` (0,8,0) outranks
   the cap rule above (0,6,0), so only these ACM wrappers passthrough; prose
   canvas pages (Typography, no `.ja-acm`) keep the 1140 cap. */
.t4-section:not(.t4-header):not(.t4-footer):not(.t4-footnav) > .t4-section-inner.container:has(.ja-acm > .container) {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* =========================================================================
   RESPONSIVE PROSE TABLES (§5.6 — no horizontal overflow at mobile)
   A wide article/typography <table> has a min-content width driven by its cells
   (e.g. the Typography demo table ≈360px), which can't shrink below the ~335px
   mobile content band → it spills ~5px past the viewport (horizontal scroll on
   the whole page). Mirror the §5.9 <pre> treatment: at mobile let the table
   scroll horizontally WITHIN its column (display:block + overflow-x:auto) instead
   of pushing the page. Desktop keeps display:table / width:100% untouched. Covers
   the Typography demo AND any table an owner adds to a normal article. */
@media (max-width: 767.98px) {
  .voy-typography table,
  .voy-article-prose table,
  .item-page .article-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ===== Safari megamenu PAINT fix (JA Voyara) — the real root cause =====
   `.voy-header` is `position:sticky` and carries `overflow-x:clip` (shared with
   .voy-section/.voy-footer-inner to kill horizontal bleed). On Safari, an
   element with `overflow-x:clip` + `overflow-y:visible` clips on BOTH axes, so
   the desktop megamenu dropdown — absolutely positioned BELOW the 76px header —
   is cropped to nothing: it stays in the DOM and is still clickable (you can see
   the cursor and navigate), it just never paints. Chrome does not clip the
   visible axis, so it only breaks on Safari. The header contains the dropdown,
   so it must not clip: let it overflow on desktop (where the dropdown lives).
   Mobile keeps the off-canvas menu + original clip. */
@media (min-width: 992px) {
  .voy-header { overflow: visible !important; }
}

/* ── Megamenu active state: active dropdown/mega item styled like the parent ──
   The active/current item inside an open dropdown should read like the top-level
   parent's active state — the brand active colour (orange), NOT a muted/washed
   tone (a fixed link-colour goes dark-on-dark inside the dark megamenu and looks
   faded). Uses the same active var the parent uses, so it matches in light+dark. */
#t4-megamenu-mainmenu .mega-nav li.active > a,
#t4-megamenu-mainmenu .mega-nav li.current > a,
#t4-megamenu-mainmenu .dropdown-menu li.active > a,
#t4-megamenu-mainmenu .dropdown-menu li.current > a {
  color: var(--mainnav-link-active-color) !important;
}
