/* ============================================================
   subpage.css — reusable PREMIUM enhancement layer for PHASE 3
   service/offer/product/regional pages. Scoped to body.p-sub so
   it NEVER affects the homepage or untouched pages. Additive only:
   base template stays intact if this file is absent.
   Load order: after style.min.css, before animations.css.
   ============================================================ */

/* ---- Footer logo aspect-ratio fix (BP: image-aspect-ratio) — mirror of the
   homepage rule so subpages score BP 100 too. ---- */
.p-sub .footer-logo .logo-full { height: auto; width: auto; max-width: 100%; }

/* ---- Article sidebar widget titles promoted h3→h2 (fixes heading-order skip
   H1>H3 from ToC/search asides). Preserve the exact former h3 look. ---- */
.p-sub .toc h2, .p-sub .toc-kb h2 {
  font-family: var(--font-heading); font-size: 20px; font-weight: 600;
  line-height: 23px; letter-spacing: 1px; text-transform: uppercase;
  color: #F5F6F8; margin: 0;
}

/* ---- Cinematic page hero with full-bleed image ---- */
.p-sub .page-hero { position: relative; overflow: hidden; isolation: isolate; }
.p-sub .page-hero .page-hero__bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: -2; opacity: .55;
  transform: scale(1.02);
}
/* scrim ONLY when we injected a .page-hero__bg — never touch pages that
   already have their own photo hero (e.g. .page-hero--photo). */
.p-sub .page-hero:has(> .page-hero__bg)::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(6,8,15,.72) 0%, rgba(6,8,15,.5) 45%, rgba(6,8,15,.92) 100%),
    radial-gradient(120% 80% at 80% 0%, rgba(255,107,0,.14) 0%, transparent 55%);
}
.p-sub .page-hero .container { position: relative; z-index: 1; }
.p-sub .page-hero h1 .line--loc {
  display: block; margin-top: .18em;
  font-size: .5em; letter-spacing: .01em; color: var(--accent);
  font-weight: 600;
}
@media (prefers-reduced-motion: no-preference) {
  .p-sub .page-hero .page-hero__bg { animation: subHeroDrift 22s ease-in-out infinite alternate; }
  @keyframes subHeroDrift { from { transform: scale(1.02); } to { transform: scale(1.08); } }
}

/* ---- Region bar (local SEO) — generalized from the homepage ---- */
.p-sub .region-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px 12px; max-width: var(--container-max, 1240px);
  margin: 0 auto; padding: clamp(20px, 3vw, 30px) clamp(16px, 4vw, 40px) 4px;
}
.p-sub .region-bar__label {
  font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 1.6px;
  font-size: .72rem; color: var(--text-muted); margin-right: 4px;
}
.p-sub .region-bar a {
  font-size: .86rem; color: var(--text-secondary); text-decoration: none;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--border-subtle, rgba(255,255,255,.1));
  transition: color .25s var(--ease-out, ease), border-color .25s ease, background .25s ease;
}
.p-sub .region-bar a:hover { color: var(--accent); border-color: rgba(255,107,0,.5); background: rgba(255,107,0,.08); }

/* ---- Text-led split block: content leads, image is an accent ----
   Default is intentionally NOT 50/50 (text column wider). Ratio can be
   tuned per page via inline style on .sub-split (grid-template-columns).
   Add .sub-split--reverse to flip sides. Image can be omitted entirely. */
.p-sub .sub-split {
  display: grid; grid-template-columns: 1.35fr .95fr;
  gap: clamp(28px, 4vw, 60px); align-items: stretch;
  margin-top: clamp(6px, 2vw, 20px);
}
.p-sub .sub-split > * { min-width: 0; }
.p-sub .sub-split__text { align-self: center; text-align: left; }
.p-sub .sub-split__text .eyebrow { display: inline-block; }
.p-sub .sub-split__text h2 { text-align: left; }
.p-sub .sub-split__text > p { color: var(--text-secondary); line-height: 1.75; margin: 0 0 15px; }
.p-sub .sub-split--reverse .sub-split__text { order: 2; }
.p-sub .sub-split__media {
  margin: 0; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255,107,0,.14); box-shadow: 0 22px 55px rgba(0,0,0,.5);
  min-height: 300px; position: relative;
}
.p-sub .sub-split__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 821px) and (prefers-reduced-motion: no-preference) {
  .p-sub .sub-split__media img { transition: transform .6s var(--ease-out, ease); }
  .p-sub .sub-split:hover .sub-split__media img { transform: scale(1.04); }
}
@media (max-width: 820px) {
  .p-sub .sub-split { grid-template-columns: 1fr !important; gap: 22px; }
  .p-sub .sub-split--reverse .sub-split__text { order: 0; }
  .p-sub .sub-split__media { order: -1; min-height: 210px; }
}

/* ---- Text-FLOW block: landscape image(s) floated, SEO text WRAPS around
   it and then runs full 100% width below. Best for horizontal photos +
   maximum text density. Heading spans full width on top; paragraphs wrap.
   .sub-flow--left floats the image left. Add a 2nd figure for two images. */
.p-sub .sub-flow { margin-top: clamp(6px, 2vw, 20px); }
.p-sub .sub-flow::after { content: ""; display: block; clear: both; }
.p-sub .sub-flow > .eyebrow,
.p-sub .sub-flow > h2 { clear: both; }
.p-sub .sub-flow__media {
  float: right; width: min(46%, 540px); margin: 6px 0 22px 36px;
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255,107,0,.14); box-shadow: 0 22px 55px rgba(0,0,0,.5);
}
.p-sub .sub-flow--left .sub-flow__media { float: left; margin: 6px 36px 22px 0; }
.p-sub .sub-flow__media img { display: block; width: 100%; height: auto; }
.p-sub .sub-flow__media figcaption {
  font-size: .78rem; color: var(--text-muted); padding: 8px 12px; background: rgba(255,255,255,.02);
}
.p-sub .sub-flow > p { color: var(--text-secondary); line-height: 1.75; margin: 0 0 15px; }
@media (min-width: 721px) and (prefers-reduced-motion: no-preference) {
  .p-sub .sub-flow__media img { transition: transform .6s var(--ease-out, ease); }
  .p-sub .sub-flow__media:hover img { transform: scale(1.04); }
}
@media (max-width: 720px) {
  .p-sub .sub-flow__media { float: none !important; width: 100%; margin: 0 0 18px; }
}

/* ---- Heading-order fix: former <h4> converted to <h3> for a clean
   outline (h1>h2>h3, no skips). These rules replicate the old h4 look
   exactly, scoped to p-sub so other pages' footer/callout are untouched. */
.p-sub .callout h3 { color: var(--accent); margin-bottom: 8px; font-size: 0.95rem; }
.p-sub .site-footer h3 { color: var(--text-primary); margin-bottom: 20px; font-size: 0.95rem; letter-spacing: 2px; }

/* ---- Scroll reveals (tiny IntersectionObserver, no GSAP weight) ---- */
html.js-reveal .p-sub [data-reveal] {
  opacity: 0; transform: translateY(22px);
  transition: opacity .7s var(--ease-out, cubic-bezier(.16,1,.3,1)), transform .7s var(--ease-out, cubic-bezier(.16,1,.3,1));
  will-change: opacity, transform;
}
html.js-reveal .p-sub [data-reveal].reveal-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js-reveal .p-sub [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}
