/* ==========================================================================
   Tahu Barokah — Stylesheet utama
   HTML + CSS + JavaScript murni (tanpa framework)
   ========================================================================== */

/* ---------- Font ---------- */
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/Montserrat-VariableFont_wght.ttf") format("truetype-variations"),
       url("../fonts/Montserrat-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Variabel warna ---------- */
:root {
  --background: #fbfaf5;
  --foreground: #111111;
  --brand-red: #cf2829;
  --brand-red-dark: #a61013;
  --brand-cream: #fbfaf5;
  --brand-gold: #efb300;
  --brand-gold-light: #ffc107;
  --brand-gold-dark: #cd9b07;
  --card-radius: 24px;
  --text-muted: #26211d;
  --font-montserrat: "Montserrat";
}

/* ---------- Reset dasar ---------- */
* {
  box-sizing: border-box;
}

html {
  background: var(--brand-cream);
  scroll-behavior: smooth;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-montserrat), Arial, Helvetica, sans-serif;
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* Pengganti <Image fill> milik Next.js */
.img-fill {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
}

.site-content {
  min-height: calc(100vh - 166px);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--brand-red);
  height: 92px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  align-items: center;
  display: grid;
  grid-template-columns: 160px 1fr;
  height: 92px;
  margin: 0 auto;
  max-width: 1366px;
  padding: 0 54px;
  position: relative;
}

/* Logo diturunkan sehingga sebagian menjorok ke bawah navbar,
   menumpuk di atas gambar hero. */
.site-header__logo {
  align-items: flex-start;
  display: flex;
  height: 92px;
  justify-content: flex-start;
  width: 112px;
}

.site-header__logo img {
  height: 118px;
  margin-top: 15px;
  object-fit: contain;
  width: auto;
}

.site-header__nav {
  align-items: center;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  height: 100%;
  justify-items: center;
}

.site-header__nav a {
  color: #ffffff;
  font-size: clamp(1.15rem, 1.9vw, 1.75rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.site-header__nav a:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}

.site-header__nav a.is-active {
  font-weight: 800;
}

.site-header__toggle {
  display: none;
}

/* ---------- Footer ---------- */
.site-footer {
  align-items: center;
  background: var(--brand-red);
  color: #ffffff;
  display: flex;
  height: 76px;
  justify-content: center;
  text-align: center;
}

.site-footer p {
  font-size: clamp(1rem, 1.7vw, 1.45rem);
  font-weight: 400;
}

/* ---------- Hero banner ---------- */
.hero-banner {
  background: var(--brand-red-dark);
  overflow: hidden;
  position: relative;
  width: 100%;
}

.hero-banner__image {
  object-fit: cover;
}

/* Banner beranda: gambar tampil utuh (lengkung cream sudah menyatu di gambar),
   jadi tingginya mengikuti rasio gambar dan tidak terpotong. */
.hero-banner--home {
  aspect-ratio: 1920 / 836;
  background: var(--brand-cream);
  height: auto;
}

.hero-banner--home .hero-banner__image {
  object-position: center center;
}

.hero-banner--profile,
.hero-banner--katalog {
  height: 548px;
}

.hero-banner--kontak {
  height: 900px;
}

.hero-banner--profile .hero-banner__image {
  filter: grayscale(1);
  object-position: center 38%;
}

.hero-banner--katalog .hero-banner__image {
  object-position: center 44%;
}

.hero-banner--kontak .hero-banner__image {
  object-position: center 45%;
}

.hero-banner__fade {
  background: linear-gradient(
    180deg,
    rgba(251, 250, 245, 0) 52%,
    rgba(251, 250, 245, 0.88) 82%,
    var(--brand-cream) 100%
  );
  inset: 0;
  pointer-events: none;
  position: absolute;
}

/* ---------- Halaman umum ---------- */
.page {
  background: var(--brand-cream);
}

/* ---------- Home ---------- */
.home-main {
  padding: 82px 24px 84px;
}

.home-main__inner {
  margin: 0 auto;
  max-width: 1060px;
  text-align: center;
}

.home-wordmark {
  display: block;
  height: auto;
  margin: 0 auto 20px;
  width: min(545px, 84vw);
}

.home-title {
  font-size: 1.36rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 auto 18px;
  max-width: 760px;
}

.home-description {
  color: #17120e;
  font-size: 1.11rem;
  font-weight: 400;
  line-height: 1.4;
  margin: 0 auto;
  max-width: 760px;
}

/* Tiga kartu bersudut membulat yang saling bertumpuk.
   Lebar tiap kartu dibuat sama persis: (100% + 2 x radius) / 3,
   lalu kartu ke-2 dan ke-3 digeser ke kiri sejauh satu radius
   sehingga sudut membulat kartu di depannya terlihat. */
.feature-grid {
  display: flex;
  margin: 40px auto 0;
  max-width: 880px;
}

/* Lebar tiap kartu sama persis: (100% + 2 x radius) / 3.
   Warna latar digambar oleh ::before yang melebar ke kiri sejauh
   satu radius, sehingga kartu saling bertumpuk TANPA menggeser
   kotak teksnya — jadi ketiga kartu punya lebar teks yang sama
   dan pemenggalan barisnya seragam. */
.feature-card {
  align-items: center;
  display: flex;
  flex: 0 0 calc((100% + var(--card-radius) * 2) / 3);
  flex-direction: column;
  min-height: 368px;
  padding: 26px 20px 22px;
  position: relative;
  text-align: center;
}

.feature-card::before {
  border-radius: var(--card-radius);
  content: "";
  inset: 0;
  position: absolute;
  z-index: -1;
}

.feature-card:nth-child(1) {
  z-index: 3;
}

.feature-card:nth-child(2) {
  z-index: 2;
}

.feature-card:nth-child(3) {
  z-index: 1;
}

.feature-card:nth-child(1)::before {
  background: var(--brand-gold-light);
}

.feature-card:nth-child(2)::before {
  background: var(--brand-gold);
}

.feature-card:nth-child(3)::before {
  background: var(--brand-gold-dark);
}

/* Hanya latarnya yang melebar ke kiri, masuk ke bawah kartu sebelumnya. */
.feature-card:nth-child(2)::before,
.feature-card:nth-child(3)::before {
  left: calc(var(--card-radius) * -1);
}

/* Tinggi ikon dikunci, lebarnya mengikuti bentuk asli masing-masing gambar. */
.feature-card__icon {
  height: 82px;
  margin-bottom: 20px;
  object-fit: contain;
  width: auto;
}

.feature-card h2 {
  font-size: 1.33rem;
  font-weight: 900;
  line-height: 1.4;
  margin: 0 0 14px;
}

.feature-card p {
  color: #111111;
  font-size: 1.11rem;
  font-weight: 400;
  line-height: 1.35;
  margin: 0;
}

/* ---------- Halaman teks (Profile) ---------- */
.text-page {
  padding: 112px 58px 330px;
}

.text-page__inner {
  margin: 0 auto;
  max-width: 1195px;
}

.text-block + .text-block {
  margin-top: 126px;
}

.text-block h1,
.text-block h2 {
  font-size: 1.59rem;
  font-weight: 900;
  line-height: 1.25;
  margin: 0 0 14px;
}

.text-block p {
  color: #151515;
  font-size: 1.33rem;
  font-weight: 400;
  line-height: 1.36;
  margin: 0;
}

/* ---------- Katalog ---------- */
.catalog-page {
  padding: 104px 46px 250px;
}

/* Lebar total 1180px = kolom gambar 292 + jarak 64 + kolom teks 824.
   Kolom teks 824px inilah yang menentukan pemenggalan baris deskripsi. */
.catalog-page__inner {
  display: flex;
  flex-direction: column;
  gap: 66px;
  margin: 0 auto;
  max-width: 1180px;
}

.product-row {
  align-items: start;
  display: grid;
  gap: 64px;
  grid-template-columns: 292px minmax(0, 1fr);
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.product-row:hover {
  filter: saturate(1.03);
  transform: translateY(-2px);
}

.product-row__media {
  align-items: center;
  display: flex;
  flex-direction: column;
}

/* Satu ukuran kotak untuk ketiga foto; object-fit: contain menjaga
   bentuk asli tiap produk (tahu melebar, botol memanjang). */
.product-row__image {
  height: 157px;
  position: relative;
  width: 240px;
}

.product-row__image img {
  object-fit: contain;
}

.product-row__price {
  align-items: center;
  background: var(--brand-red);
  border-radius: 999px;
  color: #ffffff;
  display: flex;
  font-size: 1.59rem;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  margin: 18px 0 0;
  min-height: 68px;
  padding: 0 24px;
  width: 292px;
}

.product-row__content h2 {
  font-size: 1.59rem;
  font-weight: 900;
  line-height: 1.25;
  margin: 0 0 12px;
}

.product-row__content p {
  color: #202020;
  font-size: 1.33rem;
  font-weight: 400;
  line-height: 1.36;
  margin: 0;
}

/* ---------- Kontak ---------- */
.contact-page {
  padding: 124px 24px 66px;
  text-align: center;
}

.contact-page__inner {
  margin: 0 auto;
  max-width: 850px;
}

.contact-page h1 {
  font-size: clamp(1.15rem, 1.95vw, 1.62rem);
  font-weight: 900;
  line-height: 1.3;
  margin: 0 0 44px;
}

.contact-links {
  align-items: center;
  display: grid;
  gap: 36px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 auto 34px;
  max-width: 560px;
}

.contact-links a,
.contact-address {
  color: #111111;
  display: inline-block;
  font-size: clamp(1rem, 1.55vw, 1.28rem);
  font-weight: 400;
  line-height: 1.35;
  transition: color 180ms ease;
}

.contact-links a:hover,
.contact-address:hover {
  color: var(--brand-red);
}

.map-embed {
  border: 0;
  border-radius: 18px;
  height: 320px;
  margin-top: 42px;
  width: 100%;
}

/* ---------- Animasi reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 560ms ease,
    transform 560ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fallback: jika JavaScript dimatikan, konten tetap terlihat */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .product-row,
  .site-header__nav a {
    transition: none;
  }
}

/* ---------- Responsif: tablet ---------- */
@media (max-width: 1023px) {
  .site-header__inner {
    grid-template-columns: 130px 1fr;
    padding: 0 28px;
  }

  .site-header__nav {
    grid-template-columns: repeat(4, minmax(92px, 1fr));
  }

  .hero-banner--profile,
  .hero-banner--katalog {
    height: 460px;
  }

  .hero-banner--kontak {
    height: 690px;
  }

  .feature-card {
    padding: 26px 16px 22px;
  }

  .catalog-page__inner {
    max-width: 850px;
  }

  .product-row {
    gap: 40px;
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .product-row__image {
    height: 140px;
    width: 210px;
  }

  .product-row__price {
    font-size: 1.35rem;
    min-height: 60px;
    width: 250px;
  }

  .product-row__content h2 {
    font-size: 1.4rem;
  }

  .product-row__content p {
    font-size: 1.18rem;
  }
}

/* ---------- Responsif: mobile ---------- */
@media (max-width: 767px) {
  .site-header {
    height: 76px;
  }

  .site-header__inner {
    display: flex;
    height: 76px;
    justify-content: space-between;
    padding: 0 18px;
  }

  .site-header__logo {
    height: 76px;
    width: 76px;
  }

  .site-header__logo img {
    height: 92px;
    margin-top: 12px;
  }

  .site-header__toggle {
    align-items: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    height: 44px;
    justify-content: center;
    padding: 0;
    width: 44px;
  }

  .site-header__toggle span {
    background: #ffffff;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 27px;
  }

  .site-header__nav {
    background: var(--brand-red);
    box-shadow: 0 18px 30px rgba(61, 0, 0, 0.2);
    display: grid;
    gap: 4px;
    grid-template-columns: 1fr;
    height: auto;
    left: 0;
    opacity: 0;
    padding: 14px 18px 20px;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 76px;
    transform: translateY(-8px);
    transition:
      opacity 180ms ease,
      transform 180ms ease;
  }

  .site-header__nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .site-header__nav a {
    border-radius: 14px;
    font-size: 1.08rem;
    padding: 14px 10px;
    text-align: center;
    width: 100%;
  }

  .site-header__nav a.is-active {
    background: rgba(255, 255, 255, 0.12);
  }

  /* Di layar kecil banner dibuat lebih tinggi agar tahu terlihat besar.
     Sisi kiri-kanan sedikit terpotong, lengkung cream tetap utuh. */
  .hero-banner--home {
    aspect-ratio: 4 / 3;
  }

  .hero-banner--profile,
  .hero-banner--katalog {
    height: 310px;
  }

  .hero-banner--kontak {
    height: 500px;
  }

  .home-main {
    padding: 58px 18px 62px;
  }

  /* Di layar kecil kartu ditumpuk ke bawah, tumpang tindihnya jadi vertikal */
  .feature-grid {
    flex-direction: column;
    max-width: 430px;
  }

  .feature-card {
    flex: 0 0 auto;
    min-height: auto;
    padding: 32px 26px 34px;
    width: 100%;
  }

  /* Tumpang tindih jadi vertikal: latar melebar ke ATAS, bukan ke kiri */
  .feature-card:nth-child(2)::before,
  .feature-card:nth-child(3)::before {
    left: 0;
    top: calc(var(--card-radius) * -1);
  }

  .feature-card__icon {
    height: 74px;
  }

  .text-page {
    padding: 76px 22px 156px;
  }

  .text-block + .text-block {
    margin-top: 72px;
  }

  .text-block h1,
  .text-block h2 {
    font-size: 1.26rem;
  }

  .text-block p {
    font-size: 1.06rem;
  }

  .catalog-page {
    padding: 72px 22px 140px;
  }

  .catalog-page__inner {
    gap: 78px;
  }

  .product-row {
    gap: 24px;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .product-row__image {
    height: 150px;
    width: min(230px, 70vw);
  }

  .product-row__price {
    font-size: 1.2rem;
    min-height: 56px;
    width: min(270px, 82vw);
  }

  .product-row__content h2 {
    font-size: 1.3rem;
  }

  .product-row__content p {
    font-size: 1.08rem;
  }

  .contact-page {
    padding: 84px 20px 62px;
  }

  .contact-links {
    gap: 18px;
    grid-template-columns: 1fr;
    margin-bottom: 24px;
  }
}

/* ---------- Responsif: layar sangat kecil ---------- */
@media (max-width: 374px) {
  .product-row__price {
    font-size: 1.08rem;
    width: 242px;
  }

  .home-description,
  .feature-card p,
  .text-block p,
  .product-row__content p,
  .contact-links a,
  .contact-address {
    font-size: 0.94rem;
  }
}
