/* Cairal Blog — Thème personnalisé */

:root {
  --bg-deep: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #263249;
  --accent-blue: #38bdf8;
  --accent-indigo: #818cf8;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: rgba(56, 189, 248, 0.15);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== HEADER / NAV ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-nav-logo {
  font-size: 1.35rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-indigo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
  text-decoration: none !important;
}

.site-nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.site-nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.site-nav-links a:hover, .site-nav-links a.active {
  color: var(--accent-blue);
  text-decoration: none;
}

.back-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-blue);
  text-decoration: none;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.back-link:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--accent-blue);
  text-decoration: none;
}

/* ===== MAIN CONTENT ===== */
.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ===== HERO / BLOG HEADER ===== */
.blog-hero {
  text-align: center;
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.blog-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-indigo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

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

/* ===== POST GRID ===== */
.post-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-3px);
}

.post-card-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--bg-card-hover);
}

.post-card-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
}

.post-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  flex: 1;
}

.post-card-title a {
  color: inherit;
  text-decoration: none;
}
.post-card-title a:hover { color: var(--accent-blue); text-decoration: none; }

.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.read-more {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-blue);
  text-decoration: none;
}
.read-more:hover { text-decoration: underline; }

/* ===== SINGLE POST ===== */
.article-container {
  max-width: 760px;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.article-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-blue);
  margin-bottom: 0.75rem;
  display: block;
}

.article-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.article-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.article-feature-image {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.article-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.article-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
}

.article-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem;
}

.article-content p { margin-bottom: 1.2rem; }

.article-content ul, .article-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
}

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

.article-content blockquote {
  border-left: 3px solid var(--accent-blue);
  padding: 0.75rem 1.25rem;
  background: rgba(56, 189, 248, 0.06);
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-primary);
}

.article-content a {
  color: var(--accent-blue);
  text-decoration: underline;
}

.article-content code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'Courier New', monospace;
}

.article-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-content pre code {
  background: none;
  border: none;
  padding: 0;
}

.article-content img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.article-nav a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.article-nav a:hover { color: var(--accent-blue); }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.pagination a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
  text-decoration: none;
}
.pagination a:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  text-decoration: none;
}

.pagination .page-number {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem 1.5rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.footer-brand {
  max-width: 300px;
}

.footer-brand-logo {
  font-size: 1.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-indigo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.footer-brand-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.footer-links-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.footer-links-group a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links-group a:hover { color: var(--accent-blue); text-decoration: none; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== PAGE 404 ===== */
.error-page {
  text-align: center;
  padding: 5rem 2rem;
}

.error-code {
  font-size: 5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-indigo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 1rem;
}

.error-message {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.error-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bg-deep);
  background: var(--accent-blue);
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.error-home-btn:hover { opacity: 0.9; text-decoration: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .site-header { padding: 0.875rem 1rem; }
  .site-main { padding: 2rem 1rem; }
  .post-feed { grid-template-columns: 1fr; }
  .article-title { font-size: 1.5rem; }
  .footer-top { flex-direction: column; }
  .site-nav-links { display: none; }
}

@media (max-width: 480px) {
  .blog-hero h1 { font-size: 1.75rem; }
  .back-link span { display: none; }
}
