/* ---- FusedGlass.org — clean rebuild theme ---- */
:root {
  --teal: #0f789b;
  --teal-dark: #0b5e7a;
  --teal-light: #2f9bc1;
  --lime: #4faf3e;
  --lime-bright: #6df16d;
  --ink: #1c2a31;
  --muted: #5d6b72;
  --line: #e3e6e4;
  --bg: #ffffff;
  --bg-warm: #f6f5f1;
  --max: 1120px;
  --prose: 46rem;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 18px;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal); text-underline-offset: 2px; }
a:hover { color: var(--teal-dark); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; z-index: 100; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--teal);
  background: linear-gradient(180deg, var(--teal) 0%, var(--teal-dark) 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 60px; position: relative; }
.brand { position: relative; display: inline-flex; align-items: center; padding-left: 81px; }
/* oversized icon whose bottom hangs off the header bar, with a drop shadow */
.brand-icon {
  position: absolute; left: -2px; top: -8px;
  height: 76px; width: auto; display: block; z-index: 3;
  filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .4));
}
.brand-word { height: 26px; width: auto; display: block; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.site-nav a {
  color: #eafaff; text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: .5rem .7rem; border-radius: 6px;
}
.site-nav a:hover, .site-nav a.active { background: rgba(255, 255, 255, .16); color: #fff; }
.nav-search { display: inline-flex; align-items: center; padding: .4rem .5rem; }
.nav-search svg { display: block; }
.nav-toggle {
  display: none; margin-left: auto; background: transparent; border: 0;
  color: #fff; font-size: 1.6rem; cursor: pointer; line-height: 1;
}

/* ---- content ---- */
main { min-height: 60vh; }
.prose { max-width: var(--prose); margin: 2.5rem auto; }
.prose.calc, .prose.wide { max-width: 60rem; }
.prose h1 { font-size: 2.1rem; line-height: 1.15; margin: 0 0 1rem; letter-spacing: -.01em; }
.prose h2 { font-size: 1.5rem; margin: 2.2rem 0 .6rem; }
.prose h3 { font-size: 1.2rem; margin: 1.8rem 0 .5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; }
.prose img { border-radius: 8px; }
/* content images (inside paragraphs) sit on their own line, not jammed against text */
.prose p img { display: block; margin: 1.5rem 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.prose figure { margin: 1.5rem 0; }
.prose figcaption { color: var(--muted); font-size: .9rem; margin-top: .4rem; text-align: center; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .55rem .7rem; text-align: left; }
.prose thead th { background: var(--bg-warm); }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; font-weight: 700; margin: 0 0 .3rem; }
.eyebrow a { text-decoration: none; }
.post-date { color: var(--muted); margin-top: -.5rem; }
/* section-menu tiles (small cousins of the homepage feature cards) */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; margin: 1.5rem 0 2rem; }
.tile {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, .12); }
.tile-media { height: 92px; background-image: var(--img); background-size: cover; background-position: center; background-color: var(--teal); }
.tile--plain .tile-media { background: linear-gradient(135deg, var(--teal-light), var(--teal-dark)); }
.tile-label { padding: .6rem .8rem; font-weight: 600; color: var(--teal-dark); font-size: .95rem; line-height: 1.25; }

/* buttons (converted from [button] shortcodes + calc) */
.btn {
  display: inline-block; background: var(--teal); color: #fff !important;
  padding: .6rem 1.1rem; border-radius: 8px; text-decoration: none; font-weight: 600;
  border: 0; cursor: pointer; font-size: 1rem; line-height: 1.2;
}
.btn:hover { background: var(--teal-dark); }
.btn--limegreen, .btn--green { background: var(--lime); }
.btn--limegreen:hover, .btn--green:hover { background: #3f8f31; }
.btn--orange { background: #e08a1e; }
.btn--ghost { background: transparent; color: var(--teal) !important; border: 1px solid var(--teal); }

/* tags */
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 1rem; }
.tag {
  display: inline-flex; align-items: center; line-height: 1;
  background: var(--bg-warm); border: 1px solid var(--line); color: var(--muted);
  font-size: .8rem; padding: .35rem .7rem; border-radius: 999px;
  text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
a.tag:hover { border-color: var(--teal-light); color: var(--teal-dark); background: #fff; }

/* ---- breadcrumbs ---- */
.breadcrumbs { border-bottom: 1px solid var(--line); background: var(--bg-warm); font-size: .85rem; }
/* clear the overhanging logo badge on the left */
.breadcrumbs .wrap { padding-top: .6rem; padding-bottom: .6rem; padding-left: calc(1.25rem + 58px); }
.breadcrumbs a { color: var(--teal-dark); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--muted); }
.breadcrumbs .sep { color: var(--muted); margin: 0 .5rem; }

/* lead image on content pages */
.lead { display: block; width: 100%; max-height: 460px; object-fit: cover; border-radius: 10px; margin: 0 0 1.6rem; }
.wiki-term .lead { max-height: 340px; }

/* ---- home ---- */
.hero { position: relative; color: #fff; padding: 5rem 0 4.5rem; overflow: hidden; background: var(--teal-dark); }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center right; opacity: .9; }
/* left-weighted scrim: text stays legible on the left, artwork shows on the right */
.hero::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(90deg, rgba(11,94,122,.94) 0%, rgba(11,94,122,.82) 38%, rgba(11,94,122,.45) 70%, rgba(15,120,155,.25) 100%); }
.hero-content { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 .6rem; letter-spacing: -.02em; text-shadow: 0 2px 12px rgba(0,0,0,.25); }
.hero p { font-size: 1.2rem; max-width: 40rem; margin: 0 0 1.5rem; color: #eaf7fc; }
.hero .btn { background: #fff; color: var(--teal-dark) !important; }
.hero .btn--ghost { background: rgba(255,255,255,.08); color: #fff !important; border-color: rgba(255,255,255,.6); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; margin: 2.5rem auto; }
.feature {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.feature:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.12); }
.feature-media { display: block; height: 150px; background-image: var(--img); background-size: cover; background-position: center; background-color: var(--teal); }
.feature--plain .feature-media { background: linear-gradient(135deg, var(--teal-light), var(--teal-dark)); }
.feature-body { padding: 1.1rem 1.3rem 1.4rem; display: block; }
.feature-title { display: block; font-size: 1.25rem; font-weight: 700; color: var(--teal-dark); margin-bottom: .25rem; }
.feature-desc { display: block; color: var(--muted); font-size: .95rem; }

/* ---- blog listing (cards) ---- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; margin: 2rem auto 3rem; }
.post-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.12); }
.post-card .thumb { display: block; height: 170px; background: var(--bg-warm); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: .9rem 1.1rem 1.1rem; }
.post-card-title { display: block; font-weight: 700; color: var(--ink); margin-bottom: .2rem; line-height: 1.3; }
.post-card .meta { color: var(--muted); font-size: .82rem; }

/* ---- wiki category filter ---- */
.filter-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.75rem auto 1.5rem; }
.filter-pills .pill {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: .85rem; line-height: 1; cursor: pointer;
  padding: .5rem .9rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-warm); color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.filter-pills .pill:hover { border-color: var(--teal-light); color: var(--teal-dark); }
.filter-pills .pill.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }
.filter-select {
  display: none; font: inherit; width: 100%; max-width: 340px;
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-warm); color: var(--ink);
}
.filter-empty { text-align: center; color: var(--muted); margin: 2rem 0 3rem; }

/* ---- wiki index (term cards) ---- */
.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; margin: 2rem auto 3rem; }
.term-card { position: relative; display: flex; align-items: flex-end; min-height: 118px; border-radius: 10px; overflow: hidden; text-decoration: none; box-shadow: var(--shadow); background: var(--teal); }
.term-card .thumb { position: absolute; inset: 0; }
.term-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.term-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.72)); }
.term-name { position: relative; z-index: 1; color: #fff; font-weight: 600; padding: .6rem .7rem; font-size: .95rem; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.term-card--plain { background: linear-gradient(135deg, var(--teal-light), var(--teal-dark)); }
.term-card--plain::after { display: none; }
.term-card--plain .term-name { align-self: center; width: 100%; text-align: center; }

/* ---- calculator ---- */
.calc-form { background: var(--bg-warm); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin: 1.5rem 0; }
.calc-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.calc-row:last-child { margin-bottom: 0; }
.calc-row label { flex: 0 0 5.5rem; font-weight: 600; }
.calc-form input[type=text] { flex: 0 0 6rem; padding: .5rem .6rem; border: 1px solid #c7cdc9; border-radius: 6px; font-size: 1rem; }
.calc-form select { padding: .5rem .5rem; border: 1px solid #c7cdc9; border-radius: 6px; font-size: 1rem; background: #fff; }
.calc-results { max-width: 34rem; }
.calc-results td[data-cell] { font-variant-numeric: tabular-nums; }
.calc-answer { background: #eaf7ef; border: 1px solid #bfe3cd; border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0; }
.calc-answer p:last-child { margin-bottom: 0; }
.calc-error { background: #fdeaea; border: 1px solid #f2c4c4; border-radius: var(--radius); padding: .8rem 1rem; color: #922; }
.footnote { font-size: .85rem; color: var(--muted); }

/* ---- footer ---- */
.site-footer { background: var(--bg-warm); border-top: 1px solid var(--line); margin-top: 4rem; padding: 2rem 0; font-size: .9rem; text-align: center; }
.site-footer p { margin: .2rem 0; }

/* ---- search ---- */
:root { --pagefind-ui-primary: var(--teal); --pagefind-ui-scale: .9; }
.search-wrap { max-width: var(--prose); margin: 2.5rem auto; }

/* ---- responsive ---- */
@media (max-width: 760px) {
  body { font-size: 17px; }
  /* content blocks that aren't inside .wrap need their own gutters on phones */
  .prose, .list, .search-wrap { padding-left: 1.25rem; padding-right: 1.25rem; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--teal-dark); padding: .5rem 1rem 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .8rem .6rem; border-radius: 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .wiki-index-grid { columns: 2 140px; }
}

/* phones: swap the category pills for a dropdown */
@media (max-width: 640px) {
  .filter-pills { display: none; }
  .filter-select { display: block; margin: 1.5rem 0; }
}
