/* EaglePress v1.0 - firstTheme Frontend CSS */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Source+Sans+3:wght@300;400;600&display=swap');

/* ── CSS Variables ─────────────────────────────────────────────────────── */
:root {
  --ep-navy: #1a1a2e;
  --ep-gold: #c9a84c;
  --ep-gold-light: #e8c96c;
  --ep-warm-white: #faf9f7;
  --ep-bg: #f5f4f1;
  --ep-text: #1d1d1d;
  --ep-text-muted: #666;
  --ep-text-light: #999;
  --ep-border: #e0ddd6;
  --ep-accent: #2271b1;
  --ep-accent-hover: #135e96;
  --ep-red: #d63638;
  --ep-green: #00a32a;
  --ep-radius: 8px;
  --ep-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --ep-shadow-hover: 0 8px 30px rgba(0,0,0,0.14);
  --ep-font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --ep-font-heading: 'Playfair Display', Georgia, serif;
  --ep-container: 1200px;
  --ep-sidebar-width: 300px;
  --ep-header-height: 70px;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ep-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--ep-accent-hover); }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--ep-font-body); }

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

body.ep-site-body {
  font-family: var(--ep-font-body);
  color: var(--ep-text);
  background: var(--ep-warm-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Container ─────────────────────────────────────────────────────────── */
.ep-container {
  max-width: var(--ep-container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Site Wrapper ──────────────────────────────────────────────────────── */
.ep-site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ────────────────────────────────────────────────────────────── */
.ep-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ep-navy);
  color: #fff;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
  transition: background 0.3s;
}

.ep-header.ep-scrolled {
  background: rgba(26, 26, 46, 0.97);
  backdrop-filter: blur(10px);
}

.ep-header-inner {
  max-width: var(--ep-container);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--ep-header-height);
  display: flex;
  align-items: center;
  gap: 24px;
}

.ep-header-logo { flex-shrink: 0; }

.ep-logo-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.ep-logo-text {
  font-family: var(--ep-font-heading);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1;
}

.ep-logo-text::first-letter {
  color: var(--ep-gold);
}

.ep-tagline {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* Primary Nav */
.ep-primary-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.ep-nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  position: relative;
}

.ep-nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--ep-gold);
  transform: scaleX(0);
  transition: transform 0.2s;
}

.ep-nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.ep-nav-link:hover::after {
  transform: scaleX(1);
}

.ep-nav-logout {
  color: rgba(255, 120, 120, 0.8);
}

/* Header Actions */
.ep-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ep-search-icon-btn, .ep-hamburger {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 20px;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.ep-search-icon-btn:hover, .ep-hamburger:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.ep-hamburger { display: none; }

/* Search bar */
.ep-search-bar {
  background: rgba(255,255,255,0.08);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 12px 24px;
}

.ep-search-bar-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
}

.ep-search-bar-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
  font-family: var(--ep-font-body);
}

.ep-search-bar-input::placeholder { color: rgba(255,255,255,0.4); }

.ep-search-bar-form button {
  padding: 10px 20px;
  background: var(--ep-gold);
  color: var(--ep-navy);
  border: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}

.ep-search-bar-form button:hover { background: var(--ep-gold-light); }

/* ── MAIN ──────────────────────────────────────────────────────────────── */
.ep-main { flex: 1; }

/* ── HERO ──────────────────────────────────────────────────────────────── */
.ep-hero {
  min-height: 480px;
  background: linear-gradient(135deg, var(--ep-navy) 0%, #2d2d52 100%);
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.ep-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.4) 100%);
}

.ep-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 0 48px;
}

.ep-hero-inner {
  max-width: var(--ep-container);
  margin: 0 auto;
  padding: 0 24px;
  max-width: 760px;
  padding-left: 24px;
}

.ep-hero-cats { margin-bottom: 12px; }

.ep-hero-cat {
  display: inline-block;
  background: var(--ep-gold);
  color: var(--ep-navy);
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  margin-right: 6px;
}

.ep-hero-title {
  font-family: var(--ep-font-heading);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
}

.ep-hero-title a { color: #fff; text-decoration: none; }

.ep-hero-excerpt {
  font-size: 18px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 20px;
  line-height: 1.6;
  max-width: 600px;
}

.ep-hero-meta {
  display: flex;
  gap: 20px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  margin-bottom: 24px;
}

.ep-hero-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--ep-gold);
  color: var(--ep-navy);
  text-decoration: none;
  border-radius: var(--ep-radius);
  font-weight: 700;
  font-size: 15px;
  transition: background 0.2s, transform 0.2s;
}

.ep-hero-btn:hover {
  background: var(--ep-gold-light);
  color: var(--ep-navy);
  transform: translateY(-2px);
}

/* ── Main Layout ───────────────────────────────────────────────────────── */
.ep-main-layout {
  max-width: var(--ep-container);
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: 1fr var(--ep-sidebar-width);
  gap: 40px;
  align-items: start;
}

.ep-posts-area, .ep-single-area {
  min-width: 0;
}

/* ── Posts Grid ────────────────────────────────────────────────────────── */
.ep-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

/* ── Post Card ─────────────────────────────────────────────────────────── */
.ep-post-card {
  background: #fff;
  border-radius: var(--ep-radius);
  box-shadow: var(--ep-shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

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

.ep-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--ep-bg);
}

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

.ep-post-card:hover .ep-card-image img {
  transform: scale(1.03);
}

.ep-card-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ep-navy) 0%, #2d2d52 100%);
  font-size: 40px;
}

.ep-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ep-card-categories {
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ep-category-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--ep-gold);
  color: var(--ep-navy);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: background 0.2s;
}

.ep-category-badge:hover {
  background: var(--ep-gold-light);
  color: var(--ep-navy);
}

.ep-card-title {
  font-family: var(--ep-font-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}

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

.ep-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ep-text-muted);
  margin-bottom: 12px;
}

.ep-meta-avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.ep-meta-author { color: var(--ep-text-muted); font-weight: 600; }
.ep-meta-author:hover { color: var(--ep-accent); }
.ep-meta-date { margin-left: auto; }

.ep-card-excerpt {
  font-size: 14px;
  color: var(--ep-text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.ep-read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ep-accent);
  text-decoration: none;
  margin-top: auto;
}

.ep-arrow { transition: transform 0.2s; }
.ep-read-more:hover .ep-arrow { transform: translateX(4px); }

.ep-no-posts {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--ep-text-muted);
}

/* ── Single Post ───────────────────────────────────────────────────────── */
.ep-single-post {
  background: #fff;
  border-radius: var(--ep-radius);
  overflow: hidden;
  box-shadow: var(--ep-shadow);
}

.ep-post-header {
  padding: 40px 48px 0;
}

.ep-post-categories {
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ep-post-title {
  font-family: var(--ep-font-heading);
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ep-text);
  margin-bottom: 20px;
}

.ep-post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--ep-text-muted);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ep-border);
  flex-wrap: wrap;
}

.ep-meta-views, .ep-meta-comments {
  color: var(--ep-text-light);
  font-size: 13px;
}

.ep-post-hero-image {
  margin: 0;
}

.ep-post-hero-image img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

/* ── Post Content Typography ───────────────────────────────────────────── */
.ep-post-content {
  padding: 36px 48px;
  font-size: 1.1rem;
  line-height: 1.85;
  color: #2d2d2d;
  max-width: 740px;
}

.ep-post-content h1,
.ep-post-content h2,
.ep-post-content h3,
.ep-post-content h4,
.ep-post-content h5,
.ep-post-content h6 {
  font-family: var(--ep-font-heading);
  font-weight: 700;
  color: var(--ep-text);
  margin: 1.6em 0 0.6em;
  line-height: 1.3;
}

.ep-post-content h1 { font-size: 2em; }
.ep-post-content h2 { font-size: 1.6em; border-bottom: 2px solid var(--ep-border); padding-bottom: 0.3em; }
.ep-post-content h3 { font-size: 1.3em; }
.ep-post-content h4 { font-size: 1.1em; }

.ep-post-content p { margin: 0 0 1.2em; }

.ep-post-content a { color: var(--ep-accent); border-bottom: 1px solid rgba(34,113,177,0.3); }
.ep-post-content a:hover { border-bottom-color: var(--ep-accent); }

.ep-post-content blockquote {
  border-left: 4px solid var(--ep-gold);
  padding: 16px 24px;
  margin: 1.5em 0;
  background: #fdf8ee;
  border-radius: 0 var(--ep-radius) var(--ep-radius) 0;
  font-style: italic;
  color: #555;
  font-size: 1.05em;
}

.ep-post-content code {
  background: #f1f3f5;
  border: 1px solid #dee2e6;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
  color: #495057;
}

.ep-post-content pre {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-left: 3px solid var(--ep-primary, #2271b1);
  color: #212529;
  padding: 20px 24px;
  border-radius: var(--ep-radius);
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 0.9em;
  line-height: 1.6;
}

.ep-post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.ep-post-content ul, .ep-post-content ol {
  padding-left: 1.5em;
  margin: 0.8em 0 1.2em;
}

.ep-post-content ul { list-style: disc; }
.ep-post-content ol { list-style: decimal; }

/* ── Download Button ──────────────────────────────────────────────────────── */
.ep-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-left: 4px solid var(--ep-accent);
  border-radius: var(--ep-radius);
  text-decoration: none;
  color: var(--ep-text);
  margin: 1.2em 0;
  max-width: 420px;
  width: 100%;
  box-sizing: border-box;
  transition: background 0.2s, border-left-color 0.2s;
}
.ep-download-btn:hover {
  background: #e9ecef;
  border-left-color: var(--ep-primary);
  color: var(--ep-text);
  text-decoration: none;
}
.ep-download-icon {
  font-size: 1.8em;
  color: var(--ep-accent);
  line-height: 1;
  flex-shrink: 0;
}
.ep-download-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ep-download-label {
  font-weight: 600;
  font-size: 0.95em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-download-filename {
  font-size: 0.78em;
  color: var(--ep-text-muted);
  font-family: var(--ep-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-post-content li { margin-bottom: 0.4em; }

.ep-post-content hr {
  border: none;
  border-top: 2px solid var(--ep-border);
  margin: 2em 0;
}

.ep-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--ep-radius);
  margin: 1em auto;
}
.ep-img                          { max-width: 100%; height: auto; border-radius: var(--ep-radius); }
.ep-post-content .ep-img-left   { float: left;  margin: 0.4em 1.4em 0.8em 0; }
.ep-post-content .ep-img-right  { float: right; margin: 0.4em 0 0.8em 1.4em; }
.ep-post-content .ep-img-center { display: block; margin: 0.8em auto; }
/* Clearfix for floated images inside post content */
.ep-post-content::after { content: ''; display: table; clear: both; }

.ep-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.ep-post-content th, .ep-post-content td {
  padding: 10px 14px;
  border: 1px solid var(--ep-border);
  text-align: left;
}

.ep-post-content th {
  background: #f6f7f7;
  font-weight: 600;
}

/* Post Tags */
.ep-post-tags {
  padding: 20px 48px;
  border-top: 1px solid var(--ep-border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--ep-text-muted);
}

.ep-tag-link {
  display: inline-block;
  padding: 4px 12px;
  background: var(--ep-bg);
  border: 1px solid var(--ep-border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--ep-text-muted);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.ep-tag-link:hover {
  background: var(--ep-navy);
  border-color: var(--ep-navy);
  color: #fff;
}

/* ── Author Box ────────────────────────────────────────────────────────── */
.ep-author-box {
  display: flex;
  gap: 20px;
  background: #fff;
  border-radius: var(--ep-radius);
  padding: 28px;
  margin-top: 24px;
  box-shadow: var(--ep-shadow);
  align-items: flex-start;
}

.ep-author-avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--ep-gold);
}

.ep-author-name {
  font-family: var(--ep-font-heading);
  font-size: 20px;
  margin-bottom: 8px;
}

.ep-author-name a { color: var(--ep-text); text-decoration: none; }
.ep-author-name a:hover { color: var(--ep-accent); }

.ep-author-bio {
  font-size: 14px;
  color: var(--ep-text-muted);
  margin-bottom: 10px;
  line-height: 1.6;
}

.ep-author-link {
  font-size: 13px;
  font-weight: 600;
}

/* ── Comments ──────────────────────────────────────────────────────────── */
.ep-comments-section {
  background: #fff;
  border-radius: var(--ep-radius);
  padding: 36px;
  margin-top: 24px;
  box-shadow: var(--ep-shadow);
}

.ep-comments-title {
  font-family: var(--ep-font-heading);
  font-size: 24px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ep-border);
}

.ep-comment {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--ep-border);
}

.ep-comment:last-of-type { border-bottom: none; }

.ep-comment-depth-1 { margin-left: 60px; }
.ep-comment-depth-2 { margin-left: 100px; }
.ep-comment-depth-3 { margin-left: 120px; }

.ep-comment-avatar img { border-radius: 50%; object-fit: cover; flex-shrink: 0; }

.ep-comment-body { flex: 1; }

.ep-comment-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.ep-comment-author { font-size: 15px; font-weight: 600; color: var(--ep-text); }
.ep-comment-date { font-size: 12px; color: var(--ep-text-light); }

.ep-comment-content { font-size: 15px; color: var(--ep-text); line-height: 1.65; }

.ep-comment-actions { margin-top: 8px; }

.ep-reply-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--ep-accent);
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}

.ep-reply-btn:hover { color: var(--ep-accent-hover); }

.ep-no-comments {
  color: var(--ep-text-muted);
  font-style: italic;
  text-align: center;
  padding: 20px 0;
}

.ep-reply-banner {
  background: #eef2f7;
  border: 1px solid #c3d9f0;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ep-cancel-reply {
  background: none;
  border: none;
  color: var(--ep-red);
  font-size: 12px;
  cursor: pointer;
  margin-left: auto;
}

/* Comment Form */
.ep-comment-form-wrap { margin-top: 36px; border-top: 2px solid var(--ep-border); padding-top: 28px; }

.ep-comment-form-title {
  font-family: var(--ep-font-heading);
  font-size: 22px;
  margin-bottom: 20px;
}

.ep-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ep-form-half { }
.ep-form-group { margin-bottom: 16px; }
.ep-form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }

.ep-input, .ep-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius);
  font-size: 15px;
  font-family: var(--ep-font-body);
  color: var(--ep-text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ep-input:focus, .ep-textarea:focus {
  outline: none;
  border-color: var(--ep-accent);
  box-shadow: 0 0 0 3px rgba(34,113,177,0.15);
}

.ep-textarea { resize: vertical; min-height: 120px; }

.ep-required { color: var(--ep-red); }

.ep-logged-in-as { font-size: 14px; color: var(--ep-text-muted); margin-bottom: 16px; }

.ep-submit-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--ep-navy);
  color: #fff;
  border: none;
  border-radius: var(--ep-radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.ep-submit-btn:hover { background: var(--ep-accent); color: #fff; }

.ep-form-status { margin-top: 12px; font-size: 14px; }
.ep-form-status.ep-success { color: var(--ep-green); }
.ep-form-status.ep-error { color: var(--ep-red); }

.ep-comments-closed { color: var(--ep-text-muted); font-style: italic; }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.ep-sidebar { display: flex; flex-direction: column; gap: 28px; }

.ep-widget {
  background: #fff;
  border-radius: var(--ep-radius);
  padding: 24px;
  box-shadow: var(--ep-shadow);
}

.ep-widget-title {
  font-family: var(--ep-font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--ep-text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ep-gold);
}

/* Search widget */
.ep-search-form { }
.ep-search-wrap { display: flex; gap: 8px; }
.ep-search-input { flex: 1; padding: 8px 12px; border: 1px solid var(--ep-border); border-radius: 4px; font-size: 14px; font-family: var(--ep-font-body); }
.ep-search-input:focus { outline: none; border-color: var(--ep-accent); }
.ep-search-btn { padding: 8px 14px; background: var(--ep-navy); color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; }
.ep-search-btn:hover { background: var(--ep-accent); }

/* Recent posts widget */
.ep-recent-list { display: flex; flex-direction: column; gap: 12px; }
.ep-recent-list li { border-bottom: 1px solid var(--ep-border); padding-bottom: 12px; }
.ep-recent-list li:last-child { border-bottom: none; padding-bottom: 0; }
.ep-recent-list a { font-size: 14px; font-weight: 600; color: var(--ep-text); line-height: 1.4; display: block; margin-bottom: 3px; }
.ep-recent-list a:hover { color: var(--ep-accent); }
.ep-post-date-small { font-size: 12px; color: var(--ep-text-light); }

/* Categories widget */
.ep-cats-widget-list { display: flex; flex-direction: column; gap: 6px; }
.ep-cats-widget-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--ep-border); }
.ep-cats-widget-list li:last-child { border-bottom: none; }
.ep-cats-widget-list a { font-size: 14px; color: var(--ep-text); font-weight: 500; }
.ep-cats-widget-list a:hover { color: var(--ep-accent); }
.ep-cat-count { font-size: 12px; color: var(--ep-text-light); background: var(--ep-bg); padding: 2px 8px; border-radius: 10px; }

/* Tags widget */
.ep-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Archive Header ─────────────────────────────────────────────────────── */
.ep-archive-header {
  background: var(--ep-navy);
  color: #fff;
  padding: 48px 24px;
  text-align: center;
}

.ep-archive-title {
  font-family: var(--ep-font-heading);
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 10px;
}

.ep-archive-desc {
  font-size: 16px;
  color: rgba(255,255,255,0.7);
  max-width: 500px;
  margin: 0 auto;
}

.ep-results-count {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  margin-top: 8px;
}

/* ── Profile Page ──────────────────────────────────────────────────────── */
.ep-profile-hero {
  background: linear-gradient(135deg, var(--ep-navy) 0%, #2d2d52 100%);
  padding: 60px 24px;
  color: #fff;
}

.ep-profile-hero-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.ep-profile-avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--ep-gold);
  flex-shrink: 0;
  display: block;
}

.ep-profile-avatar-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  border-radius: 50%;
}
.ep-profile-avatar-wrap .ep-own-avatar { cursor: pointer; }
.ep-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.ep-profile-avatar-wrap:hover .ep-avatar-overlay { opacity: 1; }
.ep-avatar-upload-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 5px 12px;
  font-size: 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  transition: border-color 0.2s, color 0.2s;
  text-align: center;
  white-space: nowrap;
}
.ep-avatar-upload-btn:hover { border-color: var(--ep-gold); color: var(--ep-gold); }
.ep-avatar-upload-btn:disabled { opacity: 0.6; cursor: default; }

.ep-profile-info { flex: 1; }

.ep-profile-name {
  font-family: var(--ep-font-heading);
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 4px;
}

.ep-profile-username { color: rgba(255,255,255,0.6); font-size: 16px; margin-bottom: 12px; }
.ep-profile-bio { font-size: 15px; color: rgba(255,255,255,0.8); margin-bottom: 10px; line-height: 1.6; }
.ep-profile-website { color: var(--ep-gold); font-size: 14px; }
.ep-profile-joined { font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 8px; }

.ep-profile-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  flex-shrink: 0;
}

.ep-stat strong {
  display: block;
  font-size: 36px;
  font-weight: 700;
  color: var(--ep-gold);
}

.ep-stat span { font-size: 12px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 1px; }

.ep-section-title {
  font-family: var(--ep-font-heading);
  font-size: 28px;
  margin-bottom: 28px;
  margin-top: 48px;
}

/* ── Auth Pages ────────────────────────────────────────────────────────── */
.ep-auth-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: linear-gradient(135deg, var(--ep-navy) 0%, #2d2d52 100%);
}

.ep-auth-card {
  background: #fff;
  border-radius: 12px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.ep-auth-logo {
  font-family: var(--ep-font-heading);
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--ep-navy);
}

.ep-auth-logo span { color: var(--ep-gold); }

.ep-auth-title {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  color: var(--ep-text-muted);
  margin-bottom: 24px;
}

.ep-auth-form .ep-form-group { margin-bottom: 16px; }
.ep-auth-form label { font-size: 13px; font-weight: 600; color: var(--ep-text-muted); margin-bottom: 4px; display: block; }
.ep-auth-form .ep-input { font-size: 15px; }
.ep-auth-form .ep-submit-btn { width: 100%; font-size: 16px; padding: 14px; margin-top: 8px; }

.ep-auth-link { text-align: center; font-size: 14px; color: var(--ep-text-muted); margin-top: 20px; }

/* ── 404 Page ──────────────────────────────────────────────────────────── */
.ep-error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}

.ep-error-inner { text-align: center; }

.ep-404-number {
  font-family: var(--ep-font-heading);
  font-size: 120px;
  font-weight: 700;
  color: var(--ep-border);
  line-height: 1;
  margin-bottom: 16px;
}

.ep-404-title {
  font-family: var(--ep-font-heading);
  font-size: 36px;
  color: var(--ep-text);
  margin-bottom: 16px;
}

.ep-404-message {
  font-size: 16px;
  color: var(--ep-text-muted);
  margin-bottom: 28px;
}

/* ── Pagination ────────────────────────────────────────────────────────── */
.ep-pagination-nav { margin-top: 40px; }
.ep-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }

.ep-page-link {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--ep-border);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ep-text);
  background: #fff;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ep-page-link:hover { background: var(--ep-navy); color: #fff; border-color: var(--ep-navy); }
.ep-page-link.ep-page-active { background: var(--ep-navy); color: #fff; border-color: var(--ep-navy); }
.ep-page-ellipsis { color: var(--ep-text-muted); padding: 0 4px; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.ep-footer {
  background: var(--ep-navy);
  color: rgba(255,255,255,0.7);
  margin-top: auto;
}

.ep-footer-inner {
  max-width: var(--ep-container);
  margin: 0 auto;
  padding: 60px 24px 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.ep-footer-heading {
  font-family: var(--ep-font-heading);
  font-size: 18px;
  color: #fff;
  margin-bottom: 16px;
}

.ep-footer-about { font-size: 14px; line-height: 1.7; margin-bottom: 10px; }

.ep-footer-links { display: flex; flex-direction: column; gap: 8px; }
.ep-footer-links li a { color: rgba(255,255,255,0.65); font-size: 14px; text-decoration: none; transition: color 0.2s; }
.ep-footer-links li a:hover { color: var(--ep-gold); }

.ep-footer .ep-tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.ep-footer .ep-tag-link {
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.05);
  font-size: 12px;
  padding: 3px 9px;
}
.ep-footer .ep-tag-link:hover { background: var(--ep-gold); border-color: var(--ep-gold); color: var(--ep-navy); }

.ep-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 24px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

/* ── Reading progress bar ───────────────────────────────────────────────── */
#ep-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--ep-gold);
  z-index: 9999;
  transition: width 0.1s linear;
  width: 0;
}

/* ── Back to top ────────────────────────────────────────────────────────── */
#ep-back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--ep-navy);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: background 0.2s, transform 0.2s;
}

#ep-back-to-top:hover { background: var(--ep-accent); transform: translateY(-2px); }
#ep-back-to-top.visible { display: flex; }

/* ── Fade-in animation ──────────────────────────────────────────────────── */
.ep-fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.5s, transform 0.5s; }
.ep-fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .ep-main-layout { grid-template-columns: 1fr 260px; }
}

@media (max-width: 992px) {
  .ep-hamburger { display: block; }
  .ep-primary-nav {
    position: absolute;
    top: var(--ep-header-height);
    left: 0;
    right: 0;
    background: var(--ep-navy);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    display: none;
    z-index: 99;
  }
  .ep-primary-nav.ep-nav-open { display: flex; }
  .ep-nav-link { padding: 12px 24px; border-radius: 0; }
  .ep-header { position: relative; }

  .ep-main-layout {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .ep-footer-inner { grid-template-columns: 1fr 1fr; }
  .ep-hero-inner { padding-left: 24px; }
}

@media (max-width: 768px) {
  .ep-posts-grid { grid-template-columns: 1fr; }
  .ep-post-content, .ep-post-header { padding-left: 24px; padding-right: 24px; }
  .ep-post-tags { padding-left: 24px; padding-right: 24px; }
  .ep-footer-inner { grid-template-columns: 1fr; gap: 28px; padding: 40px 24px; }
  .ep-profile-hero-inner { flex-direction: column; align-items: center; text-align: center; }
  .ep-author-box { flex-direction: column; }
  .ep-form-row { grid-template-columns: 1fr; }
  .ep-comment-depth-1 { margin-left: 30px; }
  .ep-comment-depth-2, .ep-comment-depth-3 { margin-left: 45px; }
}

@media (max-width: 576px) {
  .ep-hero { min-height: 320px; }
  .ep-hero-excerpt { display: none; }
  .ep-hero-meta { display: none; }
  .ep-auth-card { padding: 28px 20px; }
}

/* ── Syntax Highlight: override .ep-post-content pre/code inside blocks ── */
.ep-post-content .ep-code-block pre {
  background: transparent;
  border: none;
  border-left: none;
  padding: 1em 1.2em;
  margin: 0;
  font-size: 0.9em;
  border-radius: 0;
}
/* Grey text bug fix: let CSS variable (and hljs) control code colour */
.ep-post-content .ep-code-block pre code {
  background: transparent !important;
  border: none;
  padding: 0;
  color: var(--cb-code-text, #e6edf3);
  font-size: inherit;
}
.ep-post-content .ep-inline-code-wrap code {
  background: rgba(110, 118, 129, 0.15);
  border: 1px solid rgba(110, 118, 129, 0.25);
  padding: 0.1em 0.4em;
  color: inherit;
}

/* ── Markdown + HTML: token-level visual enhancements ───────────────────────
   Layer typographic weight and style on top of the hljs theme colours so
   that Markdown content reads as formatted prose inside a code block.       */

.ep-post-content .ep-code-block[data-lang="markdown"] pre code {
  line-height: 1.85;
}

.ep-post-content .ep-code-block[data-lang="markdown"] .hljs-section {
  font-weight: 700;
  font-size: 1.04em;
  letter-spacing: 0.01em;
  display: inline;
}

.ep-post-content .ep-code-block[data-lang="markdown"] .hljs-strong {
  color: inherit;
  font-weight: 800;
}

.ep-post-content .ep-code-block[data-lang="markdown"] .hljs-emphasis {
  font-style: italic;
}

.ep-post-content .ep-code-block[data-lang="markdown"] .hljs-quote {
  font-style: italic;
  opacity: 0.78;
}

.ep-post-content .ep-code-block[data-lang="markdown"] .hljs-code {
  background: rgba(110, 118, 129, 0.18);
  border-radius: 3px;
  padding: 0.05em 0.35em;
  font-size: 0.88em;
}

.ep-post-content .ep-code-block[data-lang="markdown"] .hljs-link {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.ep-post-content .ep-code-block[data-lang="markdown"] .hljs-bullet {
  font-weight: 600;
}

.ep-post-content .ep-inline-code-wrap[data-lang="markdown"] .hljs-section { font-weight: 700; }
.ep-post-content .ep-inline-code-wrap[data-lang="markdown"] .hljs-strong   { color: inherit; font-weight: 800; }
.ep-post-content .ep-inline-code-wrap[data-lang="markdown"] .hljs-emphasis { font-style: italic; }
.ep-post-content .ep-inline-code-wrap[data-lang="markdown"] .hljs-bullet   { font-weight: 600; }

/* Bold inside inline-formatted code blocks (code_md_render='on') */
.ep-post-content .ep-code-block[data-inline-formatted="true"] pre code strong,
.ep-post-content .ep-inline-code-wrap[data-inline-formatted="true"] code strong {
  color: var(--cb-code-text, #e6edf3) !important;
  font-weight: 800 !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   DARK MODE — firstTheme
   ══════════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --ep-bg:           #0e0e1a;
  --ep-warm-white:   #16162a;
  --ep-text:         #e2e2f0;
  --ep-text-muted:   #8888b8;
  --ep-text-light:   #5858a0;
  --ep-border:       #28284a;
  --ep-accent:       #5a9fd4;
  --ep-accent-hover: #7ab8e8;
  --ep-shadow:       0 2px 12px rgba(0,0,0,0.4);
  --ep-shadow-hover: 0 8px 30px rgba(0,0,0,0.6);
}

/* Theme toggle button */
.ep-theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0;
  padding: 6px 8px;
  border-radius: 50%;
  line-height: 1;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ep-theme-toggle::before {
  font-size: 18px;
  content: '☀️';
}
[data-theme="dark"] .ep-theme-toggle::before { content: '🌙'; }
.ep-theme-toggle:hover { background: rgba(255,255,255,0.12); }

/* Targeted dark overrides */
[data-theme="dark"] body                        { background: var(--ep-bg); color: var(--ep-text); }
[data-theme="dark"] .ep-post-card,
[data-theme="dark"] .ep-card,
[data-theme="dark"] .ep-featured-post           { background: var(--ep-warm-white); }
[data-theme="dark"] .ep-post-card:hover         { box-shadow: var(--ep-shadow-hover); }
[data-theme="dark"] .ep-sidebar-widget          { background: var(--ep-warm-white); }
[data-theme="dark"] .ep-widget-title            { border-bottom-color: var(--ep-border); }
[data-theme="dark"] .ep-single-article          { background: var(--ep-warm-white); }
[data-theme="dark"] .ep-single-post             { background: var(--ep-warm-white); }
[data-theme="dark"] .ep-post-content blockquote { background: #1e1e35; border-left-color: var(--ep-gold); color: var(--ep-text-muted); }
[data-theme="dark"] .ep-post-content code:not([class]) { background: #1e1e35; border-color: var(--ep-border); color: #a0d0f8; }
[data-theme="dark"] .ep-comment-item            { background: var(--ep-warm-white); border-color: var(--ep-border); }
[data-theme="dark"] .ep-comment-form-wrap       { background: var(--ep-warm-white); }
[data-theme="dark"] .ep-input,
[data-theme="dark"] .ep-textarea,
[data-theme="dark"] .ep-select                  { background: #0e0e1a; border-color: var(--ep-border); color: var(--ep-text); }
[data-theme="dark"] .ep-auth-card               { background: var(--ep-warm-white); }
[data-theme="dark"] .ep-profile-hero            { background: linear-gradient(135deg, #0e0e1a 0%, #1a1a3a 100%); }
[data-theme="dark"] .ep-category-card           { background: var(--ep-warm-white); }
[data-theme="dark"] .ep-tag-link                { background: #1e1e35; border-color: var(--ep-border); color: var(--ep-text-muted); }
[data-theme="dark"] .ep-tag-link:hover          { background: var(--ep-navy); color: var(--ep-gold); }
[data-theme="dark"] .ep-pagination .ep-page-link { background: var(--ep-warm-white); border-color: var(--ep-border); color: var(--ep-text); }
[data-theme="dark"] .ep-search-bar             { background: var(--ep-navy); }
[data-theme="dark"] .ep-search-bar-input       { background: rgba(255,255,255,0.08); color: #fff; }
[data-theme="dark"] .ep-archive-header          { background: #0e0e1a; }
[data-theme="dark"] .ep-results-count           { color: var(--ep-text-muted); }
[data-theme="dark"] .ep-post-meta               { color: var(--ep-text-muted); }
[data-theme="dark"] .ep-post-meta a             { color: var(--ep-text-muted); }
[data-theme="dark"] .ep-post-meta a:hover       { color: var(--ep-gold); }
[data-theme="dark"] .ep-cat-badge               { background: rgba(201,168,76,0.18); color: var(--ep-gold); }
[data-theme="dark"] .ep-footer                  { background: #0a0a18; border-top-color: #1e1e35; }
[data-theme="dark"] .ep-footer-heading          { color: var(--ep-gold); }
[data-theme="dark"] .ep-frontend-notify         { background: #16162a; color: var(--ep-text); box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
[data-theme="dark"] .ep-post-content            { color: var(--ep-text); }
[data-theme="dark"] .ep-post-content pre        { color: var(--ep-text); background: #16162a; border-color: var(--ep-border); }
[data-theme="dark"] .ep-post-content .ep-code-block pre { background: transparent; border: none; }

/* ── Markdown HR and code separator styles ─────────────────────────────── */
.ep-hr-dots { text-align: center !important; font-size: 20px; letter-spacing: 8px; color: var(--ep-text-muted); margin: 32px 0; border: none; background: none; }
.ep-post-content .ep-hr-dots { text-align: center !important; }
.ep-code-sep { display: block; width: 100%; margin: 6px 0; }
.ep-code-sep-line { border-top: 1px solid currentColor; opacity: 0.35; }
.ep-code-sep-dots { display: block; width: 100%; text-align: center !important; font-size: 14px; letter-spacing: 5px; opacity: 0.65; }
