/* ==========================================================================
   The GaDangme — Design System
   Clean, white-first design with purple accent
   ========================================================================== */

:root {
  --primary: #7C3AED;
  --primary-dark: #6D28D9;
  --secondary: #3B82F6;
  --dark: #1E1B4B;
  --text: #1E293B;
  --text-light: #64748B;
  --bg: #FFFFFF;
  --bg-alt: #FDF8F0;
  --bg-warm: #FAF0E4;
  --border: #E2E8F0;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }

/* Focus indicators */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 999;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.5rem;
}

/* ==========================================================================
   Layout
   ========================================================================== */

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

.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-warm {
  background: var(--bg-warm);
}

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-cta {
  text-align: center;
  margin-top: 2.5rem;
}


/* ==========================================================================
   Header
   ========================================================================== */

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-size: 1.25rem;
}

.logo-img {
  height: 36px;
  width: auto;
}

.logo-text strong {
  color: var(--primary);
}

.site-nav > ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.site-nav a {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--primary);
}

/* Dropdown menus */
.has-dropdown {
  position: relative;
}

.has-dropdown > a {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dropdown-arrow {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
  margin-top: 0.75rem;
  z-index: 200;
  flex-direction: column;
  gap: 0;
}

.dropdown::before {
  content: '';
  position: absolute;
  top: -0.75rem;
  left: 0;
  right: 0;
  height: 0.75rem;
}

.dropdown li {
  display: block;
}

.dropdown a {
  display: block;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 400;
  white-space: nowrap;
}

.dropdown a:hover {
  background: var(--bg-alt);
  color: var(--primary);
}

.has-dropdown:hover > .dropdown {
  display: flex;
}

.has-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.has-dropdown.kb-open > .dropdown {
  display: flex;
}

.has-dropdown.kb-open .dropdown-arrow {
  transform: rotate(180deg);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 20px;
  position: relative;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  position: absolute;
  left: 0;
  transition: 0.3s;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 9px; }
.menu-toggle span:nth-child(3) { top: 18px; }
.menu-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius);
}


/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  padding: 8rem 0 7rem;
  text-align: center;
  background-color: var(--dark);
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-images {
  position: absolute;
  inset: 0;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.hero-img.active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--dark);
  opacity: 0.75;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  color: #fff;
}

.hero .text-accent {
  color: #fff;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 620px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}


/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}


/* ==========================================================================
   Grids
   ========================================================================== */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}


/* ==========================================================================
   Article Cards
   ========================================================================== */

.card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

@media (hover: hover) {
  .card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
  }
}

.card-image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.card-title a {
  color: var(--text);
  text-decoration: none;
}
.card-title a:hover {
  color: var(--primary);
}

.card-date {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.card-excerpt {
  color: var(--text-light);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

.card-link {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--primary);
}
.card-link:hover {
  color: var(--primary-dark);
}

/* ==========================================================================
   Magazine Layout (Homepage Featured)
   ========================================================================== */

.magazine-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.magazine-card-large {
  grid-row: 1;
}

.magazine-card-large .magazine-card-image {
  display: block;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 100%;
  min-height: 400px;
  text-decoration: none;
  color: #fff;
}

.magazine-card-large .magazine-card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.magazine-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.1) 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  z-index: 1;
}

.magazine-card-overlay h3 {
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.magazine-card-overlay p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.magazine-card-overlay .badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  backdrop-filter: blur(4px);
}

.magazine-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.magazine-card-small {
  display: flex;
  gap: 1rem;
  background: var(--bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s, transform 0.2s;
}

@media (hover: hover) {
  .magazine-card-small:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }
}

.magazine-card-small-image {
  flex-shrink: 0;
  width: 200px;
}

.magazine-card-small-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.magazine-card-small-body {
  padding: 1.25rem 1.25rem 1.25rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.magazine-card-small-body h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.5rem;
}

.magazine-card-small-body h3 a {
  color: var(--text);
  text-decoration: none;
}
.magazine-card-small-body h3 a:hover {
  color: var(--primary);
}

.magazine-card-small-body p {
  font-size: 0.875rem;
  color: var(--text-light);
  line-height: 1.5;
}

.magazine-card-small-body .card-meta {
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Honour List Cards
   ========================================================================== */

.honour-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

@media (hover: hover) {
  .honour-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
  }
}

.honour-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  border: 3px solid var(--border);
}

.honour-photo--placeholder {
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-light);
}

.honour-name {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.honour-role {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

/* Honour Feature (homepage single profile) */
.honour-feature {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
}

.honour-feature-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 3px solid var(--border);
}

.honour-feature-photo--placeholder {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 700;
  color: var(--text-light);
  border-radius: var(--radius-lg);
  border: 3px solid var(--border);
  aspect-ratio: 3 / 4;
}

.honour-feature-body h3 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.honour-feature-role {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 1rem;
}

.honour-feature-excerpt {
  font-size: 1.0625rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .honour-feature {
    grid-template-columns: 1fr;
    text-align: center;
    max-width: 400px;
  }

  .honour-feature-photo,
  .honour-feature-photo--placeholder {
    max-width: 240px;
    margin: 0 auto;
  }
}

/* ==========================================================================
   Page Header (list pages)
   ========================================================================== */

.page-header {
  padding: 3rem 0 2rem;
  text-align: center;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.page-header p {
  color: var(--text-light);
  margin-top: 0.5rem;
  font-size: 1.0625rem;
}


/* ==========================================================================
   External Link Posts
   ========================================================================== */

.external-icon {
  vertical-align: -2px;
  margin-left: 0.25rem;
  opacity: 0.5;
}

.card-excerpt-url {
  font-size: 0.8125rem;
  word-break: break-all;
}

.external-link-box {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.external-link-box p:first-child {
  font-size: 1.0625rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}

.external-link-box .btn {
  margin-bottom: 1rem;
}

.external-link-box .btn svg {
  vertical-align: -2px;
}

.external-link-url {
  font-size: 0.8125rem;
  color: var(--text-light);
  word-break: break-all;
}


/* ==========================================================================
   Section Landing Pages
   ========================================================================== */

.section-hero {
  padding: 4rem 0 3rem;
  text-align: center;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.section-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.section-hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

.subcategory-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  text-decoration: none;
  color: var(--text);
}

@media (hover: hover) {
  .subcategory-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--text);
  }
}

.subcategory-icon {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.subcategory-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.subcategory-card p {
  font-size: 0.875rem;
  color: var(--text-light);
  line-height: 1.6;
}

.subcategory-card-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  text-align: left;
  gap: 1.5rem;
  padding: 2.5rem;
}

.subcategory-card-featured .subcategory-icon {
  font-size: 3rem;
  margin-bottom: 0;
}

.subcategory-card-featured h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.subcategory-count {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  .subcategory-card-featured {
    grid-template-columns: 1fr;
    text-align: center;
  }
}


/* ==========================================================================
   Article (single post)
   ========================================================================== */

/* Hero banner (posts with featured image) */
.article-hero-banner {
  position: relative;
  min-height: 400px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}

.article-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3));
  display: flex;
  align-items: flex-end;
  padding: 3rem 0;
}

.article-hero-overlay .container {
  position: relative;
  z-index: 1;
}

.article-hero-overlay h1 {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.article-hero-overlay .article-info {
  color: rgba(255, 255, 255, 0.85);
}

.article-hero-overlay .article-meta {
  margin-bottom: 1rem;
}

.badge-light {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  text-decoration: none;
  backdrop-filter: blur(4px);
}

.badge-light:hover {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
}

/* Fallback header (posts without featured image) */
.article-header {
  padding: 3rem 0 2rem;
  text-align: center;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.article-meta {
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 100px;
  background: rgba(124, 58, 237, 0.08);
  color: var(--primary);
  text-decoration: none;
}

.badge:hover {
  background: var(--primary);
  color: #fff;
}

.article-info {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-top: 1rem;
}

.article-content {
  padding: 2.5rem 0 4rem;
  font-size: 1.0625rem;
  line-height: 1.8;
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content ol,
.article-content ul {
  margin-bottom: 1.5rem;
  padding-left: 1.25rem;
}

.article-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.article-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-content img {
  border-radius: var(--radius);
  margin: 2rem 0;
}

.article-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--bg-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
  font-size: 1.0625rem;
}

/* Responsive embeds */
.embed-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  margin: 2rem 0;
}

.embed-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius);
}

.soundcloud-embed {
  margin: 2rem 0;
}

.soundcloud-embed iframe {
  border: 0;
  border-radius: var(--radius);
}

/* Hero banner responsive */
@media (max-width: 768px) {
  .article-hero-banner {
    min-height: 280px;
  }

  .article-hero-overlay {
    padding: 2rem 0;
  }

  .article-hero-overlay h1 {
    font-size: 1.5rem;
  }
}


/* ==========================================================================
   Footer CTA
   ========================================================================== */

.footer-cta {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-cta h3 {
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.footer-cta p {
  color: #CBD5E1;
  font-size: 1.0625rem;
  max-width: 560px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--dark);
  color: #CBD5E1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  padding-top: 3rem;
}

.footer-brand .logo-text {
  color: #fff;
  font-size: 1.25rem;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.footer-brand .logo-text strong {
  color: #A78BFA;
}

.footer-brand p {
  font-size: 0.9375rem;
  line-height: 1.6;
}

.footer-links h4 {
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #CBD5E1;
  font-size: 0.9375rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #fff;
}

.site-footer a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.5rem 0;
  margin-top: 3rem;
  font-size: 0.8125rem;
  text-align: center;
}


/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  list-style: none;
}

.page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.page-item a,
.page-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}

.page-item:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.page-item:hover a,
.page-item:hover span {
  color: #fff;
}

.page-item.active {
  background: var(--primary);
  border-color: var(--primary);
}

.page-item.active a,
.page-item.active span {
  color: #fff;
}

.page-item.disabled {
  opacity: 0.4;
  pointer-events: none;
}


/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .hero { padding: 5rem 0 4rem; min-height: 400px; }
  .section { padding: 3.5rem 0; }

  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }

  .magazine-grid { grid-template-columns: 1fr; }
  .magazine-card-large .magazine-card-image { min-height: 300px; }
  .magazine-card-small { flex-direction: column; }
  .magazine-card-small-image { width: 100%; height: 180px; }
  .magazine-card-small-image img { height: 180px; }
  .magazine-card-small-body { padding: 1.25rem; }

  /* Mobile nav */
  .menu-toggle { display: block; }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.5rem;
  }

  .site-nav.open { display: block; }

  .site-nav > ul {
    flex-direction: column;
    gap: 0;
  }

  .site-nav a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .has-dropdown > a {
    justify-content: space-between;
  }

  .dropdown {
    position: static;
    transform: none;
    border: none;
    box-shadow: none;
    margin-top: 0;
    padding: 0;
    display: none;
    min-width: 0;
  }

  .dropdown::before {
    display: none;
  }

  .has-dropdown.open > .dropdown {
    display: flex;
  }

  .has-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
  }

  .has-dropdown:hover > .dropdown {
    display: none;
  }

  .has-dropdown.kb-open > .dropdown {
    display: none;
  }

  .has-dropdown.open.kb-open > .dropdown {
    display: flex;
  }

  .has-dropdown.open:hover > .dropdown {
    display: flex;
  }

  .dropdown a {
    padding: 0.5rem 0 0.5rem 1.25rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 480px) {
  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }
}


/* ==========================================================================
   Directory
   ========================================================================== */

.directory-controls {
  margin-bottom: 2rem;
}

.directory-search {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 1rem;
}

.directory-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.directory-filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.filter-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  align-self: center;
}

.filter-btn {
  padding: 0.375rem 0.875rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg);
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.filter-select {
  padding: 0.375rem 2rem 0.375rem 0.875rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg);
  color: var(--text-light);
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.directory-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (hover: hover) {
  .directory-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
  }
}

.directory-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.directory-card-badges {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.badge-outline {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 100px;
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
}

.badge-association {
  background: rgba(5, 150, 105, 0.08);
  color: #059669;
  border-color: rgba(5, 150, 105, 0.2);
}

.directory-card-title {
  font-size: 1.0625rem;
  margin-bottom: 0.5rem;
}

.directory-card-title a {
  color: var(--text);
  text-decoration: none;
}

.directory-card-title a:hover {
  color: var(--primary);
}

.directory-card-address {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.directory-card .card-link {
  margin-top: auto;
  padding-top: 0.75rem;
}

.directory-result-count {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.directory-no-results {
  text-align: center;
  color: var(--text-light);
  padding: 3rem 0;
  font-size: 1.0625rem;
}

.no-results-box {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-light);
}

.no-results-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.no-results-box p {
  margin-bottom: 0.5rem;
}

.no-results-box .no-results-hint {
  font-size: 0.875rem;
}

.no-results-box .btn {
  margin-top: 1rem;
}

/* Directory single page */
.directory-hero-image {
  border-radius: var(--radius-lg);
  margin-top: 1.5rem;
}

.directory-info {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem 0;
}

.directory-info h2 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
}

.directory-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
}

.directory-details dt {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-light);
}

.directory-details dd {
  font-size: 0.9375rem;
  word-break: break-word;
}

@media (max-width: 1024px) {
  .directory-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .directory-grid { grid-template-columns: 1fr; }
  .directory-filters { flex-direction: column; }
  .filter-divider { width: 100%; height: 1px; }
  .directory-details { grid-template-columns: 1fr; gap: 0.25rem 0; }
  .directory-details dt { margin-top: 0.75rem; }
  .directory-details dt:first-child { margin-top: 0; }
}

/* Book grid & cards */
.book-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.book-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.2s;
}

.book-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.book-card-cover {
  flex-shrink: 0;
  width: 100px;
}

.book-card-cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.12);
}

.book-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.book-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.book-card-author {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.book-card-desc {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.book-card-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.book-link {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
}

.book-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

@media (max-width: 1024px) {
  .book-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .book-card { padding: 1rem; gap: 1rem; }
  .book-card-cover { width: 80px; }
}

/* ============================================
   Events
   ============================================ */

/* Filter */
.events-filter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.events-filter__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light, #666);
}
.events-filter__select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: var(--bg);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  cursor: pointer;
}

/* Section headings */
.events-section__heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 1rem;
}
.events-section__heading--past {
  color: var(--text-light);
}

/* Event row */
.events-list {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}
.event-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s;
}
.event-row:last-child {
  border-bottom: none;
}
.event-row:hover {
  background-color: rgba(124, 58, 237, 0.03);
}
.event-row--past {
  opacity: 0.7;
}
.event-row--past:hover {
  opacity: 1;
}
.event-row__date {
  text-align: center;
  min-width: 48px;
  padding-top: 2px;
  flex-shrink: 0;
}
.event-row__day {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.event-row--past .event-row__day {
  color: var(--text-light);
}
.event-row__month {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-light);
}
.event-row__content {
  flex: 1;
  min-width: 0;
}
.event-row__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  line-height: 1.3;
}
.event-row__meta {
  font-size: 0.8rem;
  color: var(--text-light);
}
.event-row__excerpt {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 0.4rem 0 0;
  line-height: 1.4;
}
.event-row__chevron {
  color: var(--border);
  font-size: 1.2rem;
  padding-top: 4px;
  flex-shrink: 0;
}

/* Past events toggle */
.events-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 0.75rem;
}
.events-toggle:hover {
  color: var(--text-light);
}
.events-toggle__chevron {
  transition: transform 0.2s;
}
.events-toggle[aria-expanded="true"] .events-toggle__chevron {
  transform: rotate(90deg);
}

/* Past events list — hidden by default */
.events-list--past {
  display: none;
}
.events-list--past.events-list--visible {
  display: block;
}
.events-section--past {
  margin-top: 2rem;
}

/* Empty state */
.events-empty {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 2rem;
}
.events-empty__icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}
.events-empty__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.events-empty__text {
  color: var(--text-light);
  font-size: 0.9rem;
  margin: 0;
}

/* === Single Event Page === */

/* Past event banner */
.event-banner--past {
  background: var(--bg-alt);
  color: var(--text-light);
  font-size: 0.85rem;
  padding: 0.6rem 0;
  text-align: center;
}

/* Event header */
.event-header {
  padding: 2.5rem 0 0;
}
.event-header__inner {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.event-header__badge {
  background: var(--primary);
  color: var(--bg);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  text-align: center;
  min-width: 72px;
  flex-shrink: 0;
}
.event-header__day {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}
.event-header__month {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  opacity: 0.9;
  margin-top: 0.15rem;
}
.event-header__info h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}
.event-header__meta {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.4rem;
}

/* Action buttons */
.event-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Divider */
.event-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.75rem 0;
}

/* Responsive */
@media (max-width: 640px) {
  .event-header__inner {
    gap: 1rem;
  }
  .event-header__badge {
    min-width: 60px;
    padding: 0.6rem 0.75rem;
  }
  .event-header__day {
    font-size: 1.5rem;
  }
  .event-header__info h1 {
    font-size: 1.35rem;
  }
}

/* Documents listing */
.documents-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.documents-search {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  width: 100%;
  max-width: 25rem;
  font-family: inherit;
}

.documents-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.documents-result-count {
  font-size: 0.875rem;
  color: var(--text-light);
  margin: 0;
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.document-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease;
}

.document-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.document-card-thumb {
  width: 4.5rem;
  height: 6rem;
  background: var(--bg-alt);
  border-radius: 0.25rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  overflow: hidden;
}

.document-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.document-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.document-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.document-card-title {
  margin: 0 0 0.125rem;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--text);
}

.document-card-author {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  color: var(--text-light);
}

.document-card-desc {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.document-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.document-card-pages {
  font-size: 0.6875rem;
  color: var(--text-light);
}

.document-card-link {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 500;
}

/* Document detail page */
.document-title {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  line-height: 1.2;
}

.document-author {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  color: var(--text-light);
}

.document-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.document-description {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-bottom: 1.5rem;
}

.document-description p {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.7;
  margin: 0;
}

.document-cover {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.document-cover img {
  width: 100%;
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .documents-grid {
    grid-template-columns: 1fr;
  }
}

/* Breadcrumb
   ========================================================================== */

.breadcrumb {
  padding: 1rem 0;
  border-bottom: 1px solid var(--bg-alt);
}

.breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-size: 0.8125rem;
  padding: 0;
  margin: 0;
}

.breadcrumb-list li:not(:last-child)::after {
  content: "/";
  color: var(--border);
  margin: 0 0.5rem;
}

.breadcrumb-list a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb-list a:hover {
  text-decoration: underline;
}

.breadcrumb-current {
  color: var(--text-light);
}

/* Search
   ========================================================================== */

.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.search-toggle:hover {
  color: var(--primary);
}

/* ==========================================================================
   Homepage — Directory Teaser
   ========================================================================== */

.directory-teaser {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.25rem;
}

.directory-teaser .directory-card {
  min-height: 0;
}

@media (max-width: 768px) {
  .directory-teaser {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Homepage — Documents Highlight
   ========================================================================== */

.documents-highlight {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .documents-highlight {
    grid-template-columns: 1fr;
  }
}

.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 16px 16px;
}

.search-modal.open {
  display: flex;
}

.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.search-modal-content {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 40px 24px 24px;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.search-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
}

.search-modal-close:hover {
  color: var(--text);
}

/* Pagefind UI overrides */
:root {
  --pagefind-ui-scale: 0.9;
  --pagefind-ui-primary: var(--primary);
  --pagefind-ui-text: var(--text);
  --pagefind-ui-background: var(--bg);
  --pagefind-ui-border: var(--border);
  --pagefind-ui-tag: var(--bg-alt);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: var(--radius);
  --pagefind-ui-font: 'Inter', system-ui, -apple-system, sans-serif;
}
