/*
 * La Stabulation Française Theme
 * A modern, spiritual design inspired by Catholic liturgical colors and sacred tradition
 * Color palette: Deep blues (devotion), gold (divine light), burgundy (sacrifice), ivory (sacred text)
 */

:root {
  color-scheme: light;

  /* Primary color palette - Spiritual & Catholic inspired */
  --bg: #f8f6f1;                    /* Warm ivory - sacred manuscript */
  --bg-deep: #ebe6db;               /* Deeper parchment tone */
  --bg-elevated: #ffffff;           /* Pure white for cards */

  --ink: #1a1512;                   /* Deep brown-black - ink on parchment */
  --ink-soft: #4a4340;              /* Softer text for secondary content */
  --ink-lighter: #6b6360;           /* Even lighter for tertiary content */

  --primary: #2d4a7c;               /* Deep liturgical blue - devotion */
  --primary-light: #3d5a8c;         /* Lighter blue for hover states */
  --primary-dark: #1d3a6c;          /* Darker blue for emphasis */

  --accent-gold: #b8860b;           /* Rich gold - divine light */
  --accent-burgundy: #6b2e2e;       /* Deep burgundy - sacrifice & dignity */
  --accent-sage: #5a6f5a;           /* Muted sage - contemplation */

  /* UI elements */
  --card: rgba(255, 255, 255, 0.92);
  --card-strong: rgba(255, 255, 255, 0.98);
  --card-border: rgba(45, 74, 124, 0.15);
  --divider: rgba(45, 74, 124, 0.12);

  /* Shadows - subtle and elegant */
  --shadow-sm: 0 2px 8px rgba(29, 58, 108, 0.08);
  --shadow: 0 8px 24px rgba(29, 58, 108, 0.12);
  --shadow-lg: 0 16px 40px rgba(29, 58, 108, 0.16);

  /* Layout */
  --radius: 12px;
  --radius-lg: 16px;
  --max-width: 1200px;
  --reading-width: 740px;

  /* Typography scale */
  --font-serif: "Crimson Pro", "Crimson Text", "Georgia", serif;
  --font-display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* Base reset and typography */
* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink);
  background: linear-gradient(to bottom, #fdfbf7 0%, var(--bg) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.3;
  margin: 0 0 0.5em;
  color: var(--primary-dark);
}

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

h2 {
  font-size: 1.9rem;
}

h3 {
  font-size: 1.4rem;
}

p {
  margin: 0 0 1.2em;
  color: var(--ink-soft);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

/* Layout structure */
.site {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 28px 100px;
}

/* Decorative elements - subtle cross pattern background */
.site::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(45, 74, 124, 0.03) 49px, rgba(45, 74, 124, 0.03) 50px),
    repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(45, 74, 124, 0.03) 49px, rgba(45, 74, 124, 0.03) 50px);
  pointer-events: none;
  z-index: 0;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 16px 0 32px;
  border-bottom: 2px solid var(--divider);
  position: relative;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Sacred symbol - stylized cross */
.sigil {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.sigil::before,
.sigil::after {
  content: "";
  position: absolute;
  background: var(--bg-elevated);
}

.sigil::before {
  width: 3px;
  height: 26px;
  border-radius: 2px;
}

.sigil::after {
  width: 20px;
  height: 3px;
  border-radius: 2px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary-dark);
  transition: color 0.3s ease;
}

.logo:hover {
  color: var(--accent-gold);
}

.tagline {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-lighter);
  margin: 0;
}

/* Navigation */
.nav {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: var(--radius);
  position: relative;
  transition: all 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-gold);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link:hover::after {
  width: 60%;
}

/* Main content area */
.main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 64px;
  margin-top: 40px;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 48px 0;
  max-width: 900px;
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-burgundy);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--accent-burgundy);
}

.hero h1 {
  font-size: 3.2rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lede {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--ink-soft);
  max-width: 680px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
}

.button.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: var(--shadow);
}

.button.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.button.ghost {
  background: var(--card-strong);
  border-color: var(--card-border);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.button.ghost:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

/* Manifest section - spiritual statement */
.manifest {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.manifest::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed var(--accent-burgundy);
  opacity: 0.3;
  border-radius: calc(var(--radius-lg) - 8px);
  pointer-events: none;
}

.manifest-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.manifest-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-burgundy);
  margin-bottom: 16px;
}

.manifest-text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.manifest-signature {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.18em;
  color: var(--primary);
  margin: 0;
}

/* Section */
.section {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.section-header h1,
.section-header h2 {
  margin-bottom: 12px;
}

.section-header p {
  font-size: 1.05rem;
  color: var(--ink-lighter);
}

/* Post grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

/* Post card */
.post-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-gold) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.post-card:hover::before {
  transform: scaleX(1);
}

.post-card-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-kicker {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-sage);
}

.post-card h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.4;
}

.post-card h3 a {
  color: var(--primary-dark);
  transition: color 0.3s ease;
}

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

.post-excerpt {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 8px 0 12px;
}

.read-more {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.3s ease;
}

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

.read-more:hover {
  gap: 10px;
  color: var(--accent-gold);
}

/* Post metadata */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink-lighter);
}

.post-meta .dot {
  opacity: 0.5;
}

.post-meta a {
  color: var(--primary);
  transition: color 0.3s ease;
}

.post-meta a:hover {
  color: var(--accent-gold);
}

.post-meta .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Single post */
.post {
  background: var(--card-strong);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 56px;
  max-width: var(--reading-width);
  margin: 0 auto;
  box-shadow: var(--shadow);
  position: relative;
}

.post::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-gold) 50%, var(--accent-burgundy) 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.post-header {
  margin-bottom: 40px;
  text-align: center;
  padding-bottom: 32px;
  border-bottom: 2px solid var(--divider);
}

.post-header .post-kicker {
  margin-bottom: 12px;
}

.post-header h1 {
  font-size: 2.6rem;
  margin-bottom: 20px;
  line-height: 1.2;
}

.post-header .post-meta {
  justify-content: center;
}

/* Post content - optimized for reading */
.post-content {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--ink);
}

.post-content > *:first-child {
  margin-top: 0;
}

.post-content h2 {
  margin-top: 48px;
  margin-bottom: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--divider);
}

.post-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.post-content h3 {
  margin-top: 36px;
  margin-bottom: 16px;
}

.post-content p {
  color: var(--ink);
  margin-bottom: 1.4em;
}

.post-content a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--accent-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: all 0.3s ease;
}

.post-content a:hover {
  color: var(--accent-gold);
  text-decoration-color: var(--primary);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 32px 0;
  box-shadow: var(--shadow);
}

.post-content blockquote {
  margin: 32px 0;
  padding: 24px 28px;
  border-left: 4px solid var(--accent-gold);
  background: linear-gradient(to right, rgba(184, 134, 11, 0.06), transparent);
  font-style: italic;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content ul,
.post-content ol {
  margin: 20px 0;
  padding-left: 28px;
}

.post-content li {
  margin-bottom: 8px;
  color: var(--ink);
}

.post-content code {
  background: var(--bg-deep);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  font-family: "Consolas", "Monaco", monospace;
  color: var(--accent-burgundy);
}

.post-content pre {
  background: var(--bg-deep);
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--card-border);
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--ink);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 14px 24px;
  box-shadow: var(--shadow-sm);
}

.page-link {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--primary);
  transition: color 0.3s ease;
}

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

.page-link.muted {
  opacity: 0.4;
  cursor: default;
}

.page-link.muted:hover {
  color: inherit;
}

.page-count {
  font-size: 0.85rem;
  color: var(--ink-lighter);
}

/* Tag cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.tag:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.tag span {
  color: var(--accent-gold);
  font-weight: 700;
}

/* Footer */
.site-footer {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 2px solid var(--divider);
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--ink-lighter);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--primary);
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent-gold);
}

/* Reading progress indicator */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-gold) 100%);
  width: 0;
  z-index: 1000;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 8px rgba(184, 134, 11, 0.5);
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card {
  animation: fadeUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .post-card {
    opacity: 1;
    animation: none;
  }
}

/* Responsive design */
@media (max-width: 960px) {
  :root {
    font-size: 17px;
  }

  .post {
    padding: 40px 32px;
  }

  .hero h1 {
    font-size: 2.6rem;
  }
}

@media (max-width: 640px) {
  :root {
    font-size: 16px;
  }

  .site {
    padding: 24px 20px 80px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .nav {
    width: 100%;
  }

  .hero {
    padding: 32px 0;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .manifest {
    padding: 28px 24px;
  }

  .post {
    padding: 32px 24px;
  }

  .post-header h1 {
    font-size: 2rem;
  }

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

  .pagination {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .site-header,
  .site-footer,
  .hero-actions,
  .read-more,
  .pagination {
    display: none;
  }

  .post {
    box-shadow: none;
    border: none;
    max-width: 100%;
  }
}
