/* =============================================================================
   DEPARTMENTS.CSS — Department Cards, Faculty Listings
   Ilahia Polytechnic College
============================================================================= */

.dept-section {
  padding: var(--space-20) 0;
  background: var(--color-off-white);
}

.dept-section .section-header {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* ── Department Cards ───────────────────────────────────────────────────────── */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
  gap: var(--space-6);
  justify-content: center;
}

.dept-card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  display: flex;
  flex-direction: column;
  position: relative;
}

.dept-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.dept-card__header {
  padding: var(--space-8) var(--space-6) var(--space-5);
  position: relative;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
}

.dept-card--civil       .dept-card__header { background: linear-gradient(135deg, #0D47A1, #1565C0); }
.dept-card--mechanical  .dept-card__header { background: linear-gradient(135deg, #1a2e5c, #2a4a8c); }
.dept-card--computer    .dept-card__header { background: linear-gradient(135deg, #2d1a5c, #4a2a8c); }
.dept-card--electronics .dept-card__header { background: linear-gradient(135deg, #5c3a1a, #8c5c2a); }

.dept-card__icon {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.dept-card__icon svg {
  width: 32px;
  height: 32px;
  fill: var(--color-white);
}

.dept-card__header h3 {
  font-size: var(--fs-lg);
  color: var(--color-white);
  margin-bottom: var(--space-1);
}

.dept-card__header .sub {
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.7);
  font-weight: var(--fw-medium);
}

/* Diploma tag */
.dept-card__tag {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: rgba(255,255,255,0.9);
  color: var(--color-primary-dark);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
}

.dept-card__body {
  padding: var(--space-5) var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dept-card__desc {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-4);
  flex: 1;
}

.dept-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-light-grey);
  margin-bottom: var(--space-4);
}

.dept-card__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  font-weight: var(--fw-medium);
}

.dept-card__meta-item svg {
  width: 14px;
  height: 14px;
  fill: var(--color-primary);
  flex-shrink: 0;
}

.dept-card__footer {
  padding: 0 var(--space-6) var(--space-6);
}

.dept-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
  transition: gap var(--transition-fast), color var(--transition-fast);
}

.dept-card__link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform var(--transition-fast);
}

.dept-card__link:hover {
  color: var(--color-accent-dark);
}

.dept-card__link:hover svg {
  transform: translateX(4px);
}

/* ── Department Detail Page ─────────────────────────────────────────────────── */
.dept-detail {
  padding: var(--space-16) 0;
}

.dept-detail__overview {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-16);
}

.dept-overview-text h2 {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-5);
}

.dept-overview-text p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.dept-overview-text h4 {
  font-size: var(--fs-lg);
  margin: var(--space-6) 0 var(--space-4);
}

.dept-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.dept-info-card {
  background: var(--color-off-white);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--color-light-grey);
}

.dept-info-card h4 {
  font-size: var(--fs-md);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-light-grey);
}

.dept-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--color-light-grey);
}

.dept-info-row:last-child { border-bottom: none; }

.dept-info-row .key {
  color: var(--color-text-muted);
  font-weight: var(--fw-medium);
}

.dept-info-row .val {
  color: var(--color-text);
  font-weight: var(--fw-semibold);
  text-align: right;
}

/* ── Faculty Cards ──────────────────────────────────────────────────────────── */
.faculty-section {
  padding: var(--space-16) 0;
  background: var(--color-off-white);
}

.faculty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-6);
}

.faculty-card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.faculty-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.faculty-card__photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--color-light-grey);
}

.faculty-card__photo-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--color-light-grey), var(--color-mid-grey));
  display: flex;
  align-items: center;
  justify-content: center;
}

.faculty-card__photo-placeholder svg {
  width: 60px;
  height: 60px;
  fill: rgba(0,0,0,0.15);
}

.faculty-card__body {
  padding: var(--space-4) var(--space-5);
}

.faculty-card__name {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--color-primary-dark);
  margin-bottom: var(--space-1);
  font-family: var(--font-body);
}

.faculty-card__role {
  font-size: var(--fs-xs);
  color: var(--color-accent-dark);
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.faculty-card__dept {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .dept-detail__overview {
    grid-template-columns: 1fr;
  }

  .dept-grid {
    grid-template-columns: 1fr;
  }

  .faculty-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 479px) {
  .faculty-grid {
    grid-template-columns: 1fr;
  }
}
