/*
Theme Name: GeneLink Family
Theme URI: https://josephbernardgreen.com/genelink
Author: Joseph Green
Author URI: https://josephbernardgreen.com
Description: Companion theme for the GeneLink Family Tree Manager plugin. Provides the navigation shell, typography, and design tokens that match the plugin's frontend.
Version: 1.1.2
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: genelink-family
Tags: family-tree, genealogy, custom-menu, full-width-template
*/

/* ─── DESIGN TOKENS ──────────────────────────────────────────────────────── */
:root {
  --gl-bg:      #F7F6F3;
  --gl-surface: #FFF;
  --gl-s2:      #F0EFEB;
  --gl-border:  #E2E0DB;
  --gl-text:    #1A1916;
  --gl-muted:   #7A786F;
  --gl-accent:  #2D6A4F;
  --gl-alight:  #E8F1ED;
  --gl-warm:    #B5541A;
  --gl-r:       8px;
  --gl-nav-h:   80px;
  --gl-sh:      0 1px 3px rgba(26,25,22,.06), 0 4px 16px rgba(26,25,22,.06);
}

/* ─── RESET / BASE ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--gl-bg);
  color: var(--gl-text);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'DM Serif Display', serif;
  line-height: 1.2;
}

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

img { max-width: 100%; height: auto; display: block; }

/* ─── SKIP LINK ──────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 1rem;
  background: var(--gl-accent);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: 0 0 var(--gl-r) var(--gl-r);
  z-index: 9999;
  font-size: .85rem;
}
.skip-link:focus { top: 0; }

/* ─── CUSTOM LOGO ────────────────────────────────────────────────────────── */
.custom-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.custom-logo {
  max-height: calc(var(--gl-nav-h) - 16px);
  width: auto;
  display: block;
}

/* ─── NAV ────────────────────────────────────────────────────────────────── */
.gl-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--gl-nav-h);
  background: var(--gl-surface);
  border-bottom: 1px solid var(--gl-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}

.gl-nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  color: var(--gl-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
}
.gl-nav-logo:hover { text-decoration: none; }
.gl-nav-logo-dot { color: var(--gl-accent); font-size: 1.25rem; line-height: 0; position: relative; top: 2px; }

.gl-nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: .25rem;
  margin-left: auto;
}
.gl-nav-menu li a,
.gl-nav-menu li button {
  display: block;
  padding: .4rem .7rem;
  font-size: .84rem;
  color: var(--gl-muted);
  border-radius: var(--gl-r);
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: color .15s, background .15s;
}
.gl-nav-menu li a:hover,
.gl-nav-menu li button:hover,
.gl-nav-menu li.current-menu-item > a {
  color: var(--gl-text);
  background: var(--gl-s2);
  text-decoration: none;
}
.gl-nav-menu li.current-menu-item > a { font-weight: 500; }

.gl-nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gl-accent);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  margin-left: .5rem;
  overflow: hidden;
}
.gl-nav-avatar img { width: 100%; height: 100%; object-fit: cover; }
.gl-nav-avatar:hover { opacity: .85; text-decoration: none; }

.gl-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  color: var(--gl-text);
  margin-left: auto;
}

/* ─── MOBILE NAV ─────────────────────────────────────────────────────────── */
.gl-mobile-nav {
  display: none;
  position: fixed;
  inset: var(--gl-nav-h) 0 0 0;
  background: var(--gl-surface);
  z-index: 199;
  padding: 1rem 1.5rem;
  overflow-y: auto;
  border-top: 1px solid var(--gl-border);
}
.gl-mobile-nav.open { display: block; }
.gl-mobile-nav ul { list-style: none; display: flex; flex-direction: column; gap: .25rem; }
.gl-mobile-nav ul li a {
  display: block;
  padding: .7rem .9rem;
  font-size: .9rem;
  color: var(--gl-text);
  border-radius: var(--gl-r);
}
.gl-mobile-nav ul li a:hover,
.gl-mobile-nav ul li.current-menu-item > a {
  background: var(--gl-s2);
  text-decoration: none;
}

/* ─── PAGE SHELL ─────────────────────────────────────────────────────────── */
#gl-main { min-height: calc(100vh - var(--gl-nav-h)); }

.gl-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.gl-page-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}


/* ─── FOOTER (base) ──────────────────────────────────────────────────────── */
.gl-footer {
  background: var(--gl-surface);
  border-top: 1px solid var(--gl-border);
  color: var(--gl-muted);
  font-size: .82rem;
}
.gl-footer a { color: var(--gl-muted); text-decoration: none; }
.gl-footer a:hover { color: var(--gl-accent); }

/* ─── RESPONSIVE (nav) ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .gl-nav-menu { display: none; }
  .gl-hamburger { display: flex; align-items: center; justify-content: center; }
  .gl-nav-avatar { margin-left: .25rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SINGLE POST
═══════════════════════════════════════════════════════════════════════════ */


/* ─── READING PROGRESS (fixed top bar) ──────────────────────────────────── */
.gl-progress-bar {
  position: fixed;
  top: var(--gl-nav-h);
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gl-accent);
  z-index: 198;
  transition: width .1s linear;
  pointer-events: none;
}

/* ─── SINGLE WRAP (2-col grid) ───────────────────────────────────────────── */
.gl-single-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2.5rem;
  align-items: start;
}

/* ─── BREADCRUMB ─────────────────────────────────────────────────────────── */
.gl-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .35rem;
  align-items: center;
  font-size: .78rem;
  color: var(--gl-muted);
  margin-bottom: 1.5rem;
}
.gl-breadcrumb a { color: var(--gl-muted); text-decoration: none; }
.gl-breadcrumb a:hover { color: var(--gl-accent); }
.gl-breadcrumb-sep { color: var(--gl-border); }
.gl-breadcrumb-current { color: var(--gl-text); }

/* ─── ENTRY HEADER ───────────────────────────────────────────────────────── */
.gl-entry-header { margin-bottom: 1.75rem; }

.gl-category-label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gl-accent);
  margin-bottom: .75rem;
}
.gl-category-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  flex-shrink: 0;
}

.gl-entry-title {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.15;
  color: var(--gl-text);
  margin-bottom: .85rem;
}

.gl-entry-excerpt {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--gl-muted);
  margin-bottom: 1.25rem;
  max-width: 65ch;
}

/* Meta bar */
.gl-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  padding: .75rem 1rem;
  background: var(--gl-s2);
  border-radius: var(--gl-r);
  font-size: .8rem;
  color: var(--gl-muted);
}
.gl-meta-author { display: flex; align-items: center; gap: .5rem; }
.gl-meta-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--gl-accent);
}
.gl-meta-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gl-meta-author-info { display: flex; flex-direction: column; gap: .05rem; }
.gl-meta-author-name { font-weight: 600; color: var(--gl-text); font-size: .82rem; }
.gl-meta-author-role { font-size: .72rem; }
.gl-meta-sep { color: var(--gl-border); user-select: none; }
.gl-meta-item { display: flex; align-items: center; gap: .3rem; }
.gl-meta-item svg { opacity: .55; flex-shrink: 0; }

/* ─── FEATURED IMAGE ─────────────────────────────────────────────────────── */
.gl-featured-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2rem;
  aspect-ratio: 16 / 9;
  background: var(--gl-s2);
}
.gl-featured-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gl-featured-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: .6rem 1rem;
  background: linear-gradient(transparent, rgba(26,25,22,.55));
  font-size: .73rem;
  line-height: 1.4;
  color: rgba(255,255,255,.88);
}

/* ─── ENTRY CONTENT — RICH TYPOGRAPHY ───────────────────────────────────── */
.entry-content {
  font-size: .96rem;
  line-height: 1.78;
  color: var(--gl-text);
}

.entry-content p { margin-bottom: 1.2rem; }
.entry-content p:last-child { margin-bottom: 0; }

.entry-content h2 {
  font-size: 1.45rem;
  margin: 2.25rem 0 .6rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--gl-border);
}
.entry-content h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 .45rem;
}
.entry-content h4 {
  font-size: .8rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gl-muted);
  margin: 1.5rem 0 .4rem;
}

.entry-content ul,
.entry-content ol { padding-left: 1.6rem; margin-bottom: 1.2rem; }
.entry-content li + li { margin-top: .3rem; }
.entry-content strong { font-weight: 600; }
.entry-content em { font-style: italic; }
.entry-content hr { border: none; border-top: 1px solid var(--gl-border); margin: 2rem 0; }

.entry-content a { color: var(--gl-accent); text-underline-offset: 2px; }
.entry-content a:hover { color: var(--gl-text); }

/* Blockquote */
.entry-content blockquote {
  margin: 1.75rem 0;
  padding: .85rem 1.25rem;
  border-left: 4px solid var(--gl-accent);
  background: var(--gl-alight);
  border-radius: 0 var(--gl-r) var(--gl-r) 0;
  font-style: italic;
  font-size: 1.02rem;
  color: var(--gl-text);
}
.entry-content blockquote cite {
  display: block;
  margin-top: .55rem;
  font-style: normal;
  font-size: .78rem;
  font-weight: 600;
  color: var(--gl-muted);
}

/* Float images */
.entry-content .alignleft {
  float: left;
  margin: .25rem 1.5rem 1rem 0;
  border-radius: var(--gl-r);
  max-width: 45%;
}
.entry-content .alignright {
  float: right;
  margin: .25rem 0 1rem 1.5rem;
  border-radius: var(--gl-r);
  max-width: 45%;
}
.entry-content .aligncenter { display: block; margin: 1.5rem auto; }
.entry-content::after { content: ''; display: table; clear: both; }

/* Tables */
.entry-content table { width: 100%; border-collapse: collapse; font-size: .875rem; margin: 1.5rem 0; }
.entry-content th {
  background: var(--gl-s2);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gl-muted);
  padding: .6rem .9rem;
  text-align: left;
  border-bottom: 2px solid var(--gl-border);
}
.entry-content td { padding: .55rem .9rem; border-bottom: 1px solid var(--gl-border); vertical-align: top; }
.entry-content tr:last-child td { border-bottom: none; }
.entry-content tr:hover td { background: var(--gl-s2); }

/* Callout boxes (plugin/shortcode output) */
.gl-callout,
.entry-content .callout {
  display: flex;
  gap: .85rem;
  padding: 1rem 1.2rem;
  border-radius: var(--gl-r);
  margin: 1.5rem 0;
  font-size: .875rem;
  line-height: 1.6;
}
.gl-callout-icon,
.entry-content .callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }
.gl-callout-body strong,
.entry-content .callout-body strong {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .2rem;
}
.gl-callout.tip,  .entry-content .callout.tip  { background: var(--gl-alight); border-left: 3px solid var(--gl-accent); }
.gl-callout.note, .entry-content .callout.note { background: #FEF9EC; border-left: 3px solid #D4A017; }
.gl-callout.info, .entry-content .callout.info { background: #EBF4FB; border-left: 3px solid #2E86C1; }

/* Record card (plugin output) */
.gl-record-card,
.entry-content .record-card {
  background: var(--gl-surface);
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-r);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  font-size: .85rem;
  box-shadow: var(--gl-sh);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .4rem .9rem;
  align-items: start;
}
.entry-content .record-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--gl-s2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  grid-row: 1 / 3;
}
.entry-content .record-card-title { font-family: 'DM Serif Display', serif; font-size: .95rem; color: var(--gl-text); }
.entry-content .record-card-meta  { font-size: .75rem; color: var(--gl-muted); line-height: 1.5; }
.entry-content .record-card-link  { font-size: .78rem; color: var(--gl-accent); font-weight: 500; grid-column: 2; }
.entry-content .record-card-link:hover { text-decoration: underline; }

/* Person mention pill (plugin output) */
.gl-person-pill,
.entry-content .person-mention {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .18rem .55rem .18rem .35rem;
  background: var(--gl-alight);
  border: 1px solid #C8DDD4;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--gl-accent);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.entry-content .person-mention:hover { background: #D4EBE0; text-decoration: none; }
.entry-content .pm-av,
.gl-person-pill-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gl-accent);
  color: #fff;
  font-size: .58rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

/* ─── ENTRY FOOTER ───────────────────────────────────────────────────────── */
.gl-entry-footer { margin-top: 3rem; }

/* Tags */
.gl-tags-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1.5rem;
}
.gl-tags-row-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gl-muted);
  margin-right: .15rem;
}
.gl-tag {
  display: inline-block;
  padding: .22rem .65rem;
  background: var(--gl-s2);
  border: 1px solid var(--gl-border);
  border-radius: 999px;
  font-size: .78rem;
  color: var(--gl-text);
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.gl-tag:hover { background: var(--gl-alight); color: var(--gl-accent); border-color: #C8DDD4; text-decoration: none; }

/* Share bar */
.gl-share-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem .65rem;
  padding: .85rem 1.1rem;
  background: var(--gl-s2);
  border-radius: var(--gl-r);
  margin-bottom: 2rem;
}
.gl-share-bar-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gl-muted);
}
.gl-share-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .38rem .8rem;
  border-radius: var(--gl-r);
  font-size: .8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity .15s;
}
.gl-share-btn:hover { opacity: .82; text-decoration: none; }
.gl-share-btn.twitter  { background: #0C7DBF; color: #fff; }
.gl-share-btn.facebook { background: #1456B4; color: #fff; }
.gl-share-btn.copy     { background: var(--gl-surface); color: var(--gl-text); border: 1px solid var(--gl-border); }
.gl-share-btn.copy:hover { color: var(--gl-text); }

/* Author bio */
.gl-author-bio {
  display: flex;
  gap: 1.1rem;
  padding: 1.25rem 1.4rem;
  background: var(--gl-surface);
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-r);
  margin-bottom: 2.5rem;
  box-shadow: var(--gl-sh);
}
.gl-author-bio-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--gl-accent);
}
.gl-author-bio-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gl-author-bio-name { font-family: 'DM Serif Display', serif; font-size: 1rem; margin-bottom: .15rem; }
.gl-author-bio-role { font-size: .75rem; color: var(--gl-accent); font-weight: 600; margin-bottom: .4rem; }
.gl-author-bio-desc { font-size: .84rem; line-height: 1.65; color: var(--gl-muted); }

/* Related posts */
.gl-related { margin-bottom: 2.5rem; }
.gl-related-title { font-size: 1.05rem; margin-bottom: 1rem; }
.gl-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.gl-related-card {
  background: var(--gl-surface);
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-r);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  box-shadow: var(--gl-sh);
  transition: box-shadow .18s, transform .18s;
}
.gl-related-card:hover { box-shadow: 0 6px 24px rgba(26,25,22,.12); transform: translateY(-2px); text-decoration: none; }
.gl-related-card-thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--gl-s2); }
.gl-related-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gl-related-card-thumb--empty { background: linear-gradient(135deg, var(--gl-s2), var(--gl-border)); }
.gl-related-card-body { padding: .85rem 1rem; flex: 1; }
.gl-related-card-cat {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gl-accent);
  margin-bottom: .3rem;
}
.gl-related-card-title { font-family: 'DM Serif Display', serif; font-size: .95rem; line-height: 1.3; color: var(--gl-text); }

/* Comments */
.gl-comments-section {
  background: var(--gl-surface);
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-r);
  padding: 1.5rem;
  box-shadow: var(--gl-sh);
}
.gl-comments-section .comments-title {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}
.gl-comments-section .comment-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.gl-comments-section .comment { display: flex; gap: .85rem; margin-bottom: 1.25rem; }
.gl-comments-section .comment .avatar { border-radius: 50%; flex-shrink: 0; }
.gl-comments-section .comment-body { flex: 1; }
.gl-comments-section .comment-meta { margin-bottom: .35rem; }
.gl-comments-section .comment-author { font-size: .85rem; font-weight: 600; }
.gl-comments-section .comment-author a { color: var(--gl-text); }
.gl-comments-section .comment-metadata { font-size: .73rem; color: var(--gl-muted); }
.gl-comments-section .comment-metadata a { color: var(--gl-muted); }
.gl-comments-section .comment-content p { font-size: .875rem; line-height: 1.6; margin-bottom: 0; }
.gl-comments-section .reply { margin-top: .35rem; }
.gl-comments-section .reply a { font-size: .78rem; color: var(--gl-accent); }
.gl-comments-section .children { list-style: none; padding: 0; margin: .75rem 0 0 2.5rem; }
.gl-comments-section .comment-respond { margin-top: 1.25rem; }
.gl-comments-section .comment-reply-title { font-size: .95rem; margin-bottom: .85rem; }
.gl-comments-section .comment-form textarea,
.gl-comments-section .comment-form input[type="text"],
.gl-comments-section .comment-form input[type="email"],
.gl-comments-section .comment-form input[type="url"] {
  width: 100%;
  padding: .6rem .85rem;
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-r);
  font-family: inherit;
  font-size: .875rem;
  background: var(--gl-s2);
  color: var(--gl-text);
  margin-bottom: .75rem;
  transition: border-color .15s, box-shadow .15s;
}
.gl-comments-section .comment-form textarea:focus,
.gl-comments-section .comment-form input:focus {
  outline: none;
  border-color: var(--gl-accent);
  box-shadow: 0 0 0 3px rgba(45,106,79,.1);
}
.gl-comments-section .comment-form textarea { min-height: 100px; resize: vertical; }
.gl-comments-section .form-submit input[type="submit"] {
  background: var(--gl-accent);
  color: #fff;
  border: none;
  padding: .5rem 1.2rem;
  border-radius: var(--gl-r);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.gl-comments-section .form-submit input[type="submit"]:hover { background: #235840; }

/* ─── SIDEBAR ────────────────────────────────────────────────────────────── */
.gl-sidebar {
  position: sticky;
  top: calc(var(--gl-nav-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.gl-widget {
  background: var(--gl-surface);
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-r);
  padding: 1rem 1.1rem;
  box-shadow: var(--gl-sh);
}
.gl-widget-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gl-muted);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--gl-border);
}

/* Reading progress */
.gl-reading-progress-track {
  height: 6px;
  background: var(--gl-s2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: .55rem;
}
.gl-reading-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gl-accent);
  border-radius: 3px;
  transition: width .15s linear;
}
.gl-reading-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .73rem;
  color: var(--gl-muted);
}

/* TOC widget */
.gl-toc-widget { overflow: hidden; }
.gl-toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .1rem; }
.gl-toc-list li a {
  display: block;
  font-size: .8rem;
  color: var(--gl-muted);
  padding: .3rem .5rem;
  border-radius: 4px;
  border-left: 2px solid transparent;
  line-height: 1.4;
  text-decoration: none;
  transition: color .15s, background .15s, border-color .15s;
}
.gl-toc-list li a:hover,
.gl-toc-list li.active > a {
  color: var(--gl-accent);
  background: var(--gl-alight);
  border-left-color: var(--gl-accent);
}
.gl-toc-list li.toc-h3 > a { padding-left: 1.1rem; font-size: .76rem; }

/* Recent posts */
.gl-recent-posts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .65rem; }
.gl-recent-post {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  text-decoration: none;
  color: var(--gl-text);
}
.gl-recent-post:hover { text-decoration: none; }
.gl-recent-post-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--gl-s2);
}
.gl-recent-post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gl-recent-post-title { font-size: .8rem; line-height: 1.35; font-weight: 500; margin-bottom: .15rem; }
.gl-recent-post:hover .gl-recent-post-title { color: var(--gl-accent); }
.gl-recent-post-date { font-size: .72rem; color: var(--gl-muted); }

/* Categories */
.gl-cat-list { list-style: none; padding: 0; margin: 0; }
.gl-cat-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .32rem .5rem;
  border-radius: 4px;
  font-size: .82rem;
  color: var(--gl-text);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.gl-cat-list li a:hover { background: var(--gl-s2); color: var(--gl-accent); }
.gl-cat-count {
  font-size: .7rem;
  color: var(--gl-muted);
  background: var(--gl-s2);
  border-radius: 999px;
  padding: .1rem .4rem;
  flex-shrink: 0;
}

/* ─── FOOTER — 4-COLUMN GRID ─────────────────────────────────────────────── */
.gl-footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.75rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
}
.gl-footer-brand { display: flex; flex-direction: column; gap: .65rem; }
.gl-footer-brand-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  color: var(--gl-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.gl-footer-brand-logo:hover { text-decoration: none; }
.gl-footer-brand-desc { font-size: .82rem; line-height: 1.6; max-width: 24ch; }

.gl-footer-col-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gl-text);
  margin-bottom: .85rem;
}

.gl-footer-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.gl-footer-nav ul li a { font-size: .83rem; }

.gl-footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gl-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .75rem;
}

/* ─── RESPONSIVE — SINGLE POST ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .gl-single-wrap { grid-template-columns: 1fr; }
  .gl-sidebar { position: static; }
  .gl-toc-widget { display: none; }
  .gl-reading-progress { display: none; }
}
@media (max-width: 640px) {
  .gl-related-grid { grid-template-columns: 1fr; }
  .gl-meta-bar { gap: .5rem .6rem; }
  .gl-meta-sep { display: none; }
  .entry-content .alignleft,
  .entry-content .alignright { float: none; max-width: 100%; margin: 1rem 0; }
  .gl-comments-section .children { margin-left: 1.25rem; }
}

/* ─── RESPONSIVE — FOOTER ────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .gl-footer-grid { grid-template-columns: 1fr 1fr; gap: 1.75rem; }
  .gl-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .gl-footer-grid { grid-template-columns: 1fr; }
}
