/* =========================================================
   SCVSKM — EVENTS ARCHIVE DEDICATED STYLESHEET
   Strict Theme: Cinnamon Maroon | Ivory Cream | Gold Accent
   Standard Uniform Typography Scale Applied
   Inherits Local Noto Sans & Global Navigation from style.css
   ========================================================= */

/* --- 1. Top Navigation Bar (Back Link) --- */
.archive-nav-bar {
  margin-bottom: 16px;
}

.btn-back-link {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  color: var(--cinnamon-dark, #771d1d);
  border: 1.5px solid var(--gold-accent, #dfc39a);
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(119, 29, 29, 0.06);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-back-link:hover {
  background: var(--cinnamon-bg, #fcdada);
  color: var(--cinnamon-dark, #771d1d);
  transform: translateX(-3px);
}

/* --- 2. Main Page Card --- */
.events-page-card {
  background: #ffffff;
  border: 1.5px solid var(--card-border, #e2e8f0);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 4px 16px rgba(119, 29, 29, 0.05);
  margin-bottom: 34px;
}

/* --- 3. 3-Column Event Card Gallery Grid (MeitY Portal Style) --- */
.events-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 24px;
}

.event-grid-card {
  background: #ffffff;
  border: 1.5px solid var(--card-border, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.event-grid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(119, 29, 29, 0.12);
  border-color: var(--gold-accent, #dfc39a);
}

.event-thumb-wrap {
  width: 100%;
  height: 200px;
  position: relative;
  background: #f1f5f9;
  overflow: hidden;
}

.event-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

.event-grid-card:hover .event-thumb-img {
  transform: scale(1.03);
}

/* Small Text 1 (Desktop: 12px / Mobile: 10px) */
.event-photo-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  backdrop-filter: blur(2px);
  letter-spacing: 0.02em;
}

.event-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  background: #fffdfa;
}

/* Heading 3 / Title (Desktop: 16px) */
.event-item-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--cinnamon-dark, #771d1d);
  margin: 0 0 10px 0;
  line-height: 1.4;
  flex: 1;
}

.event-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--card-border, #e2e8f0);
  padding-top: 10px;
  margin-top: auto;
}

/* Paragraph 2 (Desktop: 14px / Mobile: 12px) */
.event-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #475569);
}

.event-meta-tag.archive-tag {
  font-size: 11px;
  font-weight: 700;
  color: #c2410c;
  background: #fff7ed;
  border: 1px solid #ffedd5;
  padding: 2px 8px;
  border-radius: 4px;
}

/* --- 4. Lightbox Modal Slider (Clean Auto-Fit, Zero Black Bars) --- */
.gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.gallery-modal.show {
  display: flex;
}

.gallery-modal-dialog {
  position: relative;
  width: auto;
  max-width: 92vw;
  background: #ffffff;
  border: 2px solid var(--gold-accent, #dfc39a);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalZoom 0.22s ease-out;
}

@keyframes modalZoom {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--cinnamon-dark, #771d1d);
  color: #ffffff;
  border: 1.5px solid var(--gold-accent, #dfc39a);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 20px;
  cursor: pointer;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.modal-close-btn:hover {
  transform: scale(1.1);
  background-color: var(--cinnamon-primary, #a72626);
}

.modal-carousel-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  background: #ffffff;
  overflow: hidden;
}

.carousel-view {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
}

.carousel-view img {
  width: auto;
  max-width: 90vw;
  max-height: 76vh;
  height: auto;
  object-fit: contain;
  display: block;
}

.carousel-ctrl {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(119, 29, 29, 0.85);
  color: #ffffff;
  border: 1.5px solid var(--gold-accent, #dfc39a);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.carousel-ctrl.prev {
  left: 14px;
}

.carousel-ctrl.next {
  right: 14px;
}

.carousel-ctrl:hover {
  background-color: var(--cinnamon-primary, #a72626);
  transform: translateY(-50%) scale(1.08);
}

.modal-caption-bar {
  background: #fffdfa;
  color: var(--cinnamon-dark, #771d1d);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1.5px solid var(--gold-accent, #dfc39a);
  font-size: 14px;
  font-weight: 700;
}

.modal-caption-title {
  color: var(--cinnamon-dark, #771d1d);
  font-size: 14px;
  line-height: 1.4;
}

.modal-caption-counter {
  font-size: 13px;
  font-weight: 800;
  color: var(--cinnamon-primary, #a72626);
  background: #fef2f2;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #fecaca;
  white-space: nowrap;
}

/* Placeholder when no image exists */
.no-photo-box {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  border: 1px dashed var(--card-border, #e2e8f0);
}

/* Modal inside message state */
.modal-no-photo-state {
  padding: 40px 20px;
  color: #64748b;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  background: #ffffff;
}

/* =========================================================
   5. RESPONSIVE BREAKPOINTS (TABLET & MOBILE)
   ========================================================= */
@media (max-width: 992px) {
  .events-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

@media (max-width: 768px) {
  .events-page-card {
    padding: 22px 16px;
  }

  .event-item-title {
    font-size: 15px;
  }

  .btn-back-link {
    font-size: 13px;
    padding: 7px 15px;
  }
}

@media (max-width: 650px) {
  .events-gallery-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .event-thumb-wrap {
    height: 180px;
  }

  .carousel-view img {
    max-height: 65vh;
    max-width: 94vw;
  }

  .carousel-ctrl {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .carousel-ctrl.prev {
    left: 8px;
  }

  .carousel-ctrl.next {
    right: 8px;
  }

  .modal-caption-bar {
    padding: 10px 14px;
    font-size: 12.5px;
  }

  .event-photo-count {
    font-size: 10px;
    padding: 2px 6px;
  }
}