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

/* ========================================
   CSS CUSTOM PROPERTIES (LOCAL VARIABLES)
   ======================================== */

:root {
  /* Layout Variables */
  --home-container-padding: 2rem;
  --home-section-gap: 3rem;
  --home-card-radius: 8px;
  --home-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

  /* News Section Variables */
  --news-image-width: 300px;
  --news-image-height: 225px;
  --news-card-gap: 2rem;
  --news-content-padding: 1.5rem;

  /* Spotlight Variables */
  --spotlight-overlay-opacity: 0.9;
  --spotlight-text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);

  /* Breakpoints */
  --bp-mobile: 576px;
  --bp-tablet: 768px;
  --bp-desktop: 1024px;
  --bp-large: 1200px;

  /* Transparent Colors */
  --aa-white-transparent: rgba(255, 255, 255, var(--spotlight-overlay-opacity));
  --aa-black-transparent: rgba(0, 0, 0, 0.5);
}

/* ========================================
   SECTION: NEWS
   ======================================== */

.home-news-section {
  background-color: var(--aa-light-green);
  padding: var(--home-container-padding) 0;
}

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

/* Mobile section title alignment */
@media (max-width: 575px) {
  .section-title {
    font-size: 1.5rem;
    margin: 0 0.75rem 1.5rem;
    text-align: left;
  }
}

/* News Grid Layout */
.news-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--news-card-gap);
  margin-bottom: var(--home-container-padding);
}

/* Force single column on mobile */
@media (max-width: 575px) {
  .news-container {
    grid-template-columns: 1fr !important;
    margin-left: 0;
    margin-right: 0;
    gap: 1rem;
  }
}

/* News Card */
.newsItem {
  background: var(--aa-white);
  border-radius: var(--home-card-radius);
  overflow: hidden;
  box-shadow: var(--home-card-shadow);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.newsItem:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* News Image */
.news-image-container {
  width: 100%;
  height: var(--news-image-height);
  overflow: hidden;
  position: relative;
}

.news-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.newsItem:hover .news-image-container img {
  transform: scale(1.05);
}

/* News Content */
.news-content {
  padding: var(--news-content-padding);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-title {
  margin: 0 0 0.75rem 0;
  font-size: 1.25rem;
  line-height: 1.3;
  flex-shrink: 0;
}

.news-title-link {
  text-decoration: none;
  color: var(--aa-blue);
  font-weight: bold;
  font-family: var(--aa-font-family);
  transition: color 0.3s ease;
}

.news-title-link:hover {
  color: var(--aa-fuschia);
  text-decoration: underline;
}

.news-date {
  color: var(--aa-accent-orange);
  font-weight: bold;
  font-size: 0.875rem;
  margin: 0 0 1rem 0;
  flex-shrink: 0;
}

.news-excerpt {
  font-family: var(--aa-font-family);
  line-height: 1.6;
  color: var(--aa-gray-light);
  flex: 1;
  margin: 0;
}

/* More News Button */
.news-footer {
  text-align: center;
  margin-top: var(--home-container-padding);
}

/* Mobile news footer alignment */
@media (max-width: 575px) {
  .news-footer {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }
}

.more-news-link {
  display: inline-block;
  transition: transform 0.3s ease;
}

.more-news-link:hover {
  transform: scale(1.05);
}

.more-news-button {
  max-width: 200px;
  height: auto;
}

.more-news-text {
  display: inline-block;
  background-color: var(--aa-fuschia);
  color: var(--aa-white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--home-card-radius);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  font-family: var(--aa-font-family);
}

.more-news-text:hover {
  background-color: var(--aa-orange);
  transform: translateY(-2px);
}

/* ========================================
   SECTION: SPOTLIGHT
   ======================================== */

.spotlight-section {
  position: relative;
  overflow: hidden;
  margin-top: var(--home-section-gap);
  border-radius: var(--home-card-radius);
}

.spotlight-image {
  width: 100%;
  height: auto;
  display: block;
}

.spotlight-image img {
  width: 100%;
  height: auto;
  display: block;
}

.spotlight-label {
  position: absolute;
  top: 2rem;
  left: 2rem;
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--aa-orange);
  text-shadow: var(--spotlight-text-shadow);
  z-index: 10;
  font-family: var(--aa-font-family);
}

/* Spotlight Content Box */
.transbox {
  position: absolute;
  top: 10%;
  right: 5%;
  width: min(300px, 25%);
  background-color: var(--aa-white-transparent);
  backdrop-filter: blur(10px);
  border-radius: var(--home-card-radius);
  padding: 1.5rem;
  z-index: 15;
  box-shadow: var(--home-card-shadow);
}

.transbox h4 {
  margin: 0 0 1rem 0;
  font-weight: bold;
  color: var(--aa-spotlight-orange);
  font-size: 1.25rem;
  line-height: 1.3;
  font-family: var(--aa-font-family);
}

.transbox p {
  margin: 0 0 1rem 0;
  color: var(--aa-charcoal);
  line-height: 1.5;
  font-size: 0.9rem;
}

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

.transbox a:hover {
  color: var(--aa-fuschia);
  text-decoration: underline;
}

/* ========================================
   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);
  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);
  border-radius: var(--home-card-radius);
  padding: 0.5rem 1rem;
}

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

/* 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;
  }

  .spotlight-label {
    font-size: 3rem;
  }

  .transbox {
    width: 20%;
    padding: 2rem;
  }
}

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

  .transbox {
    width: 25%;
  }
}

/* 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;
  }

  .newsItem {
    min-height: auto;
  }

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

  .transbox {
    width: 35%;
    padding: 1rem;
    top: 15%;
  }

  .transbox h4 {
    font-size: 1rem;
  }

  .transbox p {
    font-size: 0.8rem;
  }

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

/* 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;
  }

  .newsItem {
    width: 100%;
    max-width: none;
  }

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

  .transbox {
    position: static;
    width: 100%;
    margin-top: 1rem;
    background-color: var(--aa-white);
  }

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

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

  .section-title {
    font-size: 1.5rem;
    margin: 0 0.75rem 1rem;
  }

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

  .newsItem {
    width: 100%;
    max-width: none;
  }

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

  .spotlight-section {
    margin-top: 1.5rem;
  }

  .spotlight-label {
    font-size: 1.25rem;
    top: 0.75rem;
    left: 0.75rem;
  }

  .transbox {
    position: static;
    width: 100%;
    margin-top: 0.75rem;
    padding: 1rem;
    background-color: var(--aa-white);
  }

  .transbox h4 {
    font-size: 1rem;
  }

  .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,
.transbox a: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) {
  .newsItem {
    border: 2px solid var(--aa-charcoal);
  }

  .transbox {
    border: 2px solid var(--aa-spotlight-orange);
    background-color: var(--aa-white);
  }
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

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

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

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

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