/* =====================
   CSS VARIABLES
   ===================== */
:root {
  --article-surface: #ffffff;
  --article-text: var(--charcoal-black);
  --article-muted: var(--gray-muted);
  --article-date: var(--muted);
  --article-accent: var(--primary);
  --article-btn-bg: var(--bg-light);
  --article-btn-border: var(--border);
  --article-btn-hover: rgba(219, 103, 0, 0.08);
  --radius-card: 14px;
  --radius-btn: 6px;
  --max-width: 1140px;
  --card-img-h: 220px;
}

/* =====================
   RESET
   ===================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =====================
   SECTION
   ===================== */
.articles-section {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 72px 28px 60px;
  overflow: hidden;
  background: var(--bg-light);
}

/* =====================
   HEADER
   ===================== */
.articles-header {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 52px;
  animation: fadeUp 0.7s ease both;
}

.articles-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h2);
  font-weight: 700;
  line-height: 1.2;
  color: var(--charcoal-black);
  margin-bottom: 18px;
}

.articles-sub {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--article-muted);
  line-height: 1.7;
  max-width: 540px;
  margin: 0 auto;
}

/* =====================
   ARTICLES CAROUSEL
   ===================== */
.articles-carousel {
  position: relative;
  z-index: 1;
  overflow: hidden;
  margin-bottom: 36px;
}

.articles-track {
  display: flex;
  transition: transform 0.5s ease;
}

.articles-carousel .article-card {
  flex: 0 0 100%;
  max-width: 100%;
  display: flex;
  flex-direction: row;
  height: 260px;
  min-height: 260px;
  max-height: 260px;
}

.articles-carousel .article-card__img-wrap {
  flex: 0 0 40%;
  height: 260px;
  min-height: 260px;
}

.articles-carousel .article-card__img {
  height: 100%;
}

.articles-carousel .article-card__body {
  flex: 0 0 60%;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  height: 260px;
  min-height: 260px;
  overflow: hidden;
}

.articles-carousel .article-card__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h3);
  font-weight: 600;
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  display: box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  box-orient: vertical;
  flex: 0 0 auto;
}

.articles-carousel .article-card__desc {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  line-height: 1.5;
  max-height: 4.5em;
  overflow: hidden;
  display: -webkit-box;
  display: box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  box-orient: vertical;
  flex: 0 0 auto;
}

.articles-carousel .article-card__date {
  flex: 0 0 auto;
}

.articles-carousel .article-card__btn {
  flex: 0 0 auto;
  margin-top: 8px;
}

/* =====================
   ARTICLE CARD
   ===================== */
.article-card {
  background: var(--article-surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  animation: fadeUp 0.65s ease both;
  animation-delay: var(--delay, 0s);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.article-card:hover {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

/* Image */
.article-card__img-wrap {
  position: relative;
  height: var(--card-img-h);
  overflow: hidden;
}

.article-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.article-card:hover .article-card__img {
  transform: scale(1.04);
}

.article-card__img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(22, 22, 22, 0.25) 100%
  );
}

/* Body */
.article-card__body {
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.article-card__date {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: var(--article-date);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.article-card__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--article-text);
  flex: 1;
}

.article-card__desc {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: var(--article-muted);
  line-height: 1.65;
}

/* Read More Button */
.article-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--article-btn-bg);
  border: 1px solid var(--article-btn-border);
  border-radius: var(--radius-btn);
  color: var(--article-text);
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  font-weight: 500;
  text-decoration: none;
  width: fit-content;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    gap 0.18s ease;
}

.article-card__btn:hover {
  background: var(--article-btn-hover);
  border-color: var(--primary);
  gap: 12px;
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.18s ease;
}

.article-card__btn:hover .btn-arrow {
  transform: translateX(3px);
}

/* =====================
   DOT PAGINATION
   ===================== */
.articles-dots {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding-right: 4px;
}

.dot {
  width: 22px;
  height: 5px;
  border-radius: 3px;
  border: none;
  background: rgba(22, 22, 22, 0.15);
  cursor: pointer;
  padding: 0;
  transition:
    background 0.2s ease,
    width 0.2s ease;
}

.dot--active {
  background: var(--primary);
  width: 32px;
}

.dot:hover:not(.dot--active) {
  background: rgba(219, 103, 0, 0.3);
}

/* =====================
   ANIMATIONS
   ===================== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
  .articles-carousel .article-card {
    flex-direction: column;
    height: 400px;
    min-height: 400px;
    max-height: 400px;
  }

  .articles-carousel .article-card__img-wrap {
    flex: 0 0 160px;
    height: 160px;
    min-height: 160px;
  }

  .articles-carousel .article-card__body {
    flex: 0 0 240px;
    height: 240px;
    min-height: 240px;
    padding: 20px;
  }

  .articles-carousel .article-card__title {
    font-size: 1.1rem;
  }

  .articles-title {
    font-size: 1.7rem;
  }

  .articles-dots {
    justify-content: center;
  }
}

/* =====================
   ARTICLE MODAL
   ===================== */
.article-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  padding: 0;
}

.article-modal.active {
  display: block;
}

.article-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.article-modal__content {
  position: relative;
  background: var(--article-surface);
  width: 100%;
  height: 100%;
  overflow-y: auto;
  animation: modalFadeIn 0.3s ease;
}

.article-modal__body {
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.article-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.article-modal__close:hover {
  background: #fff;
  transform: rotate(90deg);
}

.article-modal__header {
  position: relative;
  height: 45vh;
  overflow: hidden;
}

.article-modal__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3),
    rgba(0, 0, 0, 0.7)
  );
}

.article-modal__meta {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1140px;
  padding: 32px;
  color: #fff;
}

.article-modal__date {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  opacity: 0.8;
  display: block;
  margin-bottom: 8px;
}

.article-modal__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.article-modal__desc {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--article-muted);
  line-height: 1.7;
  margin-bottom: 24px;
  font-style: italic;
  border-left: 3px solid var(--primary);
  padding-left: 20px;
}

.article-modal__full-content {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--article-text);
  line-height: 1.8;
}

.article-modal__full-content p {
  margin-bottom: 16px;
}

.article-modal__full-content h3 {
  font-family: var(--font-heading);
  font-size: var(--font-size-h3);
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--charcoal-black);
}

.article-modal__full-content ul {
  margin: 16px 0;
  padding-left: 24px;
}

.article-modal__full-content li {
  margin-bottom: 8px;
}

/* Clickable card cursor */
.article-card {
  cursor: pointer;
}

@media (max-width: 768px) {
  .article-modal__header {
    height: 35vh;
  }

  .article-modal__meta {
    left: 50%;
    transform: translateX(-50%);
    max-width: 1140px;
    padding: 20px;
  }

  .article-modal__body {
    max-width: 1140px;
    margin: 0 auto;
    padding: 20px;
  }
}
