/*
  base.css — structural skeleton shared by every theme pack.
  No color, no font-family, no shadows, no decoration here.
  Each theme-*.css file supplies the actual "skin" for these same elements.
  This is the Zen Garden contract: the HTML and this skeleton never change
  between themes — only the theme-*.css files do.
*/

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }

.wrap {
  max-width: var(--max, 1100px);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 300;
  padding: 0.6rem 1rem;
}
.skip-link:focus { left: 0; }

/* Scroll progress bar (visual only in themes that want it) */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 500;
  transition: width 0.1s linear;
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; }
.site-header__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 0.75rem;
}
.logo { display: flex; align-items: center; text-decoration: none; }
.logo__image { display: block; max-height: 48px; height: auto; max-width: 100%; width: auto; }

.site-nav { flex: 1; min-width: 0; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem; margin: 0; padding: 0; }
.site-nav li { position: relative; }
.site-nav > ul > li > a,
.site-nav summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  list-style: none;
  text-decoration: none;
}
.site-nav summary::-webkit-details-marker { display: none; }
.dropdown {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.4rem;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  z-index: 30;
}
.dropdown li a { display: block; padding: 0.45rem 0.7rem; text-decoration: none; }
.dropdown .nav-heading { padding: 0.5rem 0.7rem 0.15rem; }

.theme-switcher-toggle { flex-shrink: 0; cursor: pointer; padding: 0.45rem 0.8rem; }

@media (max-width: 720px) {
  .logo { order: 1; }
  .theme-switcher-toggle { order: 2; margin-left: auto; }
  .site-nav { order: 3; flex-basis: 100%; }
}

/* Theme switcher panel */
.theme-switcher[hidden] { display: none; }
.theme-switcher__inner { padding-block: 1rem; }
.theme-switcher__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.6rem 0 0;
  padding: 0;
}
.theme-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  cursor: pointer;
  padding: 0.6rem 0.9rem;
  text-align: left;
}
.theme-option__hint { display: block; font-weight: 400; }

/* Hero */
.page-hero { position: relative; overflow: hidden; isolation: isolate; }
.page-hero__glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.page-hero__inner { padding-block: 2rem 1.25rem; }
.page-hero h1 { margin: 0; }

/* Ad slots */
.ad-slot { margin-block: 1.25rem; text-align: center; overflow: hidden; }

/* Page shell: single column by default, themes opt into a sidebar */
.page-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-block: 0.5rem 3rem;
  align-items: start;
}
.content { min-width: 0; padding-block: 0.25rem; }
.content > *:first-child { margin-top: 0; }

/* Reveal-on-scroll hook (opacity/transform defined per-theme; base just holds the class) */
.reveal { will-change: opacity, transform; }

/* Embeds */
.embed { margin-block: 1.5rem; max-width: 100%; overflow-x: auto; }
.embed iframe { display: block; width: 100%; border: 0; }
.embed img { display: block; max-width: 100%; height: auto; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem 0.75rem; vertical-align: top; }

/* Glossary */
.glossary { margin: 1.5rem 0; }
.glossary dt { margin: 0; }
.glossary dd { margin: 0.2rem 0 0; }

/* Cards (available for themes that want them; unused markup-wise today) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-block: 1.5rem; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin: 1.5rem 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; text-decoration: none; }
.spark { position: absolute; pointer-events: none; }

/* Pill */
.pill { display: inline-flex; align-items: center; gap: 0.35rem; }

/* Charts (geometry/structure only — every color comes from theme-*.css via
   --chart-series-1/2, --chart-grid, --chart-axis custom properties, so a
   theme switch recolors charts with zero JS re-render, same as everything
   else in this build). */
.chart-wrap { margin: 1.5rem 0; }
.chart-wrap[hidden] { display: none; }
.chart-picker { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-bottom: 0.85rem; font-size: 0.9rem; }
.chart-picker label { display: flex; align-items: center; gap: 0.4rem; }
.chart-picker select { font: inherit; padding: 0.3rem 0.5rem; }
.chart { position: relative; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-grid { stroke-width: 1; }
.chart-axis-label { font-size: 11px; font-family: inherit; }
.chart-bar { transition: opacity 0.1s ease; }
.chart-bar--hover { opacity: 0.75; }
.chart-line { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart-line--2 { stroke-dasharray: 7 5; }
.chart-crosshair { stroke-width: 1; pointer-events: none; }
.chart-dot { pointer-events: none; }
.chart-legend { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 0.65rem; font-size: 0.85rem; }
.chart-legend__item { display: flex; align-items: center; gap: 0.4rem; }
.chart-legend__swatch { width: 1.4rem; height: 0; border-top-width: 2.5px; border-top-style: solid; display: inline-block; }
.chart-legend__swatch--2 { border-top-style: dashed; }
.chart-tooltip {
  position: absolute; pointer-events: none; padding: 0.4rem 0.6rem; font-size: 0.8rem;
  border-radius: 6px; transform: translate(-50%, -115%); white-space: nowrap;
  opacity: 0; transition: opacity 0.1s ease; z-index: 5;
}
.chart-tooltip.is-visible { opacity: 1; }
.chart-nav { padding: 0.4rem 0.7rem; line-height: 1; }
.soll-ist { margin: 1rem 0; }
.drill-link { margin: 1.5rem 0; }
.inverter-breakdown { margin: 1rem 0; }

/* Footer */
.site-footer { padding-block: 2.25rem; margin-top: 1rem; }
.footer-nav { list-style: none; display: flex; gap: 1.1rem; flex-wrap: wrap; margin: 0 0 0.6rem; padding: 0; }
.footer-nav a { text-decoration: none; }
.footer-fineprint { margin: 0; }

/* Back to top */
.back-to-top {
  position: fixed;
  right: 1.25rem; bottom: 1.25rem;
  width: 2.9rem; height: 2.9rem;
  border-radius: 50%;
  cursor: pointer;
  z-index: 150;
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.back-to-top.is-visible { opacity: 1; transform: none; }

/* Cookie banner */
.cookie-banner { position: fixed; inset-inline: 0; bottom: 0; z-index: 200; }
.cookie-banner__inner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding-block: 1rem; }
.cookie-banner p { margin: 0; max-width: 620px; }
.cookie-banner__actions { display: flex; gap: 0.6rem; flex-shrink: 0; }
