/* dieterdavis.com — design system
   Palette: near-black bg, white headings, off-grey text, mid-blue rules, light-grey table borders. */

:root {
  --bg:            #0f1115;  /* dark, almost-black */
  --bg-elevated:   #161922;  /* subtle panels */
  --heading:       #ffffff;  /* white — big headers */
  --text:          #aab1bb;  /* off-grey — body text */
  --text-strong:   #d6dae0;  /* emphasis */
  --accent:        #4f9cf9;  /* mid-blue — rules, separators, links */
  --accent-dim:    #3a6ea5;  /* hover/visited */
  --border:        #2a2f3a;  /* subtle dividers */
  --border-table:  #4b5563;  /* light-grey — table borders */

  --maxw:          820px;
  --maxw-wide:     900px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text-strong); text-decoration: underline; }

h1, h2, h3, h4 { color: var(--heading); line-height: 1.2; font-weight: 650; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); letter-spacing: -0.02em; margin: 0 0 0.25em; }
h2 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.85rem); margin: 2em 0 0.6em; }
h3 { font-size: 1.2rem; margin: 1.6em 0 0.4em; }
p  { margin: 0 0 1.1em; }
strong { color: var(--text-strong); }

hr { border: 0; border-top: 2px solid var(--accent); width: 3rem; margin: 1.75rem 0; opacity: 0.9; }
hr.full { width: 100%; border-top: 1px solid var(--border); }

/* ---- layout ---- */
.site-header, .site-footer, main {
  width: 100%;
  max-width: var(--maxw-wide);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
/* min-width:0 lets this flex item honor max-width even when a child (e.g. a wide
   comparison table) is wider than the column — the table scrolls inside instead
   of stretching the page and breaking the centered alignment with the header. */
main { flex: 1 0 auto; min-width: 0; max-width: var(--maxw); padding-block: 2.5rem 3.5rem; }

/* ---- header / nav ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--border);
}
.wordmark { color: var(--heading); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.wordmark:hover { color: var(--heading); text-decoration: none; }
.site-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-nav a { color: var(--text); font-size: 0.95rem; }
.site-nav a:hover { color: var(--heading); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--heading); border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--border); padding-block: 1.5rem; font-size: 0.875rem; text-align: center; }
.site-footer p { margin: 0; }

/* ---- home hero ---- */
.hero .tagline { color: var(--text-strong); font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem); margin: 0.2em 0 0.15em; }
.hero .subtagline { color: var(--accent); font-size: 0.95rem; letter-spacing: 0.05em; text-transform: uppercase; margin: 0 0 0.25rem; }

/* ---- tables ---- */
table { border-collapse: collapse; width: 100%; margin: 1.2em 0; }
th, td { border: 1px solid var(--border-table); padding: 0.5em 0.7em; text-align: left; }
th { color: var(--heading); }

/* ---- entry lists (blog / projects) ---- */
.entry-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.entry-list li { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.entry-list li:first-child { border-top: 1px solid var(--border); }
.entry-list h2, .entry-list h3 { margin: 0 0 0.3rem; font-size: 1.2rem; }
.entry-list .meta { color: var(--text); font-size: 0.85rem; }
.entry-list .excerpt { margin: 0.2rem 0 0; }

/* ---- Pool Industry Insights ---- */
.crumbs { font-size: 0.85rem; color: var(--text); margin: 0 0 0.6rem; }
.crumbs .sep { color: var(--border-table); margin: 0 0.15rem; }
.entry-lede { color: var(--text-strong); font-size: 1.05rem; margin: 0.4rem 0 1.4rem; }
.muted { color: var(--text); opacity: 0.7; }
.badge {
  display: inline-block; font-size: 0.8rem; color: var(--accent);
  border: 1px solid var(--border-table); border-radius: 6px; padding: 0.15rem 0.6rem; margin: 0 0 1rem;
}
.table-scroll { overflow-x: auto; margin: 1.2em 0; }
.table-scroll table { margin: 0; }
table.compare { font-size: 0.92rem; min-width: 640px; }
table.facts { width: 100%; }
table.facts th[scope="row"] { width: 34%; font-weight: 600; vertical-align: top; }
table.timeline { font-size: 0.92rem; }
.src { font-size: 0.8rem; }
.entry-stamp { color: var(--text); font-size: 0.85rem; margin-top: 1.6rem; }
.insights-disclaimer {
  margin: 2.5rem 0 0; padding: 1rem 1.1rem; border: 1px solid var(--border);
  border-radius: 8px; font-size: 0.8rem; color: var(--text);
}
.insights-disclaimer p { margin: 0 0 0.6rem; }
.insights-disclaimer p:last-child { margin: 0; }
.disclaimer-contact { margin-top: 0.9rem; }
.tip { border-bottom: 1px dotted var(--border-table); cursor: help; }
.tip:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.compare-hint { font-size: 0.85rem; color: var(--text); margin: 0 0 0.6rem; }
.compare-nav { font-size: 0.9rem; margin: 1.4rem 0 0; }
.compare-nav .sep { color: var(--border-table); }
.mp {
  display: inline-block; font-size: 0.72rem; line-height: 1.45;
  padding: 0.04rem 0.45rem; border-radius: 4px; border: 1px solid var(--border-table);
  margin: 0 0.2rem 0.2rem 0; white-space: nowrap;
}
.mp-on { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.mp-partial { color: var(--accent); border-color: var(--accent); }
.mp-off { color: var(--text); opacity: 0.6; }
.mp-unknown { color: var(--text); opacity: 0.6; border-style: dashed; }
.mp-note { font-size: 0.82rem; margin-top: 0.35rem; }
.mp-legend { font-size: 0.82rem; color: var(--text); margin: 1rem 0 0; }
.brand-filter { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin: 0.6rem 0 0; }
.brand-filter input {
  flex: 1 1 320px; min-width: 0; font: inherit; font-size: 0.95rem;
  color: var(--heading); background: var(--bg-elevated);
  border: 1px solid var(--border-table); border-radius: 8px; padding: 0.6rem 0.85rem;
}
.brand-filter input::placeholder { color: var(--text); opacity: 0.8; }
.brand-filter input:focus { outline: none; border-color: var(--accent); }
.brand-count { font-size: 0.85rem; color: var(--text); white-space: nowrap; }
.cta-line { margin: 1.6rem 0 0; }
.cta {
  display: inline-block; background: var(--accent); color: var(--bg);
  font-weight: 600; padding: 0.7rem 1.2rem; border-radius: 8px;
}
.cta:hover { background: var(--accent-dim); color: var(--bg); text-decoration: none; }

/* ---- PDF embed (patent) ---- */
.pdf-actions { font-size: 0.92rem; margin: 0.4rem 0 0.6rem; }
.pdf-embed {
  display: block; width: 100%; height: 80vh; min-height: 480px;
  border: 1px solid var(--border-table); border-radius: 8px;
  background: var(--bg-elevated); margin: 0.5rem 0 0;
}

/* ---- socials (contact) ---- */
.socials { display: flex; gap: 1rem; flex-wrap: wrap; list-style: none; padding: 0; margin: 1.75rem 0 0; }
.socials a {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--text);
  border: 1px solid var(--border-table);
  border-radius: 8px;
  padding: 0.7rem 1.05rem;
}
.socials a:hover { color: var(--heading); border-color: var(--accent); text-decoration: none; }
.socials svg { width: 22px; height: 22px; flex: none; }

/* ---- accessibility ---- */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--bg-elevated); padding: 0.5rem 0.75rem; border: 1px solid var(--accent); z-index: 10; }

@media (max-width: 540px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .site-nav { gap: 1rem; }
}
