@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Malayalam:wght@400;500;600;700&family=Poppins:wght@400;500;600;700;800&display=swap');

/* =========================================================================
   style.css — Established Institutional Design System Tokens & Base Architecture
   ========================================================================= */

:root {
  /* Modern University Palette — Slate, Royal Blue & Teal */
  --theme-primary: #0f172a;
  /* Deep Slate */
  --theme-primary-dark: #020617;
  /* Near Black */
  --theme-secondary: #1e40af;
  /* Royal Blue */
  --theme-accent: #0d9488;
  /* Teal — modern academic accent */
  --theme-accent-hover: #0f766e;
  /* Deep Teal */
  --theme-accent-light: #f0fdfa;
  /* Soft Teal Tint */
  --theme-highlight: #38bdf8;
  /* Sky highlight */

  --theme-bg: #ffffff;
  --theme-surface: #f8fafc;
  /* Cool Light Gray Surface */
  --theme-surface-alt: #f1f5f9;
  /* Light Slate Gray */

  --theme-text: #0f172a;
  /* Dark Navy / Charcoal Text */
  --theme-muted: #475569;
  /* Slate Muted Text */
  --theme-line: #e2e8f0;
  /* Crisp 1px Border Line */
  --theme-soft: #f8fafc;

  /* Backward Compatibility Aliases */
  --c-primary: var(--theme-primary);
  --c-secondary: var(--theme-secondary);
  --c-accent: var(--theme-accent);
  --c-bg: var(--theme-bg);
  --c-surface: var(--theme-surface);
  --c-text: var(--theme-text);
  --c-muted: var(--theme-muted);
  --c-line: var(--theme-line);
  --c-soft: var(--theme-soft);

  /* Typography — Poppins */
  --font-serif: 'Poppins', system-ui, sans-serif;
  --font-heading: 'Poppins', system-ui, sans-serif;
  --font-body: 'Poppins', system-ui, sans-serif;
  --font-malayalam: 'Noto Sans Malayalam', 'Poppins', sans-serif;

  /* Restrained Institutional Radii (6px - 10px) */
  --radius-lg: 10px;
  --radius-card: 8px;
  --radius: 6px;
  --radius-sm: 4px;
  --radius-full: 9999px;

  /* Subtle Elevation Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12);

  --maxw: 1280px;
  --header-h: 80px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--theme-text);
  background-color: var(--theme-bg);
  line-height: 1.65;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* prevents horizontal scroll from any oversized element on mobile */
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--theme-secondary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--theme-accent);
}

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--theme-primary);
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
}

h3 {
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  font-weight: 700;
}

p {
  margin: 0 0 1.25em;
  max-width: 680px;
}

p:last-child {
  margin-bottom: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Institutional Grid Alignment ---- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 80px 0;
  position: relative;
  scroll-margin-top: var(--header-h);
  /* keeps anchored/jumped-to sections clear of the sticky header */
}

/* Section Headings - Academic Alignment */
.section-head {
  text-align: left;
  max-width: 800px;
  margin-bottom: 40px;
  border-bottom: 2px solid var(--theme-line);
  padding-bottom: 16px;
}

.section-label,
.section-eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 12px;
  font-weight: 800;
  color: var(--theme-accent);
  margin-bottom: 6px;
  font-family: var(--font-heading);
}

.section-title {
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 800;
  color: var(--theme-primary);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.section-sub,
.subtitle {
  color: var(--theme-muted);
  font-size: 16px;
  margin: 0;
  line-height: 1.5;
}

/* ---- Academic Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.25;
  white-space: nowrap;
}

.btn-primary {
  background: var(--theme-secondary);
  color: #ffffff;
  border: none;
}

.btn-primary:hover {
  background: var(--theme-primary);
  color: #ffffff;
}

.btn-accent {
  background: var(--theme-accent);
  color: #ffffff;
  font-weight: 700;
}

.btn-accent:hover {
  background: var(--theme-accent-hover);
  color: #ffffff;
}

.btn-outline {
  border-color: var(--theme-line);
  color: var(--theme-primary);
  background: #ffffff;
}

.btn-outline:hover {
  border-color: var(--theme-primary);
  background: var(--theme-surface);
}

.btn-light,
.btn-white {
  background: #ffffff;
  color: var(--theme-primary);
  border: 1px solid var(--theme-line);
}

.btn-light:hover,
.btn-white:hover {
  background: var(--theme-surface);
  border-color: var(--theme-primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13.5px;
}

/* ---- Restrained Academic Cards ---- */
.card {
  background: #ffffff;
  border: 1px solid var(--theme-line);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(11, 25, 44, 0.2);
}

.card-media {
  height: 200px;
  background: var(--theme-surface-alt);
  overflow: hidden;
  position: relative;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 22px;
}

.card-body h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

/* ---- Badges & Metadata Chips ---- */
.chip {
  display: inline-flex;
  align-items: center;
  background: var(--theme-surface);
  color: var(--theme-text);
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--theme-line);
}

.chip-row {
  margin-top: 14px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-new {
  display: inline-block;
  background: var(--theme-accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-left: 8px;
  text-transform: uppercase;
}

/* ---- Form Controls ---- */
.form-row,
.form-group {
  margin-bottom: 20px;
}

.form-row label,
.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--theme-primary);
}

.form-row .req,
.form-group label .req {
  color: #dc2626;
  margin-left: 2px;
}

.form-control,
.form-group input,
.form-group select,
.form-group textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--theme-line);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: inherit;
  background: #ffffff;
  color: var(--theme-text);
  transition: var(--transition);
  box-sizing: border-box;
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--theme-secondary);
  box-shadow: 0 0 0 3px rgba(11, 25, 44, 0.1);
}

.form-group textarea,
textarea.form-control {
  min-height: 110px;
  resize: vertical;
}

.form-group small,
.form-help {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--theme-muted);
}

/* ---- State Blocks ---- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--theme-muted);
  padding: 40px;
  font-size: 14.5px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--theme-line);
  border-top-color: var(--theme-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.state-block {
  border-radius: var(--radius-card);
  padding: 36px;
  text-align: center;
  color: var(--theme-muted);
}

.state-empty {
  border: 1px solid var(--theme-line);
  background: var(--theme-surface);
}

.skel {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

/* ---- Back to Top ---- */
#scroll-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 500;
  width: 44px;
  height: 44px;
  border: 1px solid var(--theme-line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--theme-primary);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: var(--transition);
  display: grid;
  place-items: center;
}

#scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#scroll-top:hover {
  background: var(--theme-accent);
  color: #ffffff;
  border-color: var(--theme-accent);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 2000;
  background: var(--theme-primary);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.skip-link:focus {
  left: 12px;
}

/* =========================================================================
   RESPONSIVE BASE — was completely missing before. Without this, every
   multi-column grid in components.css stays locked at desktop widths and
   overflows/crushes text on tablet and mobile.
   ========================================================================= */

@media (max-width: 1024px) {
  section {
    padding: 64px 0;
  }

  .container {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  section {
    padding: 48px 0;
  }

  h1 {
    font-size: clamp(1.9rem, 7vw, 2.4rem);
  }

  h2 {
    font-size: clamp(1.5rem, 6vw, 1.9rem);
  }

  .section-head {
    margin-bottom: 28px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .btn {
    width: 100%;
  }
}