:root {
  --ink: #111815;
  --muted: #68736d;
  --paper: #f7f3ec;
  --paper-strong: #fffdf8;
  --line: #e1d8c8;
  --brand: #185e52;
  --brand-dark: #102f2b;
  --accent: #a95a35;
  --gold: #d8a64d;
  --plum: #4d3047;
  --shadow-soft: 0 22px 70px rgba(17, 24, 21, 0.1);
  --shadow-hover: 0 30px 90px rgba(17, 24, 21, 0.16);
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  background-image:
    linear-gradient(rgba(24, 94, 82, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 94, 82, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  font-family: "Segoe UI", "Nirmala UI", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--brand);
}

.container-xl {
  max-width: 1180px;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 248, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  color: var(--ink);
  font-weight: 850;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--plum));
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(24, 94, 82, 0.25);
  font-size: 1.35rem;
}

.nav-link {
  color: var(--ink);
  font-weight: 700;
}

.nav-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding-inline: 1rem !important;
}

.btn {
  border-radius: 8px;
  font-weight: 750;
}

.btn-primary {
  border-color: var(--brand);
  background: var(--brand);
}

.btn-primary:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.hero-band {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(16, 47, 43, 0.98), rgba(24, 94, 82, 0.9) 54%, rgba(77, 48, 71, 0.82)),
    url("https://images.unsplash.com/photo-1456513080510-7bf3a84b82f8?auto=format&fit=crop&w=1900&q=85");
  background-position: center;
  background-size: cover;
}

.hero-band::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 160px;
  background: linear-gradient(180deg, transparent, rgba(247, 243, 236, 0.98));
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 700px;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 4rem;
  align-items: center;
  padding-block: 5.5rem 7.5rem;
}

.hero-copy h1,
.page-head h1 {
  max-width: 780px;
  font-size: clamp(3rem, 7vw, 6.4rem);
  font-weight: 850;
  line-height: 0.94;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 650px;
  margin-block: 1.4rem 2rem;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.2rem;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.hero-actions .btn {
  padding: 0.82rem 1.15rem;
}

.hero-metrics {
  display: grid;
  max-width: 620px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 2.2rem;
}

.hero-metrics div {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.hero-metrics strong {
  display: block;
  color: #fff;
  font-size: 1.75rem;
}

.hero-metrics span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.86rem;
}

.hero-panel,
.auth-card,
.admin-card,
.content-card,
.material-card,
.video-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 2.2rem;
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(18px);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--gold), var(--accent), var(--plum));
}

.hero-panel h2 {
  margin-block: 1rem;
  font-weight: 850;
}

.panel-label,
.eyebrow,
.chip {
  display: inline-flex;
  width: fit-content;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chip {
  padding: 0.28rem 0.58rem;
  color: var(--brand-dark);
  background: #edf4ee;
  border-radius: 999px;
  text-transform: none;
}

.lesson-medallion {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  margin-top: 1.3rem;
  color: #fff;
  background: radial-gradient(circle at 30% 25%, #e7bd68, var(--accent) 52%, var(--plum));
  border-radius: 999px;
  box-shadow: 0 18px 45px rgba(169, 90, 53, 0.25);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.text-link {
  display: inline-flex;
  padding-bottom: 0.18rem;
  border-bottom: 2px solid var(--gold);
  color: var(--brand-dark);
  font-weight: 850;
}

.credential-band {
  position: relative;
  z-index: 2;
  margin-top: -3.6rem;
}

.credential-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 1rem;
  align-items: center;
  padding: 1.3rem;
  border: 1px solid rgba(225, 216, 200, 0.8);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.credential-grid h2 {
  max-width: 760px;
  margin: 0.35rem 0 0;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 850;
  line-height: 1.1;
}

.credential-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.credential-list span {
  display: grid;
  min-height: 86px;
  place-items: center;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f1e6;
  color: var(--brand-dark);
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
}

.content-band,
.split-band,
.article-shell,
.admin-shell {
  padding-block: 4.5rem;
}

.section-heading {
  margin-bottom: 1.8rem;
}

.section-heading h2,
.page-head h1,
.article-main h1,
.admin-head h1 {
  font-weight: 850;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.02;
}

.compact {
  margin-bottom: 1rem;
}

.page-head {
  padding-block: 5rem;
  color: #fff;
  background:
    linear-gradient(110deg, rgba(16, 47, 43, 0.98), rgba(77, 48, 71, 0.86)),
    url("https://images.unsplash.com/photo-1481627834876-b7833e8f5570?auto=format&fit=crop&w=1800&q=85");
  background-position: center;
  background-size: cover;
}

.page-head-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 2rem;
  align-items: end;
}

.page-head p {
  margin: 0 0 0.5rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.1rem;
}

.card-grid,
.material-grid,
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.content-card,
.material-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.4rem;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.content-card:hover,
.material-card:hover,
.video-card:hover {
  transform: translateY(-4px);
  border-color: rgba(216, 166, 77, 0.7);
  box-shadow: var(--shadow-hover);
}

.card-cover,
.card-cover-placeholder {
  width: calc(100% + 2.8rem);
  height: 170px;
  margin: -1.4rem -1.4rem 0;
  border-radius: 8px 8px 0 0;
}

.card-cover {
  object-fit: cover;
}

.card-cover-placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(24, 94, 82, 0.92), rgba(77, 48, 71, 0.88)),
    linear-gradient(45deg, rgba(216, 166, 77, 0.25) 25%, transparent 25%, transparent 50%, rgba(216, 166, 77, 0.25) 50%, rgba(216, 166, 77, 0.25) 75%, transparent 75%);
  background-size: auto, 24px 24px;
}

.card-cover-placeholder span {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.content-card h2,
.content-card h3,
.material-card h2,
.video-card h2 {
  font-size: 1.35rem;
  font-weight: 850;
  line-height: 1.16;
}

.content-card p,
.material-card p,
.video-card p {
  color: var(--muted);
}

.meta-row {
  display: flex;
  margin-top: auto;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.split-band {
  border-block: 1px solid var(--line);
  background: linear-gradient(180deg, #f5efe5, #ebe4d7);
}

.split-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
}

.list-stack,
.stack-form {
  display: grid;
  gap: 0.8rem;
}

.download-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  transition: transform 160ms ease, border-color 160ms ease;
}

.download-row:hover {
  transform: translateX(4px);
  border-color: var(--gold);
}

.download-row span {
  font-weight: 780;
}

.download-row small {
  color: var(--muted);
  white-space: nowrap;
}

.video-grid-small {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.video-frame {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #111;
  box-shadow: 0 18px 45px rgba(17, 24, 21, 0.16);
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 0.8rem;
  margin-bottom: 1.4rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow-soft);
}

.article-shell {
  padding-block: 4.5rem;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.88), rgba(247, 243, 236, 0));
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 3rem;
  align-items: start;
}

.article-main {
  max-width: 820px;
  padding: 1.2rem;
  border: 1px solid rgba(225, 216, 200, 0.74);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: var(--shadow-soft);
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 0;
  height: 4px;
  background: var(--gold);
}

.article-cover {
  width: 100%;
  max-height: 430px;
  object-fit: cover;
  margin-bottom: 1.3rem;
  border-radius: 8px;
}

.article-main h1 {
  margin-top: 1rem;
  font-size: clamp(2.4rem, 5vw, 4.3rem);
  line-height: 1.04;
}

.lead-copy {
  color: var(--muted);
  font-size: 1.2rem;
}

.article-body {
  margin-block: 2rem;
  font-size: 1.1rem;
  line-height: 1.9;
}

.article-body p {
  margin-bottom: 1.25rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block: 2rem;
}

.tag-row span {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.88rem;
}

.share-box {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.share-box a,
.share-box button {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
  text-align: left;
}

.article-body h2,
.comments-box h2,
.article-side h2 {
  margin-top: 2rem;
  font-size: 1.5rem;
  font-weight: 850;
}

.article-side {
  position: sticky;
  top: 88px;
  height: fit-content;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow-soft);
}

.comments-box {
  margin-top: 3rem;
}

.comment-row,
.comment-admin {
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.comment-admin {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.auth-shell {
  display: grid;
  min-height: 72vh;
  place-items: center;
  padding: 2rem;
}

.auth-card {
  display: grid;
  width: min(100%, 430px);
  gap: 1rem;
  padding: 2rem;
}

.admin-shell {
  background:
    linear-gradient(180deg, rgba(232, 240, 238, 0.72), rgba(247, 243, 236, 0.2) 34%),
    var(--paper);
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(255, 253, 248, 0.96), rgba(232, 240, 238, 0.9)),
    var(--paper-strong);
  box-shadow: var(--shadow-soft);
}

.admin-head h1 {
  font-size: clamp(2.1rem, 4vw, 3.5rem);
}

.admin-subtitle {
  max-width: 720px;
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.stats-grid,
.admin-grid {
  display: grid;
  gap: 1rem;
}

.stats-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 1rem;
}

.stats-grid div {
  position: relative;
  overflow: hidden;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: var(--shadow-soft);
}

.stats-grid div::after {
  content: "";
  position: absolute;
  inset: auto 1rem 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  border-radius: 999px 999px 0 0;
}

.stats-grid strong {
  display: block;
  font-size: 2rem;
}

.stats-grid span {
  color: var(--muted);
}

.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.admin-card {
  padding: 1.45rem;
  background: rgba(255, 253, 248, 0.94);
}

.admin-card h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 850;
}

.admin-card-title {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.admin-card-title h2 {
  margin: 0;
}

.publisher-card {
  border-color: rgba(216, 166, 77, 0.55);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.25rem 0.65rem;
  color: var(--brand-dark);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f1e6;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.wide,
.full {
  grid-column: 1 / -1;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.check-row {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  font-weight: 700;
}

.editor-box {
  font-family: Consolas, "Courier New", monospace;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #efe8da;
}

.editor-toolbar button {
  min-width: 40px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 850;
}

.rich-editor {
  min-height: 280px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  line-height: 1.8;
  outline: none;
}

.rich-editor:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem rgba(31, 95, 83, 0.13);
}

.cover-preview {
  width: min(100%, 420px);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-actions {
  gap: 0.35rem;
}

.site-footer {
  padding-block: 2.4rem;
  border-top: 1px solid var(--line);
  background: var(--brand-dark);
  color: #fff;
}

.site-footer p,
.site-footer a {
  color: rgba(255, 255, 255, 0.76);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid,
  .split-grid,
  .article-grid,
  .filter-bar,
  .admin-grid,
  .stats-grid,
  .credential-grid,
  .page-head-grid {
    grid-template-columns: 1fr;
  }

  .card-grid,
  .material-grid,
  .video-grid,
  .video-grid-small {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: auto;
    padding-block: 3rem 6rem;
  }

  .hero-metrics,
  .credential-list {
    grid-template-columns: 1fr;
  }

  .article-side {
    position: static;
  }

  .footer-grid,
  .admin-head,
  .comment-admin {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .hero-copy h1,
  .page-head h1 {
    font-size: 2.6rem;
  }
}
