:root {
  --ktb-primary: #0f6cab;
  --ktb-primary-dark: #0b4f7f;
  --ktb-accent: #f57c00;
  --ktb-success: #2e7d32;
  --ktb-surface: #f5f8fb;
  --ktb-ink: #1f2a37;
  --ktb-font-size-base: 1rem;
  --ktb-font-size-sm: 0.875rem;
  --ktb-font-size-lg: 1.125rem;
  --ktb-h1: clamp(2rem, 1.5rem + 2vw, 3rem);
  --ktb-h2: clamp(1.625rem, 1.35rem + 1.2vw, 2.25rem);
  --ktb-h3: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --ktb-h4: 1.25rem;
  --ktb-h5: 1.125rem;
  --ktb-h6: 1rem;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Open Sans", Arial, sans-serif;
  color: var(--ktb-ink);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 45%, #f4f8fc 100%);
  font-size: var(--ktb-font-size-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
  font-family: "Nunito", Arial, sans-serif;
}

h1,
.h1 {
  font-size: var(--ktb-h1);
  line-height: 1.2;
}

h2,
.h2 {
  font-size: var(--ktb-h2);
  line-height: 1.25;
}

h3,
.h3 {
  font-size: var(--ktb-h3);
  line-height: 1.3;
}

h4,
.h4 {
  font-size: var(--ktb-h4);
  line-height: 1.35;
}

h5,
.h5 {
  font-size: var(--ktb-h5);
  line-height: 1.4;
}

h6,
.h6 {
  font-size: var(--ktb-h6);
  line-height: 1.4;
}

p,
li,
.form-label,
.form-control,
.form-select,
.btn {
  font-size: var(--ktb-font-size-base);
}

small,
.small {
  font-size: var(--ktb-font-size-sm) !important;
}

.lead {
  font-size: var(--ktb-font-size-lg);
  line-height: 1.7;
}

.navbar .nav-link,
.dropdown-item,
.footer-links a,
.footer-main p,
.page-banner p,
.page-banner .breadcrumb {
  font-size: var(--ktb-font-size-base);
}

.topbar small {
  font-size: var(--ktb-font-size-sm);
}

.topbar {
  background: linear-gradient(90deg, #0f6cab, #12a4d9);
}

.hero-section {
  background: radial-gradient(circle at 20% 20%, rgba(18, 164, 217, 0.15), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(245, 124, 0, 0.18), transparent 35%);
}

.hero-section-home {
  padding-top: 2.2rem;
  padding-bottom: 1.7rem;
}

.hero-section-inner {
  padding-top: 0.4rem;
  padding-bottom: 0.2rem;
}

.hero-impact-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.5rem;
  width: 100%;
}

.hero-impact-col {
  display: flex;
}

.hero-impact-logo-wrap {
  display: flex;
  padding-top: 0.1rem;
  align-items: center;
  justify-content: center;
}

.hero-impact-logo {
  width: 80%;
  max-width: 80%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
}

.section-padded {
  padding: 3.5rem 0;
}

.bg-light-grey {
  background: var(--ktb-surface);
}

.page-banner {
  background: linear-gradient(120deg, var(--ktb-primary-dark), var(--ktb-primary));
}

.page-banner .breadcrumb,
.page-banner .breadcrumb a {
  color: rgba(255, 255, 255, 0.86);
}

.page-banner .breadcrumb-item.active,
.page-banner .text-white-75 {
  color: rgba(255, 255, 255, 0.75);
}

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

.btn-primary-brand:hover,
.btn-primary-brand:focus {
  background: var(--ktb-primary-dark);
  border-color: var(--ktb-primary-dark);
  color: #fff;
}

.btn-outline-primary-brand {
  border: 1px solid var(--ktb-primary);
  color: var(--ktb-primary);
}

.btn-outline-primary-brand:hover {
  background: var(--ktb-primary);
  color: #fff;
}

.btn-donate {
  background: var(--ktb-accent);
  border-color: var(--ktb-accent);
  color: #fff;
}

.btn-donate:hover,
.btn-donate:focus {
  background: #cf6800;
  border-color: #cf6800;
  color: #fff;
}

.text-primary-brand {
  color: var(--ktb-primary) !important;
}

.site-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.navbar {
  overflow: visible;
}

.navbar .navbar-brand {
  display: flex;
  align-items: center;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  margin-top: 0;
  margin-bottom: 0;
  margin-right: 0.4rem;
}

.navbar .site-logo {
  height: 100px;
}

.navbar .navbar-toggler {
  margin-left: auto;
}

@media (min-width: 992px) {
  .navbar .navbar-collapse {
    margin-left: 5cm;
  }
}

.site-logo-footer {
  height: 64px;
}

.footer-logo-on-dark {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.site-footer {
  background: #0f1f2f;
}

.footer-bottom {
  background: #0a1723;
}

.footer-heading {
  color: #fff;
  margin-bottom: 0.8rem;
  font-size: var(--ktb-h6);
  font-weight: 700;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin: 0.4rem 0;
}

.footer-links a,
.footer-social {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

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

.card {
  border-radius: 12px;
}

.uniform-tile {
  overflow: hidden;
}

.uniform-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #eef3f8, #dde8f4);
  border-bottom: 1px solid rgba(15, 108, 171, 0.1);
}

.uniform-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.cookie-consent-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1100;
}

.cookie-consent-banner__content {
  max-width: 980px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid rgba(15, 108, 171, 0.2);
  border-radius: 14px;
  box-shadow: 0 14px 38px rgba(11, 31, 53, 0.2);
  padding: 1rem 1.2rem;
}

.cookie-consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.cookie-consent-banner__link {
  color: var(--ktb-primary-dark);
}

.cookie-preferences-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.cookie-preferences-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.cookie-preferences-modal__dialog {
  position: relative;
  max-width: 700px;
  margin: 5vh auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(5, 28, 44, 0.24);
  padding: 1.25rem;
}

.cookie-preferences-modal__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid #e4ebf3;
  border-radius: 10px;
  padding: 0.8rem;
  margin-bottom: 0.7rem;
}

.cookie-preferences-modal__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.cookie-modal-open {
  overflow: hidden;
}

@media (max-width: 767.98px) {
  .cookie-preferences-modal__dialog {
    margin: 1rem;
    max-width: none;
  }
}

.uniform-media-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #5d7188;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.uniform-tile-body {
  min-height: 210px;
}

.uniform-title {
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.uniform-summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.team-bio {
  margin-bottom: 0;
  overflow: visible;
  display: block;
  white-space: normal;
}

.home-feature-card {
  overflow: hidden;
}

.home-feature-body {
  min-height: 170px;
}

.home-feature-title {
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-feature-summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-feature-thumb-wrap {
  flex: 0 0 auto;
}

.home-feature-thumb {
  width: 112px;
  height: 84px;
  border-radius: 10px;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(15, 108, 171, 0.16);
  background: rgba(255, 255, 255, 0.8);
  display: block;
}

.home-feature-thumb-placeholder {
  display: grid;
  place-items: center;
  color: #3e5167;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.home-feature-link {
  color: #0a57a4;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(10, 87, 164, 0.45);
}

.home-feature-link:hover {
  color: #053f7d;
  text-decoration-color: #053f7d;
}

/* Logo-inspired mixed tile colours for homepage featured tiles */
.home-feature-grid > div:nth-child(6n + 1) .home-feature-body {
  background: linear-gradient(135deg, #9ee9ff, #d8f7ff);
}

.home-feature-grid > div:nth-child(6n + 2) .home-feature-body {
  background: linear-gradient(135deg, #ff9fd0, #ffd9ee);
}

.home-feature-grid > div:nth-child(6n + 3) .home-feature-body {
  background: linear-gradient(135deg, #a6f59a, #e2ffd9);
}

.home-feature-grid > div:nth-child(6n + 4) .home-feature-body {
  background: linear-gradient(135deg, #ffbc69, #ffe3b9);
}

.home-feature-grid > div:nth-child(6n + 5) .home-feature-body {
  background: linear-gradient(135deg, #cf9bff, #efdcff);
}

.home-feature-grid > div:nth-child(6n + 6) .home-feature-body {
  background: linear-gradient(135deg, #fff37a, #fffad1);
}

/* Admin area styles aligned with site branding */
body.admin-area {
  background:
    radial-gradient(circle at 12% 8%, rgba(18, 164, 217, 0.12), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(245, 124, 0, 0.12), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #f1f7fd 100%);
}

body.admin-area main {
  padding-top: 0.65rem;
}

body.admin-area .container.py-4 {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 108, 171, 0.12);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(15, 108, 171, 0.1);
  margin-top: 1rem;
}

body.admin-area .container.py-4 > .d-flex:first-child {
  background: linear-gradient(120deg, var(--ktb-primary-dark), var(--ktb-primary));
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin: -0.15rem -0.15rem 1rem -0.15rem;
  box-shadow: 0 10px 22px rgba(15, 108, 171, 0.2);
}

body.admin-area .container.py-4 > .d-flex:first-child .h3,
body.admin-area .container.py-4 > .d-flex:first-child .h5,
body.admin-area .container.py-4 > .d-flex:first-child p {
  color: #fff !important;
}

body.admin-area .container.py-4 > p.small {
  background: rgba(15, 108, 171, 0.08);
  border: 1px solid rgba(15, 108, 171, 0.14);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  display: inline-block;
}

body.admin-area .card {
  border: 1px solid rgba(15, 108, 171, 0.12) !important;
  box-shadow: 0 8px 20px rgba(15, 108, 171, 0.08) !important;
  overflow: hidden;
}

body.admin-area .table thead th {
  background: rgba(15, 108, 171, 0.08);
  color: var(--ktb-primary-dark);
  border-bottom: 1px solid rgba(15, 108, 171, 0.2);
}

body.admin-area .table tbody tr:hover {
  background: rgba(15, 108, 171, 0.04);
}

body.admin-area .table td,
body.admin-area .table th {
  vertical-align: middle;
}

body.admin-area .btn-primary-brand {
  box-shadow: 0 8px 16px rgba(15, 108, 171, 0.28);
}

body.admin-area .btn-outline-primary-brand {
  background: rgba(255, 255, 255, 0.9);
}

body.admin-area .btn-outline-primary-brand:hover {
  box-shadow: 0 8px 16px rgba(15, 108, 171, 0.18);
}

body.admin-area .form-control:focus,
body.admin-area .form-select:focus,
body.admin-area .form-check-input:focus {
  border-color: rgba(15, 108, 171, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(15, 108, 171, 0.15);
}

body.admin-area .form-label {
  font-weight: 700;
  color: var(--ktb-primary-dark);
}

body.admin-area .small a,
body.admin-area a.small {
  color: var(--ktb-primary-dark);
}

body.admin-area .small a:hover,
body.admin-area a.small:hover {
  color: var(--ktb-primary);
}

@media (max-width: 991px) {
  .section-padded {
    padding: 2.4rem 0;
  }

  .hero-impact-card {
    height: auto;
    grid-template-rows: auto 1fr;
  }

  .hero-impact-col {
    display: block;
  }

  .hero-impact-logo {
    width: 72%;
    max-width: 72%;
  }

  .site-logo {
    height: 48px;
  }

  .navbar .navbar-brand {
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    margin-top: 0;
    margin-bottom: 0;
  }

  .navbar .site-logo {
    height: 64px;
  }

  .site-logo-footer {
    height: 54px;
  }

  .uniform-tile-body {
    min-height: 0;
  }

  .home-feature-body {
    min-height: 0;
  }

  .home-feature-thumb {
    width: 96px;
    height: 72px;
  }

  .footer-logo-on-dark {
    padding: 5px 8px;
  }
}