/* ==========================================================================
   Twelve Days of Clearance — halaman "Before Campaign"
   Figma: mobile 2336:19324 (390px) · desktop 2336:19248 (1280px)
   Mobile-first; desktop mulai 768px.

   Isi: Tokens · Base · Layout · Teks · Countdown · Tombol ·
        Menu Add to Calendar · Banner
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --green-900: #075140;
  --red-700: #b10200;
  --midnight-2: #2a2a68;
  --white: #fff;

  --teal-300: #68cbcb;

  --font: "Montserrat", system-ui, sans-serif;
  --radius-s: 8px;

  /* Transisi Spring (Figma: Based on Time · Time 0.4 · Bounce 0.2 · Delay 0)
     = spring stiffness ≈ 506, damping ≈ 36, mass 1; overshoot ±1.5%.
     Disampel jadi 41 titik untuk easing linear(). */
  --spring-duration: 0.4s;
  --spring-delay: 0s;
  --spring-ease: linear(
    0, 0.0224, 0.0794, 0.1581, 0.2486, 0.3435, 0.4375, 0.5269, 0.6093, 0.6833,
    0.7484, 0.8044, 0.8518, 0.8911, 0.9231, 0.9487, 0.9688, 0.9841, 0.9954,
    1.0036, 1.0091, 1.0125, 1.0144, 1.0151, 1.015, 1.0142, 1.0131, 1.0118,
    1.0104, 1.0089, 1.0076, 1.0063, 1.0051, 1.0041, 1.0032, 1.0024, 1.0018,
    1.0013, 1.0009, 1.0006, 1
  );

  /* Pola latar: 1 unit belah ketupat (pattern-tile.png, 85×184px) yang diulang.
     Opacity 10% sudah tertanam di file PNG-nya (alpha 26/255).
     Ditampilkan 45.66×98.94px = 85% dari skala pola di Figma (53.72×116.4px). */
  --pattern-tile: url("assets/pattern-tile.png");
  --pattern-w: 45.66px;
  --pattern-h: 98.94px;

  /* Skala mobile */
  --page-pad-block: 32px;
  --page-pad-inline: 32px;
  --title-size: 32px;
  --text-size: 16px;
  --text-leading: 1.6;
  --cd: 0.5; /* countdown mobile = 50% ukuran desktop */
}

@media (min-width: 768px) {
  :root {
    --page-pad-block: 64px;
    --title-size: 48px;
    --text-size: 24px;
    --text-leading: 1.2;
    --cd: 1;
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Hijau + pola dalam SATU latar di <html>. Saat scroll mentok (bounce),
   browser mengisi area pantulan dengan background-color halaman → hijau. */
html {
  background-color: var(--green-900);
  background-image: var(--pattern-tile);
  background-size: var(--pattern-w) var(--pattern-h);
  background-repeat: round;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-family: var(--font);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* Elemen form tidak mewarisi font secara default → paksa ikut halaman */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- Layout ---------- */
.campaign {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: calc(1216px + 2 * var(--page-pad-inline));
  margin-inline: auto;
  padding: calc(var(--page-pad-block) + 32px) var(--page-pad-inline) var(--page-pad-block);
  text-align: center;
}

.campaign__intro {
  display: contents; /* judul & lead tetap ikut gap 24px */
}

/* ---------- Teks ---------- */
.campaign__title {
  margin: 0;
  font-size: var(--title-size);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.campaign__lead,
.campaign__note {
  margin: 0;
  font-size: var(--text-size);
  line-height: var(--text-leading);
  text-wrap: balance;
}

.campaign__lead strong {
  font-weight: 700;
}

/* ---------- Countdown ---------- */
.countdown {
  display: flex;
  justify-content: center;
  gap: calc(28px * var(--cd));
}

.countdown__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Titik dua di antara kotak */
.countdown__item + .countdown__item::before {
  content: ":";
  position: absolute;
  top: 0;
  right: 100%;
  display: grid;
  place-items: center;
  width: calc(28px * var(--cd));
  height: calc(68px * var(--cd));
  font-size: calc(28px * var(--cd));
  font-weight: 700;
  line-height: 1;
}

.countdown__value {
  display: grid;
  place-items: center;
  width: calc(72px * var(--cd));
  height: calc(68px * var(--cd));
  border-radius: calc(14px * var(--cd));
  background: var(--white);
  color: var(--red-700);
  font-size: calc(40px * var(--cd));
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown__label {
  padding-top: calc(12px * var(--cd));
  font-size: calc(20px * var(--cd));
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---------- Tombol ---------- */
.campaign__actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

@media (min-width: 768px) {
  .campaign__actions {
    flex-direction: row;
    justify-content: center;
    width: auto;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 4px 16px;
  border: 1px solid var(--white);
  border-radius: var(--radius-s);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition-property: color, border-color;
  transition-duration: var(--spring-duration);
  transition-delay: var(--spring-delay);
  transition-timing-function: cubic-bezier(0.25, 1, 0.5, 1); /* fallback tanpa linear() */
}

@supports (transition-timing-function: linear(0, 1)) {
  .btn {
    transition-timing-function: var(--spring-ease);
  }
}

.btn:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

.btn--solid {
  background: var(--white);
  color: var(--midnight-2);
}

.btn--outline {
  background: transparent;
  color: var(--white);
}

/* Hover (dan focus keyboard) → teks/garis jadi #68CBCB */
.btn--solid:hover,
.btn--solid:focus-visible {
  color: var(--teal-300);
}

.btn--outline:hover,
.btn--outline:focus-visible {
  color: var(--teal-300);
  border-color: var(--teal-300);
}

.btn--solid[aria-expanded="true"] {
  color: var(--teal-300);
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition-duration: 0.01s;
  }
}

/* ---------- Menu Add to Calendar ---------- */
.calendar {
  position: relative;
  display: flex;
  flex-direction: column;
}

.calendar__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 10;
  min-width: 100%;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: var(--radius-s);
  background: var(--white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transform: translateX(-50%);
  text-align: left;
}

.calendar__menu[hidden] {
  display: none;
}

.calendar__option {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--midnight-2);
  font: 700 16px/1.6 var(--font); /* sama dengan tombol (Label/L) */
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.calendar__option:hover,
.calendar__option:focus-visible {
  outline: none;
  background: rgba(104, 203, 203, 0.18); /* --teal-300 transparan */
}

/* ---------- Banner ---------- */
.campaign__banner {
  display: block;
  width: 100%;
  margin-top: 24px; /* 24 + 24 gap = 48px seperti di Figma */
}

.campaign__banner img {
  width: 100%;
}
