/* fhg677 — responsive top navigation, main content, right sidebar */

@font-face {
  font-family: "HeadingFont";
  src: url(../fonts/uncial-antiqua.ttf.woff) format('woff');
}
@font-face {
  font-family: "BasicFont";
  src: url(../fonts/DejaVu-Sans.ttf.woff) format('woff');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "CodeFont";
  src: url(../fonts/DejaVu-Sans-Mono.ttf.woff) format('woff');
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg: #9f9f68;
  --surface: #afaf99;
  --ink: #004A4D;
  --muted: #566273;
  --rule: #d8dce3;
  --accent: #FFFF66;
  --accent-soft: #e5eafb;
  --astro-red: #870C25;

  --font-header: HeadingFont, serif;
  --font-ui: BasicFont, sans-serif;
  --font-text: BasicFont, sans-serif;

/*
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-text: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Georgia, serif;
*/

  --header-h: 3.75rem;
  --measure: 68ch;
  --sidebar-w: 18rem;
  --gap: clamp(1.5rem, 4vw, 3.5rem);
  --page-max: 76rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #9f9f68;
    --surface: #afaf99;
    --ink: #004A4D;
    --muted: #9aa6b6;
    --rule: #28313d;
    --accent: #FFFF66;
    --accent-soft: #9f9f68;
    --astro-red: #870C25;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.5; 
  font-size: 0.8rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--astro-red); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--accent); color: var(--surface);
  padding: 0.6rem 1rem; border-radius: 0.25rem; text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* ---------- Header and navigation ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 1.25rem;
  min-height: var(--header-h);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  column-gap: 1.5rem;
}

.brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  font-weight: 750; font-size: 1.2rem; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-header);
  padding: 0.5rem 0;
}
.brand__logo { display: block; width: 2.5rem; height: 2.5rem; border-radius: 0.375rem; }

.nav-toggle {
  display: none;
  align-items: center; gap: 0.6rem;
  background: none; border: 1px solid var(--rule); border-radius: 0.375rem;
  color: var(--ink); font: inherit; font-weight: 600;
  padding: 0.4rem 0.75rem; cursor: pointer;
}
.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  display: block; width: 1.1rem; height: 2px; background: currentColor;
  border-radius: 1px; transition: transform 0.2s, background-color 0.2s;
}
.nav-toggle__icon { position: relative; }
.nav-toggle__icon::before, .nav-toggle__icon::after { content: ""; position: absolute; left: 0; }
.nav-toggle__icon::before { top: -6px; }
.nav-toggle__icon::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after { transform: translateY(-6px) rotate(-45deg); }

.nav-list, .subnav { list-style: none; margin: 0; padding: 0; }

.site-nav { flex-basis: 100%; }
.nav-list { display: flex; flex-wrap: wrap; gap: 0.25rem; padding-bottom: 0.5rem; }

.nav-item { position: relative; }
.nav-item > a,
.subnav a {
  display: block; padding: 0.55rem 0.8rem;
  color: var(--ink); text-decoration: none; font-weight: 500;
  border-radius: 0.375rem;
}
.nav-item > a:hover, .subnav a:hover { background: var(--accent); }
.nav-item.is-active > a { color: var(--astro-red); box-shadow: inset 0 -2px 0 var(--astro-red); border-radius: 0.375rem 0.375rem 0 0; }
.nav-list a[aria-current="page"] { color: var(--astro-red); font-weight: 650; }

.subnav { padding-left: 0.75rem; }

@media (min-width: 48rem) {
  .site-nav { flex-basis: auto; }
  .nav-list { padding-bottom: 0; gap: 0; }
  .nav-item > a { padding: calc((var(--header-h) - 1.5rem) / 2) 0.85rem; border-radius: 0; }
  .nav-item.is-active > a { border-radius: 0; }

  .subnav {
    position: absolute; left: 0; top: 100%; min-width: 13rem; padding: 0.35rem;
    background: var(--surface); border: 1px solid var(--rule); border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  }
  .has-children:hover > .subnav,
  .has-children:focus-within > .subnav {
    opacity: 1; visibility: visible; transform: none;
  }
  .subnav a { padding: 0.5rem 0.75rem; }
}

@media (max-width: 47.99rem) {
  .nav-toggle { display: inline-flex; }

  .js .site-nav {
    display: none;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .js .site-nav.is-open { display: block; }

  .nav-list { flex-direction: column; gap: 0; padding: 0.25rem 0 0.75rem; }
  .nav-item.is-active > a { box-shadow: none; }
}

/* ---------- Layout ---------- */

.layout {
  flex: 1;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--gap) 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
}

.sidebar { border-top: 1px solid var(--rule); padding-top: 1.5rem; }

@media (min-width: 56rem) {
  .layout.has-sidebar { grid-template-columns: minmax(0, 1fr) var(--sidebar-w); }
  .sidebar {
    background: var(--surface);
    align-self: start;
    position: sticky; top: calc(var(--header-h) + 1.5rem);
    border-top: 0; border-left: 1px solid var(--rule);
    padding: 0 0 0 1.75rem;
  }
}

/* ---------- Main content ---------- */

.entry__header { margin-bottom: 1.5rem; }
.entry__header--compact { margin-bottom: 0; }
.entry__header--compact .meta { margin-bottom: 1.5rem; }

h1, h2, h3, h4 { font-family: var(--font-ui); letter-spacing: -0.02em; line-height: 1.2; color: var(--astro-red);}

.entry__header h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); font-weight: 780; margin: 0; }

.meta { color: var(--muted); font-size: 0.9rem; margin: 0.6rem 0 0; }

.prose { font-family: var(--font-text); font-size: 1.0625rem; line-height: 1.7; max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.55rem; margin: 2.2rem 0 0.6rem; }
.prose h3 { font-size: 1.25rem; margin: 1.8rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; }
.prose img, .prose video, .prose iframe { max-width: 100%; height: auto; }
.prose blockquote {
  margin: 1.5rem 0; padding: 0.1rem 0 0.1rem 1.25rem;
  border-left: 3px solid var(--accent); color: var(--muted);
}
.prose code, .prose pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.prose code { background: var(--accent-soft); padding: 0.1em 0.35em; border-radius: 0.25rem; }
.prose pre { background: var(--surface); border: 1px solid var(--rule); border-radius: 0.5rem; padding: 1rem; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; font-family: var(--font-ui); font-size: 0.95rem; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 0.5rem 0.9rem; text-align: left; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 2rem 0 0; }
.tags li { background: var(--accent-soft); color: var(--accent); font-size: 0.85rem; font-weight: 600; padding: 0.2rem 0.65rem; border-radius: 999px; }

/* ---------- Modular modules ---------- */

.module + .module { margin-top: clamp(2.5rem, 6vw, 4.5rem); }

.module--hero h1 {
  font-size: clamp(2.3rem, 6vw, 3.6rem); font-weight: 800; margin: 0 0 1rem; max-width: 18ch;
}
.module--hero .prose { font-size: 0.8rem; }
.button {
  display: inline-block; background: var(--accent); color: var(--ink);
  font-weight: 650; text-decoration: none; padding: 0.7rem 1.3rem; border-radius: 0.375rem;
}
.button:hover { filter: brightness(1.1); }

.module__title { font-size: 1.6rem; font-weight: 750; margin: 0 0 1rem; }

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.features__item { border-top: 2px solid var(--accent); padding-top: 0.75rem; }
.features__title { font-size: 1.1rem; font-weight: 720; margin: 0 0 0.35rem; }
.features__text { margin: 0; color: var(--muted); }

/* ---------- Blog list ---------- */

.post-list { list-style: none; margin: 2rem 0 0; padding: 0; max-width: var(--measure); }
.post-list__item { padding: 1.5rem 0; border-top: 1px solid var(--rule); }
.post-list__title { font-size: 1.5rem; font-weight: 720; margin: 0; }
.post-list__title a { color: var(--ink); text-decoration: none; }
.post-list__title a:hover { color: var(--accent); }
.post-list__item .prose { margin-top: 0.75rem; }
.post-list__empty { color: var(--muted); }

/* ---------- Sidebar ---------- */

.widget + .widget { margin-top: 2rem; }
.widget__title { font-size: 1rem; font-weight: 720; margin: 0 0 0.6rem; }
.widget .prose { font-family: var(--font-ui); font-size: 0.8rem; line-height: 1.5; }

.widget__list { list-style: none; margin: 0; padding: 0; }
.widget__list li { padding: 0.35rem 0; }
.widget__list a { text-decoration: none; }
.widget__list a:hover { text-decoration: underline; }
.widget__list a[aria-current="page"] { font-weight: 700; color: var(--ink); }
.widget__list--dated time { display: block; color: var(--muted); font-size: 0.82rem; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); background: var(--ink); color: var(--muted); font-size: 0.9rem; }
.site-footer__inner { max-width: var(--page-max); margin: 0 auto; padding: 1.25rem; }
.site-footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


