/* ===================================================
   BALCONY ENERGY — Main Stylesheet
   Aesthetic: Warm editorial. Think Which? meets a
   quality Sunday supplement. Trusted, human, clear.
   =================================================== */

/* --- TOKENS --- */
:root {
  --cream:       #F7F4EE;
  --warm-white:  #FDFCF9;
  --ink:         #1A1713;
  --ink-mid:     #3D3830;
  --ink-muted:   #7A7368;
  --sun:         #E8A020;      /* amber/solar accent */
  --sun-light:   #FFF3D6;
  --leaf:        #2D6A4F;      /* trustworthy green */
  --leaf-light:  #D8EDE4;
  --sky:         #1B4F72;      /* deep blue */
  --sky-light:   #D6E8F5;
  --gold:        #C4860A;
  --gold-light:  #FEF3DC;
  --border:      #E3DDD5;
  --shadow-sm:   0 1px 3px rgba(26,23,19,0.08);
  --shadow-md:   0 4px 16px rgba(26,23,19,0.10);
  --shadow-lg:   0 8px 32px rgba(26,23,19,0.12);
  --radius:      8px;
  --radius-lg:   16px;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'DM Sans', 'Segoe UI', sans-serif;
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  background: var(--warm-white);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-pad { padding: 72px 0; }

/* --- HEADER --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.logo strong { font-weight: 600; }
.logo-mark {
  color: var(--sun);
  font-size: 1.1rem;
  line-height: 1;
}

.main-nav {
  display: flex;
  gap: 32px;
}
.main-nav a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ink-mid);
  letter-spacing: 0.01em;
  transition: color 0.15s;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--leaf); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--ink);
}

/* --- HERO --- */
.hero {
  position: relative;
  background: var(--cream);
  overflow: hidden;
  padding: 80px 0 96px;
  border-bottom: 1px solid var(--border);
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.5;
  pointer-events: none;
}

/* subtle radial fade over the grid */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 30% 50%, var(--cream) 40%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.hero-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--leaf);
  background: var(--leaf-light);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 20px;
}
.hero-headline em {
  font-style: italic;
  color: var(--sun);
  font-weight: 300;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--ink-mid);
  line-height: 1.6;
  max-width: 520px;
  margin-bottom: 32px;
  font-weight: 300;
}

.hero-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-trust-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.hero-trust-row span { display: flex; align-items: center; gap: 4px; }

/* decorative panel illustration */
.hero-panel-illustration {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 420px;
  height: 320px;
  pointer-events: none;
  z-index: 1;
}
.panel-card {
  position: absolute;
  border-radius: 12px;
  background: linear-gradient(135deg, #2a5a3e 0%, #1e3d2b 100%);
  border: 2px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow-lg);
}
.panel-1 {
  width: 280px; height: 190px;
  top: 30px; right: 80px;
  transform: rotate(-8deg);
  background: linear-gradient(135deg, #1a3a2a 0%, #0d2218 50%, #1a3a2a 100%);
  background-image:
    linear-gradient(135deg, #1a3a2a 0%, #0d2218 50%, #1a3a2a 100%),
    repeating-linear-gradient(0deg, transparent, transparent 18px, rgba(255,255,255,0.04) 18px, rgba(255,255,255,0.04) 19px),
    repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(255,255,255,0.04) 18px, rgba(255,255,255,0.04) 19px);
}
.panel-2 {
  width: 220px; height: 150px;
  bottom: 20px; right: 40px;
  transform: rotate(-6deg);
  background-image:
    linear-gradient(135deg, #243d2c 0%, #0f201a 100%),
    repeating-linear-gradient(0deg, transparent, transparent 14px, rgba(255,255,255,0.05) 14px, rgba(255,255,255,0.05) 15px),
    repeating-linear-gradient(90deg, transparent, transparent 14px, rgba(255,255,255,0.05) 14px, rgba(255,255,255,0.05) 15px);
  opacity: 0.85;
}
.panel-glow {
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,160,32,0.25) 0%, transparent 70%);
  top: 10px; right: 100px;
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
  line-height: 1;
  white-space: nowrap;
}
.btn-primary {
  background: var(--leaf);
  color: #fff;
}
.btn-primary:hover { background: #245840; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--ink-mid); background: var(--cream); }

.btn-outline {
  background: transparent;
  color: var(--leaf);
  border: 1.5px solid var(--leaf);
}
.btn-outline:hover { background: var(--leaf-light); }

/* --- QUICK NAV --- */
.quick-nav { background: var(--warm-white); }

.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.qn-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 20px;
  border-radius: var(--radius-lg);
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}
.qn-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.qn-green  { background: var(--leaf-light); border-color: #b5d9c8; }
.qn-amber  { background: var(--sun-light);  border-color: #f5d99a; }
.qn-blue   { background: var(--sky-light);  border-color: #a8cfe8; }
.qn-gold   { background: var(--gold-light); border-color: #ebc97a; }

.qn-icon   { font-size: 1.5rem; }
.qn-label  { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.qn-desc   { font-size: 0.82rem; color: var(--ink-muted); line-height: 1.4; }

/* --- SECTION HEADER --- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 36px;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.see-all {
  font-size: 0.875rem;
  color: var(--leaf);
  font-weight: 500;
  transition: opacity 0.15s;
}
.see-all:hover { opacity: 0.7; }

/* --- ARTICLE GRID --- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 20px;
}

.article-card {
  background: var(--warm-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}
.article-card:hover { border-color: #c8c2b8; box-shadow: var(--shadow-md); transform: translateY(-2px); }

.article-card--lead {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  background: var(--cream);
  padding: 32px;
}
.article-card--lead h3 { font-size: 1.2rem; }
.article-card--lead p { flex: 1; }

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--leaf);
  background: var(--leaf-light);
  padding: 3px 9px;
  border-radius: 100px;
}

.article-read {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.article-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.article-card h3 a:hover { color: var(--leaf); }

.article-card p {
  font-size: 0.875rem;
  color: var(--ink-mid);
  line-height: 1.6;
  margin: 0;
}

.article-link {
  font-size: 0.82rem;
  color: var(--leaf);
  font-weight: 500;
  margin-top: auto;
  transition: gap 0.15s;
}
.article-link:hover { text-decoration: underline; }

/* --- TRUST STRIP --- */
.trust-strip {
  background: var(--ink);
  color: var(--cream);
}

.trust-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 80px;
  align-items: center;
}

.trust-text h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 16px;
}
.trust-text p {
  font-size: 0.925rem;
  color: #b8b0a4;
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 12px;
}
.trust-text .btn-outline {
  color: #d4ccbf;
  border-color: #4a4540;
  margin-top: 8px;
}
.trust-text .btn-outline:hover { background: rgba(255,255,255,0.06); border-color: #7a7368; }

.trust-stats {
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex-shrink: 0;
}
.stat { text-align: right; }
.stat-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--sun);
  line-height: 1;
  letter-spacing: -0.04em;
}
.stat-label {
  font-size: 0.8rem;
  color: #7a7368;
  letter-spacing: 0.04em;
}

/* --- LIST GRID --- */
.latest { background: var(--cream); }

.list-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--warm-white);
}

.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  color: var(--ink);
}
.list-item:nth-child(odd) { border-right: 1px solid var(--border); }
.list-item:nth-last-child(-n+2) { border-bottom: none; }
.list-item:hover { background: var(--cream); }

.list-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--sun);
  background: var(--sun-light);
  padding: 3px 8px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}

.list-title {
  font-size: 0.875rem;
  color: var(--ink-mid);
  line-height: 1.4;
}
.list-item:hover .list-title { color: var(--ink); }

/* --- FOOTER --- */
.site-footer {
  background: var(--ink);
  color: #b8b0a4;
  padding-top: 64px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid #2e2a26;
}

.footer-brand .logo { color: #e8e2d8; margin-bottom: 12px; }
.footer-brand .logo-mark { color: var(--sun); }
.footer-brand p { font-size: 0.82rem; color: #5a544e; line-height: 1.6; max-width: 200px; }

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-col strong {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #7a7368;
  margin-bottom: 4px;
}
.footer-col a {
  font-size: 0.82rem;
  color: #b8b0a4;
  transition: color 0.15s;
  line-height: 1.5;
}
.footer-col a:hover { color: #e8e2d8; }

.footer-bottom {
  padding: 16px 0;
  border-top: 1px solid #1a1713;
}
.footer-bottom p {
  font-size: 0.75rem;
  color: #3d3830;
  text-align: center;
}
.footer-bottom a { color: #5a544e; }
.footer-bottom a:hover { color: #7a7368; }

/* --- SIDEBAR BOX --- */
.sidebar-box {
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-box strong {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.sidebar-box a {
  font-size: 0.875rem;
  color: var(--leaf);
  transition: opacity 0.15s;
}
.sidebar-box a:hover { opacity: 0.7; text-decoration: underline; }

/* --- PROSE (article body) --- */
.prose { max-width: 720px; }
.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 24px;
}
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--ink);
  margin-top: 32px;
  margin-bottom: 12px;
}
.prose p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-mid);
  margin-bottom: 18px;
}
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--leaf); text-decoration: underline; }
.prose a:hover { opacity: 0.75; }
.prose ul, .prose ol {
  padding-left: 24px;
  margin-bottom: 18px;
}
.prose li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-mid);
  margin-bottom: 6px;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.9rem;
}
.prose th {
  background: var(--cream);
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--ink);
}
.prose td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  color: var(--ink-mid);
  vertical-align: top;
}
.prose tr:nth-child(even) td { background: #faf9f6; }
.prose blockquote {
  border-left: 3px solid var(--sun);
  padding: 4px 20px;
  margin: 24px 0;
  background: var(--sun-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.prose blockquote p { color: var(--ink); margin-bottom: 0; }
.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}
.prose code {
  background: var(--cream);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
  color: var(--ink);
}

/* --- ARTICLE PAGE LAYOUT (for future use) --- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding: 56px 0;
}
.article-body { min-width: 0; }
.article-sidebar { position: sticky; top: 80px; align-self: start; }

/* --- ANIMATIONS --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-inner > * {
  animation: fadeUp 0.5s ease both;
}
.hero-tag           { animation-delay: 0.05s; }
.hero-headline      { animation-delay: 0.12s; }
.hero-sub           { animation-delay: 0.2s; }
.hero-cta-row       { animation-delay: 0.28s; }
.hero-trust-row     { animation-delay: 0.35s; }

.hero-panel-illustration {
  animation: fadeUp 0.7s 0.3s ease both;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .quick-nav-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid {
    grid-template-columns: 1fr 1fr;
  }
  .article-card--lead {
    grid-column: 1 / 3;
    grid-row: auto;
  }
  .trust-inner { grid-template-columns: 1fr; gap: 40px; }
  .trust-stats { flex-direction: row; }
  .stat { text-align: left; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .hero-panel-illustration { display: none; }
}

@media (max-width: 768px) {
  .section-pad { padding: 48px 0; }
  .hero { padding: 56px 0 64px; }
  .article-grid { grid-template-columns: 1fr; }
  .article-card--lead { grid-column: auto; }
  .list-grid { grid-template-columns: 1fr; }
  .list-item:nth-child(odd) { border-right: none; }
  .list-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .list-item:last-child { border-bottom: none; }
  .main-nav { display: none; }
  .nav-toggle { display: block; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .trust-stats { flex-wrap: wrap; gap: 20px; }
}

@media (max-width: 480px) {
  .hero-cta-row { flex-direction: column; }
  .hero-cta-row .btn { width: 100%; justify-content: center; }
  .footer-inner { grid-template-columns: 1fr; }
  .quick-nav-grid { grid-template-columns: 1fr 1fr; }
}
