/* ==========================================================================
   Festive campaign page (festive.php). The site's own palette (cream, ink, terracotta) with
   small Diwali touches (a lit diya, marigold flame). Phone layout first; the
   page is short: hero, three boxes, four facts, a bulk panel, questions.
   ========================================================================== */

.d3 {
  --d3-bg:      #f5f1eb;                     /* the homepage's section cream */
  --d3-card:    #fffcf8;
  --d3-soft:    hsl(32 30% 93%);
  --d3-ink:     hsl(20 30% 9%);
  --d3-muted:   hsl(22 12% 38%);
  --d3-line:    hsl(24 18% 86%);
  --d3-accent:  hsl(17.21deg 53.53% 52.75%);
  --d3-accent-d: #a9532f;
  --d3-flame:   #e9a23b;
  --d3-ease:    cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--d3-bg); color: var(--d3-ink);
}
.d3 h1, .d3 h2, .d3 h3 { margin: 0; color: var(--d3-ink); }
.d3 p { margin: 0; }
.d3 em { font-style: italic; color: var(--d3-accent); }
.d3-wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- Buttons ---------- */
.d3-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--d3-accent); color: #fff; text-decoration: none; white-space: nowrap;
  font: 600 .95rem/1 "Inter", sans-serif;
  box-shadow: 0 12px 28px -14px hsl(17 53% 45% / .7);
  transition: background .2s, transform .2s var(--d3-ease);
}
.d3-btn:hover { background: var(--d3-accent-d); color: #fff; transform: translateY(-1px); }
.d3-btn:active { transform: translateY(0) scale(.98); }
.d3-btn:focus-visible { outline: 2px solid var(--d3-ink); outline-offset: 3px; }
.d3-btn-sm { padding: 10px 18px; font-size: .88rem; box-shadow: none; }
.d3-btn-wide { width: 100%; padding: 16px 24px; }
.d3-btn.is-off { background: var(--d3-soft); color: var(--d3-muted); pointer-events: none; }
.d3-link { display: inline-flex; align-items: center; gap: 6px; color: var(--d3-ink); font-weight: 600; text-decoration: none; font-size: .95rem; }
.d3-link:hover { color: var(--d3-accent); }

/* ---------- A small lit diya ---------- */
.d3-diya { position: relative; display: inline-block; width: 20px; height: 18px; flex: none; }
.d3-diya::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; border-radius: 2px 2px 12px 12px / 2px 2px 8px 8px; background: linear-gradient(#d4744d, #a44b2c); }
.d3-diya::after {
  content: ""; position: absolute; left: 50%; bottom: 7px; width: 7px; height: 11px; margin-left: -3.5px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 78%, #fff3c4 0%, var(--d3-flame) 60%, #d9661a 100%);
  box-shadow: 0 0 8px 2px rgba(233, 162, 59, .45); transform-origin: 50% 100%;
}

/* ---------- Hero (phone first: copy, then the photo as a short banner) ---------- */
.d3-hero {
  position: relative; isolation: isolate; overflow-x: clip; padding: 126px 0 34px;
  /* the same warm blush wash as the homepage hero */
  background:
    linear-gradient(180deg, transparent 72%, var(--d3-bg) 100%),           /* melt into the page below */
    radial-gradient(circle at 15% 18%, rgba(199, 107, 70, .10), transparent 24%),
    radial-gradient(circle at 82% 30%, rgba(244, 196, 160, .18), transparent 28%),
    radial-gradient(circle at 55% 82%, rgba(199, 107, 70, .08), transparent 24%),
    linear-gradient(135deg, #fbf6f1 0%, #f3e3d8 45%, #f8efe8 100%);
}
.d3-hero::before { /* a warm wash of lamplight behind the photo */
  content: ""; position: absolute; z-index: -1; right: -10%; top: 30%; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 162, 59, .16), transparent 65%);
}
.d3-toran { position: absolute; left: 0; right: 0; top: 70px; width: 100%; height: 46px; pointer-events: none; }

/* Tiny four-point sparkles */
.d3-spark {
  position: absolute; left: var(--x); top: var(--y); width: 14px; height: 14px; z-index: -1;
  background: var(--d3-flame); opacity: .7;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.d3-spark.is-sm { width: 9px; height: 9px; }

/* Soft glints scattered through sections by the page script */
[data-glints] { position: relative; isolation: isolate; }
.d3-glint {
  position: absolute; z-index: -1; pointer-events: none; opacity: .35;
  background: var(--d3-flame);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.d3-bulk-card .d3-glint { background: #f5c46a; }

/* Hero photo: a faint rangoli ring behind it */
.d3-hero-art { position: relative; width: min(280px, 74%); margin: 34px auto 10px; padding: 18px 0 14px; }
.d3-rangoli { /* fine rangoli rings that peek out around the photo: two thin circles with a ring of dots between */
  position: absolute; z-index: -1; left: 50%; top: 50%; width: 118%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, transparent 79.4%, hsl(17 53% 53% / .4) 79.7%, transparent 80.2%),
    radial-gradient(circle closest-side, transparent 96.4%, hsl(17 53% 53% / .28) 96.7%, transparent 97.2%);
}
.d3-rangoli::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(hsl(36 80% 55% / .6) 0 1.2deg, transparent 1.2deg 7.5deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 85%, #000 85.4%, #000 90.6%, transparent 91%);
          mask: radial-gradient(circle closest-side, transparent 85%, #000 85.4%, #000 90.6%, transparent 91%);
}

/* Non-Diwali themes: a gift icon in the chip and a small heart on the dividers */
.d3-chip-icon { color: var(--d3-accent); font-size: .95rem; }
.d3-orn-heart { color: var(--d3-accent); font-size: .8rem; opacity: .8; }

/* Shown only when an admin previews a switched-off campaign */
.d3-preview { position: relative; z-index: 3; margin: 0; padding: 82px 16px 10px; text-align: center; background: #fff4d6; color: #7a4b00; font-size: .88rem; font-weight: 600; }
.d3-preview + .d3-hero { padding-top: 96px; }

/* Small ornament between sections: a diya (or heart) on a dotted line */
.d3-orn { display: flex; align-items: center; gap: 14px; margin: 0 auto 22px; max-width: 280px; }
.d3-orn::before, .d3-orn::after {
  content: ""; flex: 1; height: 2px;
  background: radial-gradient(circle, hsl(17 53% 53% / .55) 1px, transparent 1.5px) 0 50% / 9px 2px repeat-x;
}
.d3-hero-grid { display: grid; gap: 22px; }
.d3-chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px 7px 10px; border-radius: 999px;
  background: var(--d3-card); border: 1px solid var(--d3-line); font-size: .84rem; color: var(--d3-muted);
}
.d3-chip strong { color: var(--d3-ink); font-weight: 600; }
.d3-hero h1 { margin-top: 16px; font-size: clamp(2.2rem, 7.6vw, 3.8rem); line-height: 1.05; letter-spacing: -0.025em; font-weight: 500; text-wrap: balance; }
.d3-hero h1 em { padding-bottom: .06em; }
.d3 .d3-lede { margin-top: 14px; font-size: 1.02rem; line-height: 1.6; color: var(--d3-muted); max-width: 46ch; }
.d3-cta { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.d3-hero-photo { margin: 0 auto; width: 74%; }
.d3-hero-photo img { display: block; width: 100%; height: auto; filter: drop-shadow(0 26px 26px hsl(20 30% 9% / .16)); }

/* ---------- Boxes (phone: compact rows, photo left; wider: three cards) ---------- */
.d3-boxes { padding: 22px 0 8px; }
.d3-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.d3-head h2 { font-size: clamp(1.6rem, 4.6vw, 2.2rem); font-weight: 500; letter-spacing: -0.02em; }
.d3-head p { color: var(--d3-muted); font-size: .95rem; }

.d3-list { display: grid; gap: 12px; }
.d3-box {
  display: grid; grid-template-columns: 116px 1fr; gap: 14px; padding: 12px;
  background: var(--d3-card); border: 1px solid var(--d3-line); border-radius: 18px;
  box-shadow: 0 1px 2px hsl(20 30% 9% / .04), 0 10px 26px -18px hsl(20 30% 9% / .22);
}
.d3-box-photo {
  position: relative; padding: 0; border: 0; cursor: zoom-in; background: var(--d3-soft);
  border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 5; align-self: start;
}
.d3-box-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--d3-ease); }
.d3-box-photo:hover img { transform: scale(1.04); }
.d3-box-photo:focus-visible { outline: 2px solid var(--d3-accent); outline-offset: 2px; }
.d3-zoom {
  position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 252, 248, .92); color: var(--d3-ink); font-size: .72rem;
}
.d3-box-body { display: flex; flex-direction: column; min-width: 0; }
.d3 .d3-box-tag { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--d3-accent); }
.d3-box h3 { margin-top: 4px; font-size: 1.4rem; line-height: 1.1; font-weight: 500; letter-spacing: -0.01em; }
.d3 .d3-box-desc {
  margin-top: 6px; font-size: .88rem; line-height: 1.5; color: var(--d3-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.d3-box-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.d3-price { font-family: "Fraunces", Georgia, serif; font-size: 1.3rem; font-weight: 500; font-variant-numeric: lining-nums tabular-nums; }
.d3 .d3-low { margin-top: 6px; font-size: .8rem; font-weight: 600; color: var(--d3-accent-d); }

/* ---------- Facts ---------- */
.d3-facts {
  list-style: none; margin: 18px 0 0; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px;
  background: var(--d3-soft); border-radius: 18px;
}
.d3-facts li { display: flex; gap: 10px; align-items: flex-start; font-size: .8rem; line-height: 1.4; color: var(--d3-muted); }
.d3-facts i { color: var(--d3-accent); font-size: 1.05rem; line-height: 1.2; }
.d3-facts strong { display: block; color: var(--d3-ink); font-size: .86rem; font-weight: 600; }

/* ---------- Bulk ---------- */
.d3-bulk { padding: 28px 0 8px; }
.d3-bulk-card {
  position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(60% 120% at 100% 0%, rgba(233, 162, 59, .22), transparent 60%), var(--d3-ink);
  color: hsl(32 30% 92%); border-radius: 22px; padding: 22px;
}
.d3-bulk-card::after { /* a faint rangoli quarter in the corner */
  content: ""; position: absolute; z-index: -1; right: -90px; top: -90px; width: 220px; aspect-ratio: 1; border-radius: 50%;
  background: repeating-conic-gradient(rgba(233, 162, 59, .28) 0 3deg, transparent 3deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 42%, #000 43%, #000 64%, transparent 65%);
          mask: radial-gradient(circle, transparent 42%, #000 43%, #000 64%, transparent 65%);
}
.d3-bulk-intro { display: flex; flex-direction: column; gap: 16px; }
.d3-bulk h2 { color: #fff; font-size: 1.55rem; font-weight: 500; }
.d3-bulk-intro p { margin-top: 6px; color: hsl(22 18% 72%); font-size: .93rem; line-height: 1.55; max-width: 52ch; }
.d3-bulk-intro .d3-btn { align-self: flex-start; }
.d3-bulk-panel { margin-top: 20px; }
.d3-grid { display: grid; gap: 12px; }
.d3-field label { display: block; margin-bottom: 6px; font-size: .82rem; font-weight: 600; color: hsl(32 30% 88%); }
.d3-field input, .d3-field select, .d3-field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid hsl(22 15% 30%);
  background: hsl(20 25% 13%); color: #fff; font: 500 .95rem/1.4 "Inter", sans-serif;
}
.d3-field input::placeholder, .d3-field textarea::placeholder { color: hsl(22 12% 55%); }
.d3-field input:focus, .d3-field select:focus, .d3-field textarea:focus { outline: none; border-color: var(--d3-accent); box-shadow: 0 0 0 3px hsl(17 53% 53% / .25); }
.d3-check { display: flex; gap: 10px; align-items: center; margin: 14px 0 16px; font-size: .9rem; }
.d3-check input { width: 18px; height: 18px; accent-color: var(--d3-accent); }
.d3-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.d3-err { display: none; margin-bottom: 12px; padding: 10px 14px; border-radius: 10px; background: #fdecea; color: #8a1c12; font-size: .9rem; }
.d3-err.show { display: block; }
.d3-sent { display: none; text-align: center; padding: 10px 0; }
.d3-sent.show { display: block; }
.d3-sent .d3-diya { transform: scale(1.6); margin: 8px 0 16px; }
.d3-sent h3 { color: #fff; font-size: 1.4rem; font-weight: 500; }
.d3-sent p { margin-top: 8px; color: hsl(22 18% 72%); font-size: .93rem; line-height: 1.55; }

/* ---------- Questions ---------- */
.d3-faq { padding: 28px 0 56px; }
.d3-faq h2 { font-size: 1.55rem; font-weight: 500; margin-bottom: 6px; }
.d3-faq details { border-bottom: 1px solid var(--d3-line); }
.d3-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; font-weight: 600; font-size: .98rem; }
.d3-faq summary::-webkit-details-marker { display: none; }
.d3-faq summary i { color: var(--d3-accent); transition: transform .3s var(--d3-ease); flex: none; }
.d3-faq details[open] summary i { transform: rotate(45deg); }
.d3-faq details p { padding: 0 0 16px; color: var(--d3-muted); line-height: 1.6; font-size: .95rem; max-width: 66ch; }
.d3-faq a { color: var(--d3-accent); }

/* ---------- Photo viewer ---------- */
.d3-zoombox { border: 0; padding: 0; border-radius: 18px; max-width: min(520px, 92vw); background: var(--d3-card); overflow: hidden; }
.d3-zoombox::backdrop { background: hsl(20 30% 9% / .7); }
.d3-zoombox img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; background: var(--d3-soft); }
.d3-zoombox p { padding: 12px 16px; font-weight: 600; font-size: .95rem; }
.d3-zoom-x {
  position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(255, 252, 248, .95); color: var(--d3-ink); font-size: 1.3rem; line-height: 1; cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .d3-diya::after { animation: d3-flicker 2.4s ease-in-out infinite; }
  .d3-spark { animation: d3-twinkle 3.2s ease-in-out infinite; animation-delay: var(--d); }
  .d3-glint { animation: d3-twinkle 3.6s ease-in-out infinite; }
}
@keyframes d3-twinkle { 0%, 100% { opacity: .15; transform: scale(.6) rotate(0); } 50% { opacity: .85; transform: scale(1) rotate(20deg); } }
@keyframes d3-flicker { 0%, 100% { transform: scale(1) rotate(-1deg); } 40% { transform: scale(.93, 1.08) rotate(2deg); } 70% { transform: scale(1.05, .95) rotate(-1.5deg); } }

/* ---------- Wider screens ---------- */
@media (min-width: 640px) {
  .d3-grid { grid-template-columns: 1fr 1fr; }
  .d3-span { grid-column: 1 / -1; }
  .d3-facts { grid-template-columns: repeat(4, 1fr); padding: 18px 20px; }
  .d3-bulk-card { padding: 28px 32px; }
  .d3-bulk-intro { flex-direction: row; align-items: center; justify-content: space-between; gap: 28px; }
  .d3-bulk-intro .d3-btn { align-self: center; }
}
@media (min-width: 900px) {
  .d3-hero { padding: 190px 0 44px; }
  .d3-toran { height: 58px; }
  .d3-hero-art { justify-self: end; width: 100%; max-width: 400px; margin: 0; padding: 24px 0 16px; }
  .d3-hero-grid { grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
  .d3-head { flex-direction: row; align-items: baseline; justify-content: space-between; }
  .d3-list { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .d3-box { grid-template-columns: 1fr; padding: 12px 12px 16px; }
  .d3-box-photo { aspect-ratio: 1; }
  .d3-box-body { padding: 4px 6px 0; }
  .d3-box-desc { -webkit-line-clamp: 3; }
}

/* ---------- Arriving from the Diwali link or pill: the page opens out of the same warm light ---------- */
html.dv-arrive::after {
  content: ""; position: fixed; inset: 0; z-index: 2147482990; pointer-events: none; background: #f6e6d2;
  animation: dv-lift .8s .1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes dv-lift { to { opacity: 0; visibility: hidden; } }
@view-transition { navigation: auto; }
