/* Shared styles for handbook.php, gallery.php and chalawan-news.php */

.media-section {
  background-color: #f6f7f8;
}

.media-section-header h2 {
  color: #0e1b4d;
}

.media-btn {
  background: linear-gradient(135deg, #f5a623, #ffc107);
  border: none;
  color: #1a0e00;
  font-weight: 700;
}

.media-btn:hover,
.media-btn:focus-visible {
  background: linear-gradient(135deg, #e6951a, #f5b400);
  color: #1a0e00;
}

/* ---------- Participant's Handbook ---------- */
.handbook-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 500px;
  border-radius: 16px;
  overflow: hidden;
  background: #0e1b4d;
  box-shadow: 0 16px 40px rgba(14, 27, 77, 0.18);
}

.handbook-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.media-related {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.media-related a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: 2px solid #f5a623;
  border-radius: 50px;
  color: #b36b00;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.media-related a:hover,
.media-related a:focus-visible {
  background: #f5a623;
  color: #1a0e00;
}

/* ---------- Photos & Videos ---------- */
.media-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.media-filter button {
  border: 2px solid #0e1b4d;
  background: transparent;
  color: #0e1b4d;
  border-radius: 50px;
  padding: 8px 22px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.media-filter button.active,
.media-filter button:hover,
.media-filter button:focus-visible {
  background: #0e1b4d;
  color: #fff;
}

.media-filter .badge {
  background: #ffc107;
  color: #1a0e00;
  margin-left: 6px;
}

.media-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0e1b4d;
  font-weight: 700;
}

.media-group-title i {
  color: #f5a623;
}

.media-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  color: inherit;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(14, 27, 77, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.media-card:hover,
.media-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(14, 27, 77, 0.16);
  color: inherit;
}

.media-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #0e1b4d 0%, #3b2a7a 55%, #df5b27 100%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 3rem;
}

.media-card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.media-card:hover .media-card-thumb img {
  transform: scale(1.05);
}

.media-card-platform-icon {
  position: absolute;
  font-size: 6rem;
  opacity: 0.25;
}

.media-card-play {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 2rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.media-card:hover .media-card-play {
  background: #f5a623;
  transform: scale(1.1);
}

.media-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 50px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.media-card-body {
  padding: 16px 18px 20px;
}

.media-card-title {
  margin: 0 0 6px;
  color: #0e1b4d;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
}

.media-card-meta {
  color: #6c757d;
  font-size: 0.9rem;
}

.media-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: #b36b00;
  font-weight: 600;
}

.media-empty {
  padding: 40px 20px;
  border: 2px dashed #d6d9e0;
  border-radius: 16px;
  color: #6c757d;
  text-align: center;
}

.media-empty i {
  display: block;
  margin-bottom: 8px;
  font-size: 2.2rem;
  color: #f5a623;
}

.video-modal .modal-content {
  background: #000;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
}

.video-modal .modal-header {
  border-bottom: 0;
  color: #fff;
}

.video-modal .modal-title {
  color: #fff;
  font-size: 1rem;
}

.video-modal .btn-close {
  filter: invert(1);
}

.video-modal .video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-modal .video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-modal .video-external {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at 50% 35%, rgba(245, 166, 35, 0.25), transparent 60%),
    linear-gradient(160deg, #1b1f4b, #0b0d24);
  color: rgba(255, 255, 255, 0.85);
}

.video-modal .video-external > i {
  font-size: 4rem;
  color: #ffc107;
  line-height: 1;
}

.video-modal .video-external p {
  margin: 0;
  font-size: 0.95rem;
}

.video-modal.is-vertical .modal-dialog {
  max-width: min(420px, 92vw);
}

.video-modal.is-vertical .video-frame {
  aspect-ratio: 9 / 16;
  width: min(100%, calc(80vh * 9 / 16));
  margin: 0 auto;
}

.video-modal .video-description {
  max-height: 20vh;
  overflow-y: auto;
  padding: 12px 18px 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-line;
}

.video-modal .video-description:empty {
  display: none;
}

.video-modal:not(.is-vertical).has-description .modal-dialog {
  max-width: min(960px, 94vw, 95vh);
}

.video-modal .video-backup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  padding: 10px 18px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
}

.video-modal .video-backup[hidden] {
  display: none;
}

.video-modal .video-backup a {
  padding: 4px 14px;
  border: 1px solid rgba(255, 193, 7, 0.6);
  border-radius: 50px;
  color: #ffc107;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.video-modal .video-backup a:hover,
.video-modal .video-backup a:focus-visible {
  background: #ffc107;
  color: #1a0e00;
}

.video-modal.is-vertical.has-description .video-frame {
  width: min(100%, calc(55vh * 9 / 16));
}

.video-modal.is-vertical.has-description .video-description {
  max-height: 22vh;
}

@media (min-width: 992px) {
  .video-modal.is-vertical.has-description .modal-dialog {
    max-width: min(760px, 94vw);
  }

  .video-modal.is-vertical.has-description .video-layout {
    display: flex;
    align-items: stretch;
  }

  .video-modal.is-vertical.has-description .video-frame {
    flex: 0 0 auto;
    width: auto;
    height: min(78vh, 680px);
    margin: 0;
  }

  .video-modal.is-vertical.has-description .video-description {
    flex: 1;
    max-height: min(78vh, 680px);
    padding: 4px 20px 20px;
  }
}

.media-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 8px 0 0;
  color: #6c757d;
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ---------- Chalawan News ---------- */
.news-intro {
  max-width: 820px;
  margin: 0 auto;
  color: #4a4f5c;
  line-height: 1.8;
}

.news-latest {
  padding: 24px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(14, 27, 77, 0.1);
}

.news-latest-label {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 14px;
  border-radius: 50px;
  background: #df5b27;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

@media (min-width: 992px) {
  .news-latest-cover {
    position: sticky;
    top: 100px;
  }
}

.news-latest a.glightbox {
  display: block;
  border-radius: 12px;
  overflow: hidden;
}

.news-latest img {
  width: 100%;
  border-radius: 12px;
  transition: transform 0.4s ease;
}

.news-latest a.glightbox:hover img {
  transform: scale(1.03);
}

.news-day-card {
  position: relative;
  display: block;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(14, 27, 77, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

a.news-day-card:hover,
a.news-day-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(14, 27, 77, 0.16);
  color: inherit;
}

.news-day-cover {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(160deg, #0e1b4d 0%, #3b2a7a 60%, #df5b27 100%);
}

.news-day-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-day-body {
  padding: 14px 16px 18px;
}

.news-day-number {
  color: #df5b27;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.news-day-title {
  margin: 4px 0;
  color: #0e1b4d;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.news-day-date {
  color: #6c757d;
  font-size: 0.85rem;
}

.news-day-card.is-upcoming {
  opacity: 0.6;
  box-shadow: none;
  border: 2px dashed #d6d9e0;
}

.news-day-card.is-upcoming .news-day-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 2.5rem;
}

@media (max-width: 768px) {
  .handbook-frame {
    aspect-ratio: auto;
    height: 75vh;
    min-height: 500px;
  }

  .news-latest {
    padding: 16px;
  }
}
