/* Articles Page Styles */

.articles-page {
  background-color: #cfcfcf;
  color: #111827;
}

.articles-page .page-wrap {
  padding-top: 0; /* Reset padding since we build a custom header section */
}

/* Header Section (Text Left + Featured Card Right) */
.articles-header-section {
  padding: 120px 60px 60px;
  background-color: #cfcfcf;
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: flex-end; /* Align content to bottom */
}

.articles-header-container {
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 0.7fr 1.5fr; /* More width for the image, less for text */
  gap: 80px; /* Increased gap */
  align-items: flex-end; /* Align items to bottom */
}

/* Header Left: Title & Label */
.articles-header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-bottom: 0; /* Removed padding to align with bottom */
}

.articles-label {
  font-size: 18px;
  font-weight: 700;
  color: #111827; /* Purple */
  text-transform: uppercase;
  margin-bottom: 60px; /* Increased space to avoid overlap with scaled title */
  margin-top: -50px; /* Lift up */
  display: inline-block;
  position: relative;
  z-index: 10;
}

/* Header Top Layout for Label and Button */
.articles-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  width: 100%;
}

.articles-page .latest-insights-see-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  min-width: 200px;
  border-radius: 999px;
  border: 1px solid #c3c3c3;
  background: rgba(255, 255, 255, 0.35);
  color: #111827;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.articles-page .latest-insights-see-all:hover {
  border-color: #111827;
  background: #111827;
  color: #cfcfcf;
}

.articles-page .latest-insights-see-all .arrow {
  font-size: 18px;
  line-height: 1;
}

/* Dark theme styles for SVE OBJAVE button */
html[data-theme="dark"] .articles-page .latest-insights-see-all {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.3);
  color: #a855f7;
}

html[data-theme="dark"] .articles-page .latest-insights-see-all:hover {
  border-color: #a855f7;
  background: #a855f7;
  color: #020617;
}

.articles-main-title {
  display: flex;
  flex-direction: column;
  font-family: 'Impact', 'Anton', 'Oswald', sans-serif;
  font-size: 140px; /* Reduced slightly from 160px */
  line-height: 0.95; /* Increased line-height from 0.85 */
  font-weight: 400;
  text-transform: uppercase;
  color: #111827;
  margin: 0;
  letter-spacing: 0em;
  transform: scaleY(1.2); /* Condensed look */
  transform-origin: left bottom;
}

.title-line {
  display: block;
}

/* Header Right: Featured Card */
.articles-header-right {
  width: 100%;
  height: 700px; /* Reduced height */
}

/* Ensure the card inside fills the space */
.articles-header-right .insight-card {
  width: 100%;
  height: 100%;
}

/* Grid Section (4 Columns) */
.articles-grid-section {
  padding: 0 60px 120px;
  background-color: #c3c3c3;
}

.articles-grid-container {
  max-width: 1600px; /* Increased from 1500px to make cards wider */
  margin: 0 auto;
  width: 100%;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1.1fr);
  gap: 15px; /* Reduced from 24px to tighten spacing */
}

/* Match dimensions from main page */
.articles-grid .insight-card--standard {
  height: clamp(480px, 55vh, 600px);
  padding: 7px;
}

.articles-grid .insight-media {
  height: 54%;
}

/* Match homepage card curvature */
body.articles-page .insight-card--featured {
  border-radius: 24px;
}

body.articles-page .insight-card--standard {
  border-radius: 8px;
}

/* Responsive */
@media (max-width: 1400px) {
  .articles-header-container {
    grid-template-columns: 1fr 1fr;
  }
  .articles-main-title {
    font-size: 120px;
  }
  .articles-grid {
    grid-template-columns: repeat(3, 1.1fr);
  }
}

@media (max-width: 1024px) {
  .articles-header-section {
    min-height: auto;
    padding-top: 160px;
  }
  
  .articles-header-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .articles-header-right {
    height: 500px;
  }

  .articles-main-title {
    font-size: 100px;
  }

  .articles-grid {
    grid-template-columns: repeat(2, 1.1fr);
  }
}

@media (max-width: 640px) {
  .articles-header-section {
    padding: 120px 24px 40px;
  }
  
  .articles-grid-section {
    padding: 0 24px 80px;
  }

  .articles-main-title {
    font-size: 64px;
  }

  .articles-header-right {
    height: 400px;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile-only elements hidden by default */
.mobile-only-card {
  display: none;
}

/* Mobile Scroll Progress & Horizontal Slider (Max 768px) */
.mobile-scroll-progress {
  display: none;
  width: 100%;
  height: 2px;
  background: rgba(195, 195, 195, 0.8);
  margin-top: 32px;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.mobile-scroll-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 20%; /* Initial width */
  background: #c3c3c3;
  border-radius: 2px;
  will-change: width, transform;
}

@media (max-width: 768px) {
  /* Remove orange glow on mobile */
  body.articles-page::before {
    display: none;
  }

  /* Hide desktop featured card section */
  .articles-header-right {
    display: none;
  }

  /* Show mobile featured card in grid */
  .mobile-only-card {
    display: block;
  }

  /* Override container padding to match main page (full width) */
  .articles-grid-section {
    padding: 0 0 80px;
  }

  /* Restore Horizontal Swipe but with larger cards */
  .articles-grid {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 0 0 24px 16px; /* Left padding for first card peek */
    scrollbar-width: none; 
  }
  
  .articles-grid::-webkit-scrollbar {
    display: none; 
  }
  
  /* Match dimensions from main page (approx) but allow swipe */
  .articles-grid .insight-card--featured {
    min-width: 90vw; /* Large width */
    width: 90vw;
    flex-shrink: 0;
    scroll-snap-align: center;
    margin-right: 0;
    height: 360px; /* Match main page height */
  }

  .articles-grid .insight-card--standard {
    min-width: 90vw; /* Large width */
    width: 90vw;
    flex-shrink: 0;
    scroll-snap-align: center;
    margin-right: 0;
    height: 380px; /* Match main page height */
  }

  .mobile-scroll-progress {
    display: block; /* Restore progress bar */
  }
}

body.articles-page .insight-card {
  background: rgba(255, 255, 255, 0.02);
  border: 2.5px solid rgba(248, 250, 252, 0.7);
  box-shadow: 0 0 20px rgba(248, 250, 252, 0.65);
}

body.articles-page .insight-card:hover {
  border-color: rgba(248, 250, 252, 1);
  transform: translateY(-6px);
  box-shadow: 0 0 28px rgba(248, 250, 252, 0.85);
}

body.articles-page .insight-tag {
  background: #c3c3c3;
  color: #111827;
  box-shadow: 0 6px 20px rgba(17, 24, 39, 0.25);
  border: 1px solid rgba(17, 24, 39, 0.1);
}

body.articles-page .insight-date,
body.articles-page .insight-card--standard .insight-date {
  color: rgba(17, 24, 39, 0.65);
}

body.articles-page .insight-card--standard .insight-title {
  color: #111827;
}

body.articles-page .insight-excerpt {
  color: rgba(17, 24, 39, 0.7);
}

body.articles-page .insight-card--featured .insight-card-overlay {
  background: transparent;
}

body.articles-page .insight-card--featured:hover .insight-card-overlay {
  background: transparent;
}

body.articles-page .insight-card--featured .insight-title {
  color: #111827;
}

body.articles-page .view-blog-btn {
  border-color: rgba(17, 24, 39, 0.7);
  background: rgba(255, 255, 255, 0.35);
  color: #111827;
}

body.articles-page .insight-media {
  background: #c3c3c3;
  border-color: #c3c3c3;
}

html[data-theme="dark"] body.articles-page {
  background-color: #020617;
  color: #f5f5f7;
}

html[data-theme="dark"] body.articles-page .articles-header-section,
html[data-theme="dark"] body.articles-page .articles-grid-section {
  background-color: #020617;
}

html[data-theme="dark"] body.articles-page .articles-label {
  color: #a855f7;
}

html[data-theme="dark"] body.articles-page .articles-main-title {
  color: #e2e8f0;
}

html[data-theme="dark"] body.articles-page .mobile-scroll-progress {
  background: rgba(122, 40, 138, 0.1);
}

html[data-theme="dark"] body.articles-page .mobile-scroll-bar {
  background: #a855f7;
}

html[data-theme="dark"] body.articles-page .insight-card {
  background: rgba(2, 6, 23, 0.4);
  border: 2.5px solid rgba(248, 250, 252, 0.8);
  box-shadow: 0 0 24px rgba(248, 250, 252, 0.55);
}

html[data-theme="dark"] body.articles-page .insight-card:hover {
  border-color: rgba(248, 250, 252, 1);
  transform: translateY(-6px);
  box-shadow: 0 0 32px rgba(248, 250, 252, 0.85);
}

html[data-theme="dark"] body.articles-page .insight-tag {
  background: #FFFFFF;
  color: #000000;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

html[data-theme="dark"] body.articles-page .insight-date {
  color: rgba(255, 255, 255, 0.6);
}

html[data-theme="dark"] body.articles-page .insight-card--standard .insight-date {
  color: #94a3b8;
}

html[data-theme="dark"] body.articles-page .insight-card--featured .insight-title,
html[data-theme="dark"] body.articles-page .insight-card--standard .insight-title {
  color: #FFFFFF;
}

html[data-theme="dark"] body.articles-page .insight-excerpt {
  color: #64748b;
}

html[data-theme="dark"] body.articles-page .insight-card--featured .insight-card-overlay {
  background: transparent;
}

html[data-theme="dark"] body.articles-page .insight-card--featured:hover .insight-card-overlay {
  background: transparent;
}

html[data-theme="dark"] body.articles-page .view-blog-btn {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.2);
  color: #FFFFFF;
}

html[data-theme="dark"] body.articles-page .insight-media {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.1);
}
