/* =====================================================================
   The Gentle Light — PHP Front (thegentlelight-hosting-world)
   Design tokens aligned with thegentlelight-web
   ===================================================================== */

/* ------------------------------------------------------------------
   1. Design Tokens (mirrors thegentlelight-web/src/styles/tokens.css)
   ------------------------------------------------------------------ */
:root {
  /* Background */
  --bg: #faf7f0;
  --surface: #FBF8F2;
  --surface-hover: #F3EEE6;

  /* Text */
  --text: #1F2A2E;
  --muted: #5B6B70;

  /* Border */
  --border: #E6DCCF;

  /* Accent */
  --accent: #2F6F6A;
  --accent-hover: #255E5A;
  --accent-foreground: #FBF8F2;
  --focus-ring: rgba(47, 111, 106, 0.3);

  /* Badge */
  --badge-tone-bg: #F1E9DC;
  --badge-info-bg: #FBF8F2;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 0.75rem;
  --spacing-lg: 1rem;
  --spacing-xl: 1.5rem;
  --spacing-2xl: 2rem;
  --spacing-3xl: 3rem;

  /* Border radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --font-weight-black: 900;

  /* Layout */
  --tgl-max: 1040px;
  --tgl-sidebar-width: 300px;
}

/* ------------------------------------------------------------------
   2. Reset & Base
   ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html {
  font-size: 16px;
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
}

body.tgl-body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text);
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------------
   3. Layout shell
   ------------------------------------------------------------------ */
.tgl-main {
  flex: 1;
  width: 100%;
  max-width: var(--tgl-max);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 40px) clamp(16px, 3vw, 24px) clamp(32px, 6vw, 64px);
}

/* ------------------------------------------------------------------
   4. Header
   ------------------------------------------------------------------ */
.tgl-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 240, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.tgl-header-inner {
  max-width: var(--tgl-max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tgl-logo {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-extrabold);
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.tgl-logo:hover {
  color: var(--accent);
}

/* Desktop nav */
.tgl-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.tgl-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text);
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
}

.tgl-nav a:hover {
  background: var(--surface-hover);
  color: var(--accent);
}

.tgl-nav a.tgl-nav-active {
  background: var(--surface-hover);
  font-weight: var(--font-weight-bold);
}

/* Hamburger button (mobile) */
.tgl-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tgl-hamburger-lines {
  width: 18px;
  height: 12px;
  position: relative;
  display: block;
}

.tgl-hamburger-lines::before,
.tgl-hamburger-lines::after,
.tgl-hamburger-lines span {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
  border-radius: var(--radius-full);
  transition: transform 200ms ease, opacity 200ms ease;
}

.tgl-hamburger-lines::before { top: 0; }
.tgl-hamburger-lines span    { top: 5px; }
.tgl-hamburger-lines::after  { bottom: 0; }

/* Mobile menu drawer */
.tgl-mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
}

.tgl-mobile-menu.tgl-mobile-menu--open {
  display: block;
}

.tgl-mobile-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 42, 46, 0.35);
}

.tgl-mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 90vw);
  background: var(--bg);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tgl-mobile-menu-close {
  align-self: flex-end;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: var(--font-size-sm);
  cursor: pointer;
  color: var(--text);
}

.tgl-mobile-menu-links {
  display: grid;
  gap: 0.5rem;
}

.tgl-mobile-menu-links a {
  display: block;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: border-color 120ms ease, background 120ms ease;
}

.tgl-mobile-menu-links a:hover {
  background: var(--surface-hover);
  border-color: rgba(0, 0, 0, 0.2);
}

@media (max-width: 640px) {
  .tgl-nav {
    display: none;
  }
  .tgl-hamburger {
    display: inline-flex;
  }
}

/* ------------------------------------------------------------------
   5. Footer
   ------------------------------------------------------------------ */
.tgl-footer {
  border-top: 1px solid var(--border);
  background: #f8f5ef;
  margin-top: auto;
}

.tgl-footer-inner {
  max-width: var(--tgl-max);
  margin: 0 auto;
  padding: 2rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tgl-footer-brand {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: var(--text);
}

.tgl-footer-tagline {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.tgl-footer-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.05);
}

.tgl-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tgl-footer-pill {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-sm);
  color: var(--text);
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.tgl-footer-pill:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
}

.tgl-footer-copyright {
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  text-align: center;
}

/* ------------------------------------------------------------------
   6. Page header / hero blocks
   ------------------------------------------------------------------ */
.tgl-page-header {
  margin-bottom: 1.5rem;
}

.tgl-page-header h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: var(--font-weight-black);
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.tgl-kicker {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-weight: var(--font-weight-extrabold);
}

.tgl-kicker a {
  color: var(--muted);
  text-decoration: none;
}

.tgl-kicker a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tgl-lead {
  color: var(--muted);
  line-height: var(--line-height-relaxed);
  max-width: 60ch;
  margin-bottom: 1rem;
}

/* Hero card (home) */
.tgl-hero-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(247,243,235,0.86));
  border-radius: 18px;
  padding: clamp(18px, 3.2vw, 28px);
  margin-bottom: 1.5rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.tgl-hero-card h1 {
  font-size: clamp(1.5rem, 3.6vw, 2.25rem);
  font-weight: var(--font-weight-black);
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

/* CTA row */
.tgl-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1rem;
}

/* ------------------------------------------------------------------
   7. Buttons
   ------------------------------------------------------------------ */
.tgl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
  white-space: nowrap;
  font-family: inherit;
}

.tgl-btn:hover {
  transform: translateY(-1px);
}

.tgl-btn:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.tgl-btn-primary {
  background: rgba(255,255,255,0.98);
  color: var(--text);
  border-color: rgba(0,0,0,0.2);
  box-shadow: 0 8px 24px rgba(31,42,46,0.1);
}

.tgl-btn-primary:hover {
  background: #fff;
  border-color: rgba(0,0,0,0.24);
}

.tgl-btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: rgba(0,0,0,0.18);
}

.tgl-btn-secondary:hover {
  background: var(--surface-hover);
  border-color: rgba(0,0,0,0.26);
}

.tgl-btn-ghost {
  color: var(--muted);
  border-color: var(--border);
  background: rgba(255,255,255,0.7);
}

.tgl-btn-ghost:hover {
  border-color: rgba(0,0,0,0.2);
  color: var(--text);
}

/* ------------------------------------------------------------------
   8. Section wrapper
   ------------------------------------------------------------------ */
.tgl-section {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 18px;
  padding: clamp(14px, 2.4vw, 22px);
  margin-bottom: 1.5rem;
}

.tgl-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tgl-section-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-black);
  letter-spacing: -0.01em;
}

.tgl-section-link {
  font-size: var(--font-size-sm);
  color: var(--muted);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.tgl-section-link:hover {
  color: var(--text);
}

/* ------------------------------------------------------------------
   9. Card list (columns list / quotes list)
   ------------------------------------------------------------------ */
.tgl-card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

/* Column card */
.tgl-card-link {
  display: block;
  padding: 0.9375rem 1rem 0.9375rem 1.125rem;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 6px 18px rgba(0,0,0,0.06);
  transition: box-shadow 140ms ease, transform 140ms ease;
}

.tgl-card-link:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 10px 26px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.tgl-card-link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Card with thumbnail layout */
.tgl-card-link-with-thumb {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.875rem;
}

.tgl-card-thumb {
  width: 140px;
  height: 92px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.04);
}

.tgl-card-link-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tgl-card-title {
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-base);
  line-height: var(--line-height-tight);
}

.tgl-card-meta {
  font-size: var(--font-size-sm);
  color: var(--muted);
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.tgl-card-excerpt {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #555;
  margin-top: 0.25rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
}

@media (max-width: 640px) {
  .tgl-card-link-with-thumb {
    flex-direction: column;
  }
  .tgl-card-thumb {
    width: 100%;
    height: 180px;
  }
}

/* ------------------------------------------------------------------
   10. Quote cards
   ------------------------------------------------------------------ */
.tgl-quote-card {
  display: block;
  padding: 1rem 1.5rem;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 6px 18px rgba(0,0,0,0.06);
  transition: box-shadow 140ms ease, transform 140ms ease;
}

.tgl-quote-card:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 10px 26px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.tgl-quote-card:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.tgl-quote-text {
  font-size: 1.05rem;
  line-height: 1.7;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.01em;
  color: var(--text);
  position: relative;
}

.tgl-quote-text::before {
  content: '\201C';
  margin-right: 0.1em;
  color: rgba(0,0,0,0.25);
}

.tgl-quote-text::after {
  content: '\201D';
  margin-left: 0.1em;
  color: rgba(0,0,0,0.25);
}

.tgl-quote-meta {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
}

.tgl-quote-author {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: rgba(0,0,0,0.65);
  text-align: right;
}

.tgl-quote-source {
  font-size: 0.78rem;
  color: rgba(0,0,0,0.45);
  text-align: right;
}

/* ------------------------------------------------------------------
   11. Column detail article
   ------------------------------------------------------------------ */
.tgl-article {
  max-width: 100%;
}

.tgl-article-header {
  border-bottom: 1px solid rgba(0,0,0,0.12);
  padding-bottom: 0.625rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.tgl-article-title {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: var(--font-weight-black);
  line-height: var(--line-height-tight);
  letter-spacing: -0.01em;
}

.tgl-article-meta {
  display: flex;
  gap: 0.625rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.625rem;
  color: var(--muted);
  font-size: var(--font-size-sm);
}

.tgl-column-cover {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 1rem;
  object-fit: cover;
}

/* Prose / body text */
.tgl-prose {
  font-size: 16px;
  line-height: 1.95;
  letter-spacing: 0.01em;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.tgl-prose p {
  margin: 0 0 0.875rem;
}

.tgl-prose strong {
  font-weight: var(--font-weight-black);
}

.tgl-prose em {
  font-style: italic;
}

.tgl-prose h2, .tgl-prose h3 {
  margin: 1.375rem 0 0.625rem;
  line-height: var(--line-height-tight);
  letter-spacing: -0.01em;
}

.tgl-prose h2 { font-size: 1.25em; }
.tgl-prose h3 { font-size: 1.12em; }

.tgl-prose ul, .tgl-prose ol {
  margin: 0 0 0.875rem;
  padding-left: 1.25rem;
}

.tgl-prose li {
  margin: 0.375rem 0;
}

.tgl-prose blockquote {
  margin: 1rem 0;
  padding: 0.625rem 0.75rem;
  border-left: 4px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.03);
  border-radius: var(--radius-lg);
  color: rgba(0,0,0,0.78);
}

.tgl-prose hr {
  border: 0;
  margin: 1.125rem 0;
  border-top: 1px dotted rgba(0,0,0,0.14);
}

.tgl-prose a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(0,0,0,0.35);
  text-underline-offset: 3px;
}

.tgl-prose a:hover {
  text-decoration-color: rgba(0,0,0,0.7);
}

.tgl-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
  padding: 0.15em 0.35em;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.05);
}

.tgl-prose pre {
  margin: 0.875rem 0;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.08);
}

.tgl-prose pre code {
  padding: 0;
  background: transparent;
}

/* ------------------------------------------------------------------
   12. Quote detail
   ------------------------------------------------------------------ */
.tgl-quote-detail-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  padding: 0.9375rem 0.9375rem 0.9375rem 1.125rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 6px 18px rgba(0,0,0,0.06);
  margin-bottom: 0.875rem;
}

.tgl-quote-block {
  margin: 0.625rem 0 0;
  padding: 0.875rem 0.875rem 0.875rem 1rem;
  border-left: 4px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.03);
  border-radius: var(--radius-md);
}

.tgl-quote-block p, .tgl-quote-block-text {
  margin: 0;
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.85;
  letter-spacing: 0.01em;
  color: var(--text);
  font-weight: var(--font-weight-black);
  white-space: pre-wrap;
}

.tgl-quote-note-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 1.125rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 6px 18px rgba(0,0,0,0.06);
  margin-top: 0.875rem;
}

.tgl-quote-note-title {
  margin: 0 0 0.625rem;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-black);
}

.tgl-quote-note-body {
  color: var(--text);
  opacity: 0.9;
  line-height: 1.9;
  font-size: 16px;
  white-space: pre-wrap;
}

/* ------------------------------------------------------------------
   13. Badges / Pills / Tags
   ------------------------------------------------------------------ */
.tgl-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.625rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0,0,0,0.18);
  font-size: 0.82rem;
  color: var(--text);
  background: rgba(255,255,255,0.6);
  text-decoration: none;
  white-space: nowrap;
}

.tgl-pill:hover {
  border-color: rgba(0,0,0,0.28);
  background: rgba(0,0,0,0.02);
}

.tgl-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0.0625rem 0.5rem;
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--muted);
}

/* ------------------------------------------------------------------
   14. Back navigation
   ------------------------------------------------------------------ */
.tgl-back-link {
  display: inline-block;
  font-size: var(--font-size-sm);
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 0.75rem;
}

.tgl-back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--text);
}

.tgl-bottom-nav {
  margin-top: 1.125rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------
   15. Filter form
   ------------------------------------------------------------------ */
.tgl-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem 0.875rem;
  align-items: flex-end;
  margin-top: 0.875rem;
}

.tgl-filter-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: var(--font-size-sm);
  color: var(--muted);
  font-weight: var(--font-weight-medium);
}

.tgl-filter-label input,
.tgl-filter-label select {
  min-width: 10rem;
  padding: 0.4375rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--font-size-sm);
  background: #fff;
  color: var(--text);
  transition: border-color 120ms ease;
}

.tgl-filter-label input:focus,
.tgl-filter-label select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ------------------------------------------------------------------
   16. Pagination
   ------------------------------------------------------------------ */
.tgl-pagination {
  margin-top: 1.25rem;
  display: flex;
  justify-content: center;
}

/* ------------------------------------------------------------------
   17. Home page sections
   ------------------------------------------------------------------ */
.tgl-home-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.tgl-home-section {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 18px;
  padding: clamp(14px, 2.4vw, 22px);
}

.tgl-home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.tgl-home-section-title {
  font-size: 1.1rem;
  font-weight: var(--font-weight-black);
  letter-spacing: -0.01em;
}

@media (min-width: 720px) {
  .tgl-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ------------------------------------------------------------------
   18. Inline links / muted text
   ------------------------------------------------------------------ */
.tgl-inline-link {
  color: var(--accent);
  text-decoration: none;
}

.tgl-inline-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tgl-muted {
  color: var(--muted);
}

.tgl-muted-note {
  color: var(--muted);
  font-size: var(--font-size-sm);
  margin: 0;
}

/* ------------------------------------------------------------------
   19. Error / status pages
   ------------------------------------------------------------------ */
.tgl-status-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: clamp(18px, 4vw, 36px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.tgl-status-page h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: var(--font-weight-black);
  letter-spacing: -0.02em;
  line-height: var(--line-height-tight);
}

.tgl-banner {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff8e6;
  font-size: var(--font-size-sm);
  color: var(--text);
  word-break: break-word;
}

.tgl-banner-detail {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  word-break: break-word;
}

/* ------------------------------------------------------------------
   20. Misc utilities
   ------------------------------------------------------------------ */
.tgl-article-aside {
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  border-left: 4px solid var(--accent);
  background: rgba(47, 111, 106, 0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--text);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}
