/* px6a: category browsing (trek regions, travelogue and knowledge categories): blog category landing pages.
   Desktop: the category's own items as a full grid. Phone: the swipe row kept, edge to edge, snapping.
   Sibling categories stay a sideways row everywhere. CSS + px-browse.js; no markup or compiler change. */

/* ---------- intro ---------- */
body.pagebody .blogcategories .categorypagecontent { max-width: 1240px; margin: 0 auto; }
body.pagebody .blogcategories .categorypagecontent > h1 { max-width: 22ch; font-size: clamp(30px, 3.6vw, 50px) !important; font-weight: 500 !important; margin: 0 0 16px !important; }
body.pagebody .blogcategories .categorydescription { max-width: 72ch; }
body.pagebody .blogcategories .categorydescription p { font-size: 17px !important; line-height: 1.65 !important; color: var(--px-muted) !important; text-align: left !important; }
body.pagebody .blogcategories .categorydescription b, body.pagebody .blogcategories .categorydescription strong { color: var(--px-ink) !important; }
.px-more { display: none; margin-top: 6px; padding: 0; background: none; border: 0; font-weight: 600; font-size: 15px; color: var(--px-navy); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- the category box becomes a plain section ---------- */
body.pagebody .blogcategories .homeft, body.pagebody .blogcategories .regioncont { max-width: 1240px; margin: 0 auto !important; padding: 0 !important; background: none !important; }
body.pagebody .blogcategories .regiondesc {
  background: none !important; background-image: none !important; border: 0 !important; box-shadow: none !important;
  padding: 0 !important; margin: 0 !important; width: auto !important; max-width: none !important; text-align: left !important;
}
body.pagebody .blogcategories .regiondesc > h2 {
  display: block; margin: 8px 0 14px !important; padding: 0 !important; background: none !important;
  text-transform: none !important; text-align: left !important; font-size: 24px !important; color: var(--px-navy) !important;
}
body.pagebody .blogcategories .regiondesc > h2 .px-count { display: inline-block; margin-left: 10px; vertical-align: middle; font-family: var(--px-sans) !important; font-size: 14px; font-weight: 500; color: var(--px-muted); }
body.pagebody .blogcategories .regionoverview { display: none !important; } /* the page intro above already says it */
body.pagebody .blogcategories .filter-link { color: var(--px-navy) !important; font-weight: 600; }
body.pagebody .blogcategories .regiondesc .trek-carousel-container { text-align: left !important; }
body.pagebody .blogcategories .regiondesc .trek-carousel > li .trekcardinfo { padding-left: 14px !important; padding-right: 14px !important; text-align: left !important; }

/* ---------- cards (category items) ---------- */
body.pagebody .blogcategories .regiondesc .trek-carousel > li {
  border-radius: 14px !important; overflow: hidden; border: 0 !important;
  box-shadow: 0 1px 2px rgba(22,38,66,.08), 0 8px 22px rgba(22,38,66,.10) !important;
  transition: transform .2s ease, box-shadow .2s ease;
}
body.pagebody .blogcategories .regiondesc .trek-carousel > li:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(22,38,66,.1), 0 14px 30px rgba(22,38,66,.16) !important; }
body.pagebody .blogcategories .regiondesc .trek-carousel > li img { width: 100% !important; aspect-ratio: 4 / 3; height: auto !important; object-fit: cover; display: block; }
body.pagebody .blogcategories .regiondesc .trek-carousel > li p { margin: 0 !important; }
body.pagebody .blogcategories .trekcardinfo { padding-bottom: 12px !important; line-height: 1.7 !important; }
body.pagebody .blogcategories .trekcardinfo h3, body.pagebody .blogcategories .trekcardinfo h3 * { font-family: var(--px-sans) !important; font-weight: 600 !important; font-size: 14.5px !important; line-height: 1.35 !important; }
/* article and travelogue cards (title only): light, not the navy fact panel */
body.pagebody .blogcategories .regiondesc .trek-carousel > li:not(:has(.trekcardinfo > :nth-child(2))) { background: #fff !important; }
body.pagebody .blogcategories .regiondesc .trek-carousel > li:not(:has(.trekcardinfo > :nth-child(2))) > div { background: #fff !important; height: auto !important; }
body.pagebody .blogcategories .regiondesc .trek-carousel > li:not(:has(.trekcardinfo > :nth-child(2))) .trekcardinfo {
  background: #fff !important; padding: 14px 16px 16px !important; min-height: 0 !important; height: auto !important; text-align: left !important;
}
body.pagebody .blogcategories .regiondesc .trek-carousel > li:not(:has(.trekcardinfo > :nth-child(2))) .trekcardinfo h3,
body.pagebody .blogcategories .regiondesc .trek-carousel > li:not(:has(.trekcardinfo > :nth-child(2))) .trekcardinfo h3 * { color: var(--px-ink) !important; text-align: left !important; margin: 0 !important; }

/* ---------- desktop and tablet landscape: every item visible ---------- */
@media (min-width: 1024px) {
  body.pagebody .blogcategories .regiondesc .carousel-track-wrapper { overflow: visible !important; mask-image: none !important; -webkit-mask-image: none !important; }
  body.pagebody .blogcategories .regiondesc .trek-carousel {
    display: grid !important; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 20px;
    width: auto !important; transform: none !important; padding: 4px 0 8px !important; margin: 0 !important; flex-wrap: wrap;
  }
  body.pagebody .blogcategories .regiondesc .trek-carousel > li { width: auto !important; min-width: 0 !important; max-width: none !important; height: auto !important; margin: 0 !important; flex: none !important; }
  body.pagebody .blogcategories .regiondesc .trek-carousel > li[style*="display: none"] { display: none !important; }
  body.pagebody .blogcategories .regiondesc .carousel-arrow { display: none !important; }
  body.pagebody .blogcategories .regiondesc .trek-carousel-container > br { display: none; }
}

/* ---------- phones: the swipe row, edge to edge ---------- */
@media (max-width: 1023.98px) {
  /* folded from the first paint (no jump); px-browse.js adds the button, or .px-short when nothing is hidden */
  body.pagebody .blogcategories .categorydescription:not(.px-open):not(.px-short) p:first-child { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  body.pagebody .blogcategories .categorydescription:not(.px-open):not(.px-short) p:not(:first-child) { display: none; }
  body.pagebody .blogcategories .categorydescription:not(.px-open):not(.px-short):not(.px-clamp) { margin-bottom: 28px !important; } /* room for the button before it arrives */
  body.pagebody .blogcategories .categorydescription.px-clamp + .px-more, body.pagebody .blogcategories .categorydescription.px-open + .px-more { display: inline-block; }
  body.pagebody .blogcategories .categorydescription p { font-size: 16px !important; margin-bottom: 4px !important; }
  body.pagebody .blogcategories .regiondesc .carousel-track-wrapper {
    width: 100vw !important; max-width: none !important; margin: 0 0 0 calc(50% - 50vw) !important; padding: 4px 24px 14px !important; box-sizing: border-box;
    scroll-snap-type: x mandatory; scroll-padding-left: 24px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  body.pagebody .blogcategories .regiondesc .carousel-track-wrapper::-webkit-scrollbar { display: none; }
  body.pagebody .blogcategories .regiondesc .trek-carousel > li { scroll-snap-align: start; }
  body.pagebody .blogcategories .regiondesc .carousel-arrow { display: none !important; }
}

/* ---------- sibling categories: a sideways row with a soft edge ---------- */
body.pagebody .siblingcategorywrapper { max-width: 1240px; margin-left: auto !important; margin-right: auto !important; }
body.pagebody .siblingcategorywrapper > h2 { font-weight: 500 !important; font-size: clamp(28px, 3vw, 40px) !important; text-align: left !important; }
body.pagebody .siblingcategorywrapper h2 span, body.pagebody .siblingcategorywrapper h2 [class*="orange"] { color: var(--px-navy) !important; font-family: var(--px-serif) !important; font-size: inherit !important; }
@media (min-width: 1024px) {
  body.pagebody .siblingcategorywrapper .carousel-track-wrapper { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
}
body.pagebody .siblingcategorywrapper .categorycardwrapper { border-radius: 14px !important; overflow: hidden; }
body.pagebody .siblingcategorywrapper .category-name-overlay { font-family: var(--px-serif) !important; font-size: 19px !important; font-weight: 500 !important; background: linear-gradient(180deg, transparent, rgba(10,18,34,.75)) !important; border-radius: 0 !important; }
body.pagebody .blogcategories .regiondesc .trek-carousel > li .trekcardinfo h3 { padding-left: 0 !important; padding-right: 0 !important; margin: 12px 0 6px !important; }
@media (max-width: 1023.98px) {
  body.pagebody .blogcategories .categorydescription { transition: none !important; }
  body.pagebody .blogcategories .categorydescription:not(.px-open):not(.px-short):not(.px-clamp) { margin-bottom: 54px !important; }
}
@media (max-width: 1023.98px) { body.pagebody .blogcategories .filter-link { display: inline-block; margin-left: 24px !important; } }
