/* =====================================================================
   Sunrise Pujor Satkahon — shared theme for all inner pages
   (same artwork as the home page: yellow glow, chadmala, red wave, lotus, kash)
   ===================================================================== */
:root {
  --page-bg:
    radial-gradient(ellipse 60% 45% at 50% 18%, rgba(255, 246, 170, .9), rgba(255, 246, 170, 0) 70%),
    url("../images/home/bg-plain.webp") center top / cover no-repeat,
    #fcc80a;
  --yellow: #fcc80a;
  --yellow-soft: #fde68a;
  --red: #eb2c2c;
  --red-dark: #c92222;
  --maroon: #911f1f;
  --cream: #fffaf0;
  --ink: #2b1a12;
  --muted: #6b5a4e;
  --radius: 16px;
  --shadow: 0 6px 22px rgba(145, 31, 31, .12);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  display: flex; flex-direction: column;
  color: var(--ink);
  font: 15px/1.6 "Poppins", Arial, sans-serif;
  background: var(--page-bg);
  background-attachment: fixed;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- Header ---------------- */
.th-head {
  position: relative;
  max-width: 1280px; width: 100%;
  margin: 0 auto;
  padding: calc(var(--fr-gap) + var(--fr-w) + 16px) 16px 6px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
}
/* Fixed ornamental border (stays put while the page scrolls underneath) */
:root {
  --fr-gap: 10px; --fr-w: 24px; --fr-len: 360px;   /* border position & size */
  --ch-h: 190px;                                   /* chadmala height (width ≈ 0.245 × height) */
  --side: calc(var(--fr-gap) + var(--fr-w) + var(--ch-h) * .245 + 22px);  /* keeps content clear of border + chadmala */
}
.th-frame { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.th-frame i { position: absolute; display: block; }
/* Opaque strip above the top border: content scrolls away underneath it */
.th-frame::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: calc(var(--fr-gap) + var(--fr-w) + 6px);
  background: var(--page-bg); background-attachment: fixed;
}
.th-frame .t { left: var(--fr-gap); right: var(--fr-gap); height: var(--fr-w); background-repeat: repeat-x; background-size: var(--fr-len) var(--fr-w); }
.th-frame .l, .th-frame .r { top: calc(var(--fr-gap) + var(--fr-w)); bottom: 0; width: var(--fr-w); background-repeat: repeat-y; background-size: var(--fr-w) var(--fr-len); }
.th-frame .t { top: var(--fr-gap);    background-image: url("../images/home/frame-top.webp"); background-position: center top; }
.th-frame .l { left: var(--fr-gap);   background-image: url("../images/home/frame-left.webp"); background-position: left center; }
.th-frame .r { right: var(--fr-gap);  background-image: url("../images/home/frame-right.webp"); background-position: right center; }

/* Fixed hanging chadmala, just inside the border */
.th-chadmala { position: fixed; z-index: 1; top: calc(var(--fr-gap) + var(--fr-w) - 2px); height: var(--ch-h); width: auto; pointer-events: none; }
.th-chadmala.l { left: calc(var(--fr-gap) + var(--fr-w) + 10px); }
.th-chadmala.r { right: calc(var(--fr-gap) + var(--fr-w) + 10px); }

.th-itc  { justify-self: start; margin-left: max(0px, calc(var(--side) - 16px)); width: clamp(50px, 6vw, 86px); }
.th-sun  { justify-self: end; margin-right: max(0px, calc(var(--side) - 16px)); width: clamp(60px, 8vw, 120px); }
.th-logo { width: clamp(150px, 20vw, 250px); }
.th-logo:hover, .th-itc:hover, .th-sun:hover { text-decoration: none; }

/* Navigation pills */
.th-nav {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: 10px auto 4px; padding: 0 16px;
}
.th-nav a {
  padding: 7px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .85); color: var(--maroon);
  border: 1.5px solid var(--red);
  font-weight: 600; font-size: 13px; letter-spacing: .3px;
  transition: background .15s, color .15s, transform .15s;
}
.th-nav a:hover { background: #fff; text-decoration: none; transform: translateY(-1px); }
.th-nav a.on { background: var(--red); color: #fff; }

/* ---------------- Main ---------------- */
.th-main { flex: 1 0 auto; width: 100%; max-width: calc(1000px + 2 * var(--side)); margin: 0 auto; padding: 8px var(--side) 0; position: relative; z-index: 2; }
.th-title { text-align: center; margin: 10px 0 14px; }
.th-title h1 {
  margin: 0; color: var(--maroon);
  font-size: clamp(22px, 3vw, 30px); line-height: 1.25; font-weight: 800;
}
.th-title p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.th-card {
  background: var(--cream);
  border-radius: var(--radius);
  border-top: 5px solid var(--red);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin: 0 0 16px;
}
.th-card h2 { color: var(--maroon); margin: 0 0 10px; font-size: 20px; line-height: 1.3; }

.th-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #ff4b3a, var(--red) 55%, var(--red-dark));
  color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 4px 0 #8b1a14, 0 6px 14px rgba(0, 0, 0, .15);
  transition: transform .12s, box-shadow .12s;
}
.th-btn:hover { text-decoration: none; transform: translateY(-1px); }
.th-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #8b1a14; }
.th-btn.wa { background: linear-gradient(180deg, #34e07a, #25d366 55%, #1da955); box-shadow: 0 4px 0 #128c4a, 0 6px 14px rgba(0,0,0,.15); }
.th-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Search / filter row */
.th-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.th-filters input, .th-filters select {
  flex: 1 1 220px; padding: 11px 14px; font-size: 14px;
  border: 1.5px solid #f0c27a; border-radius: 12px; background: #fff; color: var(--ink);
}
.th-filters input:focus, .th-filters select:focus { outline: 2px solid var(--red); border-color: transparent; }
.th-filters .th-btn { padding: 10px 20px; }

/* Puja cards grid (All Pujas / Results) */
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.th-puja {
  display: flex; gap: 12px; align-items: center;
  background: var(--cream); border-radius: 14px; padding: 12px 14px;
  border-left: 5px solid var(--red); box-shadow: 0 2px 10px rgba(145,31,31,.10); color: var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.th-puja:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(145,31,31,.18); }
.th-puja img { width: 46px; height: 46px; flex: 0 0 46px; }
.th-puja h3 { margin: 0 0 2px; font-size: 15px; line-height: 1.3; color: var(--ink); }
.th-puja .meta { font-size: 12px; color: var(--muted); }
.th-puja .code { font-size: 12px; font-weight: 700; color: var(--red); }
.th-rank {
  flex: 0 0 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff; font-weight: 800; font-size: 16px;
}
.th-rank.gold { background: linear-gradient(135deg, #f7d354, #c9940a); }
.th-rank.silver { background: linear-gradient(135deg, #e3e6ea, #9aa0a6); }
.th-rank.bronze { background: linear-gradient(135deg, #e0a36b, #a8622d); }
.th-score { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.th-score strong { display: block; font-size: 19px; color: var(--maroon); line-height: 1.1; }
.th-empty { text-align: center; color: var(--muted); }
.th-pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 18px 0 0; }
.th-pager a, .th-pager span { padding: 7px 14px; border-radius: 10px; background: #fff; border: 1px solid #f0c27a; color: var(--maroon); font-size: 14px; font-weight: 600; }
.th-pager span { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------------- Footer: red wave + lotus + kash ---------------- */
.th-foot {
  position: relative; flex-shrink: 0;
  margin-top: 36px;
  height: clamp(150px, 19vw, 280px);
  pointer-events: none;
}
.th-foot .wave   { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; object-fit: fill; }
.th-foot .lotus  { position: absolute; left: 3%; bottom: 0; width: min(58%, 820px); }
.th-foot .kash   { position: absolute; right: 1.5%; bottom: 6%; width: clamp(80px, 12vw, 200px); }
.th-bar {
  position: relative; z-index: 3; flex-shrink: 0;
  background: linear-gradient(180deg, var(--maroon) 0%, #6f1515 100%);
  color: #ffe9c2; text-align: center;
  padding: 18px 16px 16px;
}
.th-bar::before {                       /* gold divider, like the gold edge of the wave */
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(560px, 80%); height: 2px;
  background: linear-gradient(90deg, transparent, #f5c542 20%, #ffe08a 50%, #f5c542 80%, transparent);
}
.th-bar-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.th-bar-links a {
  color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .3px;
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid rgba(255, 224, 138, .55); background: rgba(255, 255, 255, .06);
  transition: background .15s, border-color .15s;
}
.th-bar-links a:hover { text-decoration: none; background: rgba(255, 224, 138, .18); border-color: #ffe08a; }
.th-bar-tag { font-size: 12px; color: #f3d9a8; letter-spacing: .4px; }
.th-bar-tag b { color: #ffe08a; font-weight: 600; }

/* ---------------- Tablet ---------------- */
@media (max-width: 1100px) {
  :root { --ch-h: 140px; }
}

/* ---------------- Mobile ---------------- */
@media (max-width: 700px) {
  :root {
    --page-bg:
      radial-gradient(ellipse 90% 30% at 50% 12%, rgba(255, 246, 170, .95), rgba(255, 246, 170, 0) 70%),
      linear-gradient(180deg, #fde047 0%, #fcc80a 45%, #f9b908 100%);
  }
  :root { --fr-gap: 5px; --fr-w: 15px; --fr-len: 225px; --ch-h: 72px;
          --side: calc(var(--fr-gap) + var(--fr-w) + var(--ch-h) * .245 + 10px); }
  .th-chadmala.l { left: calc(var(--fr-gap) + var(--fr-w) + 3px); }
  .th-chadmala.r { right: calc(var(--fr-gap) + var(--fr-w) + 3px); }
  .th-head { padding-left: 8px; padding-right: 8px; }
  .th-itc { margin-left: calc(var(--side) - 8px); width: 42px; }
  .th-sun { margin-right: calc(var(--side) - 8px); width: 54px; }
  .th-logo { width: 140px; }
  .th-card { padding: 16px; }
  .th-foot { height: 120px; }
  .th-bar-links a { padding: 5px 12px; font-size: 12px; }
  .th-foot .lotus { width: 92%; left: 2%; }
  .th-foot .kash { width: 70px; }
}
@media print {
  body { background: #fff; }
  .th-frame, .th-chadmala, .th-nav, .th-foot, .th-bar { display: none; }
  .th-card { box-shadow: none; border: 0; }
}
