:root {
  --bg: #f8f8f8;
  --card: #ffffff;
  --text: #222;
  --muted: #666;
  --line: #ddd;
  --maxw: 1200px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
.container { max-width: var(--maxw); margin: 0 auto; padding: 1rem; }
.site-header, .site-footer { background: var(--card); border-bottom: 1px solid var(--line); }
.site-footer { border-top: 1px solid var(--line); border-bottom: none; margin-top: 1.5rem; }
.subtitle, .meta { color: var(--muted); }
.top-nav .menu,
.top-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.top-nav > .menu {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.top-nav .menu-item {
  position: relative;
}
.top-nav .menu-item > a {
  display: block;
  text-decoration: none;
  color: var(--text);
  padding: .35rem .55rem;
  border-radius: .35rem;
}
.top-nav .menu-item > a .menu-icon {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.top-nav .menu-item > a:hover,
.top-nav .menu-item > a:focus-visible {
  background: #ececec;
}
.top-nav .menu-item.has-children > a::after {
  content: " ▾";
  font-size: .75em;
}
.top-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  z-index: 20;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  padding: .2rem;
}
.top-nav .sub-menu .menu-item > a {
  padding: .45rem .6rem;
}
@media (hover: hover) {
  .top-nav .menu-item:hover > .sub-menu {
    display: block;
  }
}
.top-nav .menu-item:focus-within > .sub-menu {
  display: block;
}
.top-nav .menu-item.open > .sub-menu {
  display: block;
}
.layout-3col, .layout-3col-post {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
}
.posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.post-card, .widget, .post-body {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1rem;
}
.search-panel {
  min-width: 0;
}
.search-form {
  display: grid;
  gap: .6rem;
}
.search-form input,
.search-form button {
  font: inherit;
}
.search-form input {
  width: 100%;
  padding: .6rem .7rem;
  border: 1px solid var(--line);
  background: #fff;
}
.search-form button {
  width: fit-content;
  padding: .55rem .85rem;
  border: 1px solid var(--line);
  background: #efefef;
  cursor: pointer;
}
.search-results-widget {
  min-height: 16rem;
}
.search-result + .search-result {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 1rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.pager { display: flex; justify-content: space-between; }
.post-nav { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }

.post-body .content blockquote {
  margin: 1rem 0;
  padding: .3rem 0 .3rem 1rem;
  border-left: 3px solid #b9b9b9;
  font-style: italic;
  font-size: 1.03em;
  color: #333;
}

.post-body .content blockquote p {
  margin: .35rem 0;
}

.post-body .content figure.image-with-caption {
  display: table;
  margin: 1rem auto;
}

.post-body .content figure.image-with-caption img {
  display: block;
  max-width: 100%;
  height: auto;
}

.post-body .content figure.image-with-caption figcaption {
  display: table-caption;
  caption-side: bottom;
  text-align: center;
  color: var(--muted);
  font-size: .95em;
  padding-top: .35rem;
}

/* Keep media within content column width to avoid layout blowouts. */
.post-body .content img {
  max-width: 100%;
  height: auto;
}

.gnf-widget {
  display: flex;
  justify-content: center;
}

.gnf-text {
  display: flex;
  font-family: monospace;
  font-size: 24px;
  color: black;
  transform: rotate(-5deg);
}

.gnf-container {
  position: relative;
  width: 2ch;
  overflow: hidden;
}

.gnf-animated-text {
  position: absolute;
  animation: shift 1s ease-in-out alternate infinite;
}

@keyframes shift {
  0% { transform: translateX(0); }
  100% { transform: translateX(-1ch); }
}


.post-taxonomy {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .8rem;
  margin-top: .45rem;
}

.taxonomy-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
}

.taxonomy-group:empty {
  display: none;
}

.taxonomy-group-label {
  font-size: .92em;
  color: var(--muted);
  margin-right: .1rem;
}

.taxonomy-pill {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .86em;
  line-height: 1.35;
  border: 1px solid transparent;
}

.taxonomy-pill-category {
  background: #e6f3ff;
  border-color: #b9dbff;
  color: #1b4f7a;
}

.taxonomy-pill-tag {
  background: #fff1e3;
  border-color: #ffd5aa;
  color: #7a4b1b;
}

@media (max-width: 980px) {
  .top-nav > .menu {
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
  }
  .top-nav .sub-menu {
    position: static;
    display: none;
    min-width: 0;
    box-shadow: none;
    border: 0;
    padding: 0 0 0 .8rem;
  }

  .layout-3col, .layout-3col-post {
    display: flex;
    flex-direction: column-reverse;
  }
  .posts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
