/* ===== KANE ENERGY — COMMUNITY POWER GHOST THEME ===== */
/* Design tokens matched from kane.energy */

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

:root {
  --kane-dark: #1B2A4A;
  --kane-accent: #2E75B6;
  --kane-accent-hover: #245d94;
  --kane-warm-accent: #C8913A;
  --kane-warm-accent-hover: #B07E2F;
  --kane-warm-light: #FDF6EB;
  --kane-light-bg: #F0F5FA;
  --kane-warm: #E8F0F7;
  --text-primary: #1B2A4A;
  --text-secondary: #4A5568;
  --text-light: #718096;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(27,42,74,0.08);
  --shadow-md: 0 4px 16px rgba(27,42,74,0.1);
  --shadow-lg: 0 8px 32px rgba(27,42,74,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1140px;
  --transition: 0.25s ease;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font-body);
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 16px;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
}

/* ===== UTILITY ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section-pad { padding: 96px 0; }
.section-pad-sm { padding: 72px 0; }

/* ===== NAVIGATION ===== */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
nav.scrolled { box-shadow: var(--shadow-sm); }
.nav-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--kane-dark);
  transition: opacity var(--transition);
}
.nav-logo:hover img { filter: brightness(1.1); }
.nav-logo img { height: 36px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a {
  text-decoration: none; color: var(--text-secondary); font-size: 15px;
  font-weight: 500; transition: color var(--transition); position: relative;
}
.nav-links a:hover { color: var(--kane-dark); }
.nav-links .dropdown { position: relative; cursor: pointer; }
.nav-links .dropdown-label { display: flex; align-items: center; gap: 4px; }
.nav-links .dropdown-label::after {
  content: ''; display: block; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 4px solid var(--text-light); transition: transform var(--transition);
}
.nav-links .dropdown:hover .dropdown-label::after { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute; top: calc(100% + 12px); left: -12px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 200px; opacity: 0; visibility: hidden;
  transform: translateY(-4px); transition: all var(--transition);
  padding: 8px 0;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.dropdown-open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a {
  display: block; padding: 10px 20px; font-size: 14px;
  color: var(--text-secondary); transition: all var(--transition);
}
.dropdown-menu a:hover { background: var(--kane-light-bg); color: var(--kane-dark); }
.btn-nav {
  display: inline-flex; align-items: center; padding: 10px 22px;
  background: var(--kane-accent); color: var(--white) !important;
  border-radius: var(--radius); font-family: var(--font-body); font-weight: 600; font-size: 14px;
  text-decoration: none; transition: all var(--transition);
}
.btn-nav:hover { background: var(--kane-accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--kane-dark); margin: 5px 0; transition: all var(--transition); }

/* ===== BLOG HERO ===== */
.blog-hero {
  padding-top: 72px;
  background: var(--kane-dark);
  position: relative; overflow: hidden;
  text-align: center;
}
.blog-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(200,145,58,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(46,117,182,0.1) 0%, transparent 50%);
}
.blog-hero::after {
  content: ''; position: absolute; inset: 0; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30Z' fill='none' stroke='white' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}
.blog-hero .container {
  position: relative; z-index: 1;
  padding: 80px 24px 72px;
}
.blog-hero .hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--kane-warm-accent); margin-bottom: 16px;
}
.blog-hero h1 {
  font-size: clamp(36px, 5vw, 56px); font-weight: 800; line-height: 1.12;
  color: var(--white); margin-bottom: 20px; letter-spacing: -0.5px;
}
.blog-hero p {
  font-size: 18px; line-height: 1.7; color: rgba(255,255,255,0.65);
  max-width: 560px; margin: 0 auto;
}
.blog-hero-sm .container { padding: 64px 24px 56px; }

/* Author hero */
.author-hero {
  display: flex; align-items: center; gap: 24px; text-align: left;
  justify-content: center;
}
.author-hero-avatar {
  width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,0.2);
}

/* ===== POST HERO ===== */
.post-hero {
  padding-top: 72px;
  background: var(--kane-dark);
  position: relative; overflow: hidden;
}
.post-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(200,145,58,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(46,117,182,0.1) 0%, transparent 50%);
}
.post-hero .container { position: relative; z-index: 1; }
.post-hero-inner {
  max-width: 760px; margin: 0 auto;
  padding: 80px 0 72px; text-align: center;
}
.post-hero-tag {
  display: inline-block; font-family: var(--font-body);
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--kane-warm-accent); text-decoration: none;
  margin-bottom: 16px; transition: color var(--transition);
}
.post-hero-tag:hover { color: #E8C36A; }
.post-hero h1 {
  font-size: clamp(32px, 4vw, 48px); font-weight: 800; line-height: 1.2;
  color: var(--white); margin-bottom: 20px; letter-spacing: -0.3px;
}
.post-hero-excerpt {
  font-size: 18px; line-height: 1.7; color: rgba(255,255,255,0.65);
  margin-bottom: 24px;
}
.post-hero-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap;
  font-size: 14px; color: rgba(255,255,255,0.5);
}
.post-author {
  display: flex; align-items: center; gap: 8px;
}
.post-author-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
}

/* ===== FEATURE IMAGE ===== */
.post-feature-image {
  margin-top: -32px; position: relative; z-index: 2;
  padding-bottom: 40px;
}
.post-feature-image .container { max-width: 900px; }
.post-feature-image img {
  width: 100%; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.post-feature-image figcaption {
  text-align: center; font-size: 13px; color: var(--text-light);
  margin-top: 12px; font-style: italic;
}

/* ===== POST CONTENT (Ghost editor output) ===== */
.post-body {
  max-width: 720px; margin: 0 auto;
  font-size: 17px; line-height: 1.8; color: var(--text-secondary);
}
.post-body h2 {
  font-size: clamp(24px, 3vw, 32px); font-weight: 700; color: var(--kane-dark);
  margin: 48px 0 16px; line-height: 1.3;
}
.post-body h3 {
  font-size: clamp(20px, 2.5vw, 24px); font-weight: 700; color: var(--kane-dark);
  margin: 40px 0 12px; line-height: 1.3;
}
.post-body h4 {
  font-size: 18px; font-weight: 700; color: var(--kane-dark);
  margin: 32px 0 8px;
}
.post-body p { margin-bottom: 24px; }
.post-body a {
  color: var(--kane-accent); text-decoration: underline;
  text-underline-offset: 3px; transition: color var(--transition);
}
.post-body a:hover { color: var(--kane-accent-hover); }
.post-body ul, .post-body ol {
  margin: 0 0 24px 24px;
}
.post-body li { margin-bottom: 8px; }
.post-body blockquote {
  border-left: 3px solid var(--kane-warm-accent);
  padding: 16px 24px; margin: 32px 0;
  background: var(--kane-warm-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--kane-dark);
}
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body img {
  max-width: 100%; height: auto; border-radius: var(--radius);
  margin: 32px 0;
}
.post-body pre {
  background: var(--kane-dark); color: rgba(255,255,255,0.85);
  padding: 24px; border-radius: var(--radius);
  overflow-x: auto; margin: 32px 0;
  font-size: 14px; line-height: 1.6;
}
.post-body code {
  background: var(--kane-light-bg); padding: 2px 6px;
  border-radius: 4px; font-size: 0.9em;
}
.post-body pre code {
  background: none; padding: 0; border-radius: 0; font-size: inherit;
}
.post-body hr {
  border: none; border-top: 1px solid var(--border);
  margin: 48px 0;
}
.post-body figure { margin: 32px 0; }
.post-body figcaption {
  text-align: center; font-size: 13px; color: var(--text-light);
  margin-top: 8px; font-style: italic;
}

/* Ghost-specific cards */
.kg-card { margin: 32px 0; }
.kg-image-card img { max-width: 100%; height: auto; border-radius: var(--radius); }
.kg-width-wide { margin-left: -120px; margin-right: -120px; max-width: calc(100% + 240px); }
.kg-width-full { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); max-width: 100vw; }
.kg-width-full img { border-radius: 0; }
.kg-bookmark-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: box-shadow var(--transition);
}
.kg-bookmark-card:hover { box-shadow: var(--shadow-md); }
.kg-bookmark-container {
  display: flex; text-decoration: none; color: inherit;
}
.kg-bookmark-content { padding: 20px; flex: 1; }
.kg-bookmark-title {
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  color: var(--kane-dark); margin-bottom: 8px;
}
.kg-bookmark-description {
  font-size: 14px; color: var(--text-light); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kg-bookmark-metadata {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; font-size: 12px; color: var(--text-light);
}
.kg-bookmark-icon { width: 16px; height: 16px; }
.kg-bookmark-thumbnail { width: 200px; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* ===== POST TAGS ===== */
.post-tags {
  max-width: 720px; margin: 40px auto 0;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 32px; border-top: 1px solid var(--border);
}
.post-tag-pill {
  display: inline-block; padding: 6px 16px;
  background: var(--kane-light-bg); border-radius: 20px;
  font-size: 13px; font-weight: 600; color: var(--kane-accent);
  text-decoration: none; transition: all var(--transition);
}
.post-tag-pill:hover {
  background: var(--kane-accent); color: var(--white);
}

/* ===== AUTHOR CARD ===== */
.post-author-card {
  max-width: 720px; margin: 48px auto 0;
  display: flex; align-items: center; gap: 24px;
  padding: 32px; background: var(--kane-light-bg);
  border-radius: var(--radius-lg);
}
.author-card-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.author-card-info h3 {
  font-size: 18px; font-weight: 700; color: var(--kane-dark);
  margin-bottom: 4px;
}
.author-card-info p {
  font-size: 14px; color: var(--text-secondary); line-height: 1.6;
}

/* ===== POSTS GRID ===== */
.posts-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
.post-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all var(--transition);
}
.post-card:hover {
  box-shadow: var(--shadow-lg); transform: translateY(-4px);
  border-color: transparent;
}
.post-card-image { display: block; overflow: hidden; }
.post-card-image img {
  width: 100%; height: 220px; object-fit: cover;
  transition: transform 0.4s ease;
}
.post-card:hover .post-card-image img { transform: scale(1.03); }
.post-card-content { padding: 28px 24px; }
.post-card-tag {
  display: inline-block; font-family: var(--font-body);
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--kane-warm-accent); margin-bottom: 8px;
}
.post-card-title {
  font-size: 20px; font-weight: 700; color: var(--kane-dark);
  line-height: 1.3; margin-bottom: 12px;
}
.post-card-title a {
  text-decoration: none; color: inherit;
  transition: color var(--transition);
}
.post-card-title a:hover { color: var(--kane-accent); }
.post-card-excerpt {
  font-size: 15px; color: var(--text-secondary); line-height: 1.65;
  margin-bottom: 16px;
}
.post-card-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-light);
}

/* ===== SECTION HEADER ===== */
.section-header { text-align: center; max-width: 640px; margin: 0 auto 64px; }
.section-eyebrow {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--kane-warm-accent); margin-bottom: 16px;
}
.section-header h2 {
  font-size: clamp(28px, 3.5vw, 40px); font-weight: 800; color: var(--kane-dark);
  line-height: 1.2; margin-bottom: 16px; letter-spacing: -0.3px;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 24px; margin-top: 64px; padding-top: 32px;
  border-top: 1px solid var(--border);
}
.pagination-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; background: transparent;
  color: var(--kane-accent); border: 1.5px solid var(--kane-accent);
  border-radius: var(--radius); font-family: var(--font-body);
  font-weight: 600; font-size: 14px; text-decoration: none;
  transition: all var(--transition);
}
.pagination-btn:hover {
  background: var(--kane-accent); color: var(--white);
}
.pagination-info {
  font-size: 14px; color: var(--text-light);
}

/* ===== PARTNERSHIP CTA ===== */
.partnership-cta {
  background: linear-gradient(165deg, var(--kane-dark) 0%, #243B5E 100%);
  text-align: center; position: relative; overflow: hidden;
}
.partnership-cta::before {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(46,117,182,0.15) 0%, transparent 70%);
}
.partnership-cta .container { position: relative; z-index: 1; }
.partnership-cta h2 {
  font-size: clamp(28px, 3.5vw, 42px); font-weight: 700; color: rgba(255,255,255,0.7);
  line-height: 1.25; margin-bottom: 8px;
}
.partnership-cta h2 strong { color: var(--white); font-weight: 800; }
.partnership-cta p {
  font-size: 17px; color: rgba(255,255,255,0.6); max-width: 540px;
  margin: 20px auto 40px; line-height: 1.7;
}
.btn-cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 18px 40px; background: var(--kane-warm-accent); color: var(--white);
  border-radius: var(--radius); font-family: var(--font-body); font-weight: 700; font-size: 16px;
  text-decoration: none; transition: all var(--transition);
  border: none; cursor: pointer;
}
.btn-cta:hover { background: var(--kane-warm-accent-hover); transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 32px rgba(200,145,58,0.4); }
.btn-cta svg { width: 18px; height: 18px; }

/* ===== FOOTER ===== */
footer {
  background: #0F1B30; padding: 64px 0 32px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px; margin-bottom: 48px;
}
.footer-brand p { color: rgba(255,255,255,0.65); font-size: 14px; line-height: 1.7; margin-top: 16px; max-width: 280px; }
.footer-col h4 {
  font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: rgba(255,255,255,0.6); margin-bottom: 20px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 12px; }
.footer-col a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 14px; transition: color var(--transition); }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.footer-bottom p { color: rgba(255,255,255,0.55); font-size: 13px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .posts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 72px; left: 0; right: 0; background: var(--white);
    padding: 16px 24px; gap: 16px; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md); z-index: 99;
  }
  .nav-toggle { display: block; }
  .dropdown-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; min-width: 0; padding: 0 0 0 16px; display: none;
  }
  .dropdown.dropdown-open .dropdown-menu { display: block; }
  .dropdown-menu a { padding: 8px 0; }
  .kg-width-wide { margin-left: 0; margin-right: 0; max-width: 100%; }
  .post-author-card { flex-direction: column; text-align: center; }
}

@media (max-width: 600px) {
  .blog-hero h1 { font-size: 32px; }
  .post-hero h1 { font-size: 28px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .post-hero-meta { flex-direction: column; gap: 8px; }
  .author-hero { flex-direction: column; text-align: center; }
  .post-card-image img { height: 180px; }
}

/* ===== ANIMATIONS ===== */
.fade-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.fade-up:nth-child(2) { transition-delay: 0.1s; }
.fade-up:nth-child(3) { transition-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-up { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== GRAIN OVERLAY ===== */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 9999;
  pointer-events: none; opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ===== FOCUS STATES ===== */
:focus-visible {
  outline: 2px solid var(--kane-warm-accent);
  outline-offset: 3px;
  border-radius: 2px;
}
