/* ============================================================
   Hero halaman dalam yang sudah punya foto: satu kolom, semua teks
   di tengah, foto tidak transparan sebagai latar penuh.

   SEMUA aturan di berkas ini hanya berlaku bila halaman punya foto
   (class body .fs-hero-photo, dipasang oleh inc/hero-photo.php saat
   assets/hero/{template}-desktop.webp ada). Halaman tanpa foto tidak
   berubah sama sekali: hero lamanya (dua kolom, gambar di kanan) tetap
   tampil sampai fotonya tersedia.

   Dimuat paling akhir (setelah pattern-gradients.css) karena
   pattern-gradients memaksa latar merah pada hero lewat !important.
   Beranda tidak ikut aturan ini: ia punya layout sendiri di home-shadcn.css.
============================================================ */

/* ---- 1. Gambar lama di hero disembunyikan -------------------------------
 * Gambar lama berupa potongan transparan yang berdiri di kolom kanan.
 * Hero sekarang hanya teks di atas foto latar. */
body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero) :is(
  .fs-solution-image-hero__visual,
  .fs-products-hero__visual,
  .fs-market-hero__visual,
  .fs-reseller-hero__visual,
  .fs-order-agent-hero__visual,
  .fs-about-hero__media
),
body.fs-hero-photo.fs-inner-page #main-content > section.fs-st-hero:first-of-type > div > figure {
  display: none !important;
}

/* ---- 2. Satu kolom di tengah -------------------------------------------- */
body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero) :is(
  .fs-solution-image-hero__layout,
  .fs-products-hero__layout,
  .fs-market-hero__layout,
  .fs-reseller-hero__layout,
  .fs-order-agent-hero__layout,
  .fs-about-hero__layout
) {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  grid-template-columns: none !important;
  gap: 2rem !important;
  text-align: center !important;
}

/* Kolom teks (selalu anak pertama): lebar terbaca, di tengah. */
body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero) :is(
  .fs-solution-image-hero__layout,
  .fs-products-hero__layout,
  .fs-market-hero__layout,
  .fs-reseller-hero__layout,
  .fs-order-agent-hero__layout,
  .fs-about-hero__layout
) > :first-child {
  width: 100%;
  max-width: 56rem;
  margin-inline: auto !important;
  text-align: center !important;
}

body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero) :is(
  .fs-solution-image-hero__layout,
  .fs-products-hero__layout,
  .fs-market-hero__layout,
  .fs-reseller-hero__layout,
  .fs-order-agent-hero__layout,
  .fs-about-hero__layout
) :is(h1, h2, p, .eyebrow, .fs-section-label) {
  margin-inline: auto !important;
  text-align: center !important;
}

body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero) :is(
  .fs-solution-image-hero__layout,
  .fs-products-hero__layout,
  .fs-market-hero__layout,
  .fs-reseller-hero__layout,
  .fs-order-agent-hero__layout,
  .fs-about-hero__layout
) h1 {
  max-width: none !important;
}

body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero) :is(
  .fs-solution-image-hero__layout,
  .fs-products-hero__layout,
  .fs-market-hero__layout,
  .fs-reseller-hero__layout,
  .fs-order-agent-hero__layout,
  .fs-about-hero__layout
) :is([class*="__lead"], [class*="-lead"]) {
  max-width: 46rem !important;
}

/* Tombol dan baris statistik di tengah. */
body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero) :is(
  .fs-solution-image-hero__layout,
  .fs-products-hero__layout,
  .fs-market-hero__layout,
  .fs-reseller-hero__layout,
  .fs-order-agent-hero__layout,
  .fs-about-hero__layout
) :is([class*="actions"], [class*="-buttons"]) {
  justify-content: center !important;
}

/* Kartu statistik atau bukti di bawah teks: tetap satu blok di tengah. */
body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero) :is(
  .fs-solution-image-hero__layout,
  .fs-products-hero__layout,
  .fs-market-hero__layout,
  .fs-reseller-hero__layout,
  .fs-order-agent-hero__layout,
  .fs-about-hero__layout
) > :not(:first-child) {
  width: 100%;
  max-width: 60rem;
  margin-inline: auto !important;
}

/* ---- 2b. Hero teks-saja (tanpa elemen __layout) --------------------------
 * FAQ, hub Solusi, Program Referral, Manajemen Reseller dan Supplier. Kontainernya flex dengan teks
 * rata kiri dari aturan lama, jadi dipusatkan di sini. */
body.fs-hero-photo.fs-inner-page #main-content > section.hero-bg:first-of-type:not(.fs-solution-image-hero):not(.fs-products-hero):not(.fs-category-hero):not(.fs-market-hero):not(.fs-reseller-hero):not(.fs-order-agent-hero) > div:not(.absolute):not([class*="bg-dot"]) {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
}

body.fs-hero-photo.fs-inner-page #main-content > section.hero-bg:first-of-type:not(.fs-solution-image-hero):not(.fs-products-hero):not(.fs-category-hero):not(.fs-market-hero):not(.fs-reseller-hero):not(.fs-order-agent-hero) > div:not(.absolute):not([class*="bg-dot"]) > div {
  width: 100%;
  max-width: 56rem;
  margin-inline: auto !important;
  text-align: center !important;
}

body.fs-hero-photo.fs-inner-page #main-content > section.hero-bg:first-of-type:not(.fs-solution-image-hero):not(.fs-products-hero):not(.fs-category-hero):not(.fs-market-hero):not(.fs-reseller-hero):not(.fs-order-agent-hero) > div:not(.absolute):not([class*="bg-dot"]) :is(h1, h2, p, .eyebrow, .fs-section-label) {
  margin-inline: auto !important;
  text-align: center !important;
}

body.fs-hero-photo.fs-inner-page #main-content > section.hero-bg:first-of-type:not(.fs-solution-image-hero):not(.fs-products-hero):not(.fs-category-hero):not(.fs-market-hero):not(.fs-reseller-hero):not(.fs-order-agent-hero) > div:not(.absolute):not([class*="bg-dot"]) h1 {
  max-width: 100% !important;
}

/* Baris judul yang dikunci nowrap (Manajemen Reseller dan Supplier) lebih lebar dari layar HP dan terpotong. */
body.fs-hero-photo.fs-inner-page #main-content > section.hero-bg:first-of-type:not(.fs-solution-image-hero):not(.fs-products-hero):not(.fs-category-hero):not(.fs-market-hero):not(.fs-reseller-hero):not(.fs-order-agent-hero) > div:not(.absolute):not([class*="bg-dot"]) h1 span {
  white-space: normal !important;
}

body.fs-hero-photo.fs-inner-page #main-content > section.hero-bg:first-of-type:not(.fs-solution-image-hero):not(.fs-products-hero):not(.fs-category-hero):not(.fs-market-hero):not(.fs-reseller-hero):not(.fs-order-agent-hero) > div:not(.absolute):not([class*="bg-dot"]) div:is(.flex, [class*="grid"]) {
  justify-content: center !important;
}

/* Aturan lama memakai text-align-last: left, jadi baris terakhir paragraf menempel di kiri. Baris judul yang
 * dibungkus span blok selebar isinya juga menempel di kiri. Keduanya dipusatkan. */
body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero) :is(
  .fs-solution-image-hero__layout,
  .fs-products-hero__layout,
  .fs-market-hero__layout,
  .fs-reseller-hero__layout,
  .fs-order-agent-hero__layout,
  .fs-about-hero__layout
) :is(h1, h2, p),
body.fs-hero-photo.fs-inner-page #main-content > section.hero-bg:first-of-type:not(.fs-solution-image-hero):not(.fs-products-hero):not(.fs-category-hero):not(.fs-market-hero):not(.fs-reseller-hero):not(.fs-order-agent-hero) > div:not(.absolute):not([class*="bg-dot"]) :is(h1, h2, p) {
  text-align-last: center !important;
}

body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero) :is(
  .fs-solution-image-hero__layout,
  .fs-products-hero__layout,
  .fs-market-hero__layout,
  .fs-reseller-hero__layout,
  .fs-order-agent-hero__layout,
  .fs-about-hero__layout
) h1 > .block,
body.fs-hero-photo.fs-inner-page #main-content > section.hero-bg:first-of-type:not(.fs-solution-image-hero):not(.fs-products-hero):not(.fs-category-hero):not(.fs-market-hero):not(.fs-reseller-hero):not(.fs-order-agent-hero) > div:not(.absolute):not([class*="bg-dot"]) h1 > .block {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto !important;
}

/* ---- 3. Foto latar ------------------------------------------------------ */
body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero) {
  /* Foto gudang terang, jadi diberi lapisan gelap kemerahan supaya teks putih terbaca. */
  background-image:
    linear-gradient(180deg, rgb(32 0 0 / .66) 0%, rgb(32 0 0 / .56) 50%, rgb(32 0 0 / .68) 100%),
    var(--fs-hero-photo) !important;
  background-size: cover !important;
  background-position: center 45% !important;
  background-repeat: no-repeat !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(26rem, 38vw, 36rem) !important;
}

@media (max-width: 767px) {
  body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero) {
    background-image:
      linear-gradient(180deg, rgb(32 0 0 / .66) 0%, rgb(32 0 0 / .56) 50%, rgb(32 0 0 / .68) 100%),
      var(--fs-hero-photo-mobile, var(--fs-hero-photo)) !important;
    min-height: 0 !important;
  }
}

body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero) :is(h1, p) {
  text-shadow: 0 1px 18px rgb(0 0 0 / .35);
}

/* Pola dekoratif hero (Patterns/1.webp, dipasang di ::before oleh inner-shadcn.css) dibuat untuk latar merah.
 * Di atas foto ia hanya mengotori gambar, jadi dimatikan. */
body.fs-hero-photo.fs-inner-page #main-content > section:first-of-type:is(.hero-bg, .fs-solution-image-hero)::before {
  display: none !important;
}

/* Hero blog dan kontak berlatar putih dengan teks gelap. Di atas foto teksnya harus putih. */
body.fs-hero-photo.fs-inner-page #main-content > section.fs-content-blog-hero:first-of-type :is(h1, h2, p, span, a:not([class*="button"])),
body.fs-hero-photo.fs-inner-page #main-content > section.fs-content-contact-hero:first-of-type :is(h1, h2, p, span) {
  color: #fff !important;
}
