/* =====================================================================
   SolarGuide — Ghost theme stylesheet
   Adapted from the original solar_blog_v4 static design.
   ===================================================================== */

:root {
  --bg: #F7F5F1;
  --ink: #18160F;
  --ink-soft: #6B6860;
  --ink-faint: #9B9890;
  --line: #E5E2D9;
  --line-soft: #F0EDE8;
  --card: #fff;
  --accent: #F5A300;
  --accent-dark: #E09500;
  /* Falls back to the theme defaults; Ghost overrides --gh-font-* via the
     admin Typography settings (injected through {{ghost_head}}). */
  --serif: var(--gh-font-heading, 'Fraunces', Georgia, serif);
  --sans: var(--gh-font-body, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  --max: 1060px;
}

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

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

img { max-width: 100%; height: auto; }
a { color: inherit; }

.wrap { max-width: var(--max); margin: 0 auto; }

/* ------------------------------------------------------------------ NAV */
.nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.5px;
  text-decoration: none;
}
.nav-logo img { max-height: 30px; width: auto; }
.nav-logo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-bottom: 1px;
}
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  text-decoration: none;
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links li.nav-current a { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 1.25rem; }
.nav-cta {
  font-size: 13px;
  font-weight: 600;
  background: var(--ink);
  color: #fff;
  padding: 8px 18px;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  transition: opacity 0.2s;
}
.nav-cta:hover { opacity: 0.85; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; }

/* ----------------------------------------------------------------- HERO */
.hero { background: var(--ink); padding: 5rem 2.5rem 4rem; position: relative; overflow: hidden; }
.hero-bg-ring  { position: absolute; right: -120px; top: -120px; width: 500px; height: 500px; border-radius: 50%; border: 60px solid rgba(245,163,0,0.07); }
.hero-bg-ring2 { position: absolute; right: -40px; top: -40px; width: 300px; height: 300px; border-radius: 50%; border: 2px solid rgba(245,163,0,0.15); }
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
  align-items: center;
  position: relative;
}
.hero-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 1.25rem; }
.hero h1 { font-family: var(--serif); font-size: 52px; font-weight: 700; color: #fff; line-height: 1.1; letter-spacing: -1.5px; margin-bottom: 1.25rem; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub { font-size: 16px; color: var(--ink-faint); line-height: 1.7; max-width: 480px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.btn-primary {
  background: var(--accent); color: var(--ink);
  font-weight: 700; font-size: 14px;
  padding: 12px 24px; border-radius: 7px;
  border: none; cursor: pointer; text-decoration: none;
  font-family: var(--sans);
  transition: all 0.2s;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost { font-size: 14px; color: var(--ink-faint); font-weight: 500; text-decoration: none; display: flex; align-items: center; gap: 6px; transition: color 0.2s; }
.btn-ghost:hover { color: #fff; }

/* Hero featured card */
.hero-card { background: #fff; border-radius: 14px; overflow: hidden; text-decoration: none; display: block; }
.hero-card-media { position: relative; display: flex; }
.hero-card-img-real { width: 100%; height: auto; display: block; }
.hero-card-img { height: 180px; width: 100%; display: flex; align-items: flex-end; padding: 1rem; background-size: cover; background-position: center; }
.hero-card-img-badge { position: absolute; left: 1rem; bottom: 1rem; background: rgba(0,0,0,0.45); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; padding: 4px 10px; border-radius: 20px; backdrop-filter: blur(4px); }
.hero-card-body { padding: 1.25rem 1.5rem 1.5rem; }
.hero-card-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; color: var(--accent); text-transform: uppercase; margin-bottom: 8px; }
.hero-card-title { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); line-height: 1.3; margin-bottom: 12px; }
.hero-card-meta { display: flex; align-items: center; gap: 8px; }
.hero-card-author { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.hero-card-author span { color: var(--ink); font-weight: 600; }

/* ----------------------------------------------------------- TRUST BAR */
.trust { background: #fff; border-bottom: 1px solid var(--line); padding: 1.25rem 2.5rem; }
.trust-inner { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; gap: 3rem; flex-wrap: wrap; }
.trust-item { display: flex; align-items: baseline; gap: 8px; }
.trust-num { font-family: var(--serif); font-size: 28px; font-weight: 700; color: var(--ink); }
.trust-label { font-size: 13px; color: var(--ink-soft); }
.trust-divider { width: 1px; height: 28px; background: var(--line); flex-shrink: 0; }

/* ----------------------------------------------------------- SECTIONS */
.section-outer { padding: 3.5rem 2.5rem; }
.section-outer.alt { background: #fff; }
.section-outer.dark { background: var(--ink); }
.section-max { max-width: var(--max); margin: 0 auto; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2rem; gap: 1rem; }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.section-h2 { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--ink); letter-spacing: -0.5px; }
.section-h2.light { color: #fff; }
.section-link { font-size: 13px; font-weight: 600; color: var(--ink-soft); text-decoration: none; display: flex; align-items: center; gap: 4px; white-space: nowrap; transition: color 0.2s; }
.section-link:hover { color: var(--ink); }

/* ------------------------------------------------------- FEATURED GRID */
.feat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
.feat-card { background: #fff; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; transition: all 0.25s; display: flex; flex-direction: column; text-decoration: none; }
.feat-card:hover { border-color: #C8C5BC; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.feat-img { height: 200px; display: flex; align-items: flex-end; padding: 1rem; position: relative; background-size: cover; background-position: center; }
.feat-img-real { width: 100%; height: auto; display: block; }
.feat-img-badge { background: rgba(255,255,255,0.92); font-size: 11px; font-weight: 700; letter-spacing: 0.5px; padding: 4px 10px; border-radius: 20px; color: var(--ink); }
.feat-body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.feat-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 7px; }
.feat-title { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); line-height: 1.35; margin-bottom: 10px; flex: 1; }
.feat-excerpt { font-size: 13px; color: var(--ink-soft); line-height: 1.65; margin-bottom: 14px; }
.feat-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line-soft); margin-top: auto; }
.feat-author { display: flex; align-items: center; gap: 8px; }
.av { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; background: var(--accent); overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av-sm { width: 22px; height: 22px; font-size: 9px; }
.av-name { font-size: 12px; font-weight: 600; color: var(--ink); }
.feat-read { font-size: 12px; color: var(--ink-faint); }

/* ----------------------------------------------------------- CATEGORIES */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.cat-tile { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 1.4rem 1rem; text-align: center; text-decoration: none; display: block; transition: all 0.22s; }
.cat-tile:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); transform: translateY(-2px); }
.cat-tile-icon { width: 40px; height: 40px; border-radius: 10px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.cat-tile-name { font-size: 13px; font-weight: 600; color: #fff; }
.cat-tile-count { font-size: 11px; color: var(--ink-soft); margin-top: 3px; }

/* ----------------------------------------------- CATEGORY POST BLOCKS */
.cat-block { margin-bottom: 3rem; }
.cat-block:last-child { margin-bottom: 0; }
.cat-block-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1.5px solid var(--line); }
.cat-block-left { display: flex; align-items: center; gap: 10px; }
.cat-block-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.cat-block-name { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink); }
.cat-view-all { font-size: 12px; font-weight: 600; text-decoration: none; padding: 6px 14px; border-radius: 20px; transition: all 0.2s; border: 1px solid; white-space: nowrap; }
.cat-view-all:hover { opacity: 0.8; }

.post-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }
.post-card { background: #fff; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; transition: all 0.22s; display: flex; flex-direction: column; text-decoration: none; }
.post-card:hover { border-color: #C8C5BC; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.06); }
.post-thumb { height: 130px; display: flex; align-items: flex-end; padding: 10px 12px; position: relative; background-size: cover; background-position: center; }
.post-thumb-img { width: 100%; height: auto; display: block; }
.post-thumb-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.4px; padding: 3px 9px; border-radius: 20px; background: rgba(255,255,255,0.9); }
.post-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.post-title { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.4; margin-bottom: auto; padding-bottom: 12px; }
.post-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.post-author-row { display: flex; align-items: center; gap: 7px; }
.post-author-name { font-size: 12px; font-weight: 600; color: var(--ink); }
.post-meta { font-size: 11px; color: var(--ink-faint); }

/* ----------------------------------------------------------- NEWSLETTER */
.nl-section { background: var(--accent); padding: 4rem 2.5rem; }
.nl-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.nl-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(24,22,15,0.5); margin-bottom: 1rem; }
.nl-h2 { font-family: var(--serif); font-size: 38px; font-weight: 700; color: var(--ink); letter-spacing: -1px; line-height: 1.1; margin-bottom: 0.75rem; }
.nl-sub { font-size: 15px; color: rgba(24,22,15,0.6); margin-bottom: 2rem; }
.nl-form { display: flex; gap: 8px; max-width: 440px; margin: 0 auto; }
.nl-input { flex: 1; padding: 13px 16px; border: none; border-radius: 8px; font-size: 14px; font-family: var(--sans); outline: none; background: #fff; color: var(--ink); }
.nl-input::placeholder { color: var(--ink-faint); }
.nl-btn { background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; padding: 13px 22px; border-radius: 8px; border: none; cursor: pointer; white-space: nowrap; font-family: var(--sans); transition: opacity 0.2s; }
.nl-btn:hover { opacity: 0.85; }
.nl-message { margin-top: 1rem; font-size: 13px; font-weight: 600; color: var(--ink); min-height: 1em; }

/* -------------------------------------------------------------- FOOTER */
.site-foot { background: var(--ink); padding: 2rem 2.5rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-logo { font-family: var(--serif); font-size: 18px; font-weight: 700; color: #fff; text-decoration: none; }
.footer-copy { font-size: 13px; color: var(--ink-soft); }
.footer-links a { font-size: 13px; color: var(--ink-soft); text-decoration: none; margin-left: 1.5rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }

/* =====================================================================
   COLOR SYSTEM — base defaults + per primary-tag-slug modifiers.
   Posts/tags without a matching slug fall back to the warm default.
   ===================================================================== */
.tint { background: linear-gradient(135deg, #FFF3CC, #FFE07A); }
.tint--home-systems   { background: linear-gradient(135deg, #E1F5EE, #9FE1CB); }
.tint--cost-analysis  { background: linear-gradient(135deg, #FFF0E8, #FFBB99); }
.tint--battery-storage{ background: linear-gradient(135deg, #EAF3FB, #B5D4F4); }
.tint--maintenance    { background: linear-gradient(135deg, #EAF3DE, #C0DD97); }
.tint--sustainability { background: linear-gradient(135deg, #E1F5EE, #5DCAA5); }

.cat-color { color: #8A5E00; }
.cat-color--home-systems    { color: #0F5233; }
.cat-color--cost-analysis   { color: #A03A10; }
.cat-color--battery-storage { color: #0E4A85; }
.cat-color--maintenance     { color: #2D5A0E; }
.cat-color--sustainability  { color: #0A5240; }

.cat-bg { background: #FFF3CC; }
.cat-bg--home-systems    { background: #E1F5EE; }
.cat-bg--cost-analysis   { background: #FFF0E8; }
.cat-bg--battery-storage { background: #EAF3FB; }
.cat-bg--maintenance     { background: #EAF3DE; }
.cat-bg--sustainability  { background: #E1F5EE; }

.cat-border { border-color: #E5C87A; }
.cat-border--home-systems    { border-color: #7AD4B2; }
.cat-border--cost-analysis   { border-color: #FFAA7A; }
.cat-border--battery-storage { border-color: #85C0F0; }
.cat-border--maintenance     { border-color: #A0CC6A; }
.cat-border--sustainability  { border-color: #4DBFA0; }

.cat-icon { background: #FFE07A; }
.cat-icon--home-systems    { background: #9FE1CB; }
.cat-icon--cost-analysis   { background: #FFBB99; }
.cat-icon--battery-storage { background: #B5D4F4; }
.cat-icon--maintenance     { background: #C0DD97; }
.cat-icon--sustainability  { background: #9FE1CB; }

.av { background: var(--accent); color: var(--ink); }
.av--home-systems    { background: #1A5D3A; color: #fff; }
.av--cost-analysis   { background: #D04A10; color: #fff; }
.av--battery-storage { background: #185FA5; color: #fff; }
.av--maintenance     { background: #3B6D11; color: #fff; }
.av--sustainability  { background: #0F6E56; color: #fff; }

/* =====================================================================
   SINGLE POST / PAGE
   ===================================================================== */
.article { background: #fff; }
.article-head { max-width: 720px; margin: 0 auto; padding: 3.5rem 1.5rem 1.5rem; text-align: center; }
.article-tag { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 1rem; display: inline-block; text-decoration: none; }
.article-title { font-family: var(--serif); font-size: 42px; font-weight: 700; line-height: 1.15; letter-spacing: -1px; color: var(--ink); margin-bottom: 1rem; }
.article-excerpt { font-size: 18px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 1.75rem; }
.article-meta { display: flex; align-items: center; justify-content: center; gap: 10px; }
.article-meta .av { width: 36px; height: 36px; font-size: 12px; }
.article-meta-text { text-align: left; font-size: 13px; color: var(--ink-soft); }
.article-meta-text strong { display: block; color: var(--ink); font-weight: 600; font-size: 14px; }
.article-feature { max-width: 1000px; margin: 1.5rem auto 0; padding: 0 1.5rem; }
.article-feature img { width: 100%; border-radius: 14px; display: block; }

.gh-content { max-width: 720px; margin: 0 auto; padding: 2.5rem 1.5rem 3rem; font-size: 18px; line-height: 1.75; color: #2A2820; }
.gh-content > * + * { margin-top: 1.5rem; }
.gh-content h2 { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: -0.5px; color: var(--ink); margin-top: 2.5rem; }
.gh-content h3 { font-family: var(--serif); font-size: 23px; font-weight: 600; color: var(--ink); margin-top: 2rem; }
.gh-content h4 { font-size: 19px; font-weight: 700; color: var(--ink); margin-top: 1.75rem; }
.gh-content a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.gh-content ul, .gh-content ol { padding-left: 1.4rem; }
.gh-content li + li { margin-top: 0.4rem; }
.gh-content blockquote { border-left: 3px solid var(--accent); padding-left: 1.25rem; font-style: italic; color: var(--ink-soft); }
.gh-content img { border-radius: 10px; }
.gh-content figure { margin-top: 1.75rem; }
.gh-content figcaption { text-align: center; font-size: 13px; color: var(--ink-faint); margin-top: 0.5rem; }
.gh-content pre { background: var(--ink); color: #F7F5F1; padding: 1rem 1.25rem; border-radius: 10px; overflow-x: auto; font-size: 14px; }
.gh-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
.gh-content hr { border: none; border-top: 1px solid var(--line); }
.gh-content :where(.kg-width-wide) { max-width: 1000px; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); display: flex; justify-content: center; }
.gh-content :where(.kg-width-full) img { border-radius: 0; }

/* Article footer: tags + author bio */
.article-foot { max-width: 720px; margin: 0 auto; padding: 0 1.5rem 3rem; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 2rem; }
.pill { font-size: 12px; font-weight: 600; padding: 5px 14px; border-radius: 20px; border: 1px solid var(--line); color: var(--ink-soft); text-decoration: none; transition: all 0.2s; }
.pill:hover { border-color: var(--ink); color: var(--ink); }
.author-bio { display: flex; gap: 1rem; align-items: flex-start; padding: 1.5rem; background: var(--bg); border-radius: 14px; }
.author-bio .av { width: 52px; height: 52px; font-size: 16px; }
.author-bio-name { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); }
.author-bio-text { font-size: 14px; color: var(--ink-soft); line-height: 1.6; margin-top: 4px; }

/* =====================================================================
   ARCHIVE HEADER (tag / author)
   ===================================================================== */
.archive-head { background: var(--ink); padding: 4rem 2.5rem; text-align: center; position: relative; overflow: hidden; }
.archive-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.archive-title { font-family: var(--serif); font-size: 44px; font-weight: 700; color: #fff; letter-spacing: -1px; }
.archive-desc { font-size: 16px; color: var(--ink-faint); max-width: 540px; margin: 1rem auto 0; line-height: 1.7; }

/* =====================================================================
   PAGINATION
   ===================================================================== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 1.5rem; padding: 1rem 0 0; }
.pagination a, .pagination .page-number { font-size: 14px; font-weight: 600; color: var(--ink-soft); text-decoration: none; padding: 9px 18px; border: 1px solid var(--line); border-radius: 7px; }
.pagination a:hover { border-color: var(--ink); color: var(--ink); }
.pagination .page-number { border: none; }

.empty { text-align: center; color: var(--ink-soft); padding: 3rem 0; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero h1 { font-size: 40px; }
  .feat-grid, .post-grid { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .nav { padding: 0 1.25rem; }
  .nav-links { display: none; }
  .nav-links.is-open { display: flex; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 0.5rem 1.25rem 1rem; }
  .nav-toggle { display: block; }
  .hero, .section-outer, .nl-section, .trust { padding-left: 1.25rem; padding-right: 1.25rem; }
  .hero h1 { font-size: 32px; }
  .feat-grid, .post-grid, .cat-grid { grid-template-columns: 1fr; }
  .trust-divider { display: none; }
  .trust-inner { gap: 1.25rem; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .article-title { font-size: 30px; }
  .nl-form { flex-direction: column; }
  .site-foot { flex-direction: column; text-align: center; }
  .footer-links a { margin: 0 0.75rem; }
}
