/* ============================================================
   Shared Sections – News & Announcements Redesign
   ============================================================ */

/* ---------- Stacked sections (site-wide vertical separators) ----------
   Use: <section class="section-stack"> for one-off layouts.
   Add section-stack--alt for the band background. section-stack--accent
   places a gold chip on the bottom edge.
   All major named section classes (home-section, dept-section, etc.) have
   their separators and alternating band backgrounds applied below.
   ------------------------------------------------------------------------- */
.section-stack {
  position: relative;
  z-index: 0;
  padding: var(--section-stack-padding, 2.75rem 0 2rem);
  border-bottom: var(--section-separator-width, 1px) solid
    var(--section-separator-color, var(--color-border-light));
}

.section-stack:last-child {
  border-bottom: none;
}

.section-stack.section-stack--accent::after {
  content: "";
  position: absolute;
  bottom: calc(-1 * var(--section-separator-width, 1px));
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: var(--section-separator-accent-width, 4rem);
  height: var(--section-separator-accent-height, 0.25rem);
  background: var(--gradient-accent-bar);
  border-radius: 0.125rem;
  pointer-events: none;
}

.section-stack.section-stack--accent:last-child::after {
  display: none;
}

/* section-stack--alt: uses the band background (full-width via pseudo) */
.section-stack.section-stack--alt::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  background: var(--section-band-bg, var(--color-bg-section));
  z-index: -1;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────────
   Full-width alternating background bands
   Technique: 100vw pseudo-element centered on the section so the band
   bleeds to the viewport edges even when content is inside a padded container.
   Section must have position: relative; z-index: 0 (creates stacking context).
   ::before { z-index: -1 } renders behind children, above transparent bg.
   ───────────────────────────────────────────────────────────────────────── */

/* Shared positioning root for every section that participates */
:is(
  .home-section,
  .dept-section,
  .college-about-section,
  .programs-section-new,
  .management-section,
  .dept-hierarchy-section,
  .news-section-new,
  .announcements-section-new,
  .about-section,
  .about-video-section,
  .dept-manager-section,
  .dept-vm-section,
  .dept-management-section
) {
  position: relative;
  z-index: 0;
}

/* Shared full-width pseudo mixin — bleeds background to viewport edges */
.home-content-container .home-section:nth-child(even)::before,
.dept-section:nth-child(even)::before,
.programs-section-new::before,
.dept-hierarchy-section::before,
.dept-vm-section::before,
.about-video-section::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  background: var(--section-band-bg, var(--color-bg-section));
  z-index: -1;
  pointer-events: none;
}

/* Home page — even sections get the band */
.home-content-container .home-section:nth-child(even) {
  background: var(--section-band-bg, var(--color-bg-section));
}

/* Generic stacked dept sections (college-departments, center-details) */
.dept-section:nth-child(even) {
  background: var(--section-band-bg, var(--color-bg-section));
}

/* Named inner-page sections that always carry the band */
.programs-section-new,
.dept-hierarchy-section,
.dept-vm-section,
.about-video-section {
  background: var(--section-band-bg, var(--color-bg-section));
}

/* Keep org-chart tree scrollable horizontally without clipping the band pseudo */
.dept-hierarchy-tree {
  overflow-x: auto;
}

/* ---------- Shared: section heading (used by all inner pages) ---------- */
.section-heading {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.625rem;
}

.section-heading-icon {
  width: 2.875rem;
  height: 2.875rem;
  background: var(--gradient-section-icon, linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%));
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.3);
}

.section-heading-icon i {
  color: #fff !important;
  font-size: 1.125rem;
}

.section-heading-label {
  font-size: 1.3125rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  line-height: 1.2;
}

.section-heading-bar {
  width: 3rem;
  height: 0.1875rem;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-secondary-light));
  border-radius: 0.125rem;
  margin-top: 0.3125rem;
}

/* ---------- Shared: skeleton animation ---------- */
.skeleton-box {
  background: linear-gradient(90deg, var(--color-bg-section) 25%, #e4eaf0 50%, var(--color-bg-section) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s infinite;
}

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

/* ---------- Shared: empty state ---------- */
.shared-empty-state {
  text-align: center;
  padding: 3rem 0;
  color: var(--color-text-muted);
}

.shared-empty-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.shared-empty-icon i {
  font-size: 1.375rem;
}

.shared-empty-state p {
  font-size: 0.9375rem;
  margin: 0;
}

/* ---------- Shared: view more button ---------- */
.shared-view-more {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.shared-view-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  background: var(--gradient-section-icon, linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%));
  color: #fff !important;
  text-decoration: none;
  padding: 0.6875rem 1.75rem;
  border-radius: 1.875rem;
  font-size: 0.875rem;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(var(--color-primary-rgb), 0.3);
}

.shared-view-more-btn:hover {
  transform: translateY(-0.125rem);
  box-shadow: 0 8px 20px rgba(var(--color-primary-rgb), 0.4);
  color: #fff !important;
}

/* ============================================================
   News Section
   ============================================================ */

.news-section-new {
  padding: 2.75rem 0 2rem;
  border-bottom: var(--section-separator-width, 1px) solid var(--section-separator-color);
}

.news-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 991px) {
  .news-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .news-cards-grid {
    grid-template-columns: 1fr;
  }
}

.news-card-new {
  display: flex;
  flex-direction: column;
  border-radius: 0.875rem;
  overflow: hidden;
  background: #fff;
  border: 1.5px solid var(--color-border);
  box-shadow: 0 2px 10px rgba(var(--color-primary-rgb), 0.06);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.news-card-new:hover {
  transform: translateY(-0.3125rem);
  box-shadow: 0 10px 28px rgba(var(--color-primary-rgb), 0.14);
  border-color: var(--color-primary);
  color: inherit;
  text-decoration: none;
}

.news-card-img-wrap {
  position: relative;
  height: 13.125rem;
  overflow: hidden;
}

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

.news-card-new:hover .news-card-img {
  transform: scale(1.06);
}

.news-card-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(var(--color-primary-dark-rgb), 0.65) 100%);
}

.news-card-date {
  position: absolute;
  bottom: 0.75rem;
  right: 0.875rem;
  left: 0.875rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.news-card-body {
  padding: 1rem 1rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.news-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  line-height: 1.6;
  flex: 1;
}

.news-card-read-more {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.7813rem;
  font-weight: 700;
  color: var(--color-primary);
  transition: gap 0.2s ease;
}

.news-card-new:hover .news-card-read-more {
  gap: 0.625rem;
}

/* ============================================================
   Announcements Section
   ============================================================ */

.announcements-section-new {
  padding: 2.75rem 0 2rem;
  border-bottom: var(--section-separator-width, 1px) solid var(--section-separator-color);
}

.announcements-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 991px) {
  .announcements-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .announcements-cards-grid {
    grid-template-columns: 1fr;
  }
}

.announcement-card {
  display: flex;
  flex-direction: column;
  border-radius: 0.875rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 12px rgba(var(--color-primary-rgb), 0.08);
  border: 1.5px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.announcement-card:hover {
  transform: translateY(-0.3125rem);
  box-shadow: 0 10px 28px rgba(var(--color-primary-rgb), 0.16);
  color: inherit;
  text-decoration: none;
}

.announcement-card-header {
  padding: 1.25rem 1.25rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.announcement-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 1.25rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  width: fit-content;
}

.announcement-card-date {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.announcement-card-body {
  padding: 1.125rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  flex: 1;
}

.announcement-card-title {
  font-size: 0.9063rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  line-height: 1.6;
  flex: 1;
}

.announcement-card-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.7813rem;
  font-weight: 700;
  color: var(--color-primary);
  transition: gap 0.2s ease;
}

.announcement-card:hover .announcement-card-link {
  gap: 0.625rem;
}

/* ---------- Legacy grid helpers kept for other pages ---------- */
.news-section-grid .row:last-child {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 991px) {
  .news-section-grid .row:last-child {
    grid-template-columns: 1fr;
  }
}

.news-section-grid .row:last-child > .col-lg-4 { width: 100%; }
.news-section-grid .cardcontainer { display: grid; height: 100%; }
.news-section-grid .card { display: grid; grid-template-rows: auto auto 1fr; height: 100%; }
.news-section-grid .card-body { display: flex; align-items: center; justify-content: center; text-align: center; }

.events-section-grid .row:not(.str-top),
.announcements-section-grid .row:not(.str-top) {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 767px) {
  .events-section-grid .row:not(.str-top),
  .announcements-section-grid .row:not(.str-top) {
    grid-template-columns: 1fr;
  }
}

.events-section-grid .row:not(.str-top) > .col-md-4,
.announcements-section-grid .row:not(.str-top) > .col-md-4 { width: 100%; }
.events-section-grid .ev-section,
.announcements-section-grid .ev-section { display: grid; height: 100%; }
.events-section-grid .event-box,
.announcements-section-grid .event-box { display: grid; grid-template-rows: auto auto 1fr auto; height: 100%; }
.events-section-grid .ev-title,
.announcements-section-grid .ev-title { display: flex; align-items: center; justify-content: center; text-align: center; }
