/* ============================================
   Sections - Feature-Specific Styles
   ============================================ */

/* --- Hero Section with Video Carousel --- */

.hero {
  position: relative;
  width: 100%;
  height: 85svh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}

.video-carousel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform 0.5s ease;
}

.video-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
}

.video-slide video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-play-button {
  display: block;
  position: absolute;
  left: 50%;
  top: 70%; /* Position below the hero title area */
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  font-size: 28px;
  cursor: pointer;
  z-index: 10; /* Above hero-content which is typically z-index: 1-5 */
  background-color: rgba(0, 0, 0, 0.3);
}

.hero-video-wrap.show-play-button + .hero-play-button,
.video-slide.show-play-button .hero-play-button {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide play button by default when video is playing */
.hero-play-button {
  display: none !important;
}

.hero-video-wrap.show-play-button ~ .hero-play-button,
.video-slide.show-play-button .hero-play-button {
  display: flex !important;
}

.hero-content {
  z-index: 1;
  padding: 2rem;
  position: relative;
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.25rem;
}

/* --- Photo Carousel Section --- */

.photo-carousel-section {
  position: relative;
  width: 100%;
  height: 85svh;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  padding-top: 4rem;
  color: white;
}

.photo-carousel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform 0.5s ease;
}

.photo-slide {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.photo-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Events Section --- */

.events-section {
  background: rgba(0, 0, 0, 0.9);
}

.events-section h2 {
  color: #ffffff;
}

/* Events table — compact one-line rows with expand */
.events-table {
  margin-top: 1rem;
  border-collapse: collapse;
}

.events-table td {
  padding: 0;
}

/* Main event row — single compact line */
.event-row td {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.event-name {
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  flex: 1;
  margin-right: 1rem;
}

.event-name-sub {
  font-weight: 400;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Expand toggle button — inline at end of row */
.event-row .expand-toggle {
  flex-shrink: 0;
  background: rgba(0, 135, 145, 0.15);
  border: 1px solid #008791;
  color: #008791;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  font-size: 0.8rem;
  margin-top: 0;
  border-radius: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.event-row .expand-toggle:hover {
  background: rgba(0, 135, 145, 0.25);
}

/* Details row — hidden by default */
.event-details-row td {
  padding: 0 0.75rem 0.75rem;
}

.event-details {
  color: #f0f0f0;
}

.event-details.collapsed {
  display: none;
}

.event-field {
  font-size: 0.85rem;
  margin: 0.3rem 0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.event-field .field-label {
  font-weight: 600;
  color: #008791;
  margin-right: 0.25rem;
}

.event-link {
  margin-top: 0.5rem;
}

.event-link a {
  color: #008791;
  text-decoration: none;
  font-size: 0.85rem;
}

.event-link a:hover {
  text-decoration: underline;
}

/* Inner expandable text (long detail body) */
.event-details .expandable-text {
  max-height: 4em;
  overflow: hidden;
  position: relative;
}

.event-details .expandable-text:not(.collapsed) {
  max-height: none;
}

.event-details .expandable-text.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.2em;
  background: linear-gradient(to bottom, transparent 70%, rgba(0, 0, 0, 0.85) 100%);
}

.no-date {
  opacity: 0.4;
}

.no-data {
  text-align: center;
  padding: 2rem;
  opacity: 0.7;
}

/* --- Schools Section --- */

/* --- Schools Section --- */

.schools-section {
  background: rgba(0, 0, 0, 0.9);
}

.schools-section h2 {
  color: #ffffff;
}

/* Schools controls and search */
.schools-controls {
  margin-top: 1rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.schools-search {
  flex: 1;
  min-width: 200px;
}

.schools-search input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: white;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Schools table wrapper */
.schools-table-wrapper {
  height: 500px;
  overflow: auto;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.schools-table th {
  font-weight: 600;
}

.schools-table .school-name {
  font-weight: 600;
  color: #008791;
}

.schools-table .school-contact {
  font-size: 0.8rem;
}

.schools-table .school-contact a {
  color: #008791;
  text-decoration: none;
  margin-right: 0.5rem;
}

.schools-table .school-contact a:hover {
  text-decoration: underline;
}

.schools-pagination {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: white;
}

/* --- Comments Section --- */

.comments-section {
  background: rgba(0, 0, 0, 0.9);
}

.comments-section h2 {
  color: #ffffff;
}

.comments-list {
  background: rgba(0, 0, 0, 0.5);
  margin: 0.5rem 0 1rem 0;
  max-height: 320px;
  overflow-y: auto;
  border-radius: 4px;
}

.comment {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.comment:last-child {
  border-bottom: none;
}

.comment .meta {
  font-size: 0.85rem;
  color: #d0d0d0;
  margin-bottom: 0.25rem;
}

.comment .meta strong {
  color: #ffffff;
  font-weight: 600;
}

.comment .body {
  white-space: pre-wrap;
  font-size: 1rem;
  color: #f0f0f0;
  line-height: 1.5;
}

/* Comment form */
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.comment-form input,
.comment-form textarea {
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: white;
  border-radius: 4px;
  resize: vertical;
}

.comment-form button {
  align-self: flex-start;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 4px;
}

.comment-form button:hover {
  background: rgba(0, 0, 0, 0.7);
}

#commentMsg {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  opacity: 0.95;
}

/* Comments pagination */
.comments-pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

.comments-pagination button {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 4px;
}

/* ============================================
   Responsive Section Styles
   ============================================ */

@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  /* Event cards adjust width for mobile */
  .event-card {
    flex: 0 0 280px;
  }

  /* Schools section adjustments */
  .schools-controls {
    flex-direction: column;
  }

  .schools-search {
    width: 100%;
  }

  .schools-table-wrapper {
    height: 450px;
  }

  .schools-table {
    font-size: 0.8rem;
  }

  .comments-list {
    max-height: 280px;
  }
}
