/* Área de membros — paleta herdada da Rede Enteogenia Terapêutica */
:root {
  --bg:        #F5F0E1;
  --bg-raise:  #FDFBF5;
  --bg-soft:   #EFE9D8;
  --ink:       #2A2A28;
  --muted:     #6F6F6A;
  --line:      #E0D9C8;
  --accent:    #3E5836;
  --accent-d:  #2D3F27;
  --accent-bg: #E5EAD9;
  --terra:     #7A4E32;
  --danger:    #A03A2B;
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-ui: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 14px rgba(74, 52, 32, 0.08);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
img, video, iframe { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-d); }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff; padding: 8px 12px; z-index: 20;
}
.skip-link:focus { left: 8px; top: 8px; }

.container { width: min(1040px, calc(100% - 32px)); margin-inline: auto; }
.container-lg { width: min(1100px, calc(100% - 32px)); }

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-raise) 88%, transparent);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
.site-header__inner {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.site-header__logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink); font-weight: 600;
}
.site-header__mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--accent); color: var(--accent);
  font-family: var(--font-display); font-size: 13px; letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
}
.site-header__name { letter-spacing: 0.16em; text-transform: uppercase; font-size: 12px; }
.site-header__nav { display: flex; gap: 22px; align-items: center; }
.site-header__nav a {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
}
.site-header__nav a[aria-current="page"],
.site-header__nav a:hover { color: var(--ink); }
.site-header__toggle {
  display: none; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 8px;
}
.site-header__toggle-bars { display: flex; flex-direction: column; gap: 5px; }
.site-header__toggle-bars span {
  display: block; width: 20px; height: 2px; background: var(--ink);
}

.page { padding: 36px 0 72px; }
.site-footer {
  padding: 28px 16px 48px; text-align: center;
  color: var(--muted); font-size: 13px; border-top: 1px solid var(--line);
}

.body-public main { width: min(560px, calc(100% - 32px)); margin: 48px auto 0; }
.landing { text-align: center; }
.eyebrow {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 12px;
}
.landing__title, h1 {
  font-family: var(--font-display);
  font-weight: 600; font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px;
}
.landing__subtitle, .lede { color: var(--muted); font-size: 1.05rem; }
.card {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: left;
  border-radius: var(--radius);
}
.card--login { margin-top: 28px; }
.stack { display: grid; gap: 16px; }
.field label, .field legend { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; padding: 12px 14px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit;
}
.help, .muted, .small { color: var(--muted); }
.small { font-size: 13px; }
.mt-6 { margin-top: 24px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font: 600 14px/1 var(--font-ui);
  cursor: pointer; text-decoration: none;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-d); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--block { width: 100%; }
.btn-text {
  background: none; border: 0; color: var(--accent); cursor: pointer;
  font: inherit; padding: 0; text-decoration: underline; text-underline-offset: 3px;
}
.auth-code-input { letter-spacing: 0.4em; font-size: 1.4rem; text-align: center; }

.alert {
  padding: 12px 14px; border-left: 3px solid var(--accent);
  background: var(--bg-soft); margin: 12px 0; border-radius: var(--radius-sm);
}
.alert--error { border-color: var(--danger); background: #F0D9CF; }
.alert--success { border-color: var(--accent); background: var(--accent-bg); }
.flash-stack { margin-bottom: 16px; }

.hero-home { margin-bottom: 32px; max-width: 640px; }
.course-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.course-card {
  background: var(--bg-raise); border: 1px solid var(--line); overflow: hidden;
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.course-card__cover { height: 140px; object-fit: cover; width: 100%; display: block; }
.course-card__cover--empty {
  background:
    linear-gradient(135deg, var(--accent-bg), transparent 55%),
    repeating-linear-gradient(-18deg, transparent, transparent 12px, rgba(62, 88, 54, 0.06) 12px, rgba(62, 88, 54, 0.06) 13px);
}
.course-card__body { padding: 18px; display: grid; gap: 10px; }
.course-card h2 { font-family: var(--font-display); font-size: 1.4rem; margin: 0; font-weight: 600; }
.course-card h2 a { color: var(--ink); text-decoration: none; }

.progress {
  height: 4px; background: var(--line); border-radius: 99px; overflow: hidden;
}
.progress__bar { height: 100%; background: var(--accent); }

.crumb { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.course-head {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line);
}
.module-block { margin-bottom: 28px; }
.module-block__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.module-block h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 8px; }
.item-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.item-row {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  background: var(--bg-raise); border-radius: var(--radius-sm);
}
.item-row.is-read { opacity: 0.72; }
.item-row__mark {
  width: 22px; height: 22px; border: 1px solid var(--accent); display: grid; place-items: center;
  font-size: 12px; color: var(--accent); flex: 0 0 auto; border-radius: 4px;
}

.badge {
  display: inline-block; border: 1px solid var(--line); padding: 2px 8px;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  border-radius: 999px;
}
.badge--sm { font-size: 10px; }

.item-page { max-width: 760px; }
.prose { font-size: 1.05rem; }
.prose img { border: 1px solid var(--line); }
.video-frame { position: relative; padding-top: 56.25%; background: #000; margin: 16px 0; border-radius: var(--radius-sm); overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.read-toggle { margin: 28px 0; }
.item-pager {
  display: flex; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line); padding-top: 16px;
}

.admin-subnav {
  display: flex; flex-wrap: wrap; gap: 12px 20px;
  margin-bottom: 28px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.admin-subnav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.admin-subnav a[aria-current="page"] { color: var(--accent); }
.admin-section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.admin-section h2 { font-family: var(--font-display); font-size: 1.6rem; margin: 0 0 6px; }
.admin-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; }
.stat-grid {
  list-style: none; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
}
.stat-grid li {
  background: var(--bg-raise); border: 1px solid var(--line); padding: 16px;
  display: grid; gap: 4px; border-radius: var(--radius);
}
.stat-grid strong { font-family: var(--font-display); font-size: 1.8rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--bg-raise); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.table-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-narrow { max-width: 560px; }
.check--inline { font-size: 12px; white-space: nowrap; }
.publish-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-row { display: flex; gap: 8px; margin-bottom: 16px; }
.search-row .input { max-width: 320px; }
.plain-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.inline { display: inline; }
.empty-state { border: 1px dashed var(--line); padding: 32px; display: grid; gap: 8px; justify-items: start; border-radius: var(--radius); background: var(--bg-raise); }
.empty-state .btn { margin-top: 8px; }
.tabular { font-variant-numeric: tabular-nums; }
.pager { display: flex; gap: 16px; margin-top: 16px; }

@media (max-width: 720px) {
  .site-header__toggle { display: block; }
  .site-header__nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    background: var(--bg-raise); border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 16px; align-items: flex-start;
  }
  .site-header__nav.is-open { display: flex; }
}
