/* ===== Updates Page Layout ===== */
.magazine {
  max-width: 1600px;
  margin: -70px auto;
  padding: 3rem 2rem;
  color: #1f2937;
  font-family: "Inter", Arial, sans-serif;
}

/* ===== Updates Grid ===== */
.magazine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2.5rem;
  justify-content: center;
  margin-bottom: 35px;
}

.magazine-grid > .card {
  max-width: 380px;
  margin: 0 auto;
}

/* ===== Update Card ===== */
.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);
}

.card-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ===== Card Media ===== */
.card-media {
  position: relative;
  background: #f9fafb;
  text-align: center;
  padding: 0.75rem;
}

.card-media img {
  max-width: 100%;
  height: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.media-fallback {
  background: linear-gradient(135deg, #d1d5db, #f3f4f6);
  height: 200px;
  border-radius: 12px;
}

/* ===== Ribbon for pinned posts ===== */
.ribbon {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #fde047;
  color: #111;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* ===== Card Body ===== */
.card-body {
  padding: 1.5rem;
  flex: 1;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  color: #6b7280;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0.5rem 0;
  line-height: 1.4;
}

.byline {
  font-size: 0.9rem;
  color: #4b5563;
  margin-bottom: 0.75rem;
}

.card-content {
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.6;
}

/* ===== Teacher of the Month Section ===== */
.teacher-section {
  display: flex;
  justify-content: center;
  align-items: center;
}

.teacher-section .magazine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2.5rem;
  max-width: 1600px;
  margin: 0 auto;
  justify-content: center; /* centers grid items horizontally */
}



@media (max-width: 768px) {
  .teacher-section .magazine-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Confetti Canvas ===== */
canvas.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}


/* ===== Filter Bar ===== */
.updates-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 1.2rem auto;
  max-width: 700px;
  text-align: center;
}

/* ===== Common Field Styles ===== */
.filter-input,
.filter-select {
  flex: 1 1 200px;
  min-width: 140px;
  box-sizing: border-box;
  height: 35px;              /* ✅ true compact height */
  padding: 0rem 1.0rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1;
  background-color: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

/* Hover & focus */
.filter-input:focus,
.filter-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
  outline: none;
}

/* Placeholder */
.filter-input::placeholder {
  color: #9ca3af;
  font-size: 0.8rem;
}

/* Dropdown arrow */
.filter-select {
  background-image: linear-gradient(45deg, transparent 50%, #2563eb 50%), 
                    linear-gradient(135deg, #2563eb 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* ===== Responsive Behavior ===== */
@media (max-width: 700px) {
  .updates-filter-bar {
    gap: 0.3rem;
    padding: 0 0.6rem;
  }

  /* Keep them side by side on small screens */
  .filter-input,
  .filter-select {
    flex: 1 1 calc(50% - 0.3rem);
    width: calc(50% - 0.3rem);
    height: 28px;
    font-size: 0.8rem;
    padding: 0 0.45rem;
  }
}

/* Stack only if the screen is ultra-narrow */
@media (max-width: 400px) {
  .filter-input,
  .filter-select {
    flex: 1 1 100%;
    width: 100%;
  }
}
