@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

:root {
  --bg: #101114;
  --panel: #191a1f;
  --panel2: #202127;
  --gold: #d5a52b;
  --gold2: #f0c45b;
  --ivory: #f4f1e9;
  --muted: #aaa9a4;
  --line: #34343a;
  --green: #1dbb76;
  --danger: #ffc2b8;
  --focus: #f0c45b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ivory);
  font-family: "DM Sans", Arial, sans-serif;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

a {
  color: var(--gold2);
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 max(22px, calc((100vw - 1060px) / 2));
  border-bottom: 1px solid #28282c;
  background: rgba(16, 17, 20, .96);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 39px;
  height: 39px;
  border: 1px solid #8e6d20;
  color: var(--gold2);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: "Playfair Display", serif;
  font-size: 25px;
  flex: 0 0 auto;
}

.brand strong {
  display: block;
  letter-spacing: 2px;
  font-size: 15px;
}

.brand small {
  display: block;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 1.4px;
  margin-top: 3px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid #8e6d20;
  flex: 0 0 auto;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.icon-button {
  background: var(--panel2);
  color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 21px;
  cursor: pointer;
}

main {
  max-width: 1060px;
  margin: auto;
  padding: 0 22px;
}

.hero {
  padding: 62px 0 35px;
  max-width: 740px;
}

.eyebrow,
.section-kicker {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--gold);
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--gold);
  border-radius: 50%;
  margin: 0 8px 1px 0;
}

.hero h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(43px, 8vw, 78px);
  line-height: 1.03;
  letter-spacing: -1.8px;
  margin: 24px 0 20px;
  font-weight: 600;
}

.hero h1 em {
  font-style: normal;
  color: var(--gold2);
}

.scripture {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  margin: 0 0 8px;
}

.reference {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: var(--gold);
  font-weight: 700;
}

.hero-copy {
  color: #c3c1ba;
  max-width: 440px;
  line-height: 1.7;
  font-size: 14px;
  margin-top: 24px;
}

.daily-card {
  background: linear-gradient(120deg, #202331, #1a1c22);
  border: 1px solid #51401e;
  border-radius: 15px;
  padding: 24px 26px;
  margin: 8px 0 52px;
}

.daily-card p {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  line-height: 1.5;
  margin: 13px 0;
}

.daily-card span {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 1.5px;
}

.section {
  margin: 0 0 54px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 19px;
}

.section-heading h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 29px;
  font-weight: 600;
  margin: 7px 0 0;
}

.text-button {
  border: 0;
  background: none;
  color: var(--gold2);
  font: 600 12px "DM Sans";
  cursor: pointer;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.category {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 17px 14px;
  text-align: left;
  color: var(--ivory);
  cursor: pointer;
  min-height: 125px;
  transition: border-color .2s ease, transform .2s ease;
}

.category:hover,
.category:focus-visible {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.category span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #302919;
  color: var(--gold2);
  font-size: 19px;
  margin-bottom: 12px;
}

.category b {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}

.category small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  min-height: 48px;
  color: var(--gold);
  margin: 20px 0 13px;
}

.search input {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ivory);
  width: 100%;
  min-width: 0;
  font: 14px "DM Sans";
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 17px;
}

.filter {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: transparent;
  color: var(--muted);
  padding: 8px 13px;
  font: 600 11px "DM Sans";
  cursor: pointer;
}

.filter.active {
  background: #3a2e16;
  color: var(--gold2);
  border-color: #72591f;
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.resource {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 17px;
  display: flex;
  gap: 13px;
  align-items: flex-start;
  min-width: 0;
}

.resource-icon {
  flex: 0 0 39px;
  height: 39px;
  border-radius: 10px;
  background: #302919;
  color: var(--gold2);
  display: grid;
  place-items: center;
  font-size: 17px;
}

.resource-body {
  min-width: 0;
  flex: 1;
}

.resource-meta {
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.resource h3 {
  font: 600 16px "Playfair Display", Georgia, serif;
  margin: 7px 0;
}

.resource p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 12px;
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.small-action {
  background: #292a30;
  border: 1px solid #414149;
  color: var(--ivory);
  border-radius: 7px;
  padding: 7px 10px;
  font: 600 10px "DM Sans";
  cursor: pointer;
}

.small-action.gold {
  background: #3a2e16;
  border-color: #72591f;
  color: var(--gold2);
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  grid-column: 1 / -1;
}

.callout {
  border: 1px solid #51401e;
  border-radius: 15px;
  padding: 28px;
  background: linear-gradient(120deg, #1c1b18, #17181d);
  margin: 0 0 35px;
}

.callout h2 {
  font: 600 29px/1.2 "Playfair Display", Georgia, serif;
  max-width: 530px;
  margin: 13px 0;
}

.callout p {
  color: #bbb9b1;
  font-size: 13px;
  line-height: 1.6;
}

.callout a {
  color: var(--gold2);
  font-size: 12px;
  text-decoration: none;
  font-weight: 700;
}

.bottom-nav {
  position: fixed;
  z-index: 6;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 21, 25, .97);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  padding: 10px max(10px, calc((100vw - 650px) / 2)) calc(10px + env(safe-area-inset-bottom));
  gap: 0;
  backdrop-filter: blur(12px);
}

.nav-item {
  flex: 1;
  max-width: 120px;
  border: 0;
  background: none;
  color: #99999a;
  font: 500 10px "DM Sans";
  display: flex;
  align-items: center;
  gap: 4px;
  flex-direction: column;
  cursor: pointer;
  padding: 3px 2px;
}

.nav-item span {
  font-size: 20px;
  line-height: 22px;
}

.nav-item.selected {
  color: var(--gold2);
}

.notice {
  max-width: 1060px;
  margin: 12px auto 0;
  padding: 11px 18px;
  border: 1px solid #72591f;
  background: #282317;
  color: var(--gold2);
  border-radius: 9px;
  font-size: 12px;
}

.notice.error {
  border-color: #8b4545;
  background: #2b1c1c;
  color: var(--danger);
}

/* Resource details dialog */
.resource-dialog {
  background: #1a1b20;
  color: var(--ivory);
  border: 1px solid #625027;
  border-radius: 15px;
  width: min(540px, calc(100% - 30px));
  max-width: 540px;
  max-height: min(85vh, 850px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px;
  margin: auto;
  scrollbar-color: #72591f #1a1b20;
}

.resource-dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(3px);
}

.dialog-close {
  float: right;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
}

.dialog-type {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 1px;
}

.dialog-copy {
  line-height: 1.8;
  color: #d1cfc8;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.dialog-note {
  background: #24252b;
  border-radius: 9px;
  padding: 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin-top: 18px;
}

.resource-thumb {
  display: block;
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
  margin: 12px auto;
}

.resource-dialog audio,
.resource-dialog video {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 12px 0;
}

.resource-dialog h2 {
  font-family: "Playfair Display", Georgia, serif;
}

.resource-dialog a {
  color: var(--gold2);
  overflow-wrap: anywhere;
}

/* Administrator area */
.admin-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  background: #17181d;
}

.admin-section > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.admin-toolbar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  margin: 12px 0;
}

.admin-form {
  display: grid;
  gap: 14px;
  background: #202127;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin: 14px 0 22px;
}

.admin-form h3 {
  margin: 0 0 3px;
  font: 600 20px "Playfair Display", Georgia, serif;
}

.admin-form label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: #d7d4ca;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  min-width: 0;
  background: #121317;
  border: 1px solid #414149;
  border-radius: 7px;
  padding: 11px 12px;
  color: var(--ivory);
  font: 13px "DM Sans", Arial, sans-serif;
}

.admin-form textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.admin-form input::placeholder,
.admin-form textarea::placeholder {
  color: #85847f;
}

.admin-form input:focus-visible,
.admin-form textarea:focus-visible,
.admin-form select:focus-visible {
  border-color: var(--gold);
}

.admin-form small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.admin-content-list {
  display: grid;
  gap: 8px;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  min-width: 0;
}

.admin-row span {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.admin-row small {
  color: var(--muted);
}

/* Consistent interaction feedback */
.icon-button:hover,
.small-action:hover,
.filter:hover,
.text-button:hover,
.nav-item:hover {
  filter: brightness(1.15);
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

@media (max-width: 700px) {
  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  main {
    padding: 0 18px;
  }

  .topbar {
    padding: 0 18px;
  }

  .brand strong {
    font-size: 13px;
  }

  .brand small {
    font-size: 7px;
  }

  .hero {
    padding-top: 48px;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
  }

  .category {
    min-height: 116px;
    padding: 14px 12px;
  }

  .resource-list {
    grid-template-columns: 1fr;
  }

  .section-heading h2 {
    font-size: 26px;
  }

  .daily-card {
    margin-bottom: 43px;
  }

  .resource-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 30px - env(safe-area-inset-top));
    padding: 21px;
  }

  .admin-section {
    padding: 16px;
  }

  .admin-form {
    padding: 14px;
  }

  .admin-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .topbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand {
    gap: 8px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    letter-spacing: 1.3px;
    font-size: 12px;
  }

  .resource-dialog {
    padding: 18px;
  }
}

@media (min-width: 900px) {
  .hero {
    padding-top: 84px;
  }

  .hero h1 {
    font-size: 82px;
  }

  .daily-card {
    max-width: 760px;
  }

  .callout {
    padding: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
