/*============================================================================
  TCE HOMEPAGE - COMPLETE STYLESHEET
  
  This file contains all CSS for the home page layout including:
  - Action CTA Section
  - News Scroller with Auto-scroll Animation
  - Featured News Section  
  - Cyprus Issue Section
  - Explore Features Section
  - All Responsive Styles
  
  Note: The scroller uses BOTH CSS (for styling/animations) and JavaScript 
  (for auto-scroll logic). The JS changes the displayed items every 6 seconds.
============================================================================*/

/* CSS Variables - Brand Colors and Transitions */
:root {
  --primary-color: #D72638;
  --primary-light: #FF4C5D;
  --primary-dark: #B01E2D;
  --secondary-color: #121212;
  --text-light: #FFFFFF;
  --text-muted: #767676;
  --transition-standard: all 0.3s ease;
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-hover: 0 15px 30px rgba(0,0,0,0.15);
}

/*============================================================================
  1. ACTION CTA SECTION (Take Action Today)
============================================================================*/

.action-cta-section {
  background-color: #D72638;
  color: white;
  padding: 50px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
  border-top: 2px solid #D72638;
  border-bottom: 2px solid #D72638;
}

.action-cta-title {
  font-family: 'Special Elite', cursive;
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  position: relative;
  color: white;
}

.action-cta-text {
  font-size: 1.25rem;
  margin: 1.2rem auto;
  max-width: 700px;
  line-height: 1.6;
  opacity: 0.9;
  font-weight: 400;
  color: white;
}

.action-button {
  background-color: #000000;
  color: #FFFFFF;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 4px;
  transition: var(--transition-standard);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000000;
  z-index: 1;
  font-size: 0.9rem;
  margin: 0 5px;
}

.action-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #FFFFFF;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.4s ease-out;
}

.action-button:hover {
  color: #000000;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #FFFFFF;
}

.action-button:hover::before {
  transform: scaleX(1);
}

/*============================================================================
  2. NEWS SCROLLER SECTION (Latest TCE News)
  
  NOTE: This section uses JavaScript for auto-scrolling functionality.
  - JS controls which items are displayed (changes every 6 seconds)
  - CSS provides the styling and fade-in animation
  - Mobile shows 1 item at a time, Desktop shows 3 items
============================================================================*/

.news-scroller {
  background-color: #1d2027;
  padding: 40px 0 20px 0;
  position: relative;
  border-bottom: 2px solid #D72638;
  margin-top: 0;
  border-top: 2px solid #D72638;
}

.news-label {
  background-color: #D72638;
  color: #FFFFFF;
  font-weight: 300;
  font-size: 1rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 0.75rem;
  display: inline-block;
  position: relative;
  padding: 5px 15px;
  font-family: 'Poppins', sans-serif;
  border-radius: 4px;
}

.news-title {
  color: #FFFFFF;
  font-weight: 800;
  margin-bottom: 1.5rem;
  font-family: 'Poppins', sans-serif;
  text-align: left;
}

/* Latest News slider container */
.news-scroller:not(.cyprus-issue-section) .news-slider {
  position: relative;
  overflow: hidden;
  min-height: 340px;
}

#news-items-container {
  min-height: 330px;
  position: relative;
  display: flex;
  flex-wrap: wrap;
}

/* Fade in and slide animation - triggered by JS when items change */
@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* News card wrapper and styling */
.news-card-link-wrapper {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
  cursor: pointer;
}

.news-card {
  background-color: transparent !important;
  overflow: hidden;
  height: 100%;
  border: none;
  position: relative;
  margin-bottom: 15px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.news-card-image-container {
  position: relative;
  text-align: left;
  margin: 0;
}

.news-card-image {
  height: 0;
  width: 100%;
  padding-bottom: 60%;
  overflow: hidden;
  position: relative;
  margin: 0;
  box-sizing: border-box;
}

.news-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card-date-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: #D72638;
  color: #FFFFFF;
  padding: 10px 10px 10px 15px;
  font-size: 1.1rem;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  z-index: 10;
  text-align: center;
  width: 60%;
  box-sizing: border-box;
  border-radius: 0;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-card-content {
  padding: 10px 0;
  position: relative;
  text-align: left;
  background-color: transparent !important;
  width: 100%;
  min-height: 90px;
}

.news-card-category {
  color: #D72638;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 1px;
  font-family: 'Poppins', sans-serif;
}

.news-card-title {
  color: #FFFFFF;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  min-height: 3.3rem;
  display: block;
}

/*============================================================================
  3. CYPRUS ISSUE SECTION (Understanding Our Struggle)
  
  This section has a RED background (vs dark background of Latest News)
  with BLACK labels and cards
============================================================================*/

.news-scroller.cyprus-issue-section {
  background-color: #D72638;
  border-bottom: 2px solid #FFFFFF;
  padding-bottom: 40px;
  overflow: hidden;
}

.news-scroller.cyprus-issue-section .news-label {
  background-color: #000000;
}

.news-scroller.cyprus-issue-section .news-card {
  background-color: #000000 !important;
}

.news-scroller.cyprus-issue-section .news-card-content {
  background-color: #000000;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.news-scroller.cyprus-issue-section .news-card-title {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Cyprus Issue section - no auto-scroll, content flows naturally */
.cyprus-issue-section .news-slider {
  position: relative;
  overflow: hidden;
  min-height: auto;
  height: auto;
}

.cyprus-issue-section .news-slider .row {
  margin-bottom: 0;
}

.cyprus-issue-section .container {
  position: relative;
  z-index: 1;
}

/*============================================================================
  4. FEATURED NEWS SECTION
============================================================================*/

.tce-featured-news-section {
  padding: 60px 0;
  background-color: #ffffff;
}

.section-header {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: #2c3e50;
}

.section-description {
  color: #6c757d;
  font-size: 1.1rem;
}

.featured-tag {
  background-color: #dc3545;
  color: white;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 3px;
  letter-spacing: 0.5px;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.featured-category {
  color: #D72638;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.featured-date {
  font-size: 0.9rem;
}

.featured-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1.3;
}

.featured-excerpt {
  color: #6c757d;
  font-size: 1rem;
  line-height: 1.6;
}

/* CSS Watermark for featured images */
.css-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% - 1.6px));
  background-color: rgba(227, 6, 19, 0.5);
  color: #fff;
  font-family: 'Special Elite', cursive;
  font-size: 0.68rem;
  padding: 5px 15px 2.5px 15px;
  border-radius: 2px;
  z-index: 1;
  width: auto;
  min-width: 45px;
  line-height: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/*============================================================================
  5. EXPLORE FEATURES SECTION (TCE Features Grid)
============================================================================*/

.explore-features-section {
  background-color: #1d2027;
  padding: 40px 0 50px 0;
}

.features-header {
  margin-bottom: 28px;
}

.features-label {
  background-color: #D72638;
  color: #FFFFFF;
  font-weight: 300;
  font-size: 1rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 0.75rem;
  display: inline-block;
  position: relative;
  padding: 5px 15px;
  font-family: 'Poppins', sans-serif;
  border-radius: 4px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card-modern {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem 1.75rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid #e5e7eb;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.feature-card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #D72638, #ff4757);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.feature-card-modern:hover::before {
  transform: scaleX(1);
}

.feature-card-modern:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  border-color: #D72638;
}

.feature-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, #D72638 0%, #ff4757 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: white;
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.feature-card-modern:hover .feature-card-icon {
  transform: scale(1.1) rotate(5deg);
}

.feature-card-modern-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.feature-card-modern-desc {
  font-size: 0.9375rem;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.feature-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #D72638;
  transition: gap 0.3s ease;
}

.feature-card-modern:hover .feature-card-link {
  gap: 0.75rem;
}

.feature-card-link i {
  font-size: 0.875rem;
  transition: transform 0.3s ease;
}

.feature-card-modern:hover .feature-card-link i {
  transform: translateX(2px);
}

/*============================================================================
  6. RESPONSIVE STYLES
============================================================================*/

/* Tablets and below (max-width: 991px) */
@media (max-width: 991px) {
  .tce-featured-news-section {
    padding: 40px 0;
  }
  
  .featured-title {
    font-size: 1.5rem;
  }
  
  .featured-excerpt {
    font-size: 0.95rem;
  }
  
  .featured-content {
    padding: 2rem 1rem !important;
  }
}

/* Mobile devices (max-width: 767px) */
@media (max-width: 767px) {
  /* News scroller adjustments */
  .news-scroller:not(.cyprus-issue-section) .news-slider {
    min-height: auto;
  }
  
  .cyprus-issue-section .news-slider {
    min-height: auto;
    height: auto;
  }
  
  #news-items-container {
    min-height: auto;
    position: relative;
  }
  
  .news-scroller {
    padding: 30px 0 20px 0;
  }
  
  /* Featured section adjustments */
  .tce-featured-news-section {
    padding: 30px 0;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .section-description {
    font-size: 1rem;
  }
  
  .featured-title {
    font-size: 1.3rem;
  }
  
  .featured-excerpt {
    font-size: 0.9rem;
  }
  
  .featured-content {
    padding: 1.5rem 1rem !important;
    margin-top: 1rem;
  }
  
  .featured-image-container {
    margin-bottom: 1rem;
  }
  
  /* Action CTA adjustments */
  .action-cta-title {
    font-size: 2rem;
  }
}

/* Extra small devices (max-width: 575px) */
@media (max-width: 575px) {
  .news-scroller {
    padding: 25px 0 15px 0;
  }
  
  .tce-featured-news-section {
    padding: 20px 0;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .section-description {
    font-size: 0.9rem;
  }
  
  .featured-title {
    font-size: 1.2rem;
  }
  
  .featured-excerpt {
    font-size: 0.85rem;
    line-height: 1.5;
  }
  
  .featured-category {
    font-size: 0.8rem;
  }
  
  .featured-date {
    font-size: 0.8rem;
  }
  
  .featured-content {
    padding: 1rem !important;
  }
  
  .action-cta-title {
    font-size: 1.75rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .feature-card-modern {
    padding: 1.5rem;
  }
}

/* Medium devices for features grid (max-width: 768px) */
@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .feature-card-modern {
    padding: 1.5rem;
  }
}
/* ===== TCE Mobile Hotfix: Cyprus Issue cards overlap fix (≤767px) ===== */
@media (max-width: 767px) {
  /* Ensure the section grows to contain its children */
  .cyprus-issue-section,
  .cyprus-issue-cards {
    display: flow-root !important;         /* establishes a new block formatting context */
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
  }

  /* If older styles used floats, cancel them and stack */
  .cyprus-issue-card {
    float: none !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 0 12px 0 !important;         /* space between cards */
    transform: none !important;
  }

  /* If a grid/flex existed, force a single-column stack with gaps */
  .cyprus-issue-cards {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Safety: if there are absolutely positioned badges/graphics inside cards, unstick them */
  .cyprus-issue-card *[style*="position:absolute"],
  .cyprus-issue-graphic,
  .cyprus-issue-badge,
  .cyprus-issue-illustration {
    position: static !important;
    inset: auto !important;
    margin: 0 0 8px 0 !important;
    max-width: 100% !important;
    height: auto !important;
  }

  /* Final safety: clearfix in case any legacy floats remain */
  .cyprus-issue-cards::after {
    content: "" !important;
    display: block !important;
    clear: both !important;
  }
}
/* ===== TCE Mobile: stack Cyprus cards (fix only-first-visible) ===== */
@media (max-width: 767px) {
  /* Let the container lay items out in a single column */
  .cyprus-issue-section .news-slider {
    position: static !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    height: auto !important;
    min-height: 0 !important;
    /* keep the container containing its children */
    overflow: hidden !important;
  }

  /* Make each card a normal block so it’s all visible */
  .cyprus-issue-section .news-slider .news-card,
  .cyprus-issue-section .news-slider .card {
    position: static !important;
    float: none !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
/* ===== TCE Mobile: unstick Cyprus cards so all are visible ===== */
@media (max-width: 767px) {
  /* Let the inner slider flow normally */
  .cyprus-issue-section .news-slider {
    position: static !important;
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important; /* allow children to define height */
  }

  /* Make each card participate in normal document flow */
  .cyprus-issue-section .news-slider .news-card,
  .cyprus-issue-section .news-slider .card {
    position: static !important;   /* <-- the key change */
    float: none !important;
    display: block !important;
    width: 100% !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    opacity: 1 !important;
    margin: 0 0 12px 0 !important; /* space between cards */
    height: auto !important;
    min-height: 0 !important;
    z-index: auto !important;
  }

  /* If images/overlays inside cards were absolutely positioned, unstick them too */
  .cyprus-issue-section .news-slider .news-card [style*="position:absolute"],
  .cyprus-issue-section .news-slider .card [style*="position:absolute"] {
    position: static !important;
    inset: auto !important;
    margin: 0 0 8px 0 !important;
    max-width: 100% !important;
    height: auto !important;
  }

  /* Final safety: ensure legacy floats don’t collapse the parent */
  .cyprus-issue-section .news-slider::after {
    content: "" !important;
    display: block !important;
    clear: both !important;
  }
}
/* ===== TCE Mobile Containment: make red wrapper expand under its cards ===== */
@media (max-width: 767px) {
  /* The red section wrapper */
  .news-scroller.cyprus-issue-section {
    display: flow-root !important;   /* new block formatting context => auto height */
    overflow: auto !important;       /* containment without clipping */
    height: auto !important;
    min-height: 0 !important;
    padding-bottom: 16px !important; /* a little breathing room */
  }

  /* Extra safety: clearfix inner container if present */
  .news-scroller.cyprus-issue-section .container::after,
  .news-scroller.cyprus-issue-section .row::after,
  .news-scroller.cyprus-issue-section::after {
    content: "" !important;
    display: block !important;
    clear: both !important;
  }
}
/* ===== TCE Mobile: make red wrapper expand, no scrolling ===== */
@media (max-width: 767px) {
  /* Red background section itself */
  .news-scroller.cyprus-issue-section {
    display: flow-root !important;  /* new layout context, auto height */
    overflow: visible !important;   /* <-- allow height to grow, no scrollbars */
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-bottom: 24px !important; /* a bit of space under last card */
  }

  /* Inner slider/wrapper that holds the three cards */
  .cyprus-issue-section .news-slider {
    position: static !important;
    display: block !important;
    overflow: visible !important;   /* <-- no clipping, no scroll */
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  /* Ensure each card sits in normal flow */
  .cyprus-issue-section .news-slider .news-card,
  .cyprus-issue-section .news-slider .card {
    position: static !important;
    float: none !important;
    display: block !important;
    width: 100% !important;
    margin: 0 0 12px 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
/* ===== TCE Mobile: tidy bottom spacing to match card gaps ===== */
@media (max-width: 767px) {
  /* Make the last card sit flush with the section bottom */
  .cyprus-issue-section .news-slider .news-card:last-child,
  .cyprus-issue-section .news-slider .card:last-child {
    margin-bottom: 0 !important;
  }

  /* Set section bottom padding to the same as the gap between cards (12px) */
  .news-scroller.cyprus-issue-section {
    padding-bottom: 12px !important; /* was 24px */
  }
}
/* ===== TCE Mobile: tighten bottom spacing of Explore TCE Features ===== */
@media (max-width: 767px) {
  /* Reduce bottom padding for visual balance with Cyprus section */
  .explore-tce-section {
    padding-bottom: 12px !important;  /* was probably 40px+ */
    margin-bottom: 0 !important;
  }

  /* Optional: match top spacing with card gap above */
  .explore-tce-section {
    margin-top: 12px !important;
  }
}
/* ===== TCE Mobile: tighten bottom spacing of Take Action / Explore section ===== */
@media (max-width: 767px) {
  .action-cta-section {
    padding-bottom: 12px !important; /* reduce large gap at bottom */
    margin-bottom: 0 !important;
  }
}
/* ===== TCE Mobile: trim bottom black container in Explore/Action section ===== */
@media (max-width: 767px) {
  /* tighten the section and its inner container */
  .action-cta-section,
  .action-cta-section .container {
    padding-bottom: 12px !important; /* same as Cyprus section */
    margin-bottom: 0 !important;
  }

  /* optional: if there's still extra gap under the last button */
  .action-cta-section .d-flex {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}
