/* Home Page Styles for ArtsArlington Theme - Improved Version */

@import './events.css';
@import './news.css';
@import './spotlight.css';

/* ========================================
   BASE LAYOUT
   ======================================== */

.site-main {
  width: 100%;
  min-height: 100vh;
}

.page-content {
  margin-bottom: var(--home-container-padding);
}

.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--home-container-padding);
}

.home-two-columns {
  display: grid;
  grid-template-columns: 2fr 1fr; /* main content | sidebar */
  gap: 1rem;
  align-items: start;
  margin-block-start: 2rem;
}

.section-title {
  font-size: 2rem;
  color: var(--aa-orange);
  margin: 0;
  font-family: var(--aa-font-family);
}

/* ========================================
   WIDGET STYLES
   ======================================== */

/* Calendar Widget */
.widget_artsopolis_calendar_teaser_widget ul {
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.widget_artsopolis_calendar_teaser_widget ul li {
  background: var(--aa-white);
  border-radius: var(--home-card-radius);
  overflow: hidden;
  box-shadow: var(--home-card-shadow);
  transition: transform 0.3s ease;
}

.widget_artsopolis_calendar_teaser_widget ul li:hover {
  transform: translateY(-2px);
}

.widget_artsopolis_calendar_teaser_widget ul li img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.widget-event-content-right {
  padding: 1rem;
}

.widget_artsopolis_calendar_teaser_widget ul li a {
  text-decoration: none;
  color: var(--aa-blue-dark);
  font-weight: bold;
  transition: color 0.3s ease;
}

.widget_artsopolis_calendar_teaser_widget ul li a:hover {
  color: var(--aa-fuschia);
}

/* Text Widget */
.textwidget p {
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--aa-white);
  font-family: var(--aa-font-family);
}

/* MetaSlider */
.metaslider .flexslider:hover .flex-prev {
  left: 250px;
}

.metaslider .caption-wrap {
  font-size: 0.875rem;
  background-color: var(--aa-black-transparent);

  .caption {
    margin: 0.5rem;
  }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Force two-column layout on desktop; keep stacking on smaller viewports */
@media (min-width: 1024px) {
  .home-two-columns > * {
    min-width: 0; /* allow flex/grid children to shrink correctly for overflow handling */
  }
}

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
  .news-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .textwidget p {
    font-size: 1.75rem;
    line-height: 1.5;
  }
}

/* Desktop (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
  .news-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Tablet-Desktop Breakpoint */
@media (max-width: 1024px) {
  .home-two-columns {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --home-container-padding: 1.5rem;
    --news-card-gap: 1.5rem;
  }

  .news-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-left: 1.5rem;
    margin-right: 1.5rem;
  }

  .news-item {
    min-height: 0;
  }

  .spotlight-label {
    font-size: 2rem;
    top: 1.5rem;
    left: 1.5rem;
  }
}

/* Mobile (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  :root {
    --home-container-padding: 1rem;
    --news-card-gap: 1rem;
  }

  .news-container {
    grid-template-columns: 1fr;
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .news-item {
    width: 100%;
    max-width: none;
  }

  .spotlight-label {
    font-size: 1.5rem;
    top: 1rem;
    left: 1rem;
  }

  .textwidget p {
    font-size: 1.125rem;
  }
}

/* Small Mobile & General Mobile Styles */
@media (max-width: 575px) {
  :root {
    --home-container-padding: 0.75rem;
    --news-card-gap: 0.75rem;
    --news-content-padding: 1rem;
  }

  .home-container {
    padding: 0;
  }

  .home-news-section {
    padding: var(--home-container-padding) 0.75rem;
  }

  .section-title {
    font-size: 1.5rem;
    margin: 0 0.75rem 1.5rem;
    text-align: left;
  }

  .news-container {
    grid-template-columns: 1fr;
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }

  .news-item {
    width: 100%;
    max-width: none;
  }

  .news-title {
    font-size: 1.125rem;
  }

  .textwidget p {
    font-size: 1rem;
    line-height: 1.3;
  }

  .widget_artsopolis_calendar_teaser_widget ul {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ========================================
   ACCESSIBILITY & INTERACTIONS
   ======================================== */

/* Focus States */
.news-title-link:focus,
.more-news-link:focus {
  outline: 2px solid var(--aa-fuschia);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .news-item {
    border: 2px solid var(--aa-gray-medium);
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .spotlight-section,
  .more-news-link,
  .widget_artsopolis_calendar_teaser_widget {
    display: none;
  }

  .news-item {
    box-shadow: none;
    border: 1px solid #000;
    break-inside: avoid;
    margin-bottom: 1rem;
  }

  .news-title-link {
    color: #000 !important;
    text-decoration: underline;
  }
}
