/* ===========================
   CBF Church - Main Stylesheet
   =========================== */

/* CSS Custom Properties */
:root {
  --color-primary: #4a7fb5;
  --color-primary-dark: #365d8a;
  --color-primary-light: #6fa8dc;
  --color-accent: #d4a843;
  --color-text: #333333;
  --color-text-light: #5a5a5a;
  --color-text-muted: #888888;
  --color-bg: #ffffff;
  --color-bg-light: #f5f7fa;
  --color-bg-warm: #faf8f5;
  --color-border: #e0e4e8;
  --color-border-light: #eef1f4;
  --font-heading: 'Inter', -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1100px;
  --sidebar-width: 300px;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --transition: 0.2s ease;
}

:root[data-theme="dark"] {
  --color-primary: #7fb0e6;
  --color-primary-dark: #2b4463;
  --color-primary-light: #a7c9ef;
  --color-accent: #e3c064;
  --color-text: #a9b1bd;
  --color-text-light: #98a2b0;
  --color-text-muted: #7f8a9b;
  --color-bg: #10141b;
  --color-bg-light: #141a23;
  --color-bg-warm: #1a2230;
  --color-border: #2a3443;
  --color-border-light: #222b39;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-primary: #7fb0e6;
    --color-primary-dark: #2b4463;
    --color-primary-light: #a7c9ef;
    --color-accent: #e3c064;
    --color-text: #a9b1bd;
    --color-text-light: #98a2b0;
    --color-text-muted: #7f8a9b;
    --color-bg: #10141b;
    --color-bg-light: #141a23;
    --color-bg-warm: #1a2230;
    --color-border: #2a3443;
    --color-border-light: #222b39;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.45);
  }
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 64px;
}

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p {
  margin-bottom: 1rem;
}

/* Skip to content (accessibility) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
  font-size: 0.875rem;
}

.skip-link:focus {
  top: 0;
}

/* ===========================
   Site Header
   =========================== */
.site-header {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  padding: 2rem 0;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.header-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px;
}

.header-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.header-logo-link:hover {
  opacity: 0.95;
}

.header-wordmark {
  height: 84px;
  width: auto;
  max-width: min(560px, 100%);
  margin-left: -26px;
}

.header-text h1 {
  font-size: 1.75rem;
  color: #fff;
  margin-bottom: 0.15rem;
  letter-spacing: 0.5px;
}

.header-text p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0;
}

/* ===========================
   Navigation
   =========================== */
.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] .site-nav {
  background: #121824;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .site-nav {
    background: #121824;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  }
}

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.75rem 0;
  color: var(--color-text);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: all var(--transition);
  border-radius: 1px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  justify-content: center;
  gap: 0;
  flex: 1 1 auto;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: 999px;
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  margin-left: 1.5rem;
}

.theme-toggle::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 22px;
  background: var(--color-border);
  margin-right: 0.85rem;
}

.theme-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.theme-icon {
  display: inline-block;
  font-size: 1.2rem;
  line-height: 1;
}

/* Dark mode component surfaces */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .post-card,
:root[data-theme="dark"] .sidebar-section,
:root[data-theme="dark"] .pagination a {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
}

:root[data-theme="dark"] .post-card h2 a {
  color: var(--color-primary-light);
}

:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] .sidebar-section h3,
:root[data-theme="dark"] .content-section h2,
:root[data-theme="dark"] .post-full h1 {
  color: var(--color-primary-light);
}

:root[data-theme="dark"] .archive-year summary {
  color: var(--color-primary-light);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .card,
  :root:not([data-theme]) .post-card,
  :root:not([data-theme]) .sidebar-section,
  :root:not([data-theme]) .pagination a {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
  }

  :root:not([data-theme]) .post-card h2 a {
    color: var(--color-primary-light);
  }

  :root:not([data-theme]) h1,
  :root:not([data-theme]) h2,
  :root:not([data-theme]) h3,
  :root:not([data-theme]) .sidebar-section h3,
  :root:not([data-theme]) .content-section h2,
  :root:not([data-theme]) .post-full h1 {
    color: var(--color-primary-light);
  }

  :root:not([data-theme]) .archive-year summary {
    color: var(--color-primary-light);
  }
}

.nav-links a i {
  font-size: 0.9em;
  width: 1em;
  text-align: center;
  opacity: 0.7;
}

.nav-links a:hover i,
.nav-links a.active i {
  opacity: 1;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ===========================
   Page Layout
   =========================== */
.page-wrapper {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 2rem;
}

.page-wrapper.full-width {
  grid-template-columns: 1fr;
}

.main-content {
  min-width: 0;
}

/* ===========================
   Content Cards
   =========================== */
.card {
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.card-sm {
  padding: 1.25rem;
}

/* ===========================
   Blog Post Cards
   =========================== */
.post-card {
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 2rem;
  margin-bottom: 1.25rem;
  transition: box-shadow var(--transition);
}

.post-card:hover {
  box-shadow: var(--shadow-hover);
}

.post-card h2 {
  margin-bottom: 0.35rem;
}

.post-card h2 a {
  color: var(--color-primary-dark);
}

.post-card h2 a:hover {
  color: var(--color-primary);
}

.post-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.post-meta span + span::before {
  content: ' · ';
}

.post-preview {
  color: var(--color-text-light);
  margin-bottom: 1rem;
}

.read-more {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-primary);
}

.read-more:hover {
  color: var(--color-primary-dark);
}

/* Single Post */
.post-full h1 {
  margin-bottom: 0.5rem;
}

.post-full .post-content {
  font-size: 1.05rem;
  line-height: 1.75;
}

.post-full .post-content p {
  margin-bottom: 1.25rem;
}

.post-full .post-content blockquote {
  border-left: 3px solid var(--color-primary-light);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--color-text-light);
  font-style: italic;
}

.post-full .back-link {
  display: inline-block;
  margin-top: 2rem;
  font-weight: 600;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
}

.pagination a {
  background: var(--color-bg);
  box-shadow: var(--shadow);
  color: var(--color-primary);
}

.pagination a:hover {
  background: var(--color-primary);
  color: #fff;
}

.pagination .current {
  background: var(--color-primary);
  color: #fff;
}

/* ===========================
   Sidebar
   =========================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-section {
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.sidebar-section h3 {
  font-size: 1rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-primary-light);
  color: var(--color-primary-dark);
}

.sidebar-section ul {
  list-style: none;
}

.sidebar-section li {
  padding: 0.35rem 0;
}

.sidebar-section li a {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.sidebar-section li a:hover {
  color: var(--color-primary);
}

.service-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.9rem;
}

.service-item:last-child {
  border-bottom: none;
}

.service-item .day {
  font-weight: 600;
  color: var(--color-text);
}

.service-item .time {
  color: var(--color-text-muted);
}

/* ===========================
   Static Content Pages
   =========================== */
.content-section {
  margin-bottom: 2rem;
}

.content-section h2 {
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border-light);
  margin-bottom: 1rem;
}

.scripture-ref {
  font-style: italic;
  color: var(--color-text-light);
  padding-left: 1.5rem;
  border-left: 3px solid var(--color-accent);
  margin: 1rem 0;
}

.scripture-cite {
  display: block;
  text-align: right;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* Contact Cards */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.contact-card {
  background: var(--color-bg-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--color-border-light);
}

.contact-card h4 {
  color: var(--color-primary-dark);
  margin-bottom: 0.15rem;
  font-family: var(--font-body);
  font-size: 1rem;
}

:root[data-theme="dark"] .contact-card h4 {
  color: var(--color-text-light);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .contact-card h4 {
    color: var(--color-text-light);
  }
}

.contact-card .role {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.contact-card a {
  font-size: 0.9rem;
}

/* ===========================
   Photo Gallery
   =========================== */
#recent-uploads-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border-light);
}

#recent-uploads-section h2 {
  margin-bottom: 0.75rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 85vh;
  border-radius: var(--radius);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ===========================
   Archives
   =========================== */
.archive-year {
  margin-bottom: 1rem;
}

.archive-year summary {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--color-primary-dark);
  cursor: pointer;
  padding: 0.5rem 0;
  font-weight: 600;
}

.archive-year summary:hover {
  color: var(--color-primary);
}

.archive-months {
  padding-left: 1.5rem;
  list-style: none;
}

.archive-months li {
  padding: 0.35rem 0;
}

.archive-months li a {
  font-size: 0.95rem;
}

.archive-months .count {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 0.4rem 1rem;
  font-size: 0.7rem;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  margin-top: 0;
}

.site-footer a {
  color: #d94a4a;
}

.site-footer a:hover {
  color: #ff6b6b;
}

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

.footer-inner p {
  margin-bottom: 0.1rem;
  line-height: 1.3;
}

/* ===========================
   Admin Styles
   =========================== */
.admin-header {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  font-size: 1.25rem;
  color: #fff;
  margin: 0;
}

.admin-header a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.admin-header a:hover {
  color: #fff;
}

.admin-theme-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 0.3rem 0.55rem;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  transition: border-color var(--transition), color var(--transition);
}

.admin-theme-toggle:hover {
  border-color: #fff;
  color: #fff;
}

.login-container {
  max-width: 400px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.login-form {
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
}

.admin-section {
  margin-bottom: 2rem;
}

.admin-form .form-group {
  margin-bottom: 1rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert.error {
  background: #fff5f5;
  color: #a23434;
  border: 1px solid #f2c0c0;
}

.alert.success {
  background: #f1fbf4;
  color: #1e6b3a;
  border: 1px solid #bfe4c9;
}

.gallery-admin-list {
  margin-top: 1.5rem;
}

.gallery-admin-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--color-border);
}

.gallery-admin-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.gallery-admin-meta {
  flex: 1;
  min-width: 0;
}

.gallery-admin-meta strong {
  display: block;
  font-size: 0.95rem;
}

.gallery-admin-actions {
  display: flex;
  gap: 0.5rem;
}

.gallery-admin-actions button {
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
}

.gallery-admin-actions button:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

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

.form-group {
  margin-bottom: 1.25rem;
}

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

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 127, 181, 0.15);
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

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

.btn-danger {
  background: #dc3545;
  color: #fff;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-outline:hover {
  background: var(--color-bg-light);
}

.btn-full {
  width: 100%;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #fff5f5;
  color: #dc3545;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #f0fff4;
  color: #28a745;
  border: 1px solid #c3e6cb;
}

:root[data-theme="dark"] .alert-error {
  background: #2a1215;
  color: #f87171;
  border-color: #4a1c1c;
}

:root[data-theme="dark"] .alert-success {
  background: #0f2618;
  color: #4ade80;
  border-color: #1a3a2a;
}

:root[data-theme="dark"] .alert.error {
  background: #2a1215;
  color: #f87171;
  border-color: #4a1c1c;
}

:root[data-theme="dark"] .alert.success {
  background: #0f2618;
  color: #4ade80;
  border-color: #1a3a2a;
}

:root[data-theme="dark"] .form-group input,
:root[data-theme="dark"] .form-group textarea,
:root[data-theme="dark"] .form-group select {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-border);
}

:root[data-theme="dark"] .admin-header {
  background: #0c1018;
}

:root[data-theme="dark"] .admin-theme-toggle {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .alert-error {
    background: #2a1215;
    color: #f87171;
    border-color: #4a1c1c;
  }

  :root:not([data-theme]) .alert-success {
    background: #0f2618;
    color: #4ade80;
    border-color: #1a3a2a;
  }

  :root:not([data-theme]) .alert.error {
    background: #2a1215;
    color: #f87171;
    border-color: #4a1c1c;
  }

  :root:not([data-theme]) .alert.success {
    background: #0f2618;
    color: #4ade80;
    border-color: #1a3a2a;
  }

  :root:not([data-theme]) .form-group input,
  :root:not([data-theme]) .form-group textarea,
  :root:not([data-theme]) .form-group select {
    background: var(--color-bg);
    color: var(--color-text);
    border-color: var(--color-border);
  }

  :root:not([data-theme]) .admin-header {
    background: #0c1018;
  }

  :root:not([data-theme]) .admin-theme-toggle {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
  }
}

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

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.posts-table {
  width: 100%;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-collapse: collapse;
  overflow: hidden;
}

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

.posts-table th {
  background: var(--color-bg-light);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.posts-table td {
  font-size: 0.95rem;
}

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

.posts-table .actions {
  white-space: nowrap;
}

.posts-table .actions a {
  margin-right: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.posts-table .actions .delete-link {
  color: #dc3545;
}

/* Editor */
.editor-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.editor-container .card {
  padding: 2rem;
}

#editor-area {
  min-height: 300px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.editor-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

:root[data-theme="dark"] .ql-toolbar.ql-snow {
  background: var(--color-bg-light);
  border-color: var(--color-border);
}

:root[data-theme="dark"] .ql-container.ql-snow {
  background: var(--color-bg);
  border-color: var(--color-border);
  color: var(--color-text);
}

:root[data-theme="dark"] .ql-editor.ql-blank::before {
  color: var(--color-text-muted);
}

:root[data-theme="dark"] .ql-snow .ql-stroke {
  stroke: var(--color-text-light);
}

:root[data-theme="dark"] .ql-snow .ql-fill {
  fill: var(--color-text-light);
}

:root[data-theme="dark"] .ql-snow .ql-picker-label {
  color: var(--color-text-light);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .ql-toolbar.ql-snow {
    background: var(--color-bg-light);
    border-color: var(--color-border);
  }

  :root:not([data-theme]) .ql-container.ql-snow {
    background: var(--color-bg);
    border-color: var(--color-border);
    color: var(--color-text);
  }

  :root:not([data-theme]) .ql-editor.ql-blank::before {
    color: var(--color-text-muted);
  }

  :root:not([data-theme]) .ql-snow .ql-stroke {
    stroke: var(--color-text-light);
  }

  :root:not([data-theme]) .ql-snow .ql-fill {
    fill: var(--color-text-light);
  }

  :root:not([data-theme]) .ql-snow .ql-picker-label {
    color: var(--color-text-light);
  }
}

/* ===========================
   Utility Classes
   =========================== */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Loading spinner */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--color-text-muted);
}

.loading::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 0.5rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--color-text-muted);
}

.empty-state p {
  font-size: 1.1rem;
}

/* Google Maps Embed */
.map-container {
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1rem;
}

.map-container iframe {
  width: 100%;
  height: 300px;
  border: none;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 260px;
  }

  .nav-links a {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .header-wordmark {
    height: 72px;
  }

  .page-wrapper {
    grid-template-columns: 1fr;
    margin: 1.25rem auto;
    gap: 1.5rem;
  }

  .header-text h1 {
    font-size: 1.35rem;
  }

  .header-logo {
    width: 48px;
    height: 48px;
  }

  /* Mobile Nav */
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border-light);
  }

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

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .card {
    padding: 1.25rem;
  }

  .post-card {
    padding: 1.25rem;
  }

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

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .posts-table th:nth-child(3),
  .posts-table td:nth-child(3) {
    display: none;
  }

  .admin-toolbar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .header-inner {
    flex-direction: column;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .editor-actions {
    flex-direction: column;
  }
}
