/* ==========================================================================
   STNG shared guest styles
   St. Theresa's Nyangusu Girls Senior School: olive green + white
   Loaded after style.css. Uses only the theme CSS variables defined in
   style.css :root (architecture §5) plus white and neutral greys.
   Mobile-first: base rules target phones, min-width queries scale up.
   ========================================================================== */

:root {
  --stng-radius: 12px;
  --stng-radius-sm: 8px;
  --stng-border: #e3e9d3;
  --stng-shadow: 0 2px 10px rgba(31, 38, 20, .06);
  --stng-shadow-hover: 0 10px 28px rgba(31, 38, 20, .12);
  --stng-muted: #6b7280;
  --stng-urgent: #b42318;
  --stng-olive-100: #eef3e2;
}

/* --------------------------------------------------------------------------
   Accessibility helpers
   -------------------------------------------------------------------------- */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.stng-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10000;
  padding: .65rem 1.1rem;
  background: var(--theme-color-dark);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 var(--stng-radius-sm) var(--stng-radius-sm);
  text-decoration: none;
  transition: top .2s ease;
}

.stng-skip-link:focus,
.stng-skip-link:focus-visible {
  top: 0;
  color: #fff;
  outline: 3px solid var(--theme-accent);
  outline-offset: 2px;
}

#main:focus {
  outline: none;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.stng-section {
  padding: 44px 0;
}

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

.stng-section--tight {
  padding: 28px 0;
}

@media (min-width: 768px) {
  .stng-section {
    padding: 64px 0;
  }

  .stng-section--tight {
    padding: 40px 0;
  }
}

/* --------------------------------------------------------------------------
   Section heading (used by SectionHeading.vue; also usable directly)
   -------------------------------------------------------------------------- */
.stng-heading {
  margin-bottom: 28px;
}

.stng-heading--center {
  text-align: center;
}

.stng-heading__eyebrow {
  display: inline-block;
  margin-bottom: .4rem;
  color: var(--theme-color);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-variant: small-caps;
}

.stng-heading__title {
  margin: 0;
  color: var(--theme-color-dark);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
}

.stng-heading__bar {
  display: block;
  width: 48px;
  height: 3px;
  margin: .8rem 0 0;
  background: var(--theme-accent);
  border-radius: 2px;
}

.stng-heading--center .stng-heading__bar {
  margin-left: auto;
  margin-right: auto;
}

.stng-heading__lead {
  margin: .9rem 0 0;
  color: var(--body-text-color);
  font-size: 1rem;
  line-height: 1.7;
}

.stng-heading--center .stng-heading__lead {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .stng-heading {
    margin-bottom: 40px;
  }

  .stng-heading__title {
    font-size: 2.1rem;
  }

  .stng-heading__lead {
    font-size: 1.075rem;
  }
}

/* --------------------------------------------------------------------------
   Grid
   -------------------------------------------------------------------------- */
.stng-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.stng-grid--sm {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

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

  .stng-grid--sm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 992px) {
  .stng-grid {
    gap: 24px;
  }
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.stng-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid var(--stng-border);
  border-radius: var(--stng-radius);
  box-shadow: var(--stng-shadow);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}

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

a.stng-card,
.stng-card a.stng-card__link {
  color: inherit;
  text-decoration: none;
}

.stng-card__img {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--theme-bg-light);
}

.stng-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stng-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: .5rem;
  padding: 18px;
}

.stng-card__title {
  margin: 0;
  color: var(--theme-color-dark);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
}

.stng-card__title a {
  color: inherit;
  text-decoration: none;
}

.stng-card__title a:hover,
.stng-card:hover .stng-card__title a {
  color: var(--theme-color);
}

.stng-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
  color: var(--stng-muted);
  font-size: .85rem;
}

.stng-card__meta i {
  color: var(--theme-color2);
  margin-right: .3rem;
}

.stng-card__text {
  margin: 0;
  color: var(--body-text-color);
  font-size: .95rem;
  line-height: 1.6;
}

.stng-card__footer {
  margin-top: auto;
  padding: 0 18px 18px;
}

@media (prefers-reduced-motion: reduce) {
  .stng-card,
  .stng-card:hover {
    transition: none;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.stng-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.25rem;
  background: var(--theme-color);
  color: #fff;
  border: 2px solid var(--theme-color);
  border-radius: var(--stng-radius-sm);
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.stng-btn:hover,
.stng-btn:focus {
  background: var(--theme-color-dark, #3a4a1f);
  border-color: var(--theme-color-dark, #3a4a1f);
  color: #fff;
}

.stng-btn:focus-visible {
  outline: 3px solid var(--theme-accent);
  outline-offset: 2px;
}

.stng-btn:disabled,
.stng-btn[aria-disabled="true"] {
  opacity: .6;
  cursor: not-allowed;
}

.stng-btn--outline {
  background: transparent;
  color: var(--theme-color);
}

.stng-btn--outline:hover {
  background: var(--theme-color);
  color: #fff;
}

/* White button: olive text + olive border; turns solid olive on hover */
.stng-btn--light {
  background: #fff;
  border-color: var(--theme-color, #4b5d23);
  color: var(--theme-color, #4b5d23);
}

.stng-btn--light:hover,
.stng-btn--light:focus {
  background: var(--theme-color, #4b5d23);
  border-color: #fff;
  color: #fff;
}

/* Olive icons in menus and the back-to-top button (no theme colour can override these) */
.stng-navbar .dropdown-menu .dropdown-item i,
.main-navigation .dropdown-menu .dropdown-item i {
  color: var(--theme-color2, #6b8e23);
}

#scroll-top {
  background-color: var(--theme-color, #4b5d23);
  color: #fff;
}

#scroll-top:hover,
#scroll-top:focus-visible {
  background-color: var(--theme-color-dark, #3a4a1f);
  color: #fff;
}

.stng-btn--sm {
  padding: .45rem .85rem;
  font-size: .85rem;
}

.stng-btn--block {
  display: flex;
  width: 100%;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.stng-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--theme-color-light);
  color: var(--theme-color);
}

.stng-badge--olive {
  background: var(--theme-color);
  color: #fff;
}

.stng-badge--gold {
  background: var(--theme-accent);
  color: var(--footer-bg2);
}

.stng-badge--urgent {
  background: var(--stng-urgent);
  color: #fff;
}

.stng-badge--muted {
  background: #eef0ec;
  color: #4b5563;
}

/* --------------------------------------------------------------------------
   Chips (filters)
   -------------------------------------------------------------------------- */
.stng-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .9rem;
  background: #fff;
  border: 1px solid var(--stng-border);
  border-radius: 999px;
  color: var(--theme-color-dark);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.stng-chip:hover {
  border-color: var(--theme-color);
  color: var(--theme-color);
}

.stng-chip.is-active,
.stng-chip[aria-pressed="true"] {
  background: var(--theme-color);
  border-color: var(--theme-color);
  color: #fff;
}

.stng-chip:focus-visible {
  outline: 3px solid var(--theme-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Filter bar
   -------------------------------------------------------------------------- */
.stng-filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.stng-filterbar .form-control,
.stng-filterbar .form-select {
  flex: 1 1 100%;
  min-height: 44px;
  border-color: var(--stng-border);
  border-radius: var(--stng-radius-sm);
}

.stng-filterbar .form-control:focus,
.stng-filterbar .form-select:focus {
  border-color: var(--theme-color2);
  box-shadow: 0 0 0 .2rem var(--theme-color-light);
}

@media (min-width: 768px) {
  .stng-filterbar .form-control,
  .stng-filterbar .form-select {
    flex: 0 1 260px;
  }
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.stng-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--stng-border);
  border-radius: var(--stng-radius);
  background: #fff;
}

.stng-table {
  width: 100%;
  min-width: 520px;
  margin: 0;
  border-collapse: collapse;
  font-size: .925rem;
}

.stng-table th,
.stng-table td {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--stng-border);
  text-align: left;
  vertical-align: top;
}

.stng-table thead th {
  background: var(--theme-color);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.stng-table tbody tr:nth-child(even) {
  background: var(--theme-bg-light);
}

.stng-table tbody tr:last-child td {
  border-bottom: 0;
}

.stng-table tfoot td,
.stng-table tfoot th {
  background: var(--theme-color-light);
  color: var(--theme-color-dark);
  font-weight: 700;
}

.stng-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Prose (CKEditor rich text)
   -------------------------------------------------------------------------- */
.stng-prose {
  color: var(--body-text-color);
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.stng-prose > :first-child {
  margin-top: 0;
}

.stng-prose > :last-child {
  margin-bottom: 0;
}

.stng-prose h1,
.stng-prose h2,
.stng-prose h3,
.stng-prose h4,
.stng-prose h5,
.stng-prose h6 {
  margin: 1.6em 0 .6em;
  color: var(--theme-color-dark);
  font-weight: 700;
  line-height: 1.3;
}

.stng-prose h1 { font-size: 1.75rem; }
.stng-prose h2 { font-size: 1.5rem; }
.stng-prose h3 { font-size: 1.25rem; }
.stng-prose h4 { font-size: 1.1rem; }

.stng-prose p {
  margin: 0 0 1em;
}

.stng-prose a {
  color: var(--theme-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.stng-prose a:hover {
  color: var(--theme-color-dark);
}

.stng-prose ul,
.stng-prose ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}

.stng-prose ul {
  list-style: disc;
}

.stng-prose ol {
  list-style: decimal;
}

.stng-prose li {
  margin-bottom: .35em;
}

.stng-prose li::marker {
  color: var(--theme-color2);
}

.stng-prose blockquote {
  margin: 1.2em 0;
  padding: .8em 1.1em;
  border-left: 4px solid var(--theme-accent);
  background: var(--theme-bg-light);
  color: var(--theme-color-dark);
  font-style: italic;
}

.stng-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--stng-radius-sm);
}

.stng-prose figure {
  margin: 1.2em 0;
}

.stng-prose figure.table,
.stng-prose .table {
  overflow-x: auto;
}

.stng-prose table {
  width: 100%;
  margin: 1.2em 0;
  border-collapse: collapse;
  font-size: .95rem;
}

.stng-prose th,
.stng-prose td {
  padding: .55rem .75rem;
  border: 1px solid var(--stng-border);
  text-align: left;
}

.stng-prose th {
  background: var(--theme-color);
  color: #fff;
}

.stng-prose tr:nth-child(even) td {
  background: var(--theme-bg-light);
}

.stng-prose hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--stng-border);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */
.stng-empty {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
  color: var(--body-text-color);
}

.stng-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--theme-color-light);
  color: var(--theme-color2);
  font-size: 1.75rem;
}

.stng-empty__title {
  margin: 0 0 .4rem;
  color: var(--theme-color-dark);
  font-size: 1.2rem;
  font-weight: 700;
}

.stng-empty__message {
  margin: 0;
  color: var(--stng-muted);
  line-height: 1.6;
}

.stng-empty__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

/* --------------------------------------------------------------------------
   Stats
   -------------------------------------------------------------------------- */
.stng-stat {
  padding: 20px 16px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--stng-border);
  border-radius: var(--stng-radius);
}

.stng-stat__num {
  display: block;
  color: var(--theme-color);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stng-stat__label {
  display: block;
  margin-top: .35rem;
  color: var(--stng-muted);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .02em;
}

@media (min-width: 768px) {
  .stng-stat__num {
    font-size: 2.4rem;
  }
}

/* --------------------------------------------------------------------------
   Timeline
   -------------------------------------------------------------------------- */
.stng-timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 28px;
  list-style: none;
}

.stng-timeline::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 8px;
  width: 2px;
  background: var(--stng-border);
}

.stng-timeline > li,
.stng-timeline__item {
  position: relative;
  padding: 0 0 24px;
}

.stng-timeline > li:last-child,
.stng-timeline__item:last-child {
  padding-bottom: 0;
}

.stng-timeline > li::before,
.stng-timeline__item::before {
  content: "";
  position: absolute;
  top: 5px;
  left: -26px;
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--theme-color);
  box-shadow: 0 0 0 2px var(--theme-color2);
}

.stng-timeline__date {
  display: block;
  margin-bottom: .2rem;
  color: var(--theme-color);
  font-size: .85rem;
  font-weight: 700;
}

.stng-timeline__title {
  margin: 0 0 .25rem;
  color: var(--theme-color-dark);
  font-size: 1.05rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Person (staff card)
   -------------------------------------------------------------------------- */
.stng-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 22px 16px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--stng-border);
  border-radius: var(--stng-radius);
  box-shadow: var(--stng-shadow);
}

.stng-person__photo,
.stng-person__initials {
  width: 120px;
  height: 120px;
  margin-bottom: 14px;
  border-radius: 50%;
  border: 3px solid var(--theme-bg-light);
  box-shadow: 0 0 0 2px var(--stng-border);
}

.stng-person__photo {
  object-fit: cover;
  object-position: center top;
  background: var(--theme-bg-light);
}

.stng-person__initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--stng-olive-100);
  color: var(--theme-color); /* olive-800 */
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: .03em;
}

.stng-person__name {
  margin: 0;
  color: var(--theme-color-dark);
  font-size: 1.05rem;
  font-weight: 700;
}

.stng-person__role {
  margin: .25rem 0 0;
  color: var(--theme-color);
  font-size: .9rem;
  font-weight: 600;
}

.stng-person__meta {
  margin: .35rem 0 0;
  color: var(--stng-muted);
  font-size: .85rem;
}

.stng-person--sm .stng-person__photo,
.stng-person--sm .stng-person__initials {
  width: 88px;
  height: 88px;
  font-size: 1.6rem;
}

/* --------------------------------------------------------------------------
   Pagination (Paginator.vue)
   -------------------------------------------------------------------------- */
.stng-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.stng-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 .75rem;
  background: #fff;
  border: 1px solid var(--stng-border);
  border-radius: var(--stng-radius-sm);
  color: var(--theme-color-dark);
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

a.stng-pagination__link:hover {
  border-color: var(--theme-color);
  color: var(--theme-color);
}

.stng-pagination__link.is-active {
  background: var(--theme-color);
  border-color: var(--theme-color);
  color: #fff;
}

.stng-pagination__link.is-disabled {
  color: #9ca3af;
  background: #f9fafb;
  cursor: not-allowed;
}

.stng-pagination__link:focus-visible {
  outline: 3px solid var(--theme-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Share buttons (ShareButtons.vue)
   -------------------------------------------------------------------------- */
.stng-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.stng-share__label {
  margin-right: 4px;
  color: var(--theme-color-dark);
  font-size: .9rem;
  font-weight: 600;
}

.stng-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--stng-border);
  border-radius: 50%;
  background: #fff;
  color: var(--theme-color);
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.stng-share__btn:hover {
  background: var(--theme-color);
  border-color: var(--theme-color);
  color: #fff;
}

.stng-share__btn:focus-visible {
  outline: 3px solid var(--theme-accent);
  outline-offset: 2px;
}

.stng-share__status {
  color: var(--theme-color);
  font-size: .85rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   File badge (FileBadge.vue)
   -------------------------------------------------------------------------- */
.stng-file {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--stng-muted);
  font-size: .85rem;
}

.stng-file__icon {
  color: var(--theme-color);
  font-size: 1.15rem;
}

.stng-file__ext {
  padding: .05rem .4rem;
  border-radius: 4px;
  background: var(--theme-color-light);
  color: var(--theme-color-dark);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.stng-text-olive { color: var(--theme-color) !important; }
.stng-text-dark { color: var(--theme-color-dark) !important; }
.stng-bg-light { background: var(--theme-bg-light) !important; }

.stng-divider {
  height: 1px;
  margin: 32px 0;
  border: 0;
  background: var(--stng-border);
  opacity: 1;
}

.stng-callout {
  padding: 16px 18px;
  border-left: 4px solid var(--theme-color);
  border-radius: var(--stng-radius-sm);
  background: var(--theme-bg-light);
  color: var(--theme-color-dark);
}

.stng-callout--gold {
  border-left-color: var(--theme-accent);
}

/* --------------------------------------------------------------------------
   Bootstrap 5.3 component overrides (buttons use component-level vars)
   -------------------------------------------------------------------------- */
.btn-primary {
  --bs-btn-bg: var(--theme-color);
  --bs-btn-border-color: var(--theme-color);
  --bs-btn-hover-bg: var(--theme-color-dark);
  --bs-btn-hover-border-color: var(--theme-color-dark);
  --bs-btn-active-bg: var(--theme-color-dark);
  --bs-btn-active-border-color: var(--theme-color-dark);
  --bs-btn-disabled-bg: var(--theme-color);
  --bs-btn-disabled-border-color: var(--theme-color);
  --bs-btn-focus-shadow-rgb: 75, 93, 35;
}

.btn-outline-primary {
  --bs-btn-color: var(--theme-color);
  --bs-btn-border-color: var(--theme-color);
  --bs-btn-hover-bg: var(--theme-color);
  --bs-btn-hover-border-color: var(--theme-color);
  --bs-btn-active-bg: var(--theme-color-dark);
  --bs-btn-active-border-color: var(--theme-color-dark);
  --bs-btn-focus-shadow-rgb: 75, 93, 35;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--theme-color2);
  box-shadow: 0 0 0 .2rem var(--theme-color-light);
}

.form-check-input:checked {
  background-color: var(--theme-color);
  border-color: var(--theme-color);
}

.page-link {
  --bs-pagination-color: var(--theme-color);
  --bs-pagination-hover-color: var(--theme-color-dark);
  --bs-pagination-active-bg: var(--theme-color);
  --bs-pagination-active-border-color: var(--theme-color);
}
