/* =========================================================================
 * amk-ux-s71.css — BUILD-S71 UI/UX improvement layer (Agam Digital / AssisteMatik)
 *
 * Scope: homepage only (.home2-template-page). Adds:
 *   1. HERO readability scrim + guaranteed-contrast text (Req. 2)
 *   2. Boxes / solution-cards auto-rotation spotlight (Req. 3)
 *   3. Typography & spacing consistency (Req. 4)
 *
 * Gated so it never touches internal pages.
 * ========================================================================= */

/* ---------------------------------------------------------------- 1. HERO */
.home2-template-page .hero_block { position: relative; isolation: isolate; }
.home2-template-page .hero_block .container::before {
  content: ""; position: absolute; inset: -10% -6%; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 90% at 70% 30%, rgba(10,6,30,0.55) 0%, rgba(10,6,30,0.28) 45%, rgba(10,6,30,0) 78%);
  filter: blur(2px);
}
.home2-template-page .hero_block h1 {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.45);
  font-weight: 800; letter-spacing: -0.01em;
}
.home2-template-page .hero-titles-slider .gradiant-text,
.home2-template-page .hero_block .gradiant-text {
  background: linear-gradient(180deg, #ffffff 0%, #cfd8ff 55%, #ffffff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 24px rgba(0,0,0,0.45); filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.home2-template-page .hero-content p {
  color: #f2f3f8; text-shadow: 0 1px 8px rgba(0,0,0,0.55);
  font-weight: 400; line-height: 1.7; max-width: 60ch; margin: 0.5rem 0 1.25rem;
}
.home2-template-page .hero_block .hero-btn { text-shadow: 0 1px 4px rgba(0,0,0,0.4); }

/* ---------------------------------------------------- 2. BOXES auto-rotation */
.home2-template-page .boxes-section { --spot-dur: 380ms; }
.home2-template-page .boxes-section .special-box,
.home2-template-page .boxes-section .regular-box {
  transition: transform var(--spot-dur) ease, box-shadow var(--spot-dur) ease,
              opacity var(--spot-dur) ease, filter var(--spot-dur) ease;
  will-change: transform;
}
.home2-template-page .boxes-section.is-auto .special-box,
.home2-template-page .boxes-section.is-auto .regular-box { opacity: 0.72; }
.home2-template-page .boxes-section.is-auto .amk-spot-active {
  opacity: 1; transform: translateY(-6px) scale(1.028); z-index: 5;
  box-shadow: 0 18px 46px rgba(76,40,200,0.30), 0 4px 12px rgba(0,0,0,0.20);
  filter: saturate(1.06);
}
@media (prefers-reduced-motion: reduce) {
  .home2-template-page .boxes-section.is-auto .special-box,
  .home2-template-page .boxes-section.is-auto .regular-box { opacity: 1; }
  .home2-template-page .boxes-section.is-auto .amk-spot-active { transform: none; box-shadow: none; filter: none; }
}
.home2-template-page .regular-boxes-items.amk-auto-shown {
  display: block !important; opacity: 0; animation: amkAutoReveal 700ms ease forwards;
}
@keyframes amkAutoReveal { from { opacity: 0; transform: translateY(14px);} to { opacity: 1; transform: translateY(0);} }

/* ---------------------------------------------------- 3. Typography / spacing */
.home2-template-page .sec { padding: 72px 0; }
.home2-template-page .sec-head { margin-bottom: 44px; }
.home2-template-page .sec-head h2 { font-size: 38px; line-height: 1.12; letter-spacing: -0.01em; }
.home2-template-page .boxes-section h2 { margin-bottom: 8px; }
.home2-template-page .special-box h3,
.home2-template-page .regular-box h3 { margin-bottom: 6px; line-height: 1.25; }
.home2-template-page .special-box p,
.home2-template-page .regular-box p { line-height: 1.65; }
.home2-template-page .closing, .home2-template-page .blog, .home2-template-page .agents { color: #eef0f7; }
.home2-template-page .closing h2, .home2-template-page .blog h2, .home2-template-page .agents h2 { color: #ffffff; }
.home2-template-page .closing p, .home2-template-page .blog p, .home2-template-page .agents p { color: #cfd3e6; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .home2-template-page .hero-content p { font-size: 0.95rem; }
  .home2-template-page .sec { padding: 52px 0; }
  .home2-template-page .sec-head h2 { font-size: 28px; }
  .home2-template-page .boxes-section.is-auto .special-box,
  .home2-template-page .boxes-section.is-auto .regular-box { opacity: 1; }
  .home2-template-page .boxes-section.is-auto .amk-spot-active {
    transform: none; box-shadow: 0 8px 20px rgba(76,40,200,0.22);
  }
}

/* =========================================================================
 * BUILD-S74 — visual enrichment layer (Agam Digital / AssisteMatik)
 * Homepage-only. Scoped to .home2-template-page. Loaded last => wins cascade.
 * Additive + fully reversible. NO content, NO layout-dimension changes.
 *   A. Ambient motion on the two dark "void" sections (podcast + magazine)
 *   B. Animated hero background gradient (subtle life)
 *   C. Discover carousel edge-fade (kills the "cut-off card" look)
 *   D. Hover-lift on cards
 * Every animation is gated by prefers-reduced-motion.
 * ========================================================================= */

/* --- A. Ambient wash on the empty dark sections ---------------------------- */
.home2-template-page .podcast-section,
.home2-template-page .magazine-wrapper {
  background:
    radial-gradient(60% 80% at 15% 20%, rgba(81,0,255,0.20), transparent 60%),
    radial-gradient(60% 80% at 85% 80%, rgba(168,50,155,0.16), transparent 60%),
    radial-gradient(50% 70% at 70% 15%, rgba(245,102,56,0.10), transparent 55%),
    #0a1228 !important;
  background-size: 180% 180%, 180% 180%, 180% 180%, 100% 100% !important;
  background-position: 0% 50%, 100% 50%, 50% 100%, 0 0 !important;
  animation: amkSectionDrift 30s ease-in-out infinite alternate !important;
}
@keyframes amkSectionDrift {
  0%   { background-position: 0% 50%, 100% 50%, 50% 100%, 0 0; }
  100% { background-position: 100% 50%, 0% 50%, 50% 0%, 0 0; }
}

/* --- B. Animated hero background ------------------------------------------ */
.home2-template-page .hero_block_bg {
  background-size: 160% 160% !important;
  animation: amkHeroGradientShift 26s ease-in-out infinite alternate !important;
}
@keyframes amkHeroGradientShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* --- C. Discover carousel edge-fade -------------------------------------- */
.home2-template-page .discover-section .slider-wrapper,
.home2-template-page .discover-section_slider {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}

/* --- D. Hover-lift on cards ---------------------------------------------- */
.home2-template-page .develeap-podcast-episode-card,
.home2-template-page .regular-box,
.home2-template-page .special-box {
  transition: transform .3s ease, box-shadow .3s ease;
}
.home2-template-page .develeap-podcast-episode-card:hover,
.home2-template-page .regular-box:hover,
.home2-template-page .special-box:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 44px rgba(10,10,20,0.45);
}

/* --- Accessibility: kill ALL S74 motion for reduced-motion --------------- */
@media (prefers-reduced-motion: reduce) {
  .home2-template-page .podcast-section,
  .home2-template-page .magazine-wrapper { animation: none !important; }
  .home2-template-page .hero_block_bg { animation: none !important; }
  .home2-template-page .develeap-podcast-episode-card:hover,
  .home2-template-page .regular-box:hover,
  .home2-template-page .special-box:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   BUILD-S81 (2026-11-02): EN homepage header RTL-leak fix.
   Root cause: assistematik-core/GLOBAL-STYLES.css forces `direction:rtl;
   text-align:right` on body/.e-body/.site-content unconditionally, which leaks
   RTL into the EN (LTR) page and shoves the EN mobile hamburger off-screen.
   Fix: re-assert LTR on the EN header (loads last -> wins cascade). HE (rtl)
   untouched. Shared plugin GLOBAL-STYLES.css intentionally left unchanged.
   -------------------------------------------------------------------------- */
html[lang="en-US"] .nav,
html[lang="en-US"] .nav-inner,
html[lang="en-US"] .nav-actions { direction: ltr; }
@media (max-width:1023px){
  /* On mobile the CTA is redundant with the burger menu; hide so the header fits. */
  .nav-cta{ display:none !important; }
}

/* =========================================================================
 * BUILD-S82 / FG1 — hero text z-index fix.
 * Root cause: template-home2.css sets .hero_block .container{z-index:6} (text ABOVE
 * hero_block_bg/hero_block_grid z-index:5). home-root.css:449 (S73) overrode it to
 * z-index:3, dropping the entire hero text (h1 / rotating slider / subtitle / CTA)
 * BELOW the background layer -> invisible. This rule loads AFTER home-root.css
 * (amk-ux-s71.css is enqueued later, and only on the front page) so it wins.
 * ========================================================================= */
.home2-template-page .hero_block .container { z-index: 6; }

/* ============ BUILD-S82 / FG2 — adaptive-contrast overlay (non-destructive, front-page only, loads last) ============
 * Measured root cause (evidence/contrast-audit-plan-20261102.json): section headings carry HARDCODED
 * colors that do NOT flip with the theme toggle, while the body bg DOES flip (#f6f6f9 light /
 * #0a0a0c dark). => roughly half the section headings are swallowed in each mode:
 *   white headings (hero h1 / cloud / aws)  -> 1.08 in light mode
 *   black headings (discover / solutions)   -> 1.06 in dark mode
 *   podcast heading (black on its own #0a1428 dark bg) -> 1.13 in BOTH modes
 * Fix: two theme tokens that flip WITH the bg; bind the mismatched section headings to them; keep the
 * dark-intent hero (white gradient title) on a dark backdrop in both modes; keep the always-dark podcast
 * heading white. No existing rule is removed; nothing is deleted.
 * Mechanism: appended to amk-ux-s71.css, which loads LAST (wins the cascade) and is enqueued only on
 * is_front_page(). Rollback = delete this block + version-bust + opcache reset.
 * ========================================================================= */

/* theme tokens: dark default (mirrors :root dark), light override (mirrors [data-theme="light"]) */
.home2-template-page                       { --amk-txt:#ffffff; --amk-dim:#b8b8c4; }
[data-theme="light"] .home2-template-page  { --amk-txt:#0f172a; --amk-dim:#5f5f6c; }

/* A) the 5 mismatched plain sections: flip their headings WITH the theme */
.home2-template-page .discover-section h2,
.home2-template-page .discover-section h3,
.home2-template-page .boxes-section h2,
.home2-template-page .boxes-section h3,
.home2-template-page .cloud-wrapper h2,
.home2-template-page .cloud-wrapper h3,
.home2-template-page .amazon-wrapper h2,
.home2-template-page .amazon-wrapper h3 { color: var(--amk-txt) !important; }

.home2-template-page .discover-section p { color: var(--amk-dim) !important; }

/* B) Hero: keep the white gradient title readable by holding the hero dark in BOTH modes
 *    (the source design hero is dark; light-mode body bg was bleeding through -> 1.08) */
.home2-template-page .hero_block { background-color:#0a0a0c; }

/* C) Podcast = always-dark block (#0a1428): force headings white in BOTH modes (was black-on-dark) */
.home2-template-page .podcast-section h2,
.home2-template-page .podcast-section h3,
.home2-template-page .podcast-section h4 { color:#ffffff !important; }

/* ============ BUILD-S82 / FG2b — extend adaptive dim to card/section BODY paragraphs ============
 * Measured root cause (audit-fix3): the 5 sections mix HARDCODED text colors at the CARD level too:
 *   boxes card[0] description = black (#000)        -> swallowed in DARK  mode (ratio 1.06)
 *   boxes cards[1-3] description = light cyan (#cce3e6/#cce3ff) -> swallowed in LIGHT mode (~1.15)
 * i.e. the same "half-in-each-mode" pattern as the headings. Fix: bind every body paragraph in the 5
 * sections to the theme-aware dim token so it is readable in BOTH modes. Buttons/links (<a>) untouched.
 * Non-destructive overlay, front-page only, loads last.
 * ========================================================================= */
.home2-template-page .discover-section p,
.home2-template-page .boxes-section p,
.home2-template-page .cloud-wrapper p,
.home2-template-page .amazon-wrapper p { color: var(--amk-dim) !important; }

/* ============ BUILD-S82 / FG2c — AWS partner section is an always-dark block (own dark-teal bg) ============
 * Measured (verify-final): .amazon-wrapper carries its OWN background rgb(9,53,63) (dark teal) in BOTH
 * light and dark modes (it does not inherit the body). So the theme-aware --amk-txt (dark in light-mode)
 * was swallowed on it (ratio 1.35). Like the podcast/footer blocks, force its text WHITE in both modes.
 * Non-destructive overlay, front-page only, loads last.
 * ========================================================================= */
.home2-template-page .amazon-wrapper h2,
.home2-template-page .amazon-wrapper h3,
.home2-template-page .amazon-wrapper p,
.home2-template-page .amazon-wrapper span { color:#ffffff !important; }
