/* ========================================================================
   Department Page Theme — shared styles for department index.php pages
   AND department sub-pages (faculty.php, career.php, etc. via
   inc/premium-styles.php). Reconciled from two previously-duplicated
   sources:
     A) the inline <style> block copy-pasted into every department index.php
     B) inc/premium-styles.php's <style> block (still also contains a
        <script> CMS-table-normalizer, which stays in premium-styles.php)
   ======================================================================== */

/* Duplicate Header Fix */
.content-card .chairman {
  display: none;
}

/* Shared Hero Style */
.about-hero {
  background: linear-gradient(-45deg, #910029, #1E4D8C, #667eea, #764ba2);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
  padding: 120px 20px 140px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

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

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

.about-hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: float 10s ease-in-out infinite;
}

.about-hero::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  bottom: -150px;
  left: -100px;
  animation: float 8s ease-in-out infinite reverse;
}

.about-hero h1 {
  font-size: 3.5rem;
  font-weight: 900;
  color: white;
  margin-bottom: 20px;
  text-shadow: 0 4px 30px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}

.about-hero h1 span {
  color: #FFD700;
}

/* Content Card */
.content-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  padding: 40px;
  margin-bottom: 30px;
  position: relative;
  z-index: 10;
  transition: all 0.3s ease;
  border: 1px solid rgba(0,0,0,0.03);
}

.content-card:hover {
  box-shadow: 0 15px 50px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}

/* Description Content Styling - For CMS Content */
.content-card p,
.content-card .description-content p {
  font-size: 1.05rem;
  line-height: 1.9;
  color: #444;
  margin-bottom: 1.2rem;
  text-align: justify;
}

.content-card h2,
.content-card h3,
.content-card h4 {
  color: #910029;
  margin-bottom: 15px;
  margin-top: 25px;
}

.content-card ul,
.content-card ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
}

.content-card li {
  font-size: 1.02rem;
  line-height: 1.8;
  color: #555;
  margin-bottom: 0.5rem;
  position: relative;
}

.content-card ul li::marker {
  color: #910029;
}

.content-card strong,
.content-card b {
  color: #1E4D8C;
  font-weight: 700;
}

/* Table Styling (explicit .modern-table markup) */
.modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eee;
  box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.modern-table th {
  background: linear-gradient(135deg, #910029, #1E4D8C);
  color: white;
  padding: 18px 20px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-align: left;
}

.modern-table td {
  padding: 18px 20px;
  background: white;
  border-bottom: 1px solid #f0f0f0;
  color: #444;
  line-height: 1.7;
  font-size: 1rem;
}

.modern-table tr:last-child td {
  border-bottom: none;
}

.modern-table tr:hover td {
  background: #fafbfc;
}

.modern-table a {
  color: #1E4D8C;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.modern-table a:hover {
  color: #910029;
  text-decoration: underline;
}

/* Section Headings */
.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1E4D8C;
  margin-bottom: 25px;
  padding-bottom: 12px;
  display: inline-block;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #910029, #1E4D8C);
  border-radius: 2px;
}

/* Image Styling for HOD/Vision Sections */
.content-card img {
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  max-width: 100%;
  height: auto;
}

.content-card img:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

/* Chairman Name Styling */
.chairman-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1E4D8C;
  margin-top: 15px;
  margin-bottom: 5px;
  text-align: center;
}

.chairman-qualification {
  font-size: 0.95rem;
  color: #666;
  text-align: center;
  font-style: italic;
}

/* Table Wrapper for Mobile Scroll (explicit .modern-table markup) */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0;
  border-radius: 12px;
  scrollbar-width: thin;
  scrollbar-color: #910029 #f0f0f0;
}

.table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: #910029;
  border-radius: 4px;
}

.table-wrapper .modern-table {
  margin: 0;
  min-width: 100%;
}

.modern-table td,
.modern-table th {
  word-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

/* =========================================
   Raw CMS <table> styling (TinyMCE content) —
   used by the JS normalizer in inc/premium-styles.php
   ========================================= */
.content-card table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin: 20px 0 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  border: 1px solid #e0e0e0 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06) !important;
  font-family: inherit !important;
}

.content-card table th {
  background: linear-gradient(135deg, #910029, #1E4D8C) !important;
  color: #fff !important;
  padding: 14px 18px !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  text-align: left !important;
  border: none !important;
  white-space: nowrap;
  vertical-align: middle !important;
}

.content-card table td {
  padding: 14px 18px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #f0f0f0 !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  color: #444 !important;
  line-height: 1.7 !important;
  font-size: 0.97rem !important;
  vertical-align: middle !important;
}

.content-card table tbody tr:nth-child(even) td {
  background: #f8f9fb !important;
}

.content-card table tbody tr:hover td {
  background: #eef2ff !important;
  transition: background 0.2s ease;
}

.content-card table tr:last-child td {
  border-bottom: none !important;
}

.content-card table a {
  color: #1E4D8C !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}
.content-card table a:hover {
  color: #910029 !important;
  text-decoration: underline !important;
}

.content-card table p {
  margin-bottom: 0 !important;
}

.table-responsive-custom {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  margin: 20px 0;
}


/* Modern Sidebar Widget */
.sidebar-widget {
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.05);
  padding: 25px;
  border: 1px solid rgba(0,0,0,0.03);
  margin-bottom: 20px;
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1E4D8C;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
  position: relative;
}

.sidebar-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px;
  height: 2px;
  background: #910029;
}

.sidebar-links {
  list-style: none;
  padding-left: 0;
}

.sidebar-links li {
  margin-bottom: 12px;
  border-bottom: 1px solid #f8f9fa;
  padding-bottom: 12px;
}

.sidebar-links li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sidebar-links a {
  color: #555;
  font-weight: 500;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  text-decoration: none;
}

.sidebar-links a:hover {
  color: #910029;
  transform: translateX(5px);
}

.sidebar-links a::before {
  content: '\f105';
  font-family: 'FontAwesome';
  margin-right: 10px;
  color: #ccc;
  transition: all 0.2s ease;
}

.sidebar-links a:hover::before {
  color: #910029;
}

.sidebar-widget.sidebar-quick-access {
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Desktop: sidebar becomes its own scrollable region, independent of page scroll */
@media (min-width: 992px) {
  .sidebar-widget.sidebar-quick-access {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .sidebar-widget.sidebar-quick-access .sidebar-list {
    overflow-y: auto;
  }
}

.sidebar-widget.sidebar-quick-access .sidebar-header {
  background: linear-gradient(135deg, #910029, #1E4D8C);
  padding: 20px;
  margin: 0;
}

.sidebar-widget.sidebar-quick-access .sidebar-header h3 {
  color: #fff;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-widget.sidebar-quick-access .sidebar-list {
  padding: 0;
  margin: 0;
  list-style: none;
  background: #fff;
}

.sidebar-widget.sidebar-quick-access .sidebar-list li {
  margin: 0;
  padding: 0;
  border: 0;
}

.sidebar-widget.sidebar-quick-access .sidebar-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  color: #555;
  font-weight: 600;
  text-decoration: none;
  background: #fff;
  transition: all 0.3s ease;
}

.sidebar-widget.sidebar-quick-access .sidebar-list a:hover {
  background: #f8f9fa;
  color: #910029;
  padding-left: 25px;
  transform: none;
}

.sidebar-widget.sidebar-quick-access .sidebar-list a::after {
  content: '\f054';
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.8rem;
  opacity: 0.5;
  color: #999;
}

.sidebar-widget.sidebar-quick-access .sidebar-list a::before {
  content: none;
}

.gallery-intro {
  margin-bottom: 28px;
}

.gallery-intro p {
  margin-bottom: 0;
  text-align: left;
  color: #5b6475;
}

.gallery-grid {
  margin-bottom: -8px;
}

.gallery-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(30, 77, 140, 0.08);
  box-shadow: 0 12px 35px rgba(17, 24, 39, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.14);
}

.gallery-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.gallery-image-wrap {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #eef3fb, #f9fbff);
}

.gallery-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.16) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-card:hover .gallery-image-wrap::after {
  opacity: 1;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.gallery-card:hover .gallery-image {
  transform: scale(1.06);
}

.gallery-caption {
  padding: 16px 18px 18px;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.6;
  color: #24324a;
  min-height: 72px;
}

.gallery-empty-state {
  padding: 42px 32px;
  border-radius: 22px;
  border: 1px dashed rgba(145, 0, 41, 0.25);
  background:
    radial-gradient(circle at top right, rgba(145, 0, 41, 0.08), transparent 36%),
    linear-gradient(135deg, #fff7f9 0%, #f7faff 100%);
  text-align: left;
}

.gallery-empty-state h2 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #910029;
}

.gallery-empty-state p {
  margin-bottom: 0;
  text-align: left;
  color: #4c566a;
}

/* Hide legacy styles */
.year-nirf, .year-nirfs, .news-hd {
  display: none !important;
}

/* ================= Responsive Design ================= */

@media (max-width: 992px) {
  .about-hero h1 {
    font-size: 2.5rem;
  }
  .content-card {
    padding: 30px;
  }
  .section-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .about-hero {
    padding: 80px 15px 100px;
  }
  .about-hero h1 {
    font-size: 2rem;
    line-height: 1.3;
  }
  .content-card {
    padding: 25px 20px;
    border-radius: 15px;
  }
  .content-card p {
    font-size: 1rem;
    text-align: left;
  }
  .modern-table th,
  .modern-table td {
    padding: 14px 15px;
    font-size: 0.95rem;
  }
  .section-title {
    font-size: 1.4rem;
  }


  .sidebar-widget {
    margin-bottom: 20px;
  }

  .sidebar-widget table {
    font-size: 0.95rem;
  }

  .gallery-empty-state { padding: 30px 22px; }
  .gallery-caption { min-height: 0; }
}

@media (max-width: 576px) {
  .about-hero {
    padding: 60px 12px 80px;
  }
  .about-hero h1 {
    font-size: 1.7rem;
    line-height: 1.2;
    word-wrap: break-word;
  }
  .content-card {
    padding: 20px 15px;
    margin-bottom: 20px;
  }
  .section-title {
    font-size: 1.25rem;
  }
  .section-title::after {
    width: 40px;
    height: 3px;
  }

  .content-card a,
  .sidebar-widget a {
    padding: 8px 4px;
    display: inline-block;
    min-height: 44px;
    line-height: 1.6;
  }



  .container {
    overflow-x: hidden;
  }

  .content-card img {
    max-width: 100% !important;
    height: auto !important;
  }

  .table-wrapper {
    margin: 15px -5px;
    padding: 0 5px;
    box-shadow: inset 0 0 8px rgba(145, 0, 41, 0.1);
  }

  .modern-table th {
    padding: 12px 15px;
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .modern-table td {
    padding: 12px 15px;
    font-size: 0.95rem;
    line-height: 1.7;
    text-align: left;
  }

}

/* Extra Small Phones (400px and below) */
@media (max-width: 400px) {
  .about-hero h1 {
    font-size: 1.5rem;
  }

  .content-card {
    padding: 15px 12px;
  }

  .section-title {
    font-size: 1.1rem;
  }


  .modern-table {
    font-size: 0.85rem;
  }

  .modern-table th,
  .modern-table td {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
}

/* Landscape orientation optimization */
@media (max-height: 500px) and (orientation: landscape) {
  .about-hero {
    padding: 40px 15px 60px;
  }

  .about-hero h1 {
    font-size: 1.8rem;
  }
}
