/* ==========================================
   Typography (Local Fonts)
   ========================================== */
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/static/Inter-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/static/Inter-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/static/Inter-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
}

/* ==========================================
   Global CSS Variables
   ========================================== */
:root {
  /* Couleurs - Primary */
  --soft-orange: hsl(35, 77%, 62%);
  --soft-red: hsl(5, 85%, 63%);

  /* Couleurs - Neutral */
  --off-white: hsl(36, 100%, 99%);
  --grayish-blue: hsl(233, 8%, 79%);
  --dark-grayish-blue: hsl(236, 13%, 42%);
  --very-dark-blue: hsl(240, 100%, 5%);

  /* Typographie */
  --ff-primary: 'Inter', sans-serif;
  --fw-regular: 400;
  --fw-bold: 700;
  --fw-extrabold: 800;
  --fs-body: 15px;
}

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

/* ==========================================
   Base Styles / Global
   ========================================== */
body {
  font-family: var(--ff-primary);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  background-color: var(--off-white);
  color: var(--dark-grayish-blue);
  line-height: 1.6;
  min-height: 100vh;
}

/* Default improvements for certain elements */
ul {
  list-style-type: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

img, 
picture {
  max-width: 100%;
  display: block;
}

h1, h2, h3 {
  color: var(--very-dark-blue);
  line-height: 1.1;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* ==========================================
   Desktop Layout (Step 3)
   ========================================== */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem;
}

.header,
.main-container {
  width: 100%;
  max-width: 1110px;
}

/* --- Header & Navigation --- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5.5rem 0;
}

.menu-open-btn,
.menu-close-btn {
  display: none;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links li a {
  font-weight: var(--fw-regular);
  color: var(--dark-grayish-blue);
}

.nav-links li a:hover,
.nav-links li a:focus {
  color: var(--soft-orange);
}

/* --- Main Layout --- */
.main-container {
  display: flex;
  flex-direction: column;
  gap: 4.5rem;
  margin-bottom: 5rem;
}

/* Top Section: Hero + Sidebar */
.top-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

/* --- Hero Section --- */
.hero {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: var(--fw-extrabold);
  padding-right: 1.5rem;
}

.hero-text-block {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}

.hero-description {
  margin-bottom: 2rem;
}

.btn-primary {
  display: inline-block;
  background-color: var(--soft-red);
  color: var(--off-white);
  padding: 1rem 2.25rem;
  text-transform: uppercase;
  font-weight: var(--fw-bold);
  letter-spacing: 0.25rem;
  transition: background-color 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--very-dark-blue);
}

/* --- News Sidebar --- */
.news-sidebar {
  background-color: var(--very-dark-blue);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  color: var(--soft-orange);
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

.sidebar-articles {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.news-item:not(:last-child) {
  border-bottom: 1px solid var(--dark-grayish-blue);
  padding-bottom: 2rem;
}

.news-item-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.news-item-title a {
  color: var(--off-white);
  font-weight: var(--fw-bold);
}

.news-item-title a:hover,
.news-item-title a:focus {
  color: var(--soft-orange);
}

.news-item-summary {
  color: var(--grayish-blue);
}

/* --- Bottom Articles --- */
.bottom-articles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.article-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.card-image img {
  width: 100px;
  height: auto;
  object-fit: contain;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-number {
  color: var(--grayish-blue);
  font-size: 2rem;
  font-weight: var(--fw-bold);
  line-height: 1;
}

.card-title {
  font-size: 1.15rem;
  font-weight: var(--fw-extrabold);
}

.card-title a {
  color: var(--very-dark-blue);
}

.card-title a:hover,
.card-title a:focus {
  color: var(--soft-red);
}

.card-summary {
  font-size: 0.95rem;
}

/* --- Attribution --- */
.attribution {
  font-size: 11px;
  text-align: center;
  padding: 1rem 0;
  margin-top: auto;
}

.attribution a {
  color: hsl(228, 45%, 44%);
}

/* ==========================================
/* Responsive Logic (Mobile < 768px) - Step 4
   ========================================== */
@media (max-width: 768px) {
  /* Reduced spacing */
  .header {
    padding: 2rem 0;
  }
  
  .main-container {
    gap: 3.5rem;
    margin-bottom: 3.5rem;
  }

  /* Transform grids to 1 column */
  .top-section {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-title {
    font-size: 2.75rem;
    padding-right: 0;
  }

  .bottom-articles {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Navigation / Menu Off-Canvas */
  .menu-open-btn {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 68%;
    height: 100vh;
    background-color: var(--off-white);
    padding: 2rem 1.5rem;
    z-index: 200;
    transition: right 0.4s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 20px rgba(0, 0, 0, 0.4);
  }

  /* Class added via JS (Step 5) */
  .main-nav.active {
    right: 0;
  }

  .menu-close-btn {
    display: block;
    align-self: flex-end;
    margin-bottom: 5rem;
  }

  .nav-links {
    flex-direction: column;
    gap: 1.5rem;
  }

  .nav-links li a {
    color: var(--very-dark-blue);
    font-size: 1.15rem;
    font-weight: var(--fw-bold);
  }

  /* Dark Overlay */
  .menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }

  /* Class added via JS (Step 5) */
  .menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Animations & Transitions (Hover Effects) */
@keyframes fadeInSlideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Triggers smooth fade-in via JS */
.fade-in-on-load {
  opacity: 0;
  animation: fadeInSlideUp 0.8s ease-out forwards;
}

/* Dynamic hover effects (Micro-interactions) */

/* Progressive zoom on thumbnail images (Bottom articles) */
.article-card:hover .card-image img {
  transform: scale(1.08);
}

.card-image {
  overflow: hidden;
}

.card-image img {
  transform: scale(1);
  transition: transform 0.4s ease-out;
}

/* Slight move of sidebar articles on hover (News Sidebar) */
.news-item {
  transition: transform 0.3s ease;
}

.news-item:hover {
  transform: translateX(4px);
}

/* Main button (Hero section) animated */
.btn-primary:active {
  transform: scale(0.97);
}
