/* NJTPA Events Styles */

/* Events Hero Section with Highlighted Events */
.events-hero-section {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  background: var(--njtpa-dark-blue);
  color: var(--njtpa-white);
  margin-bottom: var(--space-5xl);
}

.events-hero-section .container {
  position: relative;
  z-index: 2;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: var(--space-5xl) 20px;
}

.events-hero-section .hero-content-split {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-5xl);
  align-items: center;
  padding: 0;
  text-align: left;
  max-width: 1200px;
  margin: 0 auto;
}

.events-hero-section .hero-left {
  min-width: 0;
}

.events-hero-section .hero-title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin: 0;
}

/* Highlighted Events */
.events-hero-section .hero-right {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-lg);
  padding: var(--space-3xl);
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* max-width: 500px; */
  justify-self: end;
}

.highlighted-events-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--space-2xl) 0;
  color: var(--njtpa-white);
}

.highlighted-events-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* Highlighted Events - using event-item component */
.highlighted-event-wrapper {
  margin-bottom: 0;
}

/* Override event-item styles for hero context */
.highlighted-events-list .event-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition-base);
  padding: var(--space-lg);
  margin-bottom: 0;
}

.highlighted-events-list .event-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.highlighted-events-list .event-item__date {
  background: var(--njtpa-maroon);
  color: var(--njtpa-white);
}

.highlighted-events-list .event-item__month {
  color: rgba(255, 255, 255, 0.9);
}

.highlighted-events-list .event-item__day {
  color: #000; /* Keep day number black like original */
}

.highlighted-events-list .event-item__content h3 {
  color: var(--njtpa-white);
}

.highlighted-events-list .event-item__time {
  color: rgba(255, 255, 255, 0.8);
}

.highlighted-events-list .event-item__link {
  background: rgba(255, 255, 255, 0.1);
  color: var(--njtpa-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: var(--space-sm) var(--space-lg);
}

.highlighted-events-list .event-item__link:hover {
  background: var(--njtpa-maroon);
  border-color: var(--njtpa-maroon);
  color: var(--njtpa-white);
}

@media (max-width: 992px) {
  .events-hero-section .hero-content-split {
    grid-template-columns: 1fr;
    gap: var(--space-3xl);
  }
}

@media (max-width: 768px) {
  .events-hero-section {
    min-height: auto;
  }

  .events-hero-section .container {
    padding: var(--space-4xl) 15px;
  }

  .events-hero-section .hero-title {
    font-size: var(--font-size-3xl);
  }

  .events-hero-section .hero-right {
    padding: var(--space-2xl);
  }
}

/* Event Single Hero Section */
.event-hero-section {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  background: var(--njtpa-dark-blue);
  color: var(--njtpa-white);
  margin-bottom: var(--space-5xl);
}

.event-hero-section .hero-gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--njtpa-dark-blue);
  opacity: 0.9;
  z-index: 1;
}

.event-hero-section .container {
  position: relative;
  z-index: 2;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: var(--space-5xl) 20px;
}

.event-hero-section .hero-content {
  max-width: 100%;
  padding: 0;
  text-align: left;
}

.event-hero-section .hero-title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-3xl) 0;
}

.event-hero-section .hero-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.event-hero-section .hero-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--font-size-lg);
  color: rgba(255, 255, 255, 0.9);
}

.event-hero-section .hero-meta-item svg {
  flex-shrink: 0;
  color: var(--njtpa-maroon);
}

.event-hero-section .hero-meta-item address {
  font-style: normal;
  margin: 0;
}

@media (max-width: 768px) {
  .event-hero-section {
    min-height: 400px;
  }

  .event-hero-section .container {
    padding: var(--space-4xl) 15px;
  }

  .event-hero-section .hero-title {
    font-size: var(--font-size-3xl);
  }

  .event-hero-section .hero-meta-item {
    font-size: var(--font-size-base);
  }
}

/* Single Event Styles */
.event-single-layout .container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-4xl);
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.event-single-layout .content-area {
  min-width: 0;
}

.njtpa-single-event {
  margin-bottom: 2rem;
}

.event-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #007cba;
  margin-bottom: 1.5rem;
}

.event-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
  min-height: 3rem;
}

.event-date-meta::before {
  content: "📅";
  font-size: 1.125rem;
  line-height: 1;
  margin-top: 0.125rem;
  flex-shrink: 0;
}

.event-location-meta::before {
  content: "📍";
  font-size: 1.125rem;
  line-height: 1;
  margin-top: 0.125rem;
  flex-shrink: 0;
}

.event-datetime {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-self: flex-start;
}

.event-date {
  font-weight: 600;
  color: #333;
  font-size: 1rem;
  line-height: 1.3;
  margin: 0;
}

.event-time {
  color: #007cba;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
}

.event-location {
  font-style: normal;
  line-height: 1.4;
  color: #333;
  font-size: 0.95rem;
  margin: 0;
  align-self: flex-start;
}

.event-summary {
  background: #f8f9fa;
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 6px;
  border-left: 4px solid #007cba;
  font-size: 1.1em;
  line-height: 1.6;
}

.back-to-archive {
  margin: 2rem 0;
}

.back-to-archive-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: #f8f9fa;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid #dee2e6;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.95em;
}

.back-to-archive-link:hover {
  background: #007cba;
  color: white;
  border-color: #007cba;
}

.back-to-archive-link .arrow {
  transition: transform 0.3s ease;
}

.back-to-archive-link:hover .arrow {
  transform: translateX(-3px);
}

.njtpa-event-sidebar {
  background: transparent;
  padding: 0;
  align-self: start;
}

.njtpa-event-sidebar .widget {
  margin-bottom: 2rem;
  background: white;
  padding: 1.5rem;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.njtpa-event-sidebar .widget:last-child {
  margin-bottom: 0;
}

.njtpa-event-sidebar .widget-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #007cba;
  border-bottom: 2px solid #007cba;
  padding-bottom: 0.5rem;
}

.event-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.event-link-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
  gap: 0.75rem;
}

.event-link-item:hover {
  background: #007cba;
  color: white;
  border-color: #007cba;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 123, 186, 0.2);
}

.event-link-item:hover .arrow {
  transform: translateX(2px);
}

.event-link-item.event-link-file {
  border-left: 4px solid #28a745;
}

.event-link-item.event-link-file:hover {
  background: #28a745;
  border-color: #28a745;
}

.event-link-item .link-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
}

.event-link-item .link-content {
  flex: 1;
  min-width: 0;
}

.event-link-item .link-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
  word-wrap: break-word;
}

.event-link-item .link-type {
  font-size: 0.75rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.event-link-item .arrow {
  font-size: 0.875rem;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.event-no-files {
  text-align: center;
  padding: 1.5rem;
  color: #666;
  font-style: italic;
}

.event-no-files p {
  margin: 0;
  font-size: 0.9rem;
}

/* Events Archive Calendar Styles */
.events-layout {
  width: 100%;
  max-width: none;
}

.events-layout .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: block;
}

.events-content-area {
  width: 100%;
  max-width: none;
}

.events-page-header {
  text-align: center;
  margin-bottom: 20px;
}

.events-page-header .section__title {
  margin-bottom: 0;
  font-size: 2.2em;
  color: var(--njtpa-dark-blue);
  font-weight: 700;
}

.events-calendar-container {
  margin: 0 auto;
  margin-bottom: 2rem;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  max-width: 1200px;
  border: 2px solid var(--njtpa-dark-blue);
}

.calendar-month-nav {
  background: var(--njtpa-dark-blue);
  padding: 20px 30px;
  color: white;
  margin-bottom: 0;
}

.calendar-nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
  gap: 20px;
}

.calendar-month-selector {
  display: flex;
  gap: 8px;
  align-items: center;
}

.calendar-month-selector select {
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  min-width: 80px;
}

.calendar-month-selector select option {
  background: var(--njtpa-dark-blue);
  color: white;
}

/* Legacy nav classes - keeping for backwards compatibility */
.calendar-nav-prev,
.calendar-nav-next {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.85em;
  min-width: 80px;
  text-align: center;
}

.calendar-nav-prev:hover,
.calendar-nav-next:hover,
.calendar-nav-prev:focus,
.calendar-nav-next:focus {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

.calendar-nav-prev:focus-visible,
.calendar-nav-next:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

.events-calendar-grid {
  padding: 0;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
}

.calendar-day-header {
  padding: 12px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid #e9ecef;
}

.calendar-week:last-child {
  border-bottom: none;
}

.calendar-day {
  height: 100px;
  padding: 6px;
  border-right: 1px solid #e9ecef;
  position: relative;
  background: #fff;
  transition: all 0.2s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.calendar-day:last-child {
  border-right: none;
}

.calendar-day:hover {
  background: #f8f9fa;
}

.calendar-day-empty {
  background: #f8f9fa;
  height: 100px;
}

.calendar-day.is-today {
  background: #e7f3ff;
  border: 2px solid #007cba;
  box-shadow: inset 0 0 0 1px #007cba;
}

.calendar-day.has-events {
  background: #fff8e1;
}

.calendar-day.has-events.is-today {
  background: #e1f5fe;
}

.calendar-day-number {
  font-weight: bold;
  color: #333;
  font-size: 0.85em;
  margin-bottom: 3px;
  flex-shrink: 0;
}

.calendar-day-events {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  overflow: hidden;
}

.calendar-event-item {
  display: block;
  padding: 2px 4px;
  background: #007cba;
  color: white;
  text-decoration: none;
  border-radius: 2px;
  font-size: 0.65em;
  line-height: 1.1;
  transition: all 0.2s ease;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.calendar-event-item:hover {
  background: #005a87;
  color: white;
  transform: scale(1.02);
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 123, 186, 0.3);
}

.calendar-event-item .event-time {
  display: none;
}

.calendar-event-item .event-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1em;
}

.calendar-day-events .calendar-event-item:nth-child(4) ~ .calendar-event-item {
  display: none;
}

.calendar-day-events:has(.calendar-event-item:nth-child(4)) .calendar-event-item:nth-child(3):after {
  content: "+more";
  display: block;
  background: #666;
  color: white;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 0.6em;
  margin-top: 1px;
}

.calendar-error {
  padding: 20px;
  background: #fee;
  color: #c33;
  text-align: center;
  border-radius: 4px;
  margin: 20px;
}

/* Events Archive Responsive */
@media (max-width: 768px) {
  .event-meta {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .njtpa-event-sidebar {
    margin-top: 2rem;
  }

  .event-link-item {
    padding: 0.875rem;
    gap: 0.625rem;
  }

  .event-link-item .link-icon {
    font-size: 1rem;
  }

  .events-layout .container {
    padding: 0 15px;
  }

  .calendar-month-nav {
    padding: 12px 20px;
  }

  .calendar-nav-buttons {
    gap: 10px;
    flex-wrap: wrap;
    max-width: 100%;
  }

  .calendar-month-selector {
    gap: 6px;
    order: 2;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
  }

  .calendar-month-selector select {
    min-width: 70px;
    font-size: 0.8em;
  }

  .calendar-nav-prev,
  .calendar-nav-next {
    padding: 6px 10px;
    font-size: 0.8em;
  }

  .calendar-day {
    height: 70px;
    padding: 4px;
  }

  .calendar-day-header {
    padding: 8px 4px;
    font-size: 0.75em;
  }

  .calendar-event-item {
    font-size: 0.6em;
    padding: 1px 3px;
  }

  .calendar-day-number {
    font-size: 0.8em;
  }
}

@media (max-width: 480px) {
  .event-summary {
    padding: 1.25rem;
    margin: 1.25rem 0;
  }

  .event-meta {
    gap: 0.875rem;
    padding: 1rem;
    margin-top: 1rem;
  }

  .event-meta-item {
    font-size: 0.875rem;
  }

  .event-date-meta::before,
  .event-location-meta::before {
    font-size: 1rem;
  }

  .event-link-item {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
    gap: 0.625rem;
  }

  .event-link-item .link-icon {
    font-size: 1.25rem;
  }

  .events-page-header .section__title {
    font-size: 1.8em;
  }

  .calendar-day {
    height: 50px;
    padding: 2px;
  }

  .calendar-day-number {
    font-size: 0.75em;
    margin-bottom: 2px;
  }

  .calendar-event-item {
    font-size: 0.55em;
    padding: 1px 2px;
  }

  .calendar-month-title {
    font-size: 1.2em;
  }
}


.page-section-heading {
  color: var(--njtpa-dark-blue);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
}

/* Calendar Navigation Enhancements */
.calendar-nav-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.85em;
  min-width: 80px;
  text-align: center;
}

.calendar-nav-btn:hover,
.calendar-nav-btn:focus {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  outline: none;
}

.calendar-nav-btn:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

.calendar-go-btn {
  padding: 6px 12px;
  background: var(--njtpa-maroon);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-go-btn:hover,
.calendar-go-btn:focus {
  background: #8b1538;
}

.calendar-go-btn:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

.calendar-today-link {
  text-align: center;
  margin-top: 12px;
}

.calendar-today-link a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  font-size: 0.85em;
}

.calendar-today-link a:hover,
.calendar-today-link a:focus {
  color: white;
}

/* Other month days (prev/next month) */
.calendar-day-other-month {
  background: #f0f0f0;
}

.calendar-day-other-month .calendar-day-number {
  color: #999;
  font-weight: normal;
}

/* Event overflow indicator */
.calendar-more-events {
  display: block;
  padding: 2px 4px;
  background: #666;
  color: white;
  border-radius: 2px;
  font-size: 0.65em;
  text-align: center;
  margin-top: 1px;
}

/* Calendar focus styles */
.calendar-event-item:focus {
  outline: 2px solid var(--njtpa-dark-blue);
  outline-offset: 1px;
}

.calendar-month-selector select:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Firefox select fix */
@-moz-document url-prefix() {
  .calendar-month-selector select option {
    background-color: #1a365d;
  }
}

/* Screen reader text */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mobile List View */
.events-mobile-list {
  display: none;
  padding: 20px;
}

.events-mobile-list-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--njtpa-dark-blue);
  margin: 0 0 1rem 0;
  text-align: center;
}

.events-mobile-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.events-mobile-item:hover,
.events-mobile-item:focus {
  background: #f8f9fa;
  border-color: var(--njtpa-dark-blue);
}

.events-mobile-item:focus-visible {
  outline: 2px solid var(--njtpa-dark-blue);
  outline-offset: 2px;
}

.events-mobile-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 0.5rem;
  background: var(--njtpa-dark-blue);
  color: white;
  border-radius: 4px;
}

.events-mobile-day {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.events-mobile-weekday {
  font-size: 0.7rem;
  text-transform: uppercase;
  opacity: 0.9;
}

.events-mobile-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.events-mobile-title {
  font-weight: 600;
  color: var(--njtpa-dark-blue);
  line-height: 1.3;
}

.events-mobile-time {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.25rem;
}

.events-mobile-empty {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 2rem;
}

/* Show mobile list, hide grid on small screens */
@media (max-width: 768px) {
  .events-calendar-grid {
    display: none;
  }

  .events-mobile-list {
    display: block;
  }

  .calendar-nav-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }

  .calendar-nav-btn {
    order: 1;
  }

  .calendar-month-selector {
    order: 2;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
  }

  .calendar-go-btn {
    padding: 6px 16px;
  }

  .calendar-today-link {
    margin-top: 8px;
  }
}