:root {
  --hero-bg: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3));
  --shadow-color: rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
}

a {
  text-decoration: none;
  color: var(--accent-color);
}

/* Hero Section */
.department-hero {
  position: relative;
  height: 60vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* dark overlay */
.department-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.dept-hero-overlay,
.department-hero>* {
  position: relative;
  z-index: 2;
}

/* .department-hero {
      background-image: url("{% if hero_image %}{{ media_url }}{% else %}{% static 'images/default-hero.jpg' %}{% endif %}");
    }
  .dept-hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--hero-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 2rem;
  } */

.dept-hero-overlay h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.dept-hero-overlay p {
  font-size: 1.2rem;
}

/* Main Container */
.dept-page {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  gap: 2rem;
}

/* Chairman Card */
.chairman-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1rem;
  padding: 1.5rem;
}

@media (max-width:768px) {
  .chairman-card h2 {
    text-align: center;
    font-size: 20px;
    margin-bottom: 10px;
  }
}

.chairman-card h2 {
  color: var(--primary-color);
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
}

.chairman-card h3 {
  color: hsl(0, 0%, 43.5%);
  margin-bottom: 5px;
  margin-top: -5px;
  font-weight: 600;
  font-size: 16px;
}

.chairman-info p {
  margin-bottom: 10px;
}

.chairman-info a {
  max-width: 250px;
}

.chairman-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
}

.chairman-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chairman-info .designation {
  font-size: 1rem;
  color: hsl(0, 0%, 43.5%);
  margin-bottom: 0.5rem;
}

.chairman-info .btn-chairman-profile,
.faculty-card .profile-btn {
  display: inline-block;
  background: var(--primary-color);
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  transition: background var(--transition-speed);
  text-align: center;
  font-weight: normal;
  border-radius: 4px;
}

.faculty-actions a {
  font-weight: normal;
  color: var(--white-color);
}

.chairman-info .btn-chairman-profile:hover,
.faculty-card .profile-btn:hover {
  background: var(--accent-color);
}

/* About Section */
.dept-about {
  margin-bottom: 1.5rem;
  text-align: justify !important;
}

.dept-about h3 {
  font-size: 1.4rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.dept-about p {
  font-size: 1rem;
  line-height: 1.6;
  color: #444;
}

.dept-page h1 {
  text-align: center;
  color: var(--primary-color);
}

section h2 {
  text-align: left;
  margin-bottom: 1rem;
}

.faculty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  justify-items: center;
}

.faculty-card {
  background: var(--light-bg);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 1px 4px var(--shadow-color);
  transition: transform var(--transition-speed);
  width: 100%;
}

.faculty-card:hover {
  transform: translateY(-3px);
}

.faculty-card img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  border-radius: 50%;
}

.faculty-card h3 {
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 0.3rem;
}

.faculty-card p {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 0.5rem;
}

/* News & Updates Section */
.news-section {
  background: var(--white-color);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px var(--shadow-color);
}

.news-section h2 {
  font-size: 1.6rem;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 1rem;
}

.news-list {
  max-height: 300px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
}

.news-list li {
  padding: 0.5rem;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.news-list li:last-child {
  border-bottom: none;
}

.news-list li i {
  color: var(--accent-color);
}

.news-list li a {
  font-size: 0.95rem;
  color: var(--primary-color);
}

/* Gallery Section */
.dept-gallery {
  padding-block: 1.5rem;
}

.gallery-container {
  text-align: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 1px 4px var(--shadow-color);
}

/* Responsive */
@media screen and (max-width: 768px) {
  .dept-hero {
    height: 30vh;
  }

  .dept-hero-overlay h1 {
    font-size: 2rem;
  }

  .dept-hero-overlay p {
    font-size: 1rem;
  }

  .chairman-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .chairman-photo {
    margin: 0 auto 1rem;
  }

  .chairman-info {
    align-items: center;
  }
}

.dept-about input {
  display: none;
}

.public-content .ql-editor {
  pointer-events: none;
  user-select: none;
  border: none !important;
  background: transparent;
}


.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  transition: transform var(--transition-speed) ease;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: var(--spacing);
}

.sidebar-nav li+li {
  margin-top: var(--spacing);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
}

.sidebar-nav i {
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

.toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  padding: var(--spacing);
  cursor: pointer;
}

.content {
  flex: 1;
  padding: var(--spacing);
}

.section {
  margin-bottom: var(--section-spacing);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .dept-container {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%);
    z-index: 1000;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .toggle-btn {
    display: block;
    position: fixed;
    top: var(--spacing);
    left: var(--spacing);
    z-index: 1100;
  }

  .content {
    padding-top: calc(var(--spacing) * 3);
  }
}



button.toggle-btn-dept {
  padding: 11px;
  margin-bottom: 1px;
  background: none;
  border: solid 1px var(--primary-color);
  color: var(--primary-color);
}

.bi-list::before {
  font-size: 24px;
}

button.sidebarCancel {
  display: none;
}



.department-sections-container {
  display: grid;
  grid-template-columns: 300px 1fr;
}

.dept-header {
  margin-block: 50px 30px;
}

.dept-header h1 {
  color: var(--primary-color);
  text-align: center;
  line-height: 1;
}

.department-sections-container .section {
  padding: 20px 50px;
}

@media (max-width: 768px) {
  .department-sections-container .section {
    padding: 0px;
  }
}

.department-sections-container .section:not(.active) {
  display: none;
}

.department-sections-container .section.active {
  display: block;
}

.sidebar-nav {
  background-color: smokewhite;
}

.sidebar-nav a {
  font-weight: 700;
  padding: 14px 10px;
  color: var(--primary-color);
  border-bottom: solid 1px #213448;
}

.sidebar-nav:first-child {
  border-top: solid 1px #213448;
}

.sidebar-nav a:hover {
  background-color: var(--primary-color);
  color: white;
}

.sidebar-nav a.active {
  background-color: var(--primary-color);
  transition: all 350ms ease;
  color: white;
}

@media screen and (min-width: 768px) {

  .sidebarDeptMobile,
  #sidebarToggleDept,
  .dept-sidebar-overlay {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .sidebar-nav a span {
    display: none;
  }

  .department-sections-container {
    grid-template-columns: 50px 1fr;
  }

  .sidebarDeptMobile {
    position: fixed;
    left: 0;
    bottom: 0;
    top: 0;
    background: #f1f1f1;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 350ms;
  }

  .sidebarDeptMobile.active {
    transform: translateX(0%);
    transition: transform 350ms;
  }

  .dept-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0px;
    background: #00000060;
    z-index: 999;
    backdrop-filter: blur(1px);
  }

  .dept-sidebar-overlay.active {
    display: block;
  }
}