/* Salaamio — brand overrides on top of Pico CSS */

:root {
  --pico-font-family-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --pico-font-weight: 400;
  --pico-font-size: 100%;
  --pico-line-height: 1.5;
  --brand-500: #14b8a6;
  --brand-600: #0d9488;
  --brand-700: #0f766e;
  --accent-500: #8b5cf6;
}

/* Override Pico's fluid root font scaling — keep 16px across breakpoints */
html { font-size: 16px; }
@media (min-width: 576px) { html { font-size: 16px; } }
@media (min-width: 768px) { html { font-size: 16px; } }
@media (min-width: 1024px) { html { font-size: 16px; } }
@media (min-width: 1280px) { html { font-size: 16px; } }
@media (min-width: 1536px) { html { font-size: 16px; } }

/* Tighter heading scale than Pico defaults */
h1, h2, h3, h4, h5, h6 { line-height: 1.2; }
h1 { font-size: 2rem; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

[data-theme="light"],
:root:not([data-theme="dark"]) {
  --pico-primary: var(--brand-600);
  --pico-primary-background: var(--brand-500);
  --pico-primary-border: var(--brand-500);
  --pico-primary-underline: rgba(20, 184, 166, 0.4);
  --pico-primary-hover: var(--brand-700);
  --pico-primary-hover-background: var(--brand-600);
  --pico-primary-hover-border: var(--brand-600);
  --pico-primary-focus: rgba(20, 184, 166, 0.25);
}

/* Improve control contrast in light mode */
[data-theme="light"] .theme-toggle,
:root:not([data-theme="dark"]) .theme-toggle {
  background: #f5f7fa;
  border-color: #c3ceda;
  color: #0f172a;
}

[data-theme="light"] .theme-toggle:hover,
[data-theme="light"] .theme-toggle:focus-visible,
[data-theme="light"] .theme-toggle[aria-expanded="true"],
:root:not([data-theme="dark"]) .theme-toggle:hover,
:root:not([data-theme="dark"]) .theme-toggle:focus-visible,
:root:not([data-theme="dark"]) .theme-toggle[aria-expanded="true"] {
  background: #ecf2f7;
  border-color: #8ea8c0;
  color: #0d9488;
}

[data-theme="light"] .theme-menu,
:root:not([data-theme="dark"]) .theme-menu {
  border-color: #c3ceda;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .theme-menu button,
:root:not([data-theme="dark"]) .theme-menu button {
  color: #0f172a;
}

[data-theme="light"] .theme-menu button svg,
:root:not([data-theme="dark"]) .theme-menu button svg {
  color: #334155;
}

[data-theme="light"] .theme-menu button:hover,
[data-theme="light"] .theme-menu button:focus-visible,
:root:not([data-theme="dark"]) .theme-menu button:hover,
:root:not([data-theme="dark"]) .theme-menu button:focus-visible {
  background: #e7eef5;
  color: #0f172a;
}

[data-theme="light"] .theme-menu button[aria-current="true"] svg,
:root:not([data-theme="dark"]) .theme-menu button[aria-current="true"] svg {
  color: var(--pico-primary);
}

[data-theme="dark"] {
  --pico-primary: #2dd4bf;
  --pico-primary-background: var(--brand-500);
  --pico-primary-border: var(--brand-500);
  --pico-primary-underline: rgba(45, 212, 191, 0.4);
  --pico-primary-hover: #5eead4;
  --pico-primary-hover-background: var(--brand-600);
  --pico-primary-hover-border: var(--brand-600);
  --pico-primary-focus: rgba(45, 212, 191, 0.25);
}

/* Layout */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body > header,
body > footer {
  flex-shrink: 0;
}

body > main {
  flex: 1;
}

/* Top navbar */
.site-nav {
  border-bottom: 1px solid var(--pico-muted-border-color);
  background: var(--pico-background-color);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
}

.site-nav a.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-nav a.brand img {
  height: 2.25rem;
  width: auto;
}

.site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav .nav-links li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav .nav-links a {
  text-decoration: none;
  color: var(--pico-color);
  font-weight: 500;
}

.site-nav .nav-links a:hover {
  color: var(--pico-primary);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--pico-muted-border-color);
  padding-block: 1.25rem;
  font-size: 0.9rem;
  color: var(--pico-muted-color);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.site-footer ul li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer ul a {
  color: var(--pico-muted-color);
  text-decoration: none;
}

.site-footer ul a:hover {
  color: var(--pico-primary);
}

/* Theme toggle */
.theme-picker {
  position: relative;
}

.theme-toggle {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  color: var(--pico-color);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.theme-toggle[aria-expanded="true"] {
  border-color: var(--pico-primary);
  color: var(--pico-primary);
  outline: none;
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 11rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 100;
}

.theme-menu li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.theme-menu button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  background: none;
  border: none;
  border-radius: 0.375rem;
  color: var(--pico-color);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.theme-menu button:hover,
.theme-menu button:focus-visible {
  background: var(--pico-muted-border-color);
  outline: none;
}

.theme-menu button[aria-current="true"] {
  color: var(--pico-primary);
  font-weight: 500;
}

.theme-menu button svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Hero */
.hero {
  text-align: center;
  padding-block: 4rem 3rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin-bottom: 1rem;
}

.hero p.lead {
  font-size: 1.2rem;
  color: var(--pico-muted-color);
  max-width: 38rem;
  margin: 0 auto 2rem;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Card grid for categories */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
  margin-block: 2.5rem;
}

.card-grid > article {
  margin: 0;
  text-align: center;
}

.card-grid .card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--pico-primary);
}

/* Org profile pages */
.org-cover {
  width: 100%;
  max-height: 20rem;
  object-fit: cover;
  border-radius: var(--pico-border-radius);
  margin-bottom: 1.5rem;
}

.org-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.org-header img.org-logo {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--pico-muted-border-color);
}

.org-header h1 {
  margin: 0 0 0.25rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(20, 184, 166, 0.12);
  color: var(--pico-primary);
}

.badge.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}
.badge.badge-info {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}
.badge.badge-success {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

[data-theme="dark"] .badge.badge-warning { color: #fbbf24; }
[data-theme="dark"] .badge.badge-info { color: #60a5fa; }
[data-theme="dark"] .badge.badge-success { color: #4ade80; }

.org-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .org-grid {
    grid-template-columns: 1fr;
  }
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.contact-list svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--pico-primary);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.facility-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.facility-grid div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.facility-grid svg {
  width: 1.1rem;
  height: 1.1rem;
}

.facility-grid .yes { color: #16a34a; }
.facility-grid .no { color: #dc2626; }

dl.school-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}

dl.school-details dt {
  font-weight: 600;
  color: var(--pico-muted-color);
}

dl.school-details dd {
  margin: 0;
}

/* Error / not-found pages */
.status-page {
  text-align: center;
  padding-block: 5rem;
}

.status-page h1 {
  font-size: 6rem;
  margin: 0;
  line-height: 1;
  color: var(--pico-primary);
}

.status-page p {
  font-size: 1.15rem;
  color: var(--pico-muted-color);
  margin-bottom: 2rem;
}

/* Container width tweak for narrower content */
.container {
  max-width: 75rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
/* Salaamio — Custom overrides (theme.min.css handles base styles) */

/* Brand color palette (from SalaamunUI customization) */
:root {
    --bs-primary: #14b8a6;
    --bs-primary-rgb: 20, 184, 166;
    --bs-dark: #102a43;
    --bs-link-color: #14b8a6;
    --bs-link-hover-color: #0d9488;
}

.bg-primary { background-color: #14b8a6 !important; }
.btn-primary { background-color: #14b8a6; border-color: #14b8a6; }
.btn-primary:hover, .btn-primary:focus { background-color: #0d9488; border-color: #0d9488; }
.text-primary { color: #14b8a6 !important; }
a.text-primary:hover { color: #0d9488 !important; }
.border-primary { border-color: #14b8a6 !important; }
.btn-outline-primary { color: #14b8a6; border-color: #14b8a6; }
.btn-outline-primary:hover { background-color: #14b8a6; border-color: #14b8a6; color: #fff; }

/* Form controls */
.form-control:focus { border-color: #14b8a6; box-shadow: 0 0 0 0.25rem rgba(20, 184, 166, 0.25); }
.form-check-input:checked { background-color: #14b8a6; border-color: #14b8a6; }
.form-check-input { border: 1px solid #1e2022; }

/* Table styling */
.table tr { color: #1e2022; }
.table thead th { color: #1e2022; }

/* Crisper text colors — theme defaults are too light */
body {
    color: #1e2022;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.text-body {
    color: #3b4152 !important;
}

.text-muted {
    color: #677788 !important;
}

.nav-link {
    color: #3b4152;
}

.nav-link:hover,
.nav-link.active {
    color: #14b8a6;
}

.card-text {
    color: #3b4152;
}

.dropdown-header {
    color: #8c98a4;
}

body > main {
    flex: 1;
}

/* Category cards on home page */
.card-hover-shadow {
    transition: box-shadow 0.2s ease;
}
.card-hover-shadow:hover {
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}
