@import url("https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap");

:root {
  /* Diaspora Link Teal Color Palette */
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --teal-900: #134e4a;

  /* Semantic colors */
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --text-light: #334155;
  --text-muted: #64748b;
  --accent: var(--teal-600);
  --accent-hover: var(--teal-700);
  --accent-light: var(--teal-50);
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 8px 32px rgba(13, 148, 136, 0.15);
  --shadow-teal: 0 4px 24px rgba(13, 148, 136, 0.12);
  --radius: 16px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3 {
  font-family: "Crimson Text", Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-size: 2.75rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-light);
  line-height: 1.8;
}

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

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

/* Layout */
.page {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-wide {
  max-width: 1100px;
}

/* Header styles */
.site-header {
  padding: 3rem 0 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 3rem;
}

.site-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.site-header .tagline {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 1.5rem;
}

/* Dark branded header */
.site-header--dark {
  background: var(--teal-900);
  margin: 0 -24px 3rem;
  padding: 2.5rem 24px 2rem;
  border-bottom: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

.site-header--dark .tagline {
  color: var(--teal-300);
}

.site-logo {
  width: 220px;
  height: auto;
  display: block;
  margin: 0 auto 0.5rem;
}

/* Dark nav variant */
.nav--dark a {
  color: var(--teal-200);
}

.nav--dark a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

/* Navigation */
.nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.nav a {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 100px;
  transition: all 0.2s ease;
}

.nav a:hover {
  color: var(--accent);
  background: var(--accent-light);
}

/* App Download Banner */
.app-banner {
  background: linear-gradient(135deg, var(--teal-600) 0%, var(--teal-700) 100%);
  color: white;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 2rem 0;
  box-shadow: var(--shadow-teal);
}

.app-banner-content {
  flex: 1;
  min-width: 200px;
}

.app-banner h3 {
  color: white;
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
}

.app-banner p {
  color: var(--teal-100);
  margin: 0;
  font-size: 0.95rem;
}

.app-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  color: var(--teal-700);
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.app-banner-btn:hover {
  background: var(--teal-50);
  color: var(--teal-800);
  transform: translateY(-2px);
}

.app-banner-btn svg {
  width: 20px;
  height: 20px;
}

/* Floating App CTA */
.app-floating {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
}

.app-floating-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--teal-600);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.3);
  transition: all 0.2s ease;
}

.app-floating-btn:hover {
  background: var(--teal-700);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(13, 148, 136, 0.4);
}

/* Article header (for blog posts) */
.article-header {
  text-align: center;
  padding: 2rem 0 3rem;
  max-width: 700px;
  margin: 0 auto;
}

.article-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.article-meta .separator {
  color: var(--border);
}

.category-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Cards */
.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.card h2 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

/* Blog listing page */
.blog-hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.blog-hero h1 {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.blog-hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

/* Article grid */
.articles-grid {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.article-card {
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.article-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--border-light);
}

.article-card-content {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.article-card h3 a {
  color: var(--text);
}

.article-card h3 a:hover {
  color: var(--accent);
}

.article-card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.article-card p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  flex: 1;
}

.read-more {
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.read-more::after {
  content: "→";
  transition: transform 0.2s ease;
}

.read-more:hover::after {
  transform: translateX(4px);
}

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

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}

/* Article content */
.article-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 0 4rem;
}

.article-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.article-content h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-content ul,
.article-content ol {
  margin: 1.25rem 0 1.25rem 1.5rem;
  color: var(--text-light);
}

.article-content li {
  margin-bottom: 0.5rem;
}

/* Media sections */
.media-section {
  margin: 3rem 0;
}

.media-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.media-caption {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-style: italic;
}

.featured-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 2rem 0;
}

.article-image {
  width: 100%;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border-light);
  margin: 1.5rem 0;
}

.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Lists and info boxes */
.info-list {
  list-style: none;
  margin: 1.5rem 0;
}

.info-list li {
  padding: 0.75rem 0;
  padding-left: 1.75rem;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.highlight-box {
  background: linear-gradient(135deg, var(--teal-50) 0%, var(--teal-100) 100%);
  border-left: 4px solid var(--teal-500);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  margin: 2rem 0;
}

.highlight-box p {
  margin: 0;
  color: var(--teal-800);
}

.warning-box {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  margin: 2rem 0;
}

.warning-box p {
  margin: 0;
  color: #991b1b;
  font-size: 0.95rem;
}

.info-box {
  background: var(--teal-50);
  border-left: 4px solid var(--accent);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  margin: 2rem 0;
}

.info-box p {
  margin: 0;
  color: var(--teal-800);
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

.tag {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.tag:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* Page footer */
.page-footer {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid var(--border-light);
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.back-link::before {
  content: "←";
}

.back-link:hover {
  color: var(--accent);
}

/* Grid layouts */
.two-column {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

/* Admin Styles */
.admin-header {
  background: linear-gradient(135deg, var(--teal-600) 0%, var(--teal-700) 100%);
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.admin-header h1 {
  color: white;
  font-size: 2rem;
  margin: 0;
}

.admin-header p {
  color: var(--teal-100);
  margin: 0.5rem 0 0;
}

.admin-nav {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.admin-nav a {
  color: white;
  opacity: 0.8;
  font-weight: 500;
}

.admin-nav a:hover {
  opacity: 1;
}

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

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--teal-100);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background: var(--teal-700);
  color: white;
}

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

.btn-secondary:hover {
  background: var(--border-light);
}

.btn-danger {
  background: #fef2f2;
  color: #dc2626;
}

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

.btn-warning {
  background: #fef3c7;
  color: #92400e;
}

.btn-warning:hover {
  background: #fde68a;
}

.posts-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

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

.posts-table th {
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
}

.posts-table td {
  color: var(--text-light);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-published {
  background: #dcfce7;
  color: #166534;
}

.status-draft {
  background: #f3f4f6;
  color: #6b7280;
}

.status-scheduled {
  background: #fef3c7;
  color: #92400e;
}

.status-pending {
  background: #ede9fe;
  color: #5b21b6;
}

.source-ai {
  background: #ecfeff;
  color: #155e75;
}

.source-human {
  background: #ecfdf5;
  color: #065f46;
}

.login-box {
  max-width: 400px;
  margin: 4rem auto;
  text-align: center;
}

.login-box h2 {
  margin-bottom: 0.5rem;
}

.login-box p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  .blog-hero h1 {
    font-size: 2.25rem;
  }

  .article-header h1 {
    font-size: 1.75rem;
  }

  .card {
    padding: 1.5rem;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .nav {
    gap: 0.25rem;
  }

  .nav a {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }

  .app-banner {
    flex-direction: column;
    text-align: center;
  }

  .app-floating {
    left: 24px;
    right: 24px;
  }

  .app-floating-btn {
    width: 100%;
    justify-content: center;
  }

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

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