/* ============================================
   EDGE OF DISCIPLINE — Hugo Theme
   ============================================ */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-card: #f3f4f6;
  --bg-card-hover: #e5e7eb;
  --border-color: #e5e7eb;
  --border-accent: #d1d5db;
  --text-primary: #000000;
  --text-secondary: #4b5563;
  --text-muted: #374151;
  --accent-gold: #eab308;
  --accent-gold-dim: #ca9a06;
  --accent-green: #2ecc71;
  --accent-red: #e74c3c;
  --accent-blue: #4a9eff;
  --font-display: 'Montserrat', Georgia, serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1400px;
  --header-height: 80px;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent-gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-gold-dim); }
img { max-width: 100%; height: auto; }

/* === HEADER === */
.eod-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-primary);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
}
.eod-header-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 100%;
}
.eod-logo {
  font-family: var(--font-display); font-size: 1.5rem; color: var(--text-primary);
  font-weight: 700; letter-spacing: 0.02em; display: flex; align-items: center; gap: 10px;
}
.eod-logo .logo-icon {
  width: 32px; height: 32px; border: 2px solid var(--accent-gold);
  transform: rotate(45deg); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.eod-logo .logo-icon::after {
  content: ''; width: 8px; height: 8px; background: var(--accent-gold); transform: rotate(-45deg);
}
.eod-logo span.gold { color: var(--accent-gold); }
.eod-nav { display: flex; align-items: center; gap: 32px; }
.eod-nav a {
  color: var(--text-secondary); font-size: 0.88rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; position: relative; padding: 4px 0;
}
.eod-nav a::after {
  content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px;
  background: var(--accent-gold); transition: width var(--transition);
}
.eod-nav a:hover { color: var(--text-primary); }
.eod-nav a:hover::after { width: 100%; }
.eod-menu-toggle {
  display: none; background: none; border: 1px solid var(--border-color);
  color: var(--text-primary); font-size: 1.1rem; cursor: pointer;
  padding: 7px 10px; border-radius: var(--radius);
  transition: border-color var(--transition);
}
.eod-menu-toggle:hover { border-color: var(--accent-gold); color: var(--accent-gold); }

/* === HERO === */
.eod-hero {
  position: relative; padding: 80px 24px 60px; text-align: center;
  overflow: hidden; border-bottom: 1px solid var(--border-color);
  background-image: url('/images/hero_background.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.eod-hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(201,168,76,0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 50%, rgba(74,158,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.eod-hero-grid {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image: linear-gradient(rgba(201,168,76,0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(201,168,76,0.03) 1px, transparent 1px);
  background-size: 60px 60px; pointer-events: none;
}
.eod-hero h1 { font-family: var(--font-display); font-size: 3rem; color: var(--text-primary); margin-bottom: 16px; position: relative; }
.eod-hero h1 span { color: var(--accent-gold); }
.eod-hero .tagline { font-size: 1.1rem; color: var(--text-secondary); max-width: 560px; margin: 0 auto 28px; position: relative; }
.hero-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-bottom: 36px; position: relative; }
.hero-cta-primary {
  background: rgba(234, 179, 8, 0.68); color: #000; font-weight: 600;
  font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 8px 16px; border-radius: var(--radius); transition: opacity var(--transition);
}
.hero-cta-primary:hover { opacity: 0.85; }
.hero-ctas .hero-cta-green {
  display: inline-block; background: rgba(130, 210, 158, 0.68); color: #000; font-weight: 600;
  font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 8px 16px; border-radius: var(--radius); transition: opacity var(--transition);
}
.hero-ctas .hero-cta-green:hover { opacity: 0.85; }
.hero-cta-secondary {
  background: transparent; color: var(--text-secondary); font-weight: 500;
  font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--border-color);
  transition: border-color var(--transition), color var(--transition);
}
.hero-cta-secondary:hover { border-color: var(--accent-gold); color: var(--text-primary); }
.eod-filter-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 24px; flex-wrap: wrap;
}
.filter-btn {
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 6px 14px; border: 1px solid var(--border-color); border-radius: 20px;
  color: var(--text-secondary); background: transparent; cursor: pointer; transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--accent-gold); color: var(--accent-gold); background: rgba(234,179,8,0.06);
}
.hero-hint { font-size: 0.75rem; color: #5a6373; margin: -20px 0 28px; position: relative; }
.hero-stats { display: flex; justify-content: center; gap: 48px; position: relative; }
.stat { text-align: center; }
.stat-value { font-family: var(--font-mono); font-size: 1.6rem; color: var(--accent-gold); font-weight: 700; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px; }

/* === MAIN LAYOUT === */
.eod-main {
  max-width: var(--max-width); margin: 0 auto; padding: 40px 24px;
  display: grid; grid-template-columns: 1fr 290px; gap: 40px;
}
.eod-content { min-width: 0; }
.eod-sidebar { min-width: 0; }
.eod-section-label {
  display: flex; align-items: center; gap: 12px; margin: 0 0 28px;
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 600;
  color: var(--text-secondary); letter-spacing: 0.08em; text-transform: uppercase;
}
.eod-section-label::before {
  content: ''; width: 3px; height: 18px; background: var(--accent-gold); border-radius: 2px;
}

/* === POST CARDS === */
.eod-post-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-left: 3px solid transparent; border-radius: var(--radius);
  padding: 28px; margin-bottom: 24px; transition: all var(--transition);
}
.eod-post-card:hover { background: var(--bg-card-hover); border-left: 3px solid var(--accent-gold); }
.post-meta {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
}
.post-category {
  background: rgba(201,168,76,0.12); color: var(--accent-gold);
  padding: 3px 10px; border-radius: 4px; font-weight: 600; font-size: 0.7rem;
}
.eod-post-card h2 { font-family: var(--font-display); font-size: 1.35rem; color: var(--text-primary); margin-bottom: 10px; line-height: 1.3; }
.eod-post-card h2 a { color: inherit; }
.eod-post-card h2 a:hover { color: var(--accent-gold); }
.post-snippet { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.65; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-thumb { width: 100%; height: 260px; object-fit: cover; border-radius: 6px; margin-bottom: 16px; border: 1px solid var(--border-color); }
.read-more { font-size: 0.82rem; font-weight: 600; color: var(--accent-gold); text-transform: uppercase; letter-spacing: 0.08em; display: inline-flex; align-items: center; gap: 6px; }
.read-more::after { content: '\2192'; transition: transform var(--transition); }
.eod-post-card:hover .read-more::after { transform: translateX(4px); }

/* === ARTICLE === */
.eod-article { max-width: 900px; width: 100%; overflow-wrap: break-word; word-break: break-word; }
.eod-article h1 { font-family: var(--font-display); font-size: 2.2rem; line-height: 1.25; margin-bottom: 16px; }
.eod-article .article-meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border-color); }
.eod-article .post-body { font-size: 1.05rem; line-height: 1.8; color: var(--text-secondary); overflow-wrap: break-word; word-break: break-word; }
.eod-article .post-body hr { display: none; }
.eod-article .post-body h2, .eod-article .post-body h3 { font-family: var(--font-display); color: var(--text-primary); margin: 32px 0 16px; }
.eod-article .post-body h2 { font-size: 1.5rem; }
.eod-article .post-body h3 { font-size: 1.2rem; }
.eod-article .post-body p { margin-bottom: 18px; }
.eod-article .post-body blockquote { border-left: 3px solid var(--accent-gold); padding: 16px 24px; margin: 24px 0; background: rgba(201,168,76,0.05); border-radius: 0 var(--radius) var(--radius) 0; color: var(--text-primary); font-style: italic; }
.eod-article .post-body code { font-family: var(--font-mono); background: var(--bg-secondary); padding: 2px 8px; border-radius: 4px; font-size: 0.88em; color: var(--accent-gold); }
.eod-article .post-body pre { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 20px; overflow-x: auto; margin: 24px 0; }
.eod-article .post-body pre code { background: none; padding: 0; }
.eod-article .post-body ul, .eod-article .post-body ol { margin: 16px 0 16px 24px; color: var(--text-secondary); }
.eod-article .post-body li { margin-bottom: 8px; }
.eod-article .post-body img { border-radius: var(--radius); border: 1px solid var(--border-color); margin: 24px 0; }
.eod-article .post-body a { color: var(--accent-gold); border-bottom: 1px solid rgba(201,168,76,0.3); }
.eod-article .post-body a:hover { border-bottom-color: var(--accent-gold); }
.eod-article .post-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.9rem; }
.eod-article .post-body th { background: var(--bg-secondary); color: var(--accent-gold); font-weight: 600; text-align: left; padding: 12px 16px; border: 1px solid var(--border-color); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.eod-article .post-body td { padding: 10px 16px; border: 1px solid var(--border-color); color: var(--text-secondary); }
.eod-article .post-body tr:hover td { background: rgba(201,168,76,0.03); }
.post-footer-bar { border-top: 1px solid var(--border-color); padding-top: 16px; margin-top: 24px; }

/* === SIDEBAR === */
.eod-widget { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; }
.eod-widget-title { font-family: var(--font-display); font-size: 1rem; color: var(--text-primary); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.w-icon { color: var(--accent-gold); font-size: 0.9rem; }
.w-toggle { margin-left: auto; color: var(--text-muted); font-size: 0.7rem; transition: transform var(--transition); display: inline-block; }
.eod-widget-title.collapsed .w-toggle { transform: rotate(-90deg); }
.eod-collapsible { overflow: hidden; max-height: 600px; transition: max-height 0.3s ease, opacity 0.25s ease; opacity: 1; }
.eod-collapsible.collapsed { max-height: 0; opacity: 0; }
.eod-labels { display: flex; flex-wrap: wrap; gap: 8px; }
.eod-labels a { background: var(--bg-secondary); color: var(--text-secondary); padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; border: 1px solid var(--border-color); transition: all var(--transition); }
.eod-labels a:hover { border-color: var(--accent-gold); color: var(--accent-gold); background: rgba(201,168,76,0.08); }
.eod-archive-list { list-style: none; }
.eod-archive-list li { padding: 5px 0; border-bottom: 1px solid var(--border-color); }
.eod-archive-list a { color: var(--text-secondary); font-size: 0.83rem; }
.eod-archive-list a:hover { color: var(--accent-gold); }
.eod-principles { list-style: none; }
.eod-principles li { padding: 5px 0; border-bottom: 1px solid var(--border-color); color: var(--text-secondary); font-size: 0.82rem; display: flex; align-items: flex-start; gap: 10px; }
.eod-principles li:last-child { border-bottom: none; }
.eod-principles li::before { content: '\25C6'; color: var(--accent-gold); font-size: 0.55rem; margin-top: 6px; flex-shrink: 0; }
.about-text { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* === PAGINATION === */
.eod-pagination { display: flex; justify-content: space-between; padding: 24px 0; margin-top: 16px; border-top: 1px solid var(--border-color); }
.eod-pagination a { color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; padding: 8px 20px; border: 1px solid var(--border-color); border-radius: var(--radius); transition: all var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.eod-pagination a:hover { border-color: var(--accent-gold); color: var(--accent-gold); background: rgba(234,179,8,0.04); }

/* === FOOTER === */
.eod-footer { border-top: 1px solid var(--border-color); padding: 40px 24px; text-align: center; color: var(--text-muted); font-size: 0.82rem; }
.eod-footer .footer-inner { max-width: var(--max-width); margin: 0 auto; }
.eod-footer .footer-tagline { font-family: var(--font-display); font-size: 1rem; color: var(--text-secondary); margin-bottom: 8px; }
.eod-footer .footer-motto { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent-gold-dim); letter-spacing: 0.1em; margin-bottom: 16px; }

/* === READING PROGRESS === */
#eod-progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--accent-gold); z-index: 9999; width: 0%; transition: width 0.08s linear; pointer-events: none; }

/* === DISCIPLINE REPORT (Blogger HTML-inlägg) === */
.discipline-report-wrapper img { border: none !important; outline: none !important; box-shadow: none !important; }
.discipline-report-wrapper a img { display: block !important; }
.discipline-report-wrapper table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.9rem; }
.discipline-report-wrapper th { background: #f9fafb; color: var(--accent-gold); font-weight: 600; text-align: left; padding: 12px 16px; border: 1px solid var(--border-color); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.discipline-report-wrapper td { padding: 10px 16px; border: 1px solid var(--border-color); color: var(--text-secondary); }
.eod-article .post-body .discipline-report-wrapper h2 { font-family: var(--font-display); font-size: 1.35rem; color: var(--accent-gold); margin: 2rem 0 .8rem; font-weight: 700; }
.eod-article .post-body .discipline-report-wrapper h3 { font-family: var(--font-display); font-size: 1.1rem; color: var(--accent-gold); margin: 1.5rem 0 .6rem; font-weight: 600; }

/* === LIGHTBOX === */
#eod-lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999; align-items: center; justify-content: center; cursor: zoom-out; }
#eod-lightbox.open { display: flex; }
#eod-lb-img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 6px; box-shadow: 0 8px 40px rgba(0,0,0,0.6); }

/* === SCREEN READER ONLY === */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-accent); }
::selection { background: rgba(201,168,76,0.3); color: var(--text-primary); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .eod-main { grid-template-columns: 1fr; }
  .eod-nav { display: none; }
  .eod-menu-toggle { display: block; }
  .nav-dropdown-wrap { flex-direction: column; align-items: flex-start; width: 100%; }
  .nav-dropdown { position: static; opacity: 1; pointer-events: all; transform: none; box-shadow: none; border: none; border-left: 2px solid var(--border-color); padding: 4px 0 4px 12px; min-width: auto; }
  .nav-dropdown a { padding: 4px 0; font-size: 0.82rem; }
  .eod-nav.open {
    display: flex; flex-direction: column; position: fixed;
    top: var(--header-height); left: 0; right: 0;
    background: var(--bg-primary); border-bottom: 1px solid var(--border-color);
    padding: 20px 24px; gap: 16px; z-index: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .eod-hero h1 { font-size: 2rem; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .eod-hero { padding: 40px 16px 32px; }
  .eod-hero h1 { font-size: 1.55rem; }
  .eod-post-card { padding: 18px 16px; }
  .eod-main { padding: 20px 16px; }
  .eod-article h1 { font-size: 1.4rem; line-height: 1.3; }
  .eod-article .post-body h2 { font-size: 1.25rem; }
  .eod-article .post-body h3 { font-size: 1.1rem; }
  .hero-stats { flex-direction: column; gap: 14px; align-items: center; }
  .stat-value { font-size: 1.15rem; }
  .discipline-report-wrapper table { display: block !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
}

.archive-filter-btn {
  color: var(--text-secondary);
  font-size: 0.83rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.archive-filter-btn:hover { color: var(--accent-gold); }

/* Above-grid section label + filter bar (homepage) */
.eod-above-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 0;
}
.eod-above-grid .eod-section-label { margin-bottom: 20px; }
.eod-above-grid .eod-filter-bar { margin-bottom: 24px; }
/* Remove top padding from main grid on homepage */
.eod-above-grid + .eod-main { padding-top: 0; }

/* === NAV DROPDOWN === */
.nav-dropdown-wrap { position: relative; display: flex; align-items: center; }
.nav-dropdown-wrap::after { content: ''; position: absolute; top: 100%; left: 0; width: 100%; height: 14px; }
.nav-dropdown {
  position: absolute; top: calc(100% + 12px); left: 0;
  background: var(--bg-primary); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 6px 0;
  min-width: 210px; box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(-4px); z-index: 200;
}
.nav-dropdown-wrap:hover .nav-dropdown { opacity: 1; pointer-events: all; transform: translateY(0); }
.nav-dropdown a {
  display: block; padding: 8px 16px; font-size: 0.82rem;
  color: var(--text-secondary); white-space: nowrap;
  letter-spacing: 0.05em; text-transform: uppercase; font-weight: 500;
}
.nav-dropdown a::after { display: none; }
.nav-dropdown a:hover { color: var(--accent-gold); background: rgba(201,168,76,0.05); }

/* === NAV TOOLTIP === */
.nav-tooltip-wrap { position: relative; display: flex; align-items: center; }
.nav-tooltip {
  position: absolute; top: calc(100% + 16px); left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--bg-primary); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 10px 14px;
  width: 180px; box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  font-size: 0.78rem; color: var(--text-secondary);
  line-height: 1.5; text-transform: none; letter-spacing: 0;
  font-weight: 400; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200; white-space: normal;
}
.nav-tooltip::before {
  content: ''; position: absolute; top: -5px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px;
  background: var(--bg-primary); border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
}
.nav-tooltip-wrap:hover .nav-tooltip {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
