:root {
  color-scheme: light;
  --bg: #f8f1df;
  --surface: #fffdf7;
  --surface-soft: #fff6df;
  --ink: #2b2012;
  --muted: #7a6750;
  --line: #ead8b5;
  --primary: #8f1f1f;
  --primary-dark: #651414;
  --accent: #c8942f;
  --accent-soft: #fff0c4;
  --saffron: #d86f28;
  --shadow: 0 22px 62px rgba(91, 48, 18, 0.17);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Leelawadee UI", "Tahoma", system-ui, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(143, 31, 31, 0.16), transparent 360px),
    radial-gradient(circle at 12% 4%, rgba(216, 111, 40, 0.18), transparent 300px),
    radial-gradient(circle at 88% 8%, rgba(200, 148, 47, 0.2), transparent 300px),
    repeating-linear-gradient(135deg, rgba(200, 148, 47, 0.07) 0 1px, transparent 1px 18px),
    var(--bg);
}

.page-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.site-header {
  display: grid;
  place-items: center;
  padding: 4px 0 18px;
}

.temple-logo {
  display: grid;
  place-items: center;
  width: clamp(54px, 7vw, 82px);
  aspect-ratio: 1;
  border: 2px solid rgba(200, 148, 47, 0.78);
  border-radius: 999px;
  color: var(--primary-dark);
  background:
    radial-gradient(circle at 50% 34%, #fffdf7 0 28%, #fff0c4 29% 62%, #c8942f 63% 100%);
  box-shadow: 0 10px 22px rgba(91, 48, 18, 0.14);
}

.temple-logo span {
  display: grid;
  place-items: center;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 999px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  font-size: clamp(1rem, 2vw, 1.55rem);
  font-weight: 900;
  line-height: 1;
}

.temple-logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: contain;
  background: #fffdf7;
}

.banner {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(200, 148, 47, 0.5);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.banner::before,
.banner::after {
  content: "";
  display: block;
  height: 10px;
  background: linear-gradient(90deg, var(--primary-dark), var(--accent), var(--saffron), var(--accent), var(--primary-dark));
}

.banner-art {
  display: block;
  min-height: 0;
  background: #3b1e12;
}

.cover-frame img,
.cover-placeholder {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 0;
  box-shadow: none;
}

.cover-frame img {
  display: block;
  object-fit: cover;
}

.cover-placeholder {
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
  border: 0;
  color: #fffaf0;
  background:
    linear-gradient(135deg, rgba(101, 20, 20, 0.96), rgba(143, 31, 31, 0.88)),
    radial-gradient(circle at 20% 12%, rgba(255, 240, 196, 0.3), transparent 260px),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 18px);
}

.cover-placeholder[hidden] {
  display: none !important;
}

.cover-placeholder span {
  display: block;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  font-weight: 900;
}

.banner-copy {
  position: relative;
  display: grid;
  gap: 12px;
  padding: clamp(24px, 4vw, 46px);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(255, 248, 229, 0.96)),
    repeating-linear-gradient(90deg, rgba(200, 148, 47, 0.08) 0 1px, transparent 1px 32px);
}

.banner-copy::before {
  content: "";
  position: absolute;
  inset: 16px 16px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 148, 47, 0.75), transparent);
}

.eyebrow {
  width: fit-content;
  margin: 0;
  padding: 7px 14px;
  border: 1px solid rgba(200, 148, 47, 0.45);
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--accent-soft);
  font-size: 0.94rem;
  font-weight: 900;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--primary-dark);
  font-size: clamp(3.1rem, 8vw, 6.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.lead {
  max-width: 860px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.8vw, 1.32rem);
  line-height: 1.78;
}

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.detail-item {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(255, 247, 225, 0.92));
  box-shadow: 0 12px 30px rgba(91, 48, 18, 0.08);
}

.detail-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: linear-gradient(180deg, var(--accent), var(--primary), var(--saffron));
}

.detail-label {
  display: block;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 0.96rem;
  font-weight: 900;
}

.detail-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.18rem;
  line-height: 1.38;
}

.detail-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.68;
}

.donation-panel {
  padding: clamp(20px, 3.5vw, 34px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(255, 248, 230, 0.96));
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

h2 {
  margin: 8px 0 0;
  color: var(--primary-dark);
  font-size: clamp(1.85rem, 3vw, 2.75rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.refresh-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(101, 20, 20, 0.2);
  border-radius: 999px;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(101, 20, 20, 0.2);
}

.refresh-button:hover {
  background: linear-gradient(135deg, #a92828, var(--primary-dark));
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.table-status {
  display: inline-flex;
  min-height: 30px;
  margin: 0 0 16px;
  padding: 6px 12px;
  align-items: center;
  border: 1px solid rgba(200, 148, 47, 0.35);
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--accent-soft);
  font-weight: 900;
  line-height: 1.45;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 17px 20px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  font-size: 1.03rem;
  line-height: 1.55;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #4b2d12;
  background: linear-gradient(180deg, #fff2ca, #f5dfaa);
  font-weight: 900;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:nth-child(even) {
  background: #fff9eb;
}

tbody tr:hover {
  background: rgba(216, 111, 40, 0.08);
}

td:first-child,
th:first-child {
  width: 92px;
  text-align: center;
  font-weight: 900;
  color: var(--primary);
}

td:last-child {
  color: var(--primary-dark);
  font-weight: 900;
  white-space: nowrap;
}

.empty-cell {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
  white-space: normal;
}

.contact-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 18px 22px;
  border: 1px solid rgba(200, 148, 47, 0.42);
  border-radius: 10px;
  color: #fffaf0;
  background:
    linear-gradient(135deg, var(--primary-dark), var(--primary)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 14px);
  box-shadow: 0 16px 34px rgba(101, 20, 20, 0.2);
}

.contact-footer span {
  font-weight: 900;
  opacity: 0.9;
}

.contact-footer strong {
  font-size: clamp(1.08rem, 2.2vw, 1.45rem);
  line-height: 1.35;
  text-align: right;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 22px, 1160px);
    padding: 14px 0 36px;
  }

  .site-header {
    padding-bottom: 12px;
  }

  .banner,
  .detail-item,
  .donation-panel,
  .contact-footer,
  .table-wrap {
    border-radius: 9px;
  }

  .banner-copy {
    padding: 22px;
  }

  .cover-placeholder {
    min-height: 220px;
  }

  .details {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    flex-direction: column;
  }

  .refresh-button {
    width: 100%;
  }

  .contact-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .contact-footer strong {
    text-align: left;
  }

  th,
  td {
    padding: 14px 16px;
    font-size: 0.98rem;
  }
}
