/*
 * gu-custom.css
 * Gauhati University Admissions Portal — Design System Override
 * Load AFTER bootstrap.min.css in base.html
 * No SCSS compilation required — pure CSS variable overrides + utility extensions
 */

/* ============================================================
   1. DESIGN TOKENS — single source of truth
   ============================================================ */
:root {
  --gu-navy:          #0d2640;   /* Primary — header, hero, panel headers */
  --gu-navy-mid:      #1a3a5c;   /* Body text, subheadings, links */
  --gu-navy-dark:     #08192d;   /* Footer background */
  --gu-navy-light:    #e3ecf5;   /* Card icon backgrounds, hover fills */
  --gu-gold:          #c9a227;   /* Accent — CTAs, highlights, key numbers */
  --gu-gold-dark:     #a07d14;   /* Gold hover state */
  --gu-offwhite:      #f7f5f0;   /* Alternating section backgrounds */
  --gu-danger:        #c0392b;   /* Urgent notice indicators */
  --gu-success:       #265c38;   /* Status tags */
  --gu-text-body:     #1a3a5c;
  --gu-text-muted:    #4a6a8a;
  --gu-border:        #d0dce8;
  --gu-card-radius:   6px;
  --gu-section-pad:   3rem;
  --gu-font-serif:    'IBM Plex Serif', Georgia, serif;
  --gu-font-sans:     'IBM Plex Sans', 'Noto Sans', system-ui, sans-serif;

  /* Font-size tokens for elements with hardcoded px — adjusted by A-/A+ widget */
  --gu-fs-notice-title: 15px;
  --gu-fs-notice-meta:  13px;
  --gu-fs-prog-name:    15px;
  --gu-fs-prog-desc:    13px;
  --gu-fs-footer:       14px;
}

/* ── Large text (A+): scale html root so ALL rem/em units grow too ─── */
html[data-sz="lg"] {
  font-size: 112.5%;        /* browser default 16px × 1.125 ≈ 18px base */
  --gu-fs-notice-title: 17px;
  --gu-fs-notice-meta:  15px;
  --gu-fs-prog-name:    17px;
  --gu-fs-prog-desc:    15px;
  --gu-fs-footer:       16px;
}

/* ── Small text (A−) ─────────────────────────────────────────────────── */
html[data-sz="sm"] {
  font-size: 87.5%;         /* 16px × 0.875 ≈ 14px base */
  --gu-fs-notice-title: 13px;
  --gu-fs-notice-meta:  11px;
  --gu-fs-prog-name:    13px;
  --gu-fs-prog-desc:    11px;
  --gu-fs-footer:       13px;
}

/* ============================================================
   2. GOOGLE FONTS IMPORT
   ============================================================ */
/* The fonts are now loaded via <link> in the HTML head, so the @import is redundant and render-blocking. */

/* ============================================================
   3. BASE RESET & TYPOGRAPHY
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--gu-font-sans);
  font-size: 1em;      /* inherits html root size — scales with A-/A+ adjuster */
  color: var(--gu-text-body);
  background-color: #fff;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--gu-font-serif);
  font-weight: 500;
  color: var(--gu-navy);
  line-height: 1.25;
}

h4, h5, h6 {
  font-family: var(--gu-font-sans);
  font-weight: 500;
  color: var(--gu-navy);
}

a {
  color: var(--gu-navy-mid);
  text-decoration: none;
}
a:hover {
  color: var(--gu-gold-dark);
  text-decoration: underline;
}

small, .text-muted {
  color: var(--gu-text-muted) !important;
  font-size: 12px;
}

/* ============================================================
   3b. SKIP LINK & KEYBOARD FOCUS
   ============================================================ */

/* Skip-to-content link — invisible until a keyboard user presses Tab */
.gu-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
}
.gu-skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  overflow: visible;
  padding: 8px 16px;
  background: var(--gu-gold);
  color: var(--gu-navy);
  font-weight: 600;
  font-size: 14px;
  border-radius: 0 0 3px 0;
  outline: none;
  z-index: 10000;
}

/* Global keyboard focus ring (only shown during keyboard navigation) */
:focus-visible {
  outline: 3px solid var(--gu-gold);
  outline-offset: 2px;
  border-radius: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* Nav links: repurpose the bottom-border active treatment as the focus indicator */
.gu-nav-link:focus-visible {
  outline: none;
  background-color: var(--gu-navy-light);
  border-bottom-color: var(--gu-gold);
}

/* Tabs: inset outline so it doesn't overflow the tab strip border */
.gu-tab:focus-visible {
  outline: 3px solid var(--gu-gold);
  outline-offset: -3px;
}

/* Form controls already have a gold border + shadow focus indicator — suppress double ring */
.form-control:focus-visible,
.form-select:focus-visible {
  outline: none;
}

/* ============================================================
   4. ANNOUNCEMENT BAR
   ============================================================ */
.gu-announce-bar {
  background-color: var(--gu-navy);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 7px 0;
  border-bottom: 2px solid var(--gu-gold);
}

.gu-announce-bar a {
  color: var(--gu-gold);
  text-decoration: none;
  font-weight: 500;
}
.gu-announce-bar a:hover {
  color: #fff;
  text-decoration: underline;
}

.gu-announce-bar .gu-lang-switcher a {
  color: rgba(255,255,255,0.7);
  margin-left: 10px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.gu-announce-bar .gu-lang-switcher a:hover,
.gu-announce-bar .gu-lang-switcher a.active {
  color: var(--gu-gold);
}

/* ============================================================
   5. SITE HEADER
   ============================================================ */
.gu-site-header {
  background-color: var(--gu-navy);
  padding: 14px 0 12px;
  border-bottom: 3px solid var(--gu-gold);
}

.gu-site-header .gu-brand-name {
  font-family: var(--gu-font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.2;
  margin: 0;
}

.gu-site-header .gu-brand-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--gu-gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}

.gu-site-header .gu-login-btn {
  background-color: var(--gu-gold);
  color: var(--gu-navy) !important;
  font-weight: 500;
  font-size: 13px;
  border: none;
  padding: 7px 18px;
  border-radius: 3px;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s;
}
.gu-site-header .gu-login-btn:hover {
  background-color: var(--gu-gold-dark);
  text-decoration: none;
}

.gu-site-header .gu-logout-btn {
  background-color: transparent;
  color: rgba(255,255,255,0.75) !important;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 16px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}
.gu-site-header .gu-logout-btn:hover {
  background-color: rgba(255,255,255,0.1);
  color: #fff !important;
}

/* ============================================================
   6. NAVIGATION BAR
   ============================================================ */
.gu-navbar {
  background-color: #fff;
  border-bottom: 1px solid var(--gu-border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(13,38,64,0.08);
}

.gu-navbar .container {
  display: flex;
  align-items: stretch;
}

.gu-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gu-navy-mid) !important;
  text-decoration: none !important;
  letter-spacing: 0.01em;
  border-bottom: 3px solid transparent;
  transition: color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.gu-nav-link:hover,
.gu-nav-link.active {
  color: var(--gu-navy) !important;
  border-bottom-color: var(--gu-gold);
}

.gu-nav-apply {
  display: inline-flex;
  align-items: center;
  margin: 8px 0 8px 12px;
  padding: 6px 16px;
  background-color: var(--gu-gold);
  color: var(--gu-navy) !important;
  font-size: 13px;
  font-weight: 500;
  border-radius: 3px;
  text-decoration: none !important;
  transition: background-color 0.15s;
}
.gu-nav-apply:hover {
  background-color: var(--gu-gold-dark);
}

/* Mobile hamburger */
.gu-nav-toggler {
  border: none;
  background: none;
  color: var(--gu-navy);
  padding: 10px;
  font-size: 20px;
  cursor: pointer;
}

/* ============================================================
   7. HERO SECTION
   ============================================================ */
.gu-hero {
  background-color: var(--gu-navy);
  padding: 56px 0 48px;
  position: relative;
  overflow: hidden;
}

.gu-hero::before {
  /* Subtle diagonal pattern — CSS only, no image dependency */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -45deg,
      rgba(201,162,39,0.04) 0px,
      rgba(201,162,39,0.04) 1px,
      transparent 1px,
      transparent 40px
    );
  pointer-events: none;
}

.gu-hero-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gu-gold);
  margin-bottom: 12px;
}

.gu-hero h1 {
  font-family: var(--gu-font-serif);
  font-size: 2rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
}

.gu-hero p {
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  margin-bottom: 28px;
  line-height: 1.65;
}

.gu-btn-primary {
  display: inline-block;
  background-color: var(--gu-gold);
  color: var(--gu-navy) !important;
  font-weight: 500;
  font-size: 14px;
  padding: 11px 24px;
  border-radius: 3px;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s;
}
.gu-btn-primary:hover {
  background-color: var(--gu-gold-dark);
}

.gu-btn-ghost {
  display: inline-block;
  background-color: transparent;
  color: rgba(255,255,255,0.85) !important;
  font-weight: 500;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.4);
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.15s;
}
.gu-btn-ghost:hover {
  border-color: rgba(255,255,255,0.8);
  color: #fff !important;
}

/* Stat strip inside hero */
.gu-stat-strip {
  display: flex;
  gap: 32px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.12);
  flex-wrap: wrap;
}

.gu-stat-item .gu-stat-number {
  font-family: var(--gu-font-serif);
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--gu-gold);
  line-height: 1;
}

.gu-stat-item .gu-stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ============================================================
   8. QUICK-LINKS STRIP
   ============================================================ */
.gu-quicklinks {
  background-color: var(--gu-offwhite);
  border-bottom: 1px solid var(--gu-border);
  padding: 14px 0;
}

.gu-quicklinks-inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.gu-quicklinks-inner::-webkit-scrollbar { display: none; }

.gu-quicklink-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: #fff;
  border: 1px solid var(--gu-border);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gu-navy-mid);
  text-decoration: none !important;
  white-space: nowrap;
  transition: all 0.12s;
}
.gu-quicklink-btn:hover {
  border-color: var(--gu-gold);
  color: var(--gu-navy);
  background-color: var(--gu-navy-light);
}
.gu-quicklink-btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  flex-shrink: 0;
}

/* ============================================================
   9. SECTION STRUCTURE
   ============================================================ */
.gu-section {
  padding: var(--gu-section-pad) 0;
}

.gu-section-alt {
  background-color: var(--gu-offwhite);
}

.gu-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--gu-navy);
  padding: 12px 20px;
  border-radius: var(--gu-card-radius) var(--gu-card-radius) 0 0;
}

.gu-panel-header h2 {
  font-family: var(--gu-font-sans);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

.gu-panel-header a {
  font-size: 12px;
  color: var(--gu-gold);
  text-decoration: none;
  font-weight: 500;
}
.gu-panel-header a:hover {
  color: #fff;
}

.gu-section-eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gu-gold);
  margin-bottom: 8px;
}

.gu-section-title {
  font-family: var(--gu-font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--gu-navy);
  margin-bottom: 24px;
}

/* ============================================================
   10. NOTICE ITEMS
   ============================================================ */
.gu-notice-list {
  border: 1px solid var(--gu-border);
  border-top: none; /* panel-header handles top */
  border-radius: 0 0 var(--gu-card-radius) var(--gu-card-radius);
  overflow: hidden;
}

.gu-notice-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gu-border);
  background-color: #fff;
  transition: background-color 0.1s;
}
.gu-notice-item:last-child { border-bottom: none; }
.gu-notice-item:hover { background-color: var(--gu-navy-light); }

.gu-urgency-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--gu-border);
  flex-shrink: 0;
  margin-top: 6px;
}
.gu-urgency-dot.urgent {
  background-color: var(--gu-danger);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.18);
}

.gu-notice-body {
  flex: 1;
  min-width: 0;
}

.gu-notice-title {
  font-size: var(--gu-fs-notice-title);
  font-weight: 500;
  color: var(--gu-navy);
  line-height: 1.4;
  margin-bottom: 4px;
}

.gu-notice-meta {
  font-size: var(--gu-fs-notice-meta);
  color: var(--gu-text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.gu-category-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.gu-chip-ug   { background-color: #dbeafe; color: #1e40af; }
.gu-chip-pg   { background-color: #ede9fe; color: #5b21b6; }
.gu-chip-phd  { background-color: #d1fae5; color: #065f46; }
.gu-chip-general { background-color: var(--gu-navy-light); color: var(--gu-navy); }
.gu-chip-result { background-color: #fef3c7; color: #92400e; }
.gu-chip-urgent { background-color: rgba(192,57,43,0.1); color: var(--gu-danger); }

.gu-notice-view-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--gu-navy-mid);
  text-decoration: none;
}
.gu-notice-view-link:hover {
  color: var(--gu-gold-dark);
  text-decoration: underline;
}

/* ============================================================
   Tom Select overrides -- match navy/gold palette
   ============================================================ */
.ts-wrapper.form-select,
.ts-wrapper .ts-control {
  border-color: var(--gu-border);
  border-radius: 3px;
  font-size: 14px;
  min-height: 38px;
}
.ts-wrapper.focus .ts-control,
.ts-wrapper.focus.form-select {
  border-color: var(--gu-gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}
.ts-dropdown {
  border-color: var(--gu-border);
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(13, 38, 64, 0.12);
  font-size: 14px;
}
.ts-dropdown .active {
  background-color: var(--gu-navy-light);
  color: var(--gu-navy);
}
.ts-dropdown .option {
  padding: 8px 12px;
}
.ts-wrapper .ts-control input::placeholder {
  color: var(--gu-text-muted);
  font-style: italic;
}

/* ============================================================
   Timeline (per-programme admission dates)
   ============================================================ */
.gu-timeline-list {
  position: relative;
  margin: 0;
  padding: 0 0 0 1.6rem;
  list-style: none;
}
.gu-timeline-list::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background-color: var(--gu-border);
}

.gu-timeline-item {
  position: relative;
  padding: 0 0 1rem 0;
}
.gu-timeline-item:last-child { padding-bottom: 0; }

.gu-timeline-item::before {
  content: "";
  position: absolute;
  left: -1.6rem;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #fff;
  border: 2px solid var(--gu-border);
  box-sizing: border-box;
}

/* OPEN — the gold pulse */
.gu-timeline-item.is-open::before {
  background-color: var(--gu-gold);
  border-color: var(--gu-gold);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.18);
  animation: gu-pulse 1.8s ease-in-out infinite;
}

/* CLOSED — faded */
.gu-timeline-item.is-closed { opacity: 0.55; }
.gu-timeline-item.is-closed::before {
  background-color: var(--gu-border);
  border-color: var(--gu-border);
}
.gu-timeline-item.is-closed .gu-timeline-title { text-decoration: line-through; }

/* MILESTONE — solid navy dot (overrides upcoming/open coloring) */
.gu-timeline-item.is-milestone::before {
  border-color: var(--gu-navy);
}
.gu-timeline-item.is-milestone.is-open::before {
  background-color: var(--gu-gold);
  border-color: var(--gu-navy);
}

.gu-timeline-date {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gu-text-muted);
  margin-bottom: 2px;
}
.gu-timeline-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--gu-navy);
  margin: 0;
  line-height: 1.35;
}
.gu-timeline-desc {
  font-size: 12px;
  color: var(--gu-text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

.gu-timeline-status {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}
.gu-timeline-status.open      { background-color: rgba(38, 92, 56, 0.12);  color: var(--gu-success); }
.gu-timeline-status.closed    { background-color: var(--gu-navy-light);    color: var(--gu-text-muted); }
.gu-timeline-status.upcoming  { background-color: rgba(201, 162, 39, 0.18); color: var(--gu-gold-dark); }
.gu-timeline-status.tentative {
  background-color: transparent;
  color: var(--gu-text-muted);
  border: 1px dashed var(--gu-text-muted);
  font-style: italic;
}

/* Phase label, shown inline with the date */
.gu-timeline-phase {
  margin-left: 4px;
  color: var(--gu-navy-mid);
  font-weight: 500;
}

/* Tentative item -- dotted dot + dotted line accent */
.gu-timeline-item.is-tentative::before {
  border-style: dashed;
}

/* Compact variant for the programme-detail sidebar */
.gu-timeline-list.is-compact .gu-timeline-item { padding-bottom: 0.7rem; }
.gu-timeline-list.is-compact .gu-timeline-title { font-size: 13px; }
.gu-timeline-list.is-compact .gu-timeline-desc { display: none; }

/* Shown briefly while drive_sync is replacing the local PDF with the Drive copy */
.gu-pdf-processing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-style: italic;
  color: var(--gu-text-muted);
}
.gu-pdf-processing::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--gu-gold);
  animation: gu-pulse 1.4s ease-in-out infinite;
}
@keyframes gu-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

/* ============================================================
   11. PROGRAMME CARDS
   ============================================================ */
.gu-prog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gu-prog-card {
  border: 1px solid var(--gu-border);
  border-radius: var(--gu-card-radius);
  padding: 20px;
  background-color: #fff;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.gu-prog-card:hover {
  border-color: var(--gu-gold);
  box-shadow: 0 4px 16px rgba(13,38,64,0.1);
  transform: translateY(-2px);
}

.gu-prog-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background-color: var(--gu-navy-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gu-navy);
  flex-shrink: 0;
}
.gu-prog-icon svg {
  width: 18px;
  height: 18px;
}

.gu-prog-name {
  font-size: var(--gu-fs-prog-name);
  font-weight: 500;
  color: var(--gu-navy);
  margin: 0;
  line-height: 1.3;
}

.gu-prog-desc {
  font-size: var(--gu-fs-prog-desc);
  color: var(--gu-text-muted);
  margin: 0;
  line-height: 1.5;
}

.gu-prog-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--gu-navy-mid);
  margin-top: auto;
}

/* ============================================================
   12. FOOTER
   ============================================================ */
.gu-footer {
  background-color: var(--gu-navy-dark);
  color: rgba(255,255,255,0.85);
  padding: 40px 0 24px;
  margin-top: 0;
  font-size: var(--gu-fs-footer);
}

.gu-footer .gu-footer-brand {
  font-family: var(--gu-font-serif);
  font-size: 1rem;
  color: #fff;
  font-weight: 500;
  margin-bottom: 8px;
}

.gu-footer a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  transition: color 0.12s;
}
.gu-footer a:hover {
  color: var(--gu-gold);
  text-decoration: none;
}

.gu-footer-nav-title {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gu-gold);
  margin-bottom: 12px;
}

.gu-footer-nav li {
  margin-bottom: 7px;
  list-style: none;
}

.gu-footer-divider {
  border-color: rgba(255,255,255,0.1);
  margin: 24px 0 20px;
}

.gu-footer-bottom {
  font-size: 13px;
  color: rgba(255,255,255,0.72);
}

/* ============================================================
   13. UTILITY OVERRIDES
   ============================================================ */

/* Bootstrap btn overrides for internal dashboard buttons */
.btn-gu-primary {
  background-color: var(--gu-gold);
  color: var(--gu-navy);
  border: none;
  font-weight: 500;
  font-size: 13px;
  border-radius: 3px;
  padding: 7px 18px;
}
.btn-gu-primary:hover {
  background-color: var(--gu-gold-dark);
  color: var(--gu-navy);
}

.btn-gu-outline {
  background-color: transparent;
  color: var(--gu-navy-mid);
  border: 1px solid var(--gu-border);
  font-size: 13px;
  font-weight: 500;
  border-radius: 3px;
  padding: 6px 16px;
}
.btn-gu-outline:hover {
  border-color: var(--gu-navy);
  color: var(--gu-navy);
}

/* "View All" link style */
.gu-view-all {
  font-size: 13px;
  font-weight: 500;
  color: var(--gu-navy-mid);
  text-decoration: none;
}
.gu-view-all:hover {
  color: var(--gu-gold-dark);
  text-decoration: underline;
}

/* ============================================================
   14. STAFF / DASHBOARD SURFACES
   ============================================================ */

/* Page header shared by every staff-facing page (and public sub-pages) */
.gu-page-header {
  background-color: var(--gu-offwhite);
  border-bottom: 1px solid var(--gu-border);
  padding: 28px 0 24px;
}
.gu-page-header h1 {
  font-size: 1.5rem;
  margin: 0;
}

/* Generic surface card -- replaces ad-hoc Bootstrap .card on staff pages */
.gu-card {
  background-color: #fff;
  border: 1px solid var(--gu-border);
  border-radius: var(--gu-card-radius);
  padding: 1.5rem 1.75rem;
}
.gu-card-narrow {
  max-width: 440px;
  margin: 0 auto;
}
.gu-card-medium {
  max-width: 720px;
  margin: 0 auto;
}

/* Form labels + controls (used wherever {{ form.x }} is rendered) */
.gu-form-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gu-text-muted);
  margin-bottom: 6px;
}
.gu-form-hint {
  display: block;
  font-size: 11px;
  color: var(--gu-text-muted);
  margin-top: 4px;
}
.gu-form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.gu-form-row > * { flex: 1; min-width: 220px; }

/* Form controls -- restyle bootstrap defaults to the navy/gold palette */
.gu-card .form-control,
.gu-card .form-select {
  border-color: var(--gu-border);
  border-radius: 3px;
  font-size: 14px;
  padding: 8px 12px;
  color: var(--gu-text-body);
}
.gu-card .form-control:focus,
.gu-card .form-select:focus {
  border-color: var(--gu-gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.15);
  outline: none;
}
.gu-card .form-check-input:checked {
  background-color: var(--gu-gold);
  border-color: var(--gu-gold);
}

/* Error / alert blocks */
.gu-alert {
  border-radius: var(--gu-card-radius);
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.gu-alert-error {
  background-color: rgba(192,57,43,0.08);
  border: 1px solid rgba(192,57,43,0.3);
  color: var(--gu-danger);
}
.gu-alert-info {
  background-color: var(--gu-navy-light);
  border: 1px solid var(--gu-border);
  color: var(--gu-navy);
}

/* Status badges -- workflow states */
.gu-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.gu-status-published { background-color: rgba(38,92,56,0.12);  color: var(--gu-success); }
.gu-status-submitted { background-color: rgba(201,162,39,0.18); color: var(--gu-gold-dark); }
.gu-status-rejected  { background-color: rgba(192,57,43,0.12);  color: var(--gu-danger); }
.gu-status-draft     { background-color: var(--gu-navy-light);  color: var(--gu-navy-mid); }

/* Tabs (used in staff dashboard) */
.gu-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--gu-border);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.gu-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gu-text-muted);
  text-decoration: none !important;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.gu-tab:hover { color: var(--gu-navy); }
.gu-tab.active {
  color: var(--gu-navy);
  border-bottom-color: var(--gu-gold);
}
.gu-tab .gu-tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background-color: var(--gu-navy-light);
  border-radius: 9px;
  font-size: 11px;
  color: var(--gu-navy-mid);
}
.gu-tab.active .gu-tab-count {
  background-color: var(--gu-gold);
  color: var(--gu-navy);
}

/* Dashboard data table */
.gu-table {
  width: 100%;
  background-color: #fff;
  border: 1px solid var(--gu-border);
  border-radius: var(--gu-card-radius);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 13px;
}
.gu-table thead th {
  background-color: var(--gu-offwhite);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gu-text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--gu-border);
  text-align: left;
  white-space: nowrap;
}
.gu-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gu-border);
  vertical-align: top;
  color: var(--gu-text-body);
}
.gu-table tbody tr:last-child td { border-bottom: none; }
.gu-table tbody tr:hover { background-color: var(--gu-navy-light); }
.gu-table .gu-table-title {
  font-weight: 500;
  color: var(--gu-navy);
}
.gu-table .gu-table-reject-reason {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--gu-danger);
  line-height: 1.4;
}

/* Compact button used inside tables / lists */
.gu-btn-sm {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 3px;
  text-decoration: none !important;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.12s;
}
.gu-btn-sm + .gu-btn-sm { margin-left: 4px; }
.gu-btn-edit    { background-color: var(--gu-navy-light); color: var(--gu-navy) !important; }
.gu-btn-edit:hover    { background-color: var(--gu-navy); color: #fff !important; }
.gu-btn-approve { background-color: var(--gu-success); color: #fff !important; }
.gu-btn-approve:hover { background-color: #1d4429; }
.gu-btn-reject  { background-color: var(--gu-danger); color: #fff !important; }
.gu-btn-reject:hover  { background-color: #962d22; }
.gu-btn-warn    { background-color: var(--gu-gold); color: var(--gu-navy) !important; }
.gu-btn-warn:hover    { background-color: var(--gu-gold-dark); color: var(--gu-navy) !important; }
.gu-btn-danger-ghost {
  background-color: transparent;
  color: var(--gu-danger) !important;
  border-color: rgba(192,57,43,0.3);
}
.gu-btn-danger-ghost:hover {
  background-color: rgba(192,57,43,0.08);
}

/* ============================================================
   15. RESPONSIVE
   ============================================================ */

/* ---- Hero action buttons (Home page CTA row) ---- */
.gu-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---- Desktop breakpoint adjustments ---- */
@media (max-width: 768px) {
  .gu-hero { padding: 36px 0 32px; }
  .gu-hero h1 { font-size: 1.5rem; }
  .gu-stat-strip { gap: 20px; }
  .gu-prog-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .gu-prog-grid { grid-template-columns: 1fr; }
  .gu-stat-strip { flex-direction: column; gap: 16px; }
  .gu-hero h1 { font-size: 1.3rem; }
  .gu-hero-actions { flex-direction: column; align-items: stretch; }
  .gu-hero-actions .gu-btn-primary,
  .gu-hero-actions .gu-btn-ghost { text-align: center; }
}

/* ============================================================
   16. MOBILE NAVIGATION (hamburger menu)
   ============================================================ */

/* ── Desktop (≥ 992px) ───────────────────────────────────────
   Bootstrap's navbar-expand-lg already sets
     .navbar-expand-lg .navbar-collapse { display: flex !important; flex-basis: auto; }
   so there is nothing to fight here. We only need to override
   Bootstrap's default align-items: center (which shortens links
   and breaks the bottom-border active indicator).               */
@media (min-width: 992px) {
  .gu-nav-links-wrap {
    align-items: stretch;   /* links fill full nav height → border-bottom sits flush */
  }
}

/* ── Mobile (< 992px) ────────────────────────────────────────
   Bootstrap's navbar-expand-lg hides .navbar-toggler on ≥992px
   and shows the collapse normally on mobile. We style the
   expanded dropdown here.                                       */
@media (max-width: 991px) {

  /* Hamburger sits right-aligned; links drop below it */
  .gu-navbar .container {
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  /* Dropdown panel */
  .gu-nav-links-wrap {
    width: 100%;
    flex-direction: column;
    padding: 8px 0 14px;
    border-top: 2px solid var(--gu-gold);
    background-color: #fff;
    box-shadow: 0 6px 16px rgba(13,38,64,0.1);
  }

  /* Force flex so flex-direction: column actually applies.
     Bootstrap 5 collapse adds .show and removes display:none —
     no inline style left behind, so this class selector wins. */
  .gu-nav-links-wrap.show {
    display: flex !important;
  }

  /* Individual links: full-width rows with left-border highlight */
  .gu-nav-links-wrap .gu-nav-link {
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 500;
    border-bottom: none !important;
    border-left: 3px solid transparent;
    color: var(--gu-navy-mid) !important;
    white-space: normal;
  }
  .gu-nav-links-wrap .gu-nav-link:hover {
    background-color: var(--gu-navy-light);
    border-left-color: var(--gu-border);
    color: var(--gu-navy) !important;
  }
  .gu-nav-links-wrap .gu-nav-link.active {
    background-color: var(--gu-navy-light);
    border-left-color: var(--gu-gold);
    color: var(--gu-navy) !important;
    border-bottom: none !important;
  }

  /* Thin divider before the CTA button */
  .gu-nav-links-wrap .gu-nav-apply {
    display: block;
    margin: 10px 16px 0 !important;
    text-align: center;
    border-top: 1px solid var(--gu-border);
    padding-top: 12px;
  }
}

/* Very small phones (≤ 400px): tighten the site header */
@media (max-width: 400px) {
  .gu-site-header img { height: 38px; }
  .gu-site-header .gu-brand-name { font-size: 1.05rem; }
  .gu-site-header .gu-brand-subtitle { font-size: 9px; letter-spacing: 0.06em; }
  .gu-site-header .gu-login-btn,
  .gu-site-header .gu-logout-btn { font-size: 12px; padding: 5px 12px; }
}

/* ============================================================
   17. TIMELINE PAGE — programme header + mobile polish
   ============================================================ */

/* Programme header inside the timeline card */
.gu-prog-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.gu-prog-header-icon {
  background: var(--gu-navy-light);
  border-radius: 6px;
  padding: .55rem;
  flex-shrink: 0;
}

.gu-prog-header-body {
  flex: 1;
  min-width: 0;          /* allow text to shrink + wrap */
}

/* Apply button: sits right-aligned on desktop */
.gu-prog-apply-btn {
  flex-shrink: 0;
  align-self: flex-start;
}

/* Scrollable filter tabs (used on timeline page) */
.gu-tabs-scroll {
  overflow-x: auto;
  flex-wrap: nowrap !important;   /* prevent wrapping into multi-row blob */
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* fade out at right edge as a scroll hint */
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
          mask-image: linear-gradient(to right, black 85%, transparent 100%);
}
.gu-tabs-scroll::-webkit-scrollbar { display: none; }

/* ── Mobile-specific timeline improvements (≤ 640px) ─────── */
@media (max-width: 640px) {

  /* Less horizontal padding on the card → more content width */
  .gu-card-timeline {
    padding: 1.1rem 1rem;
  }

  /* Apply button: break to its own full-width row below the title */
  .gu-prog-apply-btn {
    flex: 0 0 100%;
    text-align: center;
    margin-top: .25rem;
  }

  /* Status chips: large enough to read without squinting */
  .gu-timeline-status {
    font-size: 10.5px;
    padding: 2px 8px;
    vertical-align: middle;
  }

  /* Date line: a touch more prominent */
  .gu-timeline-date {
    font-size: 11.5px;
    font-weight: 500;
  }

  /* Title: slightly larger */
  .gu-timeline-title {
    font-size: 13.5px;
    line-height: 1.45;
  }

  /* Connecting line and dots: boost contrast on small screens */
  .gu-timeline-list::before {
    background-color: var(--gu-text-muted);   /* darker than --gu-border */
    opacity: .4;
  }

  /* Open dot: pulse is more visible on larger dot */
  .gu-timeline-item.is-open::before {
    width: 16px;
    height: 16px;
    top: 4px;
  }
}

/* ============================================================
   18. NOTICE LIST — YEAR SIDEBAR NAVIGATION
   ============================================================ */

.gu-year-nav {
  background-color: #fff;
  border: 1px solid var(--gu-border);
  border-radius: var(--gu-card-radius);
  overflow: hidden;
  position: sticky;
  top: 72px;   /* sit just below the sticky navbar */
}

.gu-year-nav-title {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gu-text-muted);
  padding: 10px 16px;
  background-color: var(--gu-offwhite);
  border-bottom: 1px solid var(--gu-border);
}

.gu-year-nav-link {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gu-navy-mid);
  text-decoration: none !important;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--gu-border);
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.gu-year-nav-link:last-child {
  border-bottom: none;
}
.gu-year-nav-link:hover {
  background-color: var(--gu-navy-light);
  color: var(--gu-navy);
  border-left-color: var(--gu-border);
}
.gu-year-nav-link.active {
  background-color: var(--gu-navy-light);
  color: var(--gu-navy);
  border-left-color: var(--gu-gold);
  font-weight: 600;
}

/* ============================================================
   19. PAGINATION
   ============================================================ */

.gu-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gu-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gu-navy-mid);
  background-color: #fff;
  border: 1px solid var(--gu-border);
  border-radius: 3px;
  text-decoration: none !important;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
  cursor: pointer;
}
.gu-page-link:hover {
  background-color: var(--gu-navy-light);
  border-color: var(--gu-navy-mid);
  color: var(--gu-navy);
}
.gu-page-link.active {
  background-color: var(--gu-navy);
  border-color: var(--gu-navy);
  color: #fff;
  cursor: default;
}
.gu-page-link.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}

/* ============================================================
   20. FONT SIZE ADJUSTER (A− / A / A+)
   ============================================================ */
.gu-font-adjuster {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 10px;
}

.gu-sz-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.65);
  border-radius: 3px;
  padding: 3px 7px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.12s;
  /* Three sizes for the visual "A" itself */
}
.gu-sz-btn:nth-child(1) { font-size: 11px; } /* A− */
.gu-sz-btn:nth-child(2) { font-size: 13px; } /* A  */
.gu-sz-btn:nth-child(3) { font-size: 15px; } /* A+ */

.gu-sz-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.45);
  color: #fff;
}
.gu-sz-btn.gu-sz-active {
  background: rgba(201,162,39,0.25);
  border-color: var(--gu-gold);
  color: var(--gu-gold);
}

/* Font adjuster row inside mobile nav menu */
.gu-nav-sz-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 6px;
  margin-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.gu-nav-sz-label {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 4px;
}
/* Bigger touch targets for adjuster buttons inside nav */
.gu-nav-sz-row .gu-sz-btn {
  padding: 6px 12px;
  min-width: 36px;
}

/* Override remaining hardcoded-px rules so they participate in scaling */

html[data-sz="lg"] .gu-hero p            { font-size: 17px; }
html[data-sz="lg"] .gu-btn-primary,
html[data-sz="lg"] .gu-btn-ghost         { font-size: 16px; }
html[data-sz="lg"] .gu-timeline-title    { font-size: 16px; }
html[data-sz="lg"] .gu-timeline-desc     { font-size: 14px; }
html[data-sz="lg"] .gu-timeline-date     { font-size: 13px; }
html[data-sz="lg"] .gu-notice-view-link  { font-size: 15px; }
html[data-sz="lg"] .gu-quicklink-btn     { font-size: 15px; }
html[data-sz="lg"] .gu-year-nav-link     { font-size: 16px; }

html[data-sz="sm"] .gu-hero p            { font-size: 14px; }
html[data-sz="sm"] .gu-btn-primary,
html[data-sz="sm"] .gu-btn-ghost         { font-size: 13px; }
html[data-sz="sm"] .gu-timeline-title    { font-size: 13px; }
html[data-sz="sm"] .gu-timeline-desc     { font-size: 11px; }
html[data-sz="sm"] .gu-notice-view-link  { font-size: 12px; }
html[data-sz="sm"] .gu-quicklink-btn     { font-size: 12px; }
html[data-sz="sm"] .gu-year-nav-link     { font-size: 13px; }
