/*
===============================================
MODERN DEPARTMENTS STYLES
Medical Theme – Block + Page
Fully isolated with depblock- / deppage- prefix
===============================================
*/

/* ══════════════════════════════════════════════
   DEPARTMENTS BLOCK (Homepage)
   ══════════════════════════════════════════════ */

/* ── Section ── */
#modern-departments-block {
  background: linear-gradient(135deg, #1d4577 0%, #2a5a8a 50%, #e6f5fa 100%);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

#modern-departments-block::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.3;
  pointer-events: none;
}

/* ── Header ── */
.depblock-header {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
  z-index: 2;
}

.depblock-title {
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(45deg, #ffffff, #e6f5fa, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 16px 0;
  letter-spacing: -0.02em;
  font-family: "poppins", sans-serif;
}

.depblock-subtitle {
  color: rgba(230, 245, 250, 0.85);
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto;
  font-family: "poppins", sans-serif;
  font-weight: 400;
  opacity: 0.9;
}

/* ── Grid ── */
.depblock-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
  z-index: 2;
}

/* ── Card Wrapper ── */
.depblock-card-wrap {
  display: flex;
  flex-direction: column;
}

/* ── Card ── */
.depblock-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(29, 69, 119, 0.12);
  transition: all 0.4s ease;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.depblock-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 45px rgba(29, 69, 119, 0.22);
}

/* ── Image Area ── */
.depblock-card__img-area {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e6f5fa, #dceaf5);
}

/* Blurred background fill */
.depblock-card__img-blur {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  filter: blur(20px) saturate(1.2);
  transform: scale(1.1);
  z-index: 0;
  opacity: 0.7;
}

/* Main sharp image */
.depblock-card__img-main {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.5s ease;
}

.depblock-card:hover .depblock-card__img-main {
  transform: scale(1.05);
}

/* ── Info ── */
.depblock-card__info {
  padding: 16px 18px;
  text-align: center;
}

.depblock-card__name {
  color: #1d4577;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
  margin: 0;
  font-family: "poppins", sans-serif;
  text-transform: capitalize;
}

/* ── Footer ── */
.depblock-footer {
  display: flex;
  justify-content: center;
  margin-top: 50px;
  position: relative;
  z-index: 2;
}

.depblock-view-all {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15),
    rgba(255, 255, 255, 0.25)
  );
  backdrop-filter: blur(15px);
  color: white;
  padding: 16px 32px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.4s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(29, 69, 119, 0.2);
  position: relative;
  overflow: hidden;
  font-family: "poppins", sans-serif;
}

.depblock-view-all::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.depblock-view-all:hover::before {
  left: 100%;
}

.depblock-view-all:hover {
  background: linear-gradient(135deg, #1d4577, #2a5a8a);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 40px rgba(29, 69, 119, 0.3);
  border-color: #e6f5fa;
  text-decoration: none;
  color: white;
}

.depblock-view-all i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.depblock-view-all:hover i {
  transform: translateX(5px);
}

/* ── Entrance Animations ── */
.depblock-card-wrap {
  animation: depblockSlideIn 0.6s ease forwards;
  opacity: 0;
}

.depblock-card-wrap:nth-child(1) {
  animation-delay: 0.05s;
}
.depblock-card-wrap:nth-child(2) {
  animation-delay: 0.1s;
}
.depblock-card-wrap:nth-child(3) {
  animation-delay: 0.15s;
}
.depblock-card-wrap:nth-child(4) {
  animation-delay: 0.2s;
}
.depblock-card-wrap:nth-child(5) {
  animation-delay: 0.25s;
}
.depblock-card-wrap:nth-child(6) {
  animation-delay: 0.3s;
}

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

/* ── Block Responsive ── */
@media (max-width: 1400px) {
  .depblock-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
  }
}

@media (max-width: 1024px) {
  .depblock-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  #modern-departments-block {
    padding: 60px 0;
  }

  .depblock-title {
    font-size: 2.2rem;
  }

  .depblock-subtitle {
    font-size: 1rem;
  }

  .depblock-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .depblock-card__img-area {
    height: 240px;
  }

  .depblock-view-all {
    padding: 14px 28px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  #modern-departments-block {
    padding: 40px 0;
  }

  .depblock-title {
    font-size: 1.8rem;
  }

  .depblock-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .depblock-card__img-area {
    height: 220px;
  }

  .depblock-card__info {
    padding: 12px 14px;
  }

  .depblock-card__name {
    font-size: 0.8rem;
  }
}

/* ══════════════════════════════════════════════
   DEPARTMENTS PAGE (#modern-departments-page)
   ══════════════════════════════════════════════ */

#modern-departments-page {
  background: linear-gradient(135deg, #1d4577 0%, #2a5a8a 50%, #e6f5fa 100%);
  padding: 60px 0 80px 0;
  position: relative;
  overflow: hidden;
  min-height: 50vh;
}

#modern-departments-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.3;
  pointer-events: none;
}

/* ── Page Grid ── */
.deppage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
  z-index: 2;
}

/* ── Page Card ── */
.deppage-card-wrap {
  display: flex;
  flex-direction: column;
}

.deppage-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(29, 69, 119, 0.12);
  transition: all 0.4s ease;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.deppage-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 22px 50px rgba(29, 69, 119, 0.22);
}

/* ── Page Image ── */
.deppage-card__img-area {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e6f5fa, #dceaf5);
}

.deppage-card__img-blur {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  filter: blur(20px) saturate(1.2);
  transform: scale(1.1);
  z-index: 0;
  opacity: 0.7;
}

.deppage-card__img-main {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.5s ease;
}

.deppage-card:hover .deppage-card__img-main {
  transform: scale(1.05);
}

/* ── Page Info ── */
.deppage-card__info {
  padding: 20px 22px;
  text-align: center;
}

.deppage-card__name {
  color: #1d4577;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  margin: 0;
  font-family: "poppins", sans-serif;
  text-transform: capitalize;
}

/* ── Page Entrance Animations ── */
.deppage-card-wrap {
  animation: deppageSlideIn 0.5s ease forwards;
  opacity: 0;
}

.deppage-card-wrap:nth-child(1) {
  animation-delay: 0.05s;
}
.deppage-card-wrap:nth-child(2) {
  animation-delay: 0.08s;
}
.deppage-card-wrap:nth-child(3) {
  animation-delay: 0.11s;
}
.deppage-card-wrap:nth-child(4) {
  animation-delay: 0.14s;
}
.deppage-card-wrap:nth-child(5) {
  animation-delay: 0.17s;
}
.deppage-card-wrap:nth-child(6) {
  animation-delay: 0.2s;
}
.deppage-card-wrap:nth-child(7) {
  animation-delay: 0.23s;
}
.deppage-card-wrap:nth-child(8) {
  animation-delay: 0.26s;
}
.deppage-card-wrap:nth-child(9) {
  animation-delay: 0.29s;
}
.deppage-card-wrap:nth-child(10) {
  animation-delay: 0.32s;
}

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

/* ── Page Responsive ── */
@media (max-width: 1400px) {
  .deppage-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
  }
}

@media (max-width: 1024px) {
  .deppage-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  #modern-departments-page {
    padding: 40px 0 60px 0;
  }

  .deppage-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .deppage-card__img-area {
    height: 280px;
  }
}

@media (max-width: 480px) {
  .deppage-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .deppage-card__img-area {
    height: 260px;
  }

  .deppage-card__info {
    padding: 14px 16px;
  }

  .deppage-card__name {
    font-size: 0.85rem;
  }
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
  .depblock-card,
  .depblock-card__img-main,
  .depblock-view-all,
  .depblock-card-wrap,
  .deppage-card,
  .deppage-card__img-main,
  .deppage-card-wrap {
    animation: none !important;
    transition: none !important;
  }
}

@media (prefers-contrast: high) {
  .depblock-card,
  .deppage-card {
    border: 2px solid #1d4577;
  }

  .depblock-view-all {
    border: 2px solid white;
  }
}

/* ── Print ── */
@media print {
  #modern-departments-block,
  #modern-departments-page {
    background: white !important;
    padding: 20px 0;
  }

  .depblock-card,
  .deppage-card {
    background: white;
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  .depblock-footer {
    display: none;
  }
}
