/* ==========================================================================
   WIKIMEDIA SMALL PROJECTS (Wiki SP) - HEADER & FOOTER UNIFIED STYLES
   Pure Vanilla CSS - Standalone, Scoped, Zero Dependencies
   ========================================================================== */

/* 0. MATERIAL SYMBOLS OUTLINED (WebFont Definition) */
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 100 700;
  src: url('fonts/material-symbols-outlined.woff2') format('woff2'),
       url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v372/kJEhBvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oFsI.woff2) format('woff2');
  font-display: swap;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'liga';
}

/* 1. DESIGN TOKENS */
:root {
  --color-primary: #004d75;
  --color-primary-container: #006699;
  --color-on-primary: #ffffff;
  --color-brand-blue-hover: #00527c;
  --color-brand-blue-subtle: #ebf4f9;

  --color-secondary: #0d6d2b;
  --color-secondary-container: #9ef7a4;
  --color-on-secondary: #ffffff;
  --color-brand-green-subtle: #edf7f0;

  --color-surface-base: #f8f9fa;
  --color-surface-card: #ffffff;
  --color-on-surface: #1b1c1d;
  --color-on-surface-variant: #40484f;
  --color-outline: #707880;
  --color-border-subtle: #eaecf0;

  --font-family-display: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 2. BODY / PAGE OFFSET FOR FIXED HEADER */
body:not(.home) #page,
body.blog #page,
body.single #page,
body.page #page,
body.archive #page,
body.search #page,
body.error404 #page {
  padding-top: 4rem;
}

/* Admin bar compatibility */
body.admin-bar .wikisp-header {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .wikisp-header {
    top: 46px;
  }
}

/* 3. HEADER COMPONENT */
.wikisp-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4rem;
  z-index: 999;
  background-color: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
  transition: background-color 0.2s ease;
  box-sizing: border-box;
}

.wikisp-header *,
.wikisp-header *::before,
.wikisp-header *::after,
.wikisp-footer *,
.wikisp-footer *::before,
.wikisp-footer *::after {
  box-sizing: border-box;
}

.wikisp-header-inner {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wikisp-logo-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.wikisp-logo-wrap a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.wikisp-logo-img,
.wikisp-logo-wrap img,
.wikisp-logo-wrap .custom-logo {
  height: 2rem !important;
  max-height: 2rem !important;
  width: auto !important;
  max-width: 100% !important;
  display: block !important;
  object-fit: contain !important;
}

.wikisp-nav-desktop {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .wikisp-nav-desktop {
    display: flex;
  }
}

.wikisp-nav-link {
  font-family: var(--font-family-body);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-on-surface-variant);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.wikisp-nav-link:hover {
  color: var(--color-on-surface);
}

.wikisp-nav-link.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.wikisp-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.wikisp-btn-participate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 1rem;
  border-radius: 0.5rem;
  background-color: var(--color-primary-container);
  color: var(--color-on-primary) !important;
  font-family: var(--font-family-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.wikisp-btn-participate:hover {
  background-color: var(--color-brand-blue-hover);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: var(--color-on-primary) !important;
}

.wikisp-user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background-color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.wikisp-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-on-surface);
  border-radius: 0.375rem;
}

@media (min-width: 768px) {
  .wikisp-mobile-toggle {
    display: none;
  }
}

.wikisp-mobile-drawer {
  display: none;
  position: absolute;
  top: 4rem;
  left: 0;
  width: 100%;
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-border-subtle);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  padding: 1rem 1.5rem 1.5rem;
  flex-direction: column;
  gap: 0.5rem;
}

.wikisp-mobile-drawer.is-open {
  display: flex;
}

.wikisp-mobile-link {
  font-family: var(--font-family-body);
  font-size: 1rem;
  color: var(--color-on-surface-variant);
  text-decoration: none;
  padding: 0.625rem 0.5rem;
  border-bottom: 1px solid var(--color-border-subtle);
  display: block;
}

.wikisp-mobile-link.is-active {
  color: var(--color-primary);
  font-weight: 600;
  border-left: 3px solid var(--color-primary);
  background-color: var(--color-brand-blue-subtle);
}

.wikisp-mobile-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.75rem;
}

/* 4. FOOTER COMPONENT */
.wikisp-footer {
  width: 100%;
  background-color: var(--color-surface-card);
  border-top: 1px solid var(--color-border-subtle);
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.03);
  margin-top: 3rem;
}

.wikisp-footer-inner {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding: 3rem 1.5rem 2rem;
}

.wikisp-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

@media (min-width: 768px) {
  .wikisp-footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
  }
}

.wikisp-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wikisp-footer-logo {
  height: 2.25rem;
  width: auto;
  display: inline-block;
  object-fit: contain;
}

.wikisp-footer-desc {
  font-family: var(--font-family-body);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-on-surface-variant);
  max-width: 28rem;
  margin: 0;
}

.wikisp-footer-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.wikisp-badge-blue {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  background-color: var(--color-brand-blue-subtle);
  color: var(--color-primary);
  font-family: var(--font-family-body);
  font-size: 0.75rem;
  font-weight: 600;
}

.wikisp-badge-green {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  background-color: var(--color-brand-green-subtle);
  color: var(--color-secondary);
  font-family: var(--font-family-body);
  font-size: 0.75rem;
  font-weight: 600;
}

.wikisp-footer-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wikisp-footer-title {
  font-family: var(--font-family-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-on-surface);
  margin: 0;
}

.wikisp-footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wikisp-footer-links li {
  margin: 0;
  padding: 0;
}

.wikisp-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-family-body);
  font-size: 0.875rem;
  color: var(--color-on-surface-variant);
  text-decoration: none;
  transition: color 0.15s ease;
}

.wikisp-footer-link:hover {
  color: var(--color-primary);
}

.wikisp-footer-link .material-symbols-outlined {
  font-size: 18px !important;
  color: inherit;
  flex-shrink: 0;
}

.wikisp-footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .wikisp-footer-bottom {
    flex-direction: row;
  }
}

.wikisp-footer-legal {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-family: var(--font-family-body);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-on-surface-variant);
  text-align: center;
}

.wikisp-footer-legal p {
  margin: 0 !important;
  padding: 0 !important;
}

.wikisp-footer-legal p + p {
  margin-top: 0.375rem !important;
}

.wikisp-footer-copyright,
.wikisp-footer-legal p:not(.wikisp-footer-trademark) {
  font-family: var(--font-family-body) !important;
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
  font-weight: 400 !important;
  color: var(--color-on-surface-variant) !important;
}

@media (min-width: 768px) {
  .wikisp-footer-legal {
    text-align: left;
  }
}

.wikisp-footer-legal a {
  color: var(--color-primary);
  text-decoration: underline;
}

.wikisp-footer-legal a:hover {
  color: var(--color-brand-blue-hover);
}

.wikisp-footer-trademark {
  font-family: var(--font-family-body) !important;
  font-size: 0.75rem !important;
  line-height: 1rem !important;
  color: var(--color-outline) !important;
}

.wikisp-footer-partner {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.wikisp-footer-partner img,
.footer-partner-img {
  height: 2.7rem !important;
  width: auto !important;
  max-width: 100%;
  display: block;
  object-fit: contain;
}

/* 9. BLOG INDEX & FILTERS MODERN STYLES */
.wdb-banner {
  display: none !important;
}

.wdb-blog-index {
  padding-top: 1.5rem;
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
}

.wdb-blog-index,
.wdb-blog-index * {
  font-family: var(--font-family-body) !important;
  box-sizing: border-box;
}

/* Filter Toggle Button */
.wdb-filters {
  margin-bottom: 2rem;
}

.wdb-filters__toggle {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.5rem 1rem !important;
  border-radius: 0.5rem !important;
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  cursor: pointer !important;
  color: var(--color-primary, #0066cc) !important;
  font-family: var(--font-family-body) !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  line-height: 1.25rem !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.wdb-filters__toggle:hover {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: var(--color-brand-blue-hover, #0052a3) !important;
}

.wdb-filters__toggle-lead-icon {
  font-size: 1.125rem !important;
  color: var(--color-primary, #0066cc) !important;
}

.wdb-filters__toggle-icon {
  font-size: 1.125rem !important;
  color: #64748b !important;
  transition: transform 0.2s ease !important;
}

.wdb-filters__toggle[aria-expanded="true"] .wdb-filters__toggle-icon {
  transform: rotate(180deg) !important;
}

.wdb-filters__active-badge {
  color: #0066cc !important;
  font-size: 0.625rem !important;
}

/* Filter Panel */
.wdb-filters__panel {
  margin-top: 0.875rem;
  padding: 1.5rem;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.wdb-filters__panel[hidden] {
  display: none !important;
}

.wdb-filters__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wdb-filters__row {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wdb-filters__group-label {
  display: block !important;
  font-family: var(--font-family-body) !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: #475569 !important;
  margin-bottom: 0.625rem !important;
}

/* Category Pills */
.wdb-filters__cat-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
}

.wdb-filters__cat-list li {
  margin: 0 !important;
  padding: 0 !important;
}

.wdb-filters__cat-item {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.375rem !important;
  padding: 0.375rem 0.75rem !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 9999px !important;
  font-family: var(--font-family-body) !important;
  font-size: 0.8125rem !important;
  line-height: 1.25rem !important;
  color: #334155 !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.wdb-filters__cat-item input[type='checkbox'] {
  accent-color: var(--color-primary, #0066cc) !important;
  width: 0.875rem !important;
  height: 0.875rem !important;
  margin: 0 !important;
  cursor: pointer !important;
}

.wdb-filters__cat-item:hover {
  border-color: var(--color-primary, #0066cc) !important;
  background-color: #f0f7ff !important;
  color: var(--color-primary, #0066cc) !important;
}

.wdb-filters__cat-item--active,
.wdb-filters__cat-item:has(input:checked) {
  border-color: var(--color-primary, #0066cc) !important;
  background-color: #eff6ff !important;
  color: var(--color-primary, #0066cc) !important;
  font-weight: 600 !important;
}

/* Search Bar */
.wdb-filters__group--search {
  max-width: 24rem;
}

.wdb-filters__search-row {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}

.wdb-filters__search-icon {
  position: absolute !important;
  left: 0.75rem !important;
  font-size: 1.125rem !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
}

.wdb-filters__search-input {
  width: 100% !important;
  height: 2.375rem !important;
  padding: 0.5rem 0.875rem 0.5rem 2.375rem !important;
  font-family: var(--font-family-body) !important;
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
  color: #1e293b !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  outline: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  box-sizing: border-box !important;
}

.wdb-filters__search-input:focus {
  border-color: var(--color-primary, #0066cc) !important;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15) !important;
}

.wdb-filters__search-input::placeholder {
  color: #94a3b8 !important;
  font-family: var(--font-family-body) !important;
  font-size: 0.875rem !important;
}

/* Actions */
.wdb-filters__actions {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  margin-top: 0.5rem !important;
  padding-top: 1rem !important;
  border-top: 1px solid #e2e8f0 !important;
}

.wdb-filters__submit {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.5rem 1.25rem !important;
  border-radius: 0.5rem !important;
  border: none !important;
  background-color: var(--color-primary, #0066cc) !important;
  color: #ffffff !important;
  font-family: var(--font-family-body) !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  line-height: 1.25rem !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transition: background-color 0.15s ease, box-shadow 0.15s ease !important;
  text-decoration: none !important;
}

.wdb-filters__submit:hover {
  background-color: var(--color-brand-blue-hover, #0052a3) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  color: #ffffff !important;
}

.wdb-filters__clear {
  display: inline-flex !important;
  align-items: center !important;
  font-family: var(--font-family-body) !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  color: #64748b !important;
  text-decoration: none !important;
  padding: 0.375rem 0.625rem !important;
  border-radius: 0.375rem !important;
  transition: color 0.15s ease, background-color 0.15s ease !important;
}

.wdb-filters__clear:hover {
  color: #dc2626 !important;
  background-color: #fef2f2 !important;
}

/* 10. BLOG POST CARDS MODERN STYLES */
.wdb-post-list {
  display: flex !important;
  flex-direction: column !important;
}

.wdb-post-card {
  padding: 2rem 0 !important;
  font-family: var(--font-family-body) !important;
}

.wdb-post-card:first-child {
  padding-top: 0.5rem !important;
}

.wdb-post-card__image-link {
  display: block !important;
  margin-bottom: 1.25rem !important;
  border-radius: 0.75rem !important;
  overflow: hidden !important;
}

.wdb-post-card__image {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  border-radius: 0.75rem !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}

.wdb-post-card__image-link:hover .wdb-post-card__image {
  transform: scale(1.01) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.wdb-post-card__title {
  font-family: var(--font-family-body) !important;
  font-size: 1.375rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  margin: 0 0 0.625rem !important;
}

.wdb-post-card__title a {
  color: var(--color-primary, #0056b3) !important;
  text-decoration: none !important;
  transition: color 0.15s ease !important;
}

.wdb-post-card__title a:hover {
  color: var(--color-brand-blue-hover, #0052a3) !important;
  text-decoration: underline !important;
}

.wdb-post-card__excerpt {
  font-family: var(--font-family-body) !important;
  font-size: 0.9375rem !important;
  line-height: 1.6 !important;
  color: #334155 !important;
  margin: 0 0 0.875rem !important;
}

.wdb-post-card__meta {
  font-family: var(--font-family-body) !important;
  font-size: 0.8125rem !important;
  line-height: 1.25rem !important;
  color: #64748b !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.375rem 0.875rem !important;
}

.wdb-post-card__date {
  font-family: var(--font-family-body) !important;
  color: #64748b !important;
  font-weight: 400 !important;
}

.wdb-post-card__authors {
  font-family: var(--font-family-body) !important;
  color: #475569 !important;
}

.wdb-post-card__authors a {
  color: #475569 !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: color 0.15s ease !important;
}

.wdb-post-card__authors a:hover {
  color: var(--color-primary, #0066cc) !important;
  text-decoration: underline !important;
}

.wdb-post-card__separator {
  border: none !important;
  border-top: 1px solid #e2e8f0 !important;
  margin: 2rem 0 0 !important;
}

/* 11. BLOG PAGINATION MODERN STYLES */
.wdb-pagination,
.wdb-pagination *,
.pagination,
.pagination * {
  font-family: var(--font-family-body) !important;
  box-sizing: border-box;
}

.wdb-pagination {
  padding: 2.5rem 0 3.5rem !important;
  border-top: 1px solid #e2e8f0 !important;
  margin-top: 1rem !important;
}

.wdb-pagination__inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1rem !important;
}

.wdb-pagination__prev,
.wdb-pagination__next {
  flex: 0 0 auto !important;
}

.wdb-pagination__link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.5rem 0.875rem !important;
  border-radius: 0.5rem !important;
  font-family: var(--font-family-body) !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  line-height: 1.25rem !important;
  color: var(--color-primary, #0056b3) !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
}

.wdb-pagination__link svg {
  width: 0.75rem !important;
  height: 0.75rem !important;
  flex-shrink: 0 !important;
}

.wdb-pagination__link:hover {
  background-color: #f1f5f9 !important;
  color: var(--color-brand-blue-hover, #0052a3) !important;
  text-decoration: none !important;
}

.wdb-pagination__link--disabled {
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  opacity: 0.6 !important;
  font-weight: 500 !important;
  background-color: transparent !important;
}

.wdb-pagination__info {
  font-family: var(--font-family-body) !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  color: #64748b !important;
  padding: 0.25rem 0.75rem !important;
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 9999px !important;
  line-height: 1.25rem !important;
}



