:root {
  --container-max: 1280px;
  --gutter: 24px;
}

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  vertical-align: middle;
}

.container {
  max-width: 1300px;
  margin: 0;
  padding: 0;
  justify-self: center;
}

.header-section {
  padding: 40px 0;
}

/* =========================================================
   HEADER — ACTUALITÉS & ÉVÉNEMENTS
   ========================================================= */

.header-flex {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 64px;
}

/* Bloc titre */
.header-text {
  flex: 1;
  max-width: 850px;
  position: relative;
}

/* Accent visuel */
.header-text::before {
  content: "";
  display: block;
  width: 55px;
  height: 4px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-teal), var(--brand-orange));
}

/* Titre */
.header-text h1 {
  font-family: var(--font-family);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--gray-800);
  margin: 0 0 18px;
}

/* Description */
.header-text p {
  max-width: 680px;
  margin: 0;
  font-family: var(--font-family);
  font-size: clamp(15px, 1.5vw, 17px);
  font-weight: 400;
  line-height: 1.7;
  color: var(--gray-600);
}

/* =========================================================
   RECHERCHE
   ========================================================= */

.search-container {
  max-width: 320px;
  width: 100%;
  height: 48px;
  flex-shrink: 0;

  display: flex;
  align-items: center;

  border: 1px solid var(--gray-300);
  border-radius: 12px;
  background: #fff;

  overflow: hidden;
}

.search-input {
  flex: 1;
  min-width: 0;

  width: auto;
  height: 100%;

  padding: 12px 16px;

  border: none;
  outline: none;
  background: transparent;

  font-family: inherit;
}

.search-btn {
  width: 48px;
  height: 100%;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  background: none;
  border: none;
  color: var(--brand-teal);
  cursor: pointer;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}

.filter-btn {
  padding: 12px 24px;
  border-radius: 0.7rem;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--gray-300);
  cursor: pointer;
}

.filter-btn:hover {
  background-color: #8cd3d3;
  color: white;
  border: none;
  transition: all 0.2s;
}

.filter-btn.active {
  background-color: var(--brand-teal);
  color: white;
  border: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  row-gap: 20px;
  column-gap: 12px;
}

.featured-card {
  display: flex;
  height: 100%;
}

.featured-card .card-content.principal {
  flex: 0 0 50%;
  padding: 24px;
  color: white;
}

.featured-card .card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-news {
  grid-column: span 6;
}

.principal {
  background: linear-gradient(90deg, #044444 0%, #022727 100%);
}

.secondary-stack {
  grid-column: span 6;
  display: flex;
  gap: 12px;
}

.bottom-card {
  grid-column: span 4;
}

/* Card Styles */
.card {
  background: var(--surface-container-lowest);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
  height: 100%;
}

.card:hover {
  transform: translateY(-5px);
}

.card:not(.featured-card) {
  border-left: 2px solid var(--brand-orange); /* ta couleur */
}

.card-img-container {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.card-img {
  width: 100%; /* passe en 100% sinon cover ne marche pas bien */
  height: 100%;
  object-fit: cover;
  object-position: 17% center; /* <- ICI on déplace */
  transition: transform 0.5s;
  display: block;
  max-width: none;
}

.card-content {
  flex: 1; /* prend 1 part */
  min-width: 0;
  padding: 24px; /* ajoute du padding au texte */
}

.card:hover .card-img {
  transform: scale(1.05);
}

.badge-container {
  display: flex;
  gap: 137px;
}

.badge {
  border-radius: 0.5rem;
  margin-bottom: 20px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background: rgb(255, 144, 18, 0.3);
  color: #ff9012;
  padding: 2px 10px;
}

.badge-secondary {
  background: rgba(0, 168, 168, 0.3);
  color: var(--brand-teal);
  padding: 2px 10px;
}

.badge-date {
  color: var(--gray-500);
  backdrop-filter: blur(4px);
}

.card-content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.featured-card .card-content {
  padding: 32px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.meta-tag-secondary {
  background: rgba(0, 168, 168, 0.3);
  color: var(--brand-teal);
  border-radius: 0.5rem;
  padding: 2px 10px;
}

.meta-tag-primary {
  background: rgba(255, 138, 0, 0.3);
  color: var(--brand-orange);
  border-radius: 0.5rem;
  padding: 2px 10px;
}

.meta-date {
  color: var(--gray-500);
}

.card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}

.card h4 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.card p {
  font-size: 12px;
  margin-bottom: 24px;
  overflow: hidden;
}

.meta h4 {
  font-size: 18px;
}

.read-more {
  font-size: 14px;
  margin-top: auto;
  color: var(--brand-teal);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: gap 0.2s;
}

.read-more:hover {
  gap: 16px;
}

.search-icon {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

/* Pagination */
.pagination {
  margin: 64px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.page-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--outline-variant);
  background: none;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  color: var(--on-surface);
}

.page-btn:hover {
  background-color: #1bbfd8;
  color: white;
}

.page-btn.active {
  background-color: var(--brand-teal);
  color: white;
  border-color: var(--secondary);
}

/* =========================================================
   RESPONSIVE — REGROUPEMENT DES BREAKPOINTS
   ========================================================= */

/* ==========================================================
   RESPONSIVE
========================================================== */
/* ===========================================
   Desktop moyen (≤ 1310px)
=========================================== */

@media (max-width: 1310px) {
  .container {
    width: 100%;
    padding: 0 20px;
  }

  .news-grid {
    grid-template-rows: repeat(2, max(450px));
  }

  .featured-card {
    flex-direction: column;
  }

  .featured-card .card-content {
    flex: none;
  }

  .secondary-stack {
    flex-direction: column;
  }

  .card {
    flex-direction: column;
    max-height: 450px;
  }

  .card-img-container {
    height: 250px;
  }

  .card-img {
    width: 100%;
    height: 100%;
  }

  .badge-container {
    justify-content: space-between;
    gap: 20px;
  }
}

/* -------- Tablette -------- */

@media (max-width: 992px) {
  .container {
    width: 100%;
    padding: 0 20px;
  }

  .header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .search-container {
    width: 100%;
  }

  .news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .featured-news,
  .secondary-stack,
  .bottom-card {
    grid-column: unset;
  }

  .featured-card {
    flex-direction: column;
  }

  .featured-card .card-content {
    flex: none;
  }

  .card {
    flex-direction: column;
  }

  .card-img-container {
    height: 250px;
  }

  .card-img {
    width: 100%;
    height: 100%;
  }

  .badge-container {
    justify-content: space-between;
    gap: 20px;
  }
}

/* -------- Mobile -------- */

@media (max-width: 768px) {
  .header-section {
    padding: 30px 0;
  }

  .header-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
    margin-bottom: 48px;
  }

  .header-text {
    max-width: 650px;
  }

  .header-text::before {
    width: 45px;
    height: 3px;
    margin-bottom: 16px;
  }

  .header-text h1 {
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin-bottom: 14px;
  }

  .header-text p {
    font-size: 15px;
    line-height: 1.6;
  }

  .header-text p br {
    display: none;
  }

  .search-container {
    width: 100%;
    height: 50px;
  }

  .filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .featured-card .card-img-container {
    height: 250px;
  }

  .card-img-container {
    height: 220px;
  }

  .card-content {
    padding: 20px;
  }

  .featured-card .card-content {
    padding: 24px;
  }

  .card h3 {
    font-size: 24px;
  }

  .card h4 {
    font-size: 20px;
  }

  .card p {
    font-size: 14px;
  }

  .pagination {
    flex-wrap: wrap;
  }
}

/* -------- Petit mobile -------- */

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .header-flex {
    gap: 24px;
    margin-bottom: 40px;
  }

  .header-text h1 {
    font-size: 26px;
  }

  .header-text p {
    font-size: 14px;
    line-height: 1.6;
  }

  .search-container {
    height: 45px;
  }

  .search-btn {
    width: 44px;
  }

  .featured-card .card-img-container {
    height: 200px;
  }

  .secondary-stack {
    flex-direction: column;
  }

  .card-img-container {
    height: 180px;
  }

  .badge {
    font-size: 8px;
  }

  .badge-date {
    font-size: 10px;
  }

  .card h3 {
    font-size: 21px;
  }

  .card h4 {
    font-size: 18px;
  }

  .read-more {
    font-size: 13px;
  }
}
