/**
 * Hours Section Component Styles
 */

.hours-section {
  background-image: url('/themes/custom/gmu_libraries/images/background.png');
  background-size: cover;
  background-position: center;
  background-color: transparent;
  padding: var(--spacing-xl) 0;
  border-bottom: 5px solid var(--gmu-primary-green);
  color: var(--gmu-white);
  position: relative;
}

/* Dark overlay on top of the background image */
.hours-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.90);
  z-index: 1;
}

.hours-section__container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 3% 0 10%;
  position: relative;
  z-index: 2;
}

.hours-section__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.hours-section__title {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-20);
  color: var(--gmu-white);
  margin: 0 0 0.5rem;
  text-align: center;
}

.hours-section__view-all {
  background: var(--gmu-accent-yellow);
  color: var(--gmu-black);
  font-size: var(--font-size-12);
  font-weight: var(--font-weight-bold);
  padding: 0.5rem 1rem;
  text-decoration: none;
  transition: background var(--transition-fast);
  display: inline-block;
}

.hours-section__view-all:hover {
  background: #e6b32e;
  color: var(--gmu-black);
}

.hours-section__grid {
  display: grid;
  grid-template-columns: repeat(5, auto);
  gap: 1rem;
  width: fit-content;
  margin: 0 auto; /* Center the grid in the container */
}

/* Hours grid container for new layout */
.hours-grid-container {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0;
}

.hours-location {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  min-width: 0;
  padding: 0 0.85rem;
  border-right: 2px solid rgba(255, 199, 51, 0.45);
}

.hours-location:last-child {
  border-right: none !important;
}

.hours-section__location {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.hours-section__location-name {
  font-size: var(--font-size-14);
  font-weight: var(--font-weight-normal);
  color: var(--gmu-white);
  margin: 0;
}

.hours-section__time {
  font-size: var(--font-size-14);
  font-weight: var(--font-weight-normal);
  color: var(--gmu-white);
  margin: 0;
}

@media (max-width: 768px) {
  .hours-section__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
  }

  .hours-section__grid {
    grid-template-columns: 1fr;
  }

  /* Mobile: 2 rows × 3 columns grid */
  .hours-grid-container {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    width: 100%;
  }

  .hours-location {
    flex: unset;
    padding: 0.5rem 0.3rem;
    border-right: 2px solid rgba(255, 199, 51, 0.45);
    border-bottom: 2px solid rgba(255, 199, 51, 0.45);
    align-items: center;
  }

  /* Remove right border from every 3rd column */
  .hours-location:nth-child(3n) {
    border-right: none;
  }

  /* Remove bottom border from last row (items 4–6) */
  .hours-location:nth-child(n+4) {
    border-bottom: none;
  }

  /* Override the global :last-child rule so nth-child logic controls borders */
  .hours-location:last-child {
    border-right: none;
    border-bottom: none;
  }
}

/* Override prose h2 margin-top (higher specificity needed) */
.hours-section .hours-section__title {
  margin-top: 0;
}
