/*
 * Orthodox Fast - Application Styles
 *
 * Clean, modern design using CSS custom properties and native CSS features.
 * No preprocessor needed — Propshaft serves these directly.
 */

:root {
  --color-primary: #8B2500;
  --color-primary-light: #A0522D;
  --color-primary-dark: #6B1C00;
  --color-gold: #DAA520;
  --color-gold-light: #F0D060;
  --color-bg: #FEFCF8;
  --color-bg-card: #FFFFFF;
  --color-bg-muted: #F5F5F5;
  --color-text: #2C2C2C;
  --color-text-light: #666666;
  --color-border: #E0D8CC;
  --color-heading: #6B1C00;
  --color-nav-bg: #6B1C00;
  --color-image-placeholder: #E8E0D4;
  --color-flash-notice-bg: #E8F5E9;
  --color-flash-notice-fg: #2E7D32;
  --color-flash-notice-border: #C8E6C9;
  --color-flash-alert-bg: #FFEBEE;
  --color-flash-alert-fg: #C62828;
  --color-flash-alert-border: #FFCDD2;
  --color-success: #2E7D32;
  --color-danger: #C62828;
  --color-warning: #F9A825;
  --bg-pattern: none;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --max-width: 960px;
  color-scheme: light;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: 1.3;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-primary-light);
  text-decoration: underline;
}

/* Navigation */
.main-nav {
  background: var(--color-nav-bg);
  color: white;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-nav {
  background: #1a1a2e;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-brand a {
  color: var(--color-gold);
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: bold;
  text-decoration: none;
}

.nav-brand a:hover {
  color: var(--color-gold-light);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover {
  color: white;
  border-bottom-color: var(--color-gold);
  text-decoration: none;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Flash messages */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.flash-notice {
  background: var(--color-flash-notice-bg);
  color: var(--color-flash-notice-fg);
  border: 1px solid var(--color-flash-notice-border);
}

.flash-alert {
  background: var(--color-flash-alert-bg);
  color: var(--color-flash-alert-fg);
  border: 1px solid var(--color-flash-alert-border);
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-card);
  color: var(--color-text);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn:hover {
  background: var(--color-bg-muted);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--color-primary-light);
  color: white;
  border-color: var(--color-primary-light);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}

.btn-danger:hover {
  background: #B71C1C;
  color: white;
  border-color: #B71C1C;
}

/* Recipe card grid */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.recipe-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.recipe-card-link:hover {
  text-decoration: none;
}

.recipe-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.recipe-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.recipe-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: var(--color-image-placeholder);
}

.recipe-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.recipe-card:hover .recipe-card-image img {
  transform: scale(1.05);
}

.recipe-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary-light) 100%);
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-style: italic;
}

.recipe-card-body {
  padding: 1rem 1.25rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.recipe-card-badges {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.recipe-card-badges .badge {
  font-size: 0.65rem;
}

.recipe-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--color-heading);
}

.recipe-card-excerpt {
  color: var(--color-text-light);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

/* Legacy recipe card styles (articles, etc.) */
.recipe-meta {
  color: var(--color-text-light);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.recipe-excerpt {
  color: var(--color-text);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.read-more {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Recipe full view */
.recipe-full {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.recipe-hero {
  margin: -2rem -2rem 1.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: var(--color-image-placeholder);
}

.recipe-hero img {
  display: block;
  width: 100%;
  height: clamp(220px, 40vw, 420px);
  object-fit: cover;
}

.recipe-body {
  line-height: 1.8;
  font-size: 1.05rem;
  margin-top: 1.5rem;
}

.articles-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.articles-list li {
  margin: 0;
}

.article-list-item {
  display: flex;
  gap: 1.25rem;
  align-items: stretch;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
}

.article-list-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.article-list-thumb {
  flex: 0 0 220px;
  background: var(--color-image-placeholder);
  overflow: hidden;
}

.article-list-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
}

.article-list-body {
  flex: 1;
  padding: 1rem 1.25rem 1rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.article-list-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 0.35rem;
}

.article-list-body h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  line-height: 1.3;
}

.article-list-excerpt {
  margin: 0;
  color: var(--color-text-light);
  line-height: 1.5;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .article-list-item {
    flex-direction: column;
  }

  .article-list-thumb {
    flex: none;
    width: 100%;
    height: 180px;
  }

  .article-list-body {
    padding: 1rem 1.25rem 1.25rem;
  }
}

.recipe-body .inline-recipes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.recipe-body .inline-recipes li {
  margin: 0;
}

.recipe-body .inline-recipe-card {
  display: block;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
}

.recipe-body .inline-recipe-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.recipe-body .inline-recipe-card img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.recipe-body .inline-recipe-card-body {
  padding: 0.65rem 0.85rem 0.9rem;
}

.recipe-body .inline-recipe-card-body strong {
  display: block;
  font-family: var(--font-heading);
  color: var(--color-heading);
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.recipe-body .inline-recipe-card-body span {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.4;
}

.back-link {
  margin-top: 2rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #E0E0E0;
  color: #555;
}

.badge-published {
  background: #E8F5E9;
  color: var(--color-success);
}

.badge-draft {
  background: #FFF3E0;
  color: #E65100;
}

.badge-admin {
  background: #E3F2FD;
  color: #1565C0;
}

.badge-blog {
  background: #E8EAF6;
  color: #283593;
}

.badge-guide {
  background: #E0F2F1;
  color: #00695C;
}

.badge-announcement {
  background: #FFF8E1;
  color: #F57F17;
}

/* Category tabs */
.category-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0;
}

.tab {
  padding: 0.5rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 0.9rem;
  color: var(--color-text-light);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--color-primary);
  background: var(--color-bg-card);
  text-decoration: none;
}

.tab.active {
  color: var(--color-primary);
  background: var(--color-bg-card);
  border-color: var(--color-border);
  font-weight: 600;
}

.card-header {
  margin-bottom: 0.5rem;
}

/* Filters */
.filters {
  margin-bottom: 2rem;
}

.filter-group {
  margin-bottom: 0.75rem;
}

.filter-group > label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-right: 0.5rem;
}

.filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.filter-clear {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.badge-cuisine {
  background: #EDE7F6;
  color: #4527A0;
}

.badge-cuisine a {
  color: inherit;
  text-decoration: none;
}

.badge-fasting {
  background: #E0F2F1;
  color: #00695C;
}

.badge-fasting a {
  color: inherit;
  text-decoration: none;
}

.badge-non-fasting {
  background: #FFF3E0;
  color: #B4521A;
}

.badge-non-fasting a {
  color: inherit;
  text-decoration: none;
}

.mode-toggle {
  display: flex;
  gap: 0;
  margin: 1.25rem 0 1.5rem;
  border: 1px solid #E0D8CC;
  border-radius: 6px;
  overflow: hidden;
  max-width: 520px;
}

.mode-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  text-align: center;
  text-decoration: none;
  color: #6B1C00;
  background: #FEFCF8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  border-right: 1px solid #E0D8CC;
  transition: background 0.15s ease;
}

.mode-tab:last-child {
  border-right: none;
}

.mode-tab:hover {
  background: #F5ECDF;
}

.mode-tab.active {
  background: #6B1C00;
  color: #DAA520;
  font-weight: 600;
}

.mode-description {
  margin: -0.5rem 0 1rem;
  color: #666;
  font-style: italic;
}

.recipe-notice {
  padding: 0.875rem 1rem;
  border-radius: 6px;
  margin: 1rem 0 1.5rem;
  border-left: 4px solid;
}

.recipe-notice-feast {
  background: #FFF3E0;
  border-color: #B4521A;
  color: #5A2A00;
}

.field-row {
  display: flex;
  gap: 1rem;
}

.field-row .field {
  flex: 1;
}

/* Forms */
.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--color-bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 37, 0, 0.1);
}

.field textarea {
  resize: vertical;
  min-height: 200px;
}

.field.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field.checkbox label {
  margin: 0;
  font-weight: normal;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-top: 0.25rem;
}

.error-messages {
  background: #FFEBEE;
  border: 1px solid #FFCDD2;
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: var(--color-danger);
}

.error-messages h2 {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  color: var(--color-danger);
  font-family: var(--font-body);
}

.error-messages ul {
  margin: 0;
  padding-left: 1.25rem;
}

.error-messages li {
  font-size: 0.9rem;
}

.actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  background: #F5F0E8;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
}

.data-table tbody tr:hover {
  background: #FAFAF6;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-actions {
  display: flex;
  gap: 0.75rem;
}

/* Dashboard */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-card h3 {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  font-family: var(--font-body);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--color-primary);
  margin: 0.25rem 0;
  font-family: var(--font-heading);
}

.stat-detail {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin: 0;
}

.dashboard-actions h2 {
  font-size: 1.2rem;
}

.dashboard-actions ul {
  list-style: none;
  padding: 0;
}

.dashboard-actions li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.dashboard-actions li:last-child {
  border-bottom: none;
}

/* Session / login forms */
.session-form {
  max-width: 400px;
  margin: 2rem auto;
  background: var(--color-bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}

.session-form h1 {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Pagination */
.pagination-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.per-page-select {
  font-size: 0.85rem;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.per-page-select .tab {
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination-pages {
  display: flex;
  gap: 0.25rem;
}

.pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--color-text);
  text-decoration: none;
  transition: all 0.2s;
}

.pagination-page:hover {
  background: var(--color-border);
  text-decoration: none;
}

.pagination-page.active {
  background: var(--color-primary);
  color: white;
  font-weight: 600;
}

/* Subscribe section */
.subscribe-section {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.subscribe-section h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.subscribe-section p {
  color: var(--color-text-light);
  margin-bottom: 1rem;
}

.subscribe-form .subscribe-fields {
  display: flex;
  gap: 0.5rem;
  max-width: 450px;
  margin: 0 auto;
}

.subscribe-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
}

.subscribe-form input[type="email"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 37, 0, 0.1);
}

.subscribe-form .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Today's fast widget */
.todays-fast {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.todays-fast-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.todays-fast-header h2 {
  margin: 0;
  font-size: 1.1rem;
  flex: 1;
}

.todays-fast-cross {
  font-size: 1.3rem;
  color: var(--color-gold);
}

.todays-fast-date {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.todays-fast-body {
  margin-bottom: 0.75rem;
}

.todays-fast-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-heading);
  margin: 0.5rem 0 0.25rem;
}

.todays-fast-saints {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin: 0.25rem 0;
}

.todays-fast-hymn {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--color-text);
  margin-top: 0.5rem;
  line-height: 1.5;
}

.todays-fast-footer {
  font-size: 0.85rem;
}

.todays-recipe {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  margin: 1rem 0 0.5rem;
  background: #FEFCF8;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-gold);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.todays-recipe:hover {
  background: #F5ECDF;
}

.todays-recipe-image {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: var(--radius);
  overflow: hidden;
}

.todays-recipe-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.todays-recipe-label {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-gold);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.todays-recipe-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--color-heading);
  margin: 0 0 0.4rem;
  line-height: 1.25;
}

.todays-recipe-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* Fasting level badges */
.fasting-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
}

.fasting-level-0 {
  background: #E8F5E9;
  color: var(--color-success);
}

.fasting-level-1 {
  background: #FFF3E0;
  color: #E65100;
}

.fasting-level-2 {
  background: #FBE9E7;
  color: #BF360C;
}

.fasting-level-3 {
  background: #F3E5F5;
  color: #6A1B9A;
}

.fasting-level-4 {
  background: #FFEBEE;
  color: var(--color-danger);
}

.fasting-level-5 {
  background: #ECEFF1;
  color: #37474F;
}

/* Calendar page */
.calendar-toggle {
  display: flex;
  gap: 0.5rem;
}

.calendar-day {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.calendar-date-header {
  padding: 1rem 1.5rem;
  background: #F5F0E8;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.calendar-nav h2 {
  margin: 0;
  font-size: 1.2rem;
  flex: 1;
  text-align: center;
}

.calendar-content {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 0;
}

.calendar-main {
  padding: 1.5rem;
}

.calendar-title {
  font-size: 1.1rem;
  margin: 0 0 1rem;
  color: var(--color-heading);
}

.calendar-tone {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin: 0.5rem 0;
}

.calendar-fasting {
  margin-bottom: 1rem;
}

.calendar-saints h4,
.calendar-hymn h4,
.calendar-readings h4 {
  font-size: 0.9rem;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  margin: 1.25rem 0 0.5rem;
}

.calendar-saints ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

.calendar-saints li {
  padding: 0.15rem 0;
}

.hymn-text {
  font-family: var(--font-heading);
  font-style: italic;
  line-height: 1.7;
  font-size: 0.95rem;
}

.calendar-readings .reading {
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.reading-source {
  color: var(--color-text-light);
  font-size: 0.8rem;
}

.calendar-sidebar {
  padding: 1.5rem;
  background: #FAFAF6;
  border-left: 1px solid var(--color-border);
}

.calendar-sidebar h4 {
  font-size: 0.85rem;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  margin: 0 0 0.75rem;
}

.calendar-other-title {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
  .calendar-content {
    grid-template-columns: 1fr;
  }

  .calendar-sidebar {
    border-left: none;
    border-top: 1px solid var(--color-border);
  }

  .calendar-nav {
    flex-wrap: wrap;
  }

  .calendar-nav h2 {
    font-size: 1rem;
    order: -1;
    flex-basis: 100%;
    text-align: left;
  }

  .calendar-toggle {
    flex-wrap: wrap;
  }
}

/* Brand cross */
.brand-cross {
  font-size: 1.4em;
  vertical-align: middle;
  margin-right: 0.15em;
  line-height: 1;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 2rem 1.5rem;
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-verse {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.6);
}

.footer-cross {
  font-size: 1.8rem;
  color: var(--color-gold);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.footer-info {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .filter-tabs {
    flex-wrap: wrap;
  }

  .field-row {
    flex-direction: column;
    gap: 0;
  }

  .subscribe-form .subscribe-fields {
    flex-direction: column;
  }

  .subscribe-form .btn {
    width: 100%;
  }

  .subscribe-section {
    padding: 1rem;
  }

  .data-table {
    font-size: 0.85rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem;
  }
}

/* =======================================================================
 * Dark theme — schemamonk palette
 *
 * Applied when <html data-theme="dark"> is set (manual choice) or — via
 * the @media fallback at the bottom — when the user has no explicit
 * preference and their system requests dark.
 *
 * Palette evokes the Great Schema habit: near-black warm ground, warm
 * off-white parchment text, russet accents, and a gold-threaded
 * three-bar cross pattern like embroidery on black cloth.
 * ======================================================================= */

:root[data-theme="dark"] {
  --color-primary: #C96438;
  --color-primary-light: #E1845A;
  --color-primary-dark: #2A1510;
  --color-gold: #E0B548;
  --color-gold-light: #F2C96A;
  --color-bg: #0D0B09;
  --color-bg-card: #181410;
  --color-bg-muted: #241E18;
  --color-text: #E8DFCC;
  --color-text-light: #A79A82;
  --color-border: #2E251E;
  --color-heading: #EAA172;
  --color-nav-bg: #120E0B;
  --color-image-placeholder: #241E18;
  --color-flash-notice-bg: #1B2A1E;
  --color-flash-notice-fg: #98D0A2;
  --color-flash-notice-border: #335D3F;
  --color-flash-alert-bg: #321513;
  --color-flash-alert-fg: #F2A09C;
  --color-flash-alert-border: #7A2B26;
  --color-success: #98D0A2;
  --color-danger: #F2A09C;
  --color-warning: #F4CE68;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  --shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.75);
  --bg-pattern: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='64' height='88' viewBox='0 0 64 88'><g fill='none' stroke='%23E0B548' stroke-opacity='0.07' stroke-width='1.1' stroke-linecap='round'><line x1='32' y1='14' x2='32' y2='76'/><line x1='27' y1='22' x2='37' y2='22'/><line x1='20' y1='33' x2='44' y2='33'/><line x1='24' y1='51' x2='40' y2='57'/></g></svg>");
  color-scheme: dark;
}

[data-theme="dark"] body {
  background-color: var(--color-bg);
  background-image: var(--bg-pattern);
  background-repeat: repeat;
  background-attachment: fixed;
}

/* Badges re-tinted for dark: subtle colored wash on dark card, legible fg */
[data-theme="dark"] .badge {
  background: #2A2722;
  color: #C9C0B0;
}

[data-theme="dark"] .badge-published    { background: #1D3221; color: #98D0A2; }
[data-theme="dark"] .badge-draft        { background: #3A2A10; color: #F5C07A; }
[data-theme="dark"] .badge-admin        { background: #142E46; color: #8CB8DE; }
[data-theme="dark"] .badge-blog         { background: #1E2548; color: #9AA3E0; }
[data-theme="dark"] .badge-guide        { background: #193129; color: #8CD0B4; }
[data-theme="dark"] .badge-announcement { background: #3A2810; color: #E8B572; }
[data-theme="dark"] .badge-category     { background: #2B1F34; color: #B599D4; }
[data-theme="dark"] .badge-cuisine      { background: #1F3332; color: #8ECDC3; }
[data-theme="dark"] .badge-fasting      { background: #3A2A14; color: #E8B777; }
[data-theme="dark"] .badge-non-fasting  { background: #321513; color: #EA9A93; }

/* Recipe notices and highlighted boxes */
[data-theme="dark"] .recipe-notice-feast,
[data-theme="dark"] .subscribe-section,
[data-theme="dark"] .todays-fast,
[data-theme="dark"] .todays-recipe,
[data-theme="dark"] .admin-card,
[data-theme="dark"] .stat-card {
  background: var(--color-bg-card);
  border-color: var(--color-border);
  color: var(--color-text);
}

/* Placeholder gradient — swap light-theme primary gradient for a darker one */
[data-theme="dark"] .recipe-card-placeholder {
  background: linear-gradient(135deg, #2A1510 0%, #4A2C20 100%);
  color: rgba(255, 255, 255, 0.5);
}

/* Table stripes */
[data-theme="dark"] .data-table tbody tr:nth-child(even) {
  background: var(--color-bg-muted);
}

/* Form fields */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--color-bg-muted);
  color: var(--color-text);
  border-color: var(--color-border);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  border-color: var(--color-primary);
  outline: none;
}

/* Links in body copy get a gentle lift for contrast against near-black */
[data-theme="dark"] a {
  color: var(--color-primary-light);
}

[data-theme="dark"] a:hover {
  color: var(--color-gold-light);
}

/* Nav brand and links inherit the existing gold-on-dark treatment,
   but harden the brand color so it reads against the very dark nav bg */
[data-theme="dark"] .nav-brand a {
  color: var(--color-gold);
}

/* Footer: on a near-black body, the footer should feel monastic — darker than the page */
[data-theme="dark"] .site-footer {
  background: #09070A;
  border-top-color: #1F1812;
  color: #A79A82;
}

/* Fasting / non-fasting mode toggle (Recipes index) */
/* Segmented fasting/non-fasting switch — mirror the new .btn palette so
   the toggle reads as a coherent control: gold-thread outline on a warm
   dark surface, with the active tab the same deeper russet as .btn-primary. */
[data-theme="dark"] .mode-toggle {
  border-color: rgba(224, 181, 72, 0.45);
  background: #1F1A15;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .mode-tab {
  background: transparent;
  color: var(--color-text);
  border-right-color: rgba(224, 181, 72, 0.25);
}

[data-theme="dark"] .mode-tab:hover {
  background: #2A2218;
  color: var(--color-gold-light);
}

[data-theme="dark"] .mode-tab.active {
  background: #A84524;
  color: #F2C96A;
}

[data-theme="dark"] .mode-description {
  color: var(--color-text-light);
}

[data-theme="dark"] .mode-description {
  color: var(--color-text-light);
}

/* Recipe "Non-fasting" feast notice — warm warning box */
[data-theme="dark"] .recipe-notice-feast {
  background: #2A1708;
  border-color: var(--color-warning);
  color: #F2C46A;
}

/* Fasting level color-coded badges (used on calendar and elsewhere) */
[data-theme="dark"] .fasting-level-0 { background: #19301F; color: #98D0A2; }
[data-theme="dark"] .fasting-level-1 { background: #3A2A10; color: #E8B572; }
[data-theme="dark"] .fasting-level-2 { background: #3A1D14; color: #E89A7A; }
[data-theme="dark"] .fasting-level-3 { background: #2A1A36; color: #C39AE0; }
[data-theme="dark"] .fasting-level-4 { background: #321513; color: #EA9A93; }
[data-theme="dark"] .fasting-level-5 { background: #1F2529; color: #9FB4C0; }

/* Calendar page surfaces */
[data-theme="dark"] .calendar-day {
  background: var(--color-bg-card);
  border-color: var(--color-border);
}

[data-theme="dark"] .calendar-date-header {
  background: var(--color-bg-muted);
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .calendar-sidebar {
  background: var(--color-bg-muted);
  border-left-color: var(--color-border);
}

/* Today's-recipe callout (appears on recipes index and home) */
[data-theme="dark"] .todays-recipe {
  background: var(--color-bg-card);
  border-color: var(--color-border);
  border-left-color: var(--color-gold);
}

[data-theme="dark"] .todays-recipe:hover {
  background: var(--color-bg-muted);
}

/* Admin nav distinguishes itself from the public nav — use a cooler near-black */
[data-theme="dark"] .admin-nav {
  background: #0E0F17;
}

/* Error messages */
[data-theme="dark"] .error-messages {
  background: #2E1412;
  border-color: #5C1F1A;
  color: #F2A09C;
}

[data-theme="dark"] .error-messages h2 {
  color: #F2A09C;
}

/* Data table headers and row hover */
[data-theme="dark"] .data-table th {
  background: var(--color-bg-muted);
  color: var(--color-text-light);
}

[data-theme="dark"] .data-table tbody tr:hover {
  background: #2A2218;
}

/* Category tabs on article index — make sure the active pill reads on dark */
[data-theme="dark"] .tab.active,
[data-theme="dark"] .tab:hover {
  color: var(--color-heading);
  background: var(--color-bg-card);
  border-color: var(--color-border);
}

/* Buttons — the default .btn token-mapping produces an invisible dark-on-dark
   card with a vanishing border. Give it a muted-lift bg and a faint gold
   thread of an outline so it reads as a real button, and warm up
   .btn-primary so it sits with the schemamonk palette rather than against it. */

[data-theme="dark"] .btn {
  background: #1F1A15;
  color: var(--color-text);
  border-color: rgba(224, 181, 72, 0.45);
}

[data-theme="dark"] .btn:hover {
  background: #2A2218;
  color: var(--color-gold-light);
  border-color: rgba(224, 181, 72, 0.6);
}

[data-theme="dark"] .btn-primary {
  background: #A84524;
  color: #F9EFD8;
  border-color: #A84524;
}

[data-theme="dark"] .btn-primary:hover {
  background: #C86438;
  color: #FFF8EC;
  border-color: #C86438;
}

[data-theme="dark"] .btn-danger {
  background: #8F2824;
  color: #F9EFD8;
  border-color: #8F2824;
}

[data-theme="dark"] .btn-danger:hover {
  background: #B2322D;
  color: #FFF8EC;
  border-color: #B2322D;
}

/* Theme toggle — tiny icon button in the nav */
.theme-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.85);
  width: 2rem;
  height: 2rem;
  line-height: 1;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  color: var(--color-gold);
  border-color: var(--color-gold);
  background: rgba(255, 255, 255, 0.05);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* When the user has no stored choice, honor their system preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-primary: #C96438;
    --color-primary-light: #E1845A;
    --color-primary-dark: #2A1510;
    --color-gold: #E0B548;
    --color-gold-light: #F2C96A;
    --color-bg: #0D0B09;
    --color-bg-card: #181410;
    --color-bg-muted: #241E18;
    --color-text: #E8DFCC;
    --color-text-light: #A79A82;
    --color-border: #2E251E;
    --color-heading: #EAA172;
    --color-nav-bg: #120E0B;
    --color-image-placeholder: #241E18;
    --color-flash-notice-bg: #1B2A1E;
    --color-flash-notice-fg: #98D0A2;
    --color-flash-notice-border: #335D3F;
    --color-flash-alert-bg: #321513;
    --color-flash-alert-fg: #F2A09C;
    --color-flash-alert-border: #7A2B26;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
    --shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.75);
    --bg-pattern: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='64' height='88' viewBox='0 0 64 88'><g fill='none' stroke='%23E0B548' stroke-opacity='0.07' stroke-width='1.1' stroke-linecap='round'><line x1='32' y1='14' x2='32' y2='76'/><line x1='27' y1='22' x2='37' y2='22'/><line x1='20' y1='33' x2='44' y2='33'/><line x1='24' y1='51' x2='40' y2='57'/></g></svg>");
    color-scheme: dark;
  }

  :root:not([data-theme]) body {
    background-image: var(--bg-pattern);
    background-repeat: repeat;
    background-attachment: fixed;
  }
}

/* ============================================================
 * Wiki — markdown-rendered content from vendor/orthodox-info
 * ============================================================ */

.wiki {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 0 4rem;
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.7;
}

.wiki-breadcrumbs {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.wiki-breadcrumbs a {
  color: var(--color-primary);
  text-decoration: none;
}

.wiki-breadcrumbs a:hover {
  text-decoration: underline;
}

.wiki-breadcrumbs .sep {
  margin: 0 0.4rem;
  color: var(--color-border);
}

.wiki-body h1,
.wiki-body h2,
.wiki-body h3,
.wiki-body h4,
.wiki-body h5,
.wiki-body h6 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: 1.3;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

.wiki-body h1 { font-size: 2rem;   border-bottom: 2px solid var(--color-border); padding-bottom: 0.5rem; }
.wiki-body h2 { font-size: 1.55rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.4rem; }
.wiki-body h3 { font-size: 1.25rem; }
.wiki-body h4 { font-size: 1.1rem; }
.wiki-body h5,
.wiki-body h6 { font-size: 1rem; }

.wiki-body p,
.wiki-body ul,
.wiki-body ol {
  margin: 0 0 1rem;
}

.wiki-body ul,
.wiki-body ol {
  padding-left: 1.5rem;
}

.wiki-body li {
  margin-bottom: 0.25rem;
}

.wiki-body a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.wiki-body a:hover {
  color: var(--color-primary-dark);
}

.wiki-body blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 4px solid var(--color-gold);
  background: var(--color-bg-muted);
  color: var(--color-text);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.wiki-body blockquote p:last-child {
  margin-bottom: 0;
}

.wiki-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--color-bg-muted);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--color-primary-dark);
}

.wiki-body pre {
  background: var(--color-bg-muted);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.25rem 0;
}

.wiki-body pre code {
  background: transparent;
  padding: 0;
  color: var(--color-text);
}

.wiki-body hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

.wiki-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

.wiki-body th,
.wiki-body td {
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.wiki-body th {
  background: var(--color-bg-muted);
  font-weight: 600;
}

.wiki-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.wiki-body sup a,
.wiki-body .footnotes {
  font-size: 0.875rem;
}

.wiki-body .footnotes hr {
  margin-top: 3rem;
}
