/* Juntos no Senhor — stylesheet
   Color tokens translated 1:1 from the Claude Design mockup
   (project/Juntos no Senhor.dc.html), which used oklch() throughout. */

:root {
  --bg-page: oklch(93% 0.015 85);
  --bg-card: oklch(99% 0.005 90);
  --bg-card-alt: oklch(97% 0.015 85);
  --bg-icon: oklch(95% 0.03 85);
  --bg-pill: oklch(95% 0.02 85);
  --bg-dark-card: oklch(27% 0.03 60);
  --bg-draft-badge: oklch(92% 0.015 82);

  --border-card: oklch(88% 0.02 82);
  --border-input: oklch(80% 0.03 82);
  --border-dashed: oklch(65% 0.1 80);

  --gold: oklch(58% 0.13 78);
  --gold-dark: oklch(45% 0.11 78);
  --gold-deep: oklch(50% 0.12 78);
  --gold-light: oklch(65% 0.12 80);
  --gold-soft: oklch(78% 0.1 82);
  --gold-header-start: oklch(58% 0.13 78);
  --gold-header-end: oklch(64% 0.14 82);
  --header-shadow: oklch(40% 0.1 78 / 0.25);

  --ink: oklch(27% 0.02 55);
  --ink-body: oklch(30% 0.02 55);
  --muted-1: oklch(48% 0.02 55);
  --muted-2: oklch(50% 0.02 55);
  --muted-3: oklch(55% 0.02 55);
  --muted-4: oklch(60% 0.02 55);
  --muted-5: oklch(65% 0.02 78);
  --muted-icon: oklch(70% 0.02 78);
  --danger-text: oklch(48% 0.04 55);

  --white: oklch(99% 0.005 90);
  --white-soft: oklch(97% 0.01 90);
  --heart-empty: oklch(65% 0.03 78);
  --heart-fill: oklch(55% 0.14 78);

  --radius-card: 16px;
  --radius-card-lg: 18px;
  --radius-pill: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg-page);
  font-family: 'Nunito Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink-body);
}
a { color: var(--gold-dark); text-decoration: none; }
a:hover { color: oklch(38% 0.11 78); }
input, textarea, select, button { font-family: 'Nunito Sans', system-ui, sans-serif; }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 0; height: 0; }

.serif { font-family: 'Cormorant Garamond', serif; }

/* ---------- App shell ---------- */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card-alt);
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.06);
}
.app-content {
  flex: 1;
  padding: 18px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 8;
  background: linear-gradient(180deg, var(--gold-header-start), var(--gold-header-end));
  padding: calc(18px + var(--safe-top)) 20px 14px;
  box-shadow: 0 2px 10px var(--header-shadow);
}
.app-header__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.app-header__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-header__logo {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: var(--white-soft);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px var(--gold-light);
  font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 20px; color: var(--gold-deep);
}
.app-header__brandtext { min-width: 0; }
.app-header__title {
  font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 23px;
  color: var(--white); line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-header__date { font-size: 12px; color: oklch(97% 0.01 90 / 0.85); margin-top: 1px; }
.app-header__priest { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.app-header__priestphoto {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  box-shadow: inset 0 0 0 2px var(--gold-light), 0 0 0 2px var(--white-soft);
}
.app-header__priestname { font-size: 9.5px; color: oklch(97% 0.01 90 / 0.9); text-align: center; line-height: 1.2; max-width: 72px; }

.app-header__backbtn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.18); color: var(--white);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.app-header__backtitle { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 20px; color: var(--white); line-height: 1.2; }

.app-header__langrow {
  display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 10px;
}
.langrow__logout { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.85); margin-right: auto; }
.lang-pill {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.5px;
  padding: 4px 9px; border-radius: 20px;
  background: rgba(255,255,255,0.16); color: rgba(255,255,255,0.75);
}
.lang-pill--active { background: var(--white-soft); color: var(--gold-deep); }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: 12px; padding: 13px 16px;
  font-weight: 700; font-size: 14px; cursor: pointer; text-align: center;
  display: inline-block;
}
.btn-primary { background: var(--gold); color: var(--white); }
.btn-outline { border: 1px solid var(--border-input); background: none; color: var(--muted-1); }
.btn-danger-outline { border: 1px solid var(--border-input); background: none; color: var(--danger-text); }
.btn-block { width: 100%; display: block; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.btn-dashed {
  border: 1.5px dashed var(--border-dashed); background: none; color: var(--gold-dark);
  font-weight: 700; font-size: 13.5px; padding: 12px; border-radius: 13px; cursor: pointer; width: 100%;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-input);
  background: var(--bg-card); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn-plain { border: none; background: none; padding: 2px; cursor: pointer; display: flex; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: var(--radius-card); padding: 16px;
}
.card-link { cursor: pointer; display: block; }
.reading-card {
  background: linear-gradient(135deg, var(--white), oklch(95% 0.02 85));
  border: 1px solid oklch(80% 0.05 82); border-radius: var(--radius-card-lg); padding: 18px;
}
.reading-card__eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 6px; }
.reading-card__title { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 19px; color: var(--ink); line-height: 1.25; margin-bottom: 6px; }
.reading-card__excerpt { font-size: 13.5px; color: var(--muted-1); line-height: 1.5; margin-bottom: 12px; }

.novena-feature-card {
  background: var(--bg-dark-card); border-radius: var(--radius-card-lg); padding: 16px 18px; color: var(--white-soft);
  display: block;
}
.novena-feature-card__eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold-soft); margin-bottom: 6px; }
.novena-feature-card__title { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 18px; margin-bottom: 8px; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-track { flex: 1; height: 6px; border-radius: 4px; background: rgba(255,255,255,0.18); overflow: hidden; }
.progress-track--light { background: oklch(90% 0.02 82); }
.progress-fill { height: 100%; border-radius: 4px; background: var(--gold); }
.progress-label { font-size: 12px; font-weight: 700; color: var(--gold-soft); white-space: nowrap; }
.progress-label--onlight { color: var(--gold-dark); }

/* Category list rows (public + admin) */
.list-stack { display: flex; flex-direction: column; gap: 12px; }
.category-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border-card); border-radius: var(--radius-card); padding: 14px 16px;
}
.category-row__icon {
  width: 44px; height: 44px; border-radius: 50%; background: var(--bg-icon);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: inset 0 0 0 1.5px var(--gold-light);
}
.category-row__icon svg { width: 22px; height: 22px; }
.category-row__body { flex: 1; min-width: 0; }
.category-row__name { font-weight: 700; font-size: 15.5px; color: var(--ink); }
.category-row__meta { font-size: 12.5px; color: var(--muted-3); margin-top: 1px; }
.icon-chevron { color: var(--muted-icon); flex-shrink: 0; }

/* Article rows within a category */
.article-row { background: var(--bg-card); border: 1px solid var(--border-card); border-radius: var(--radius-card); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.article-row__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.article-row__title { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 16.5px; color: var(--ink); line-height: 1.25; }
.article-row__excerpt { font-size: 13px; color: var(--muted-2); line-height: 1.45; }
.article-row__date { font-size: 11.5px; color: var(--muted-4); margin-top: 2px; }
.favorite-form { display: contents; }
.favorite-btn { border: none; background: none; padding: 2px; cursor: pointer; flex-shrink: 0; }

/* Article detail */
.article-detail { display: flex; flex-direction: column; gap: 14px; }
.article-detail__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.article-detail__eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold-deep); }
.article-detail__title { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 24px; color: var(--ink); line-height: 1.2; margin-top: 4px; }
.article-detail__date { font-size: 12.5px; color: var(--muted-3); margin-top: 5px; }
.article-detail__actions { display: flex; gap: 8px; flex-shrink: 0; }
.article-detail__paragraph { font-size: 15px; line-height: 1.7; color: var(--ink-body); }
.not-translated-note { font-size: 12px; color: var(--muted-3); background: var(--bg-icon); border-radius: 10px; padding: 8px 12px; }

/* Novena detail */
.novena-dots { display: flex; justify-content: space-between; gap: 8px; }
.novena-dot {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; cursor: pointer; background: oklch(93% 0.02 82); color: var(--muted-3);
  border: none; text-decoration: none;
}
.novena-dot--done { background: var(--gold); color: var(--white); }
.novena-dot--selected { box-shadow: 0 0 0 2px var(--white), 0 0 0 3.5px var(--gold); }
.novena-day-card { background: var(--bg-card); border: 1px solid var(--border-card); border-radius: var(--radius-card); padding: 18px; }
.novena-day-card__eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 6px; }
.novena-day-card__title { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 19px; color: var(--ink); margin-bottom: 10px; }
.novena-day-card__text { font-size: 14.5px; line-height: 1.65; color: var(--ink-body); }
.novena-done-btn { border: none; border-radius: 13px; padding: 14px; font-weight: 700; font-size: 14px; cursor: pointer; width: 100%; background: var(--gold); color: var(--white); }
.novena-done-btn--done { background: oklch(90% 0.03 82); color: oklch(45% 0.05 78); cursor: default; }

/* Favorites empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 50px 20px; color: var(--muted-3); }
.empty-state svg { color: var(--gold-light); }
.empty-state__text { font-size: 14px; line-height: 1.5; }

/* ---------- Category quickbar + tab bar ---------- */
.category-quickbar {
  position: sticky; bottom: 58px; z-index: 7;
  display: flex; justify-content: space-around; align-items: center;
  background: var(--bg-card); border-top: 1px solid var(--border-card); padding: 9px 4px;
}
.category-quickbar__item { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; color: var(--muted-1); }
.category-quickbar__icon { width: 22px; height: 22px; }
.category-quickbar__icon svg { color: var(--gold-dark); }
.category-quickbar__label { font-size: 9px; font-weight: 700; color: var(--muted-1); text-align: center; line-height: 1.1; }

.tab-bar {
  position: sticky; bottom: 0; z-index: 8; display: flex;
  background: var(--bg-card); border-top: 1px solid var(--border-card);
  padding: 8px 6px calc(10px + var(--safe-bottom));
}
.tab-bar__item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--muted-5); }
.tab-bar__icon { width: 22px; height: 20px; display: flex; align-items: center; justify-content: center; }
.tab-bar__label { font-size: 10.5px; font-weight: 700; }
.tab-bar__item--active, .tab-bar__item--active .tab-bar__icon { color: var(--gold); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field__label { font-size: 12px; font-weight: 700; color: var(--muted-1); }
.field__hint { font-size: 11.5px; color: var(--muted-4); margin-top: 5px; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--border-input); border-radius: 10px; padding: 10px 12px;
  font-size: 14.5px; color: var(--ink); background: var(--bg-card);
}
.textarea { resize: vertical; line-height: 1.55; }
.lang-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lang-pair__col { display: flex; flex-direction: column; gap: 6px; }
.lang-pair__tag { font-size: 10.5px; font-weight: 800; letter-spacing: 0.5px; color: var(--muted-4); text-transform: uppercase; }
@media (max-width: 380px) {
  .lang-pair { grid-template-columns: 1fr; }
}

.toggle-row { display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 12px; padding: 12px 14px; }
.toggle-row__label { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle-switch__input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle-track { width: 46px; height: 26px; border-radius: 14px; position: relative; background: var(--border-card); display: block; }
.toggle-switch__input:checked + .toggle-track { background: var(--gold); }
.toggle-knob { width: 20px; height: 20px; border-radius: 50%; background: var(--bg-card); position: absolute; top: 3px; left: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: left .15s; }
.toggle-switch__input:checked + .toggle-track .toggle-knob { left: 23px; }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip { flex-shrink: 0; padding: 8px 14px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--bg-pill); color: var(--muted-1); }
.chip--active { background: var(--gold); color: var(--white); }

.badge { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: var(--radius-pill); height: fit-content; background: var(--bg-draft-badge); color: var(--muted-1); }
.badge--published { background: var(--gold); color: var(--white); }

/* Admin */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border-card); border-radius: var(--radius-card); padding: 16px; }
.stat-card__value { font-size: 26px; font-weight: 800; color: var(--gold-dark); font-family: 'Cormorant Garamond', serif; }
.stat-card__label { font-size: 12.5px; color: var(--muted-2); margin-top: 2px; }
.nav-card { cursor: pointer; background: var(--bg-card); border: 1px solid var(--border-card); border-radius: var(--radius-card); padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; }
.nav-card__title { font-weight: 700; font-size: 15px; color: var(--ink); }
.nav-card__sub { font-size: 12.5px; color: var(--muted-3); margin-top: 2px; }

.admin-row { background: var(--bg-card); border: 1px solid var(--border-card); border-radius: var(--radius-card); padding: 14px 16px; }
.admin-row--dashed { border: 1px dashed var(--border-dashed); }
.admin-row__main { display: flex; align-items: center; gap: 12px; }
.admin-row__icon { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-icon); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: inset 0 0 0 1.5px var(--gold-light); }
.admin-row__icon svg { width: 18px; height: 18px; }
.admin-row__body { flex: 1; }
.admin-row__title { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.admin-row__meta { font-size: 12px; color: var(--muted-3); }
.admin-row__top { display: flex; justify-content: space-between; gap: 8px; }
.admin-row__actions { display: flex; gap: 8px; margin-top: 6px; }
.admin-row__actions form { flex: 1; display: flex; }
.admin-row__actions .btn { flex: 1; }
.inline-editor { display: flex; flex-direction: column; gap: 8px; }

.login-shell { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: var(--bg-page); padding: 24px; }
.login-card { background: var(--bg-card); border: 1px solid var(--border-card); border-radius: var(--radius-card-lg); padding: 28px; width: 100%; max-width: 360px; }
.login-card__logo { width: 56px; height: 56px; border-radius: 50%; background: var(--gold); color: var(--white); font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 24px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.login-card__title { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 22px; color: var(--ink); text-align: center; margin-bottom: 20px; }
.login-error { background: oklch(93% 0.05 30); color: oklch(40% 0.12 30); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }

.editor-toolbar { display: flex; gap: 6px; margin-bottom: 6px; }
.editor-toolbar__btn { width: 30px; height: 26px; border: 1px solid var(--border-card); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; color: var(--muted-1); }
