/* ============================================
   GTUStudyMaterial - Common Stylesheet
   GTU Study Material - Old Papers, Syllabus & Study Resources
   ============================================ */

/* --- CSS Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1a5276;
  --primary-light: #2980b9;
  --primary-dark: #0e2f44;
  --accent: #e67e22;
  --accent-light: #f39c12;
  --text: #2c3e50;
  --text-light: #5d6d7e;
  --text-muted: #95a5a6;
  --bg: #f8f9fa;
  --bg-white: #ffffff;
  --bg-light: #ecf0f1;
  --border: #dee2e6;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
  --font-primary: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-heading: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.75em;
  font-weight: 700;
}

h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.65rem;
}
h3 {
  font-size: 1.35rem;
}
h4 {
  font-size: 1.15rem;
}

p {
  margin-bottom: 1em;
  line-height: 1.8;
}

ul,
ol {
  margin-left: 1.5em;
  margin-bottom: 1em;
}

li {
  margin-bottom: 0.5em;
}

code {
  font-size: 0.9em;
  font-weight: 500;
  background-color: #f1f3f5;
  color: #c0392b;
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-family: "Fira Code", "Consolas", monospace;
}

/* --- Layout Container --- */
.grid-container,
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header --- */
.site-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #ffffff;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.inside-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-logo img,
.header-image.is-logo-image {
  height: 42px;
  width: auto;
}

.site-logo .brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.site-logo .brand-name span {
  color: var(--accent-light);
}

/* --- Navigation --- */
.main-navigation {
  background: transparent !important;
}

.main-navigation .main-nav ul {
  display: flex;
  list-style: none;
  gap: 0;
  margin: 0;
  padding: 0;
}

.main-navigation .main-nav ul li a {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-decoration: none;
  display: block;
}

.main-navigation .main-nav ul li a:hover,
.main-navigation .main-nav ul li.current-menu-item > a {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.15);
}

/* Dropdown */
.main-navigation ul ul {
  background: var(--bg-white) !important;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 0.5rem 0;
  min-width: 200px;
}

.main-navigation .main-nav ul ul li a {
  color: var(--text) !important;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0;
}

.main-navigation .main-nav ul ul li a:hover {
  color: var(--primary) !important;
  background: var(--bg-light) !important;
}

/* Mobile menu button */
.menu-toggle {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

/* --- Main Content --- */
.site-content {
  min-height: 60vh;
}

.content-area {
  width: 100% !important;
}

.inside-article {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  margin: 1.5rem 0;
}

.entry-content {
  max-width: 900px;
  margin: 0 auto;
}

.entry-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.entry-title {
  font-size: 1.8rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.entry-title a {
  color: var(--primary-dark);
  text-decoration: none;
}

.entry-title a:hover {
  color: var(--primary-light);
}

/* --- Home Page Hero Section (replaces the old heading) --- */
.wp-block-heading.has-text-align-center {
  font-size: 1.6rem !important;
  font-weight: 700 !important;
  color: var(--primary-dark) !important;
  margin: 1.5rem 0 1rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.wp-block-heading.has-text-align-center::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

/* --- Cards / Columns Section --- */
.wp-block-columns.alignwide {
  background: var(--bg-white) !important;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  gap: 1.5rem !important;
}

.wp-block-column {
  transition: var(--transition);
}

.wp-block-column:hover {
  transform: translateY(-4px);
}

.wp-block-column figure img,
.wp-block-image img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.wp-block-column:hover figure img,
.wp-block-column:hover .wp-block-image img {
  box-shadow: var(--shadow-md);
}

/* --- Media Text Blocks (Branch cards) --- */
.wp-block-media-text {
  background: var(--bg-white) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.25rem !important;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.wp-block-media-text:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.wp-block-media-text__media img {
  border-radius: 0 !important;
}

.wp-block-media-text__content {
  padding: 1.5rem 2rem !important;
}

.wp-block-media-text__content h3 {
  color: var(--primary-dark);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* --- Buttons --- */
.wp-block-button__link,
.wp-block-button .wp-element-button {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-radius: var(--radius-sm) !important;
  padding: 0.5rem 1.2rem !important;
  font-size: 0.85rem !important;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  display: inline-block;
}

.wp-block-button__link:hover,
.wp-block-button .wp-element-button:hover {
  background: var(--accent) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.wp-block-buttons {
  gap: 0.6rem !important;
}

/* --- Tabbed Content (for paper solutions) --- */
.wp-block-ub-tabbed-content-tabs-title {
  background: var(--bg-light) !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
}

.wp-block-ub-tabbed-content-tab-title-wrap.active {
  background: var(--primary) !important;
  color: #ffffff !important;
}

.wp-block-ub-tabbed-content-tabs-content {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
  border: 1px solid var(--border);
  padding: 1.5rem !important;
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

th,
td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
}

tr:nth-child(even) {
  background: var(--bg-light);
}

tr:hover {
  background: #e8f4fd;
}

td a {
  color: var(--primary-light);
  font-weight: 500;
}

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

/* --- Spacer --- */
.wp-block-spacer {
  height: 20px !important;
}

/* --- Footer --- */
.site-footer {
  margin-top: 2rem;
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 3rem 0 0;
  margin-top: 0;
}

.footer-widgets {
  background: var(--bg-light) !important;
  padding: 2rem 0;
}

.footer-widgets-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-info {
  background: var(--primary-dark) !important;
  color: rgba(255, 255, 255, 0.9);
  padding: 1rem 0;
  font-size: 0.85rem !important;
}

.site-info a {
  color: var(--accent-light) !important;
  text-decoration: none;
}

.site-info a:hover {
  color: #ffffff !important;
}

.copyright-bar {
  text-align: center;
}

.footer-bar {
  text-align: center;
  margin-bottom: 0.75rem;
}

.footer-bar .menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
}

.footer-bar .menu li a {
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.footer-bar .menu li a:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1);
}

/* --- Back to Top --- */
.generate-back-to-top {
  background: var(--primary) !important;
  color: #ffffff !important;
  width: 44px;
  height: 44px;
  line-height: 44px;
  text-align: center;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  font-size: 18px;
  bottom: 30px;
  right: 30px;
  position: fixed;
  z-index: 100;
}

.generate-back-to-top:hover {
  background: var(--accent) !important;
  transform: translateY(-3px);
}

/* --- Utility Classes --- */
.text-center {
  text-align: center;
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}

/* --- Post Navigation (hidden) --- */
.post-navigation,
.entry-meta {
  display: none;
}

/* --- Print Styles --- */
@media print {
  body {
    display: none;
  }
}

/* --- Responsive --- */
@media screen and (max-width: 1024px) {
  .inside-article {
    padding: 1.5rem;
  }

  .wp-block-media-text {
    grid-template-columns: 100% !important;
  }
}

@media screen and (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .inside-header {
    padding: 0.5rem 0.75rem;
  }

  .inside-article {
    padding: 1.25rem;
    margin: 1rem 0;
    border-radius: var(--radius-md);
  }

  h1 {
    font-size: 1.6rem;
  }
  h2 {
    font-size: 1.35rem;
  }
  h3 {
    font-size: 1.15rem;
  }

  .wp-block-columns.alignwide {
    flex-direction: column !important;
    padding: 1rem;
  }

  .wp-block-media-text__content {
    padding: 1rem !important;
  }

  .site-info {
    font-size: 0.8rem !important;
  }

  .footer-bar .menu {
    flex-direction: column;
    align-items: center;
  }

  .wp-block-ub-tabbed-content-tabs-content {
    padding: 0.75rem !important;
  }

  table {
    font-size: 0.85rem;
  }

  th,
  td {
    padding: 0.5rem 0.6rem;
  }
}

@media screen and (max-width: 480px) {
  .inside-article {
    padding: 1rem;
  }

  .wp-block-button__link,
  .wp-block-button .wp-element-button {
    padding: 0.4rem 0.9rem !important;
    font-size: 0.8rem !important;
  }

  .site-logo .brand-name {
    font-size: 1.1rem;
  }
}

/* ============================================================
   HOME PAGE — Clean Redesign
   (new semantic markup, no wp- classes)
   ============================================================ */

/* ── Header inner wrapper ── */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
  height: 64px;
  gap: 1rem;
}

/* ── Logo ── */
a.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

/* New logo mark + wordmark */
.logo-mark {
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 0.28rem 0.58rem;
  border-radius: var(--radius-sm);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.logo-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-wordmark strong {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.logo-wordmark em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-light);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* ── Primary Navigation ── */
.primary-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 0;
  margin: 0;
  padding: 0;
  align-items: stretch;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0 0.9rem;
  height: 64px;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-item.active .nav-link {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* First-level dropdown */
.has-dropdown > .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  min-width: 190px;
  padding: 0.4rem 0;
  z-index: 200;
  list-style: none;
  margin: 0;
}

.nav-item.has-dropdown:hover > .dropdown,
.nav-item.has-dropdown.open > .dropdown {
  display: block;
}

.dropdown li {
  position: relative;
}

.dropdown li a {
  display: block;
  padding: 0.45rem 1rem;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.dropdown li a:hover {
  color: var(--primary);
  background: var(--bg-light);
}

/* Nested (third-level) dropdown */
.dropdown .has-dropdown > .dropdown--nested {
  display: none;
  position: absolute;
  top: -0.4rem;
  left: 100%;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  min-width: 150px;
  padding: 0.4rem 0;
  z-index: 201;
  list-style: none;
  margin: 0;
}

.dropdown .has-dropdown:hover > .dropdown--nested,
.dropdown .has-dropdown.open > .dropdown--nested {
  display: block;
}

.dropdown .has-dropdown > a::after {
  content: " ›";
  float: right;
  font-weight: 400;
  opacity: 0.55;
  margin-left: 0.5rem;
}

/* ── Hamburger button ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  gap: 5px;
  padding: 8px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Hero Section ── */
.hero {
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary) 60%,
    #1f6da6 100%
  );
  color: #fff;
  padding: 4.5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.04) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 20% 80%,
      rgba(255, 255, 255, 0.03) 0%,
      transparent 40%
    );
  pointer-events: none;
}

.hero .container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.hero-tagline {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: clamp(1.75rem, 4vw, 2.7rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 0.9rem;
}

.hero-title span {
  color: var(--accent-light);
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 0;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 1.1rem 0.75rem;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-light);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Buttons (new clean classes) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.3rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  line-height: 1.4;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-accent {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}
.btn-accent:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  color: #fff !important;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.55);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #fff;
  color: #fff !important;
}

.btn-lg {
  padding: 0.75rem 1.85rem;
  font-size: 0.95rem;
}

.btn-sm {
  padding: 0.32rem 0.8rem;
  font-size: 0.79rem;
}

/* ── Section Headings ── */
.section-heading {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--primary-dark);
  text-align: center;
  margin-bottom: 0.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.section-heading::after {
  content: "";
  display: block;
  width: 50px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0.5rem auto 0;
}

.section-sub {
  text-align: center;
  color: var(--text-light);
  font-size: 0.95rem;
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

/* ── Quick Access Section ── */
.quick-access {
  padding: 4.5rem 0;
  background: var(--bg);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.quick-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  color: inherit;
}

.quick-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
  color: inherit;
}

.quick-card-img {
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.quick-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.quick-card:hover .quick-card-img img {
  transform: scale(1.05);
}

.quick-card-body {
  padding: 1.1rem 1.25rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.quick-card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.35rem;
}

.quick-card-body p {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  flex: 1;
}

.quick-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-top: auto;
  transition: var(--transition);
}

.quick-card:hover .quick-link {
  color: var(--accent);
}

/* ── Branch Cards Section ── */
.branches {
  padding: 4.5rem 0 5rem;
  background: linear-gradient(180deg, var(--bg) 0%, #eef2f7 100%);
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

.branch-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.branch-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.branch-thumb {
  position: relative;
  overflow: hidden;
}

.branch-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.branch-card:hover .branch-thumb img {
  transform: scale(1.07);
}

.branch-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  letter-spacing: 0.5px;
}

.branch-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.branch-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.9rem;
  line-height: 1.3;
}

.branch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Footer (new markup) ── */

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand p {
  font-size: 0.87rem;
  color: rgba(255, 255, 255, 0.661);
  margin-top: 0.75rem;
  max-width: 300px;
  line-height: 1.6;
}

a.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

a.footer-logo span {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-content: flex-start;
  padding-top: 0.25rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.84rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.footer-bottom {
  text-align: center;
  padding: 1rem 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.753);
}

/* ── Back to Top (new clean class) ── */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 500;
}

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

.back-to-top:hover {
  background: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ── Home Page Responsive Overrides ── */
@media screen and (max-width: 1100px) {
  .branch-grid {
    grid-template-columns: 1fr;
  }
  .branch-card {
    grid-template-columns: 220px 1fr;
  }
}

@media screen and (max-width: 1024px) {
  /* Show hamburger, hide desktop nav */
  .nav-toggle {
    display: flex;
  }

  .primary-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.38s ease;
    z-index: 999;
    justify-content: flex-start;
  }

  .primary-nav.is-open {
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }

  .nav-list {
    flex-direction: column;
    padding: 0.5rem 0 1rem;
  }

  .nav-link {
    height: auto;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }

  /* Mobile: dropdowns show on .open (toggled by JS) */
  .has-dropdown > .dropdown {
    display: none !important;
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.18) !important;
    padding: 0 0 0.25rem 0.75rem;
    min-width: unset;
  }

  .has-dropdown.open > .dropdown {
    display: block !important;
  }

  .dropdown li a {
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.45rem 1.25rem;
    font-size: 0.83rem;
  }

  .dropdown li a:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.07) !important;
  }

  .dropdown .has-dropdown > .dropdown--nested {
    position: static !important;
    background: rgba(0, 0, 0, 0.15) !important;
    box-shadow: none;
    border: none;
    padding-left: 0.75rem;
  }

  .dropdown .has-dropdown > a::after {
    display: none;
  }

  /* Other responsive adjustments */
  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media screen and (max-width: 768px) {
  .header-inner {
    height: 56px;
    padding: 0 1rem;
  }
  .primary-nav {
    top: 56px;
  }
  .hero {
    padding: 3rem 0 2.5rem;
  }
  .hero-title {
    font-size: 1.65rem;
  }
  .quick-access {
    padding: 2.5rem 0;
  }
  .branches {
    padding: 2.5rem 0 3.5rem;
  }
  .branch-card {
    grid-template-columns: 1fr;
  }
  .branch-thumb {
    height: 175px;
  }
}

@media screen and (max-width: 480px) {
  .quick-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
  .stat-num {
    font-size: 1.4rem;
  }
  .hero-cta {
    flex-direction: column;
  }
  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }
  .branch-body {
    padding: 1rem;
  }
  .footer-inner {
    gap: 1.25rem;
  }
}

/* ============================================================
   Semester Tab Switcher
   ============================================================ */
.sem-tabs {
  margin-top: 1.75rem;
}

.tab-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.75rem;
}

.tab-btn {
  padding: 0.5rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 0.4rem;
  background: #fff;
  color: var(--text-dark);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.18s,
    color 0.18s,
    border-color 0.18s,
    box-shadow 0.18s;
  white-space: nowrap;
}

.tab-btn:hover {
  border-color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(26, 82, 118, 0.18);
}

.tab-panel {
  animation: fadePanel 0.2s ease;
}

.tab-panel[hidden] {
  display: none;
}

@keyframes fadePanel {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Table styles for syllabus panels */
.tab-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0;
}

.tab-panel thead th {
  background: var(--primary);
  color: #fff;
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.tab-panel tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.tab-panel tbody tr:last-child {
  border-bottom: none;
}

.tab-panel tbody td {
  padding: 0.6rem 0.85rem;
  vertical-align: middle;
  color: var(--text-dark);
}

.tab-panel tbody td a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  background: var(--accent);
  color: #fff;
  border-radius: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.16s,
    transform 0.12s;
}

.tab-panel tbody td a:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Responsive table: stack on very small screens */
@media (max-width: 540px) {
  .tab-btns {
    gap: 0.35rem;
  }
  .tab-btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
  }
  .tab-panel table,
  .tab-panel thead,
  .tab-panel tbody,
  .tab-panel th,
  .tab-panel td,
  .tab-panel tr {
    display: block;
  }
  .tab-panel thead tr {
    display: none;
  }
  .tab-panel tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.65rem;
    border-bottom: 1px dashed var(--border);
  }
  .tab-panel tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--primary);
    flex: 0 0 40%;
    font-size: 0.8rem;
  }
  .tab-panel tbody tr {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    overflow: hidden;
  }
}
