/* =========================
   FONTS
========================= */
@font-face {
  font-family: 'HelveticaNeueRoman';
  src: url('./fonts/HelveticaNeueRoman.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'HelveticaNeueMedium';
  src: url('./fonts/HelveticaNeueMedium.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

/* =========================
   GLOBAL
========================= */
html, body {
  font-family: 'HelveticaNeueMedium', sans-serif;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

a {
  text-decoration: underline limegreen 3px;
  color: black;
}

a:hover {
  color: limegreen;;
}
.on { color: limegreen; }
.off { color: black; }

/* =========================
   NAV
========================= */

/* Update the existing .nav class to include a transition */
.nav {
  position: fixed;
  z-index: 100;
  left: 18px;
  top: 20px;
  font-size: 1.15em;
  line-height: 1.2em;
  padding: 10px;
  transition: background-color 0.3s ease, border-radius 0.3s ease;
  border-radius: 0px; 
}

.nav.is-scrolled {
  background-color:#00EE00
  border-radius: 8px;
}

/* Change link colors when nav is green for better contrast */
.nav.is-scrolled a, 
.nav.is-scrolled .toggle-nav {
  color: black;
  text-decoration-color: white;
}

  .subnav.hidden {
    display: none;
  }

  .subnav {
    margin-left: 1em;
  }

.subnav a {
  text-decoration: underline #00EE00 3px;
  color: black;
}

.subnav a:hover {
  color: #00EE00;
}

/* =========================
   TEXT
========================= */

.introduction {
  font-family: 'HelveticaNeueMedium', sans-serif;
  box-sizing: border-box;
  width: 63%;
  margin: auto;
  min-height: 100%;
  font-size: 25px;
  line-height: 1.25;
  padding-left: 100px;
  padding-top: 26px;
}

img {
  width: 100%;
  max-width: 100%;
  display: block;
  margin: auto;
}

.paragraph {
  line-height: 1.1em;
  font-size: 18px;
  font-family: Arial, Helvetica, sans-serif;
}

.invites {
  font-family: 'HelveticaNeueMedium', sans-serif;
  box-sizing: border-box;
  width: 63%;
  margin: auto;
  min-height: 100%;
  font-size: 25px;
  line-height: 1.25;
  padding-left: 100px;
  padding-top: 26px;
}

/* =========================
   FILTERS
========================= */
.filters-container {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #00EE00;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 0.72em;
  z-index: 99;
  backdrop-filter: blur(10px);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-weight: 600;
  color: #333;
  margin-right: 5px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: normal;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: #00EE00;
}

#filter-type {
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
}

/* Responsive filters */
@media (max-width: 768px) {
  .filters-container {
    position: relative;
    top: 0;
    right: 0;
    margin: 20px;
    flex-direction: column;
    align-items: stretch;
  }
  .filter-group {
    justify-content: center;
  }
}


/* =========================
   DATA LAYOUT (Grid)
========================= */
.data-wrapper[data-layout="grid"] {
  display: flex;
  gap: 10px;
  width: calc(100%);
  padding: 0 19px;
  box-sizing: border-box;
  margin-top: 20px; /* Aligns with the top of Nav (20px) */
  align-items: flex-start;
}

/* Create the individual columns */
.data-column {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Offset the Left (1) and Right (4) columns to "stay in place" 
   while Middle (2 & 3) stay at the top (0 margin) */
.col-1 {
  margin-top: 90px;
}

.col-2, .col-3 {
  margin-top: 0px;
}

.col-4 {
  margin-top: 68px;
}

.data-wrapper[data-layout="grid"] .dataBlock {
  position: relative;
  width: 100%;
  padding: 18px;
  background-color: #f9f9f9; 
  border-radius: 6px;
  box-sizing: border-box;
  transition: transform 0.2s ease;
}

.data-wrapper[data-layout="grid"] .dataBlock:hover {
  transform: translateY(-2px);
}

/* Ensure images don't break the layout */
.dataImage, .dataImageurl {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #d0ffd0;
  margin-bottom: 8px;
}

/* Responsive: Stack columns on mobile */
@media (max-width: 1024px) {
  .data-wrapper[data-layout="grid"] {
    flex-wrap: wrap;
    gap: 20px;
  }
  .data-column {
    flex: 1 1 40%; /* 2 columns on tablets */
  }
  .col-1, .col-2, .col-3, .col-4 {
    margin-top: 0; /* Reset offsets on smaller screens */
  }
}

@media (max-width: 600px) {
  .data-column {
    flex: 1 1 100%; /* 1 column on mobile */
  }
}

.dataImage {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;      /* Force le format carré */
  /* LE RECADRAGE */
  object-fit: cover;        /* Remplit le carré sans déformer */
  object-position: left top; /* Aligne l'image en haut à gauche avant de couper le reste */
  /* LE RESTE */
  border-radius: 4px;
  margin-bottom: 8px;
}

.dataTitle {
  font-weight: 600;
  color: #333;
  font-size: 1.1em;
  line-height: 1.5em;
  margin-bottom: 8px;
  display: block;
}

.dataSummary {
  font-size: 0.9em;
  line-height: 1.4em;
  text-align: left;
  color: #555;
  margin-bottom: 10px;
}

.dataKeywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.keyword-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 20px;
  border: 1px solid black;
  background: white;
  line-height: 1;
  cursor: pointer;
  transition: 0.2s ease;
}

.keyword-pill.active {
  background: black;
  color: white;
}

.dataMeta {
  font-size: 0.75em;
  color: #888;
  font-style: italic;
  margin-top: 8px;
}

.dataAuthor {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
  font-style: italic;
}

.dataDate {
  font-size: 0.85rem;
  color: #999;
  margin-top: 0.5rem;
}

.dataImage {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #d0ffd0;
  margin-bottom: 8px;
}

.dataImageurl {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #d0ffd0;
  margin-bottom: 8px;
}

.dataTitre {
  display: inline-block;
  color:black;
  font-weight: 600;
  line-height: 1.4em;
  margin-bottom: 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.dataAI_Resume_PDF {
  display: inline-block;
  color:black;
  font-weight: 600;
  line-height: 1.4em;
  margin-bottom: 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* =========================
   PRINT UI (The Green Bar)
========================= */
.print-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  color: black;
  padding: 10px 20px;
  border-radius: 10px;
  display: flex;
  gap: 15px;
  align-items: center;
  z-index: 200;
  transition: bottom 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border: 1px solid #ddd;
}

.print-bar.hidden {
  bottom: -100px;
}

.print-btn {
  background: limegreen;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
  color: white;
}

.print-checkbox-wrapper {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 50;
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.print-checkbox-wrapper input {
  accent-color: #00EE00;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* =========================
   PRINT MODE (Booklet)
========================= */
#print-area {
  display: none;
}

@media print {
  /* Setup Page */
  @page {
    size: A4;
    margin: 15mm;
  }

  .print-closing {
    page-break-before: always; /* Forces new page */
    height: 270mm;            /* A4 Height */
    display: flex;
    align-items: flex-end;    /* Puts text at the bottom */
    padding-bottom: 100px;
  }

  .closing-content p {
    font-size: 36pt;
    line-height: 1.5;
    color: limegreen;
    padding-top: 20px;
    width: 100%;
  }

  body > *:not(#print-area) {
    display: none !important;
  }

  #print-area {
    display: block !important;
    background: white;
    font-family: 'HelveticaNeueRoman', sans-serif;
  }

  /* Cover Page Styling */
  .print-cover {
    height: 270mm; /* A4 height approx */
    display: flex;
    flex-direction: column;
    color: limegreen;
    padding: 40px;
    page-break-after:always;
  }

  .school-name {
    font-family: 'HelveticaNeueMedium';
    color: limegreen;
    letter-spacing: 2px;
    font-size: 60pt;
    margin-bottom: 20px;
        text-align: left;
  }

  .cover-title {
    font-size: 60pt;
    line-height: 0.9;
    font-family: 'HelveticaNeueMedium';
    margin-bottom: 40px;
    color: limegreen;
   text-shadow: 0 0 32px limegreen;
   color: transparent;
       text-align: left;
  }

  .cover-date, .cover-count {
    font-size: 36pt;
  }

  /* Content Grid (2 items per row) */
  .print-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30pt;
    padding-top: 20pt;
    text-align: left;
  }

  .print-resource {
    page-break-inside: avoid;
    display: flex;
    flex-direction: column;
    padding-top: 15pt;
    margin-bottom: 10pt;
  }

  /* Resource Elements */
  .resource-img-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin-bottom: 10pt;
  }

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

  .resource-meta {
    font-size: 22pt;
    color: limegreen;
    font-weight: bold;
    margin-bottom: 5pt;
  }

  .res-lang { margin-left: 10pt; color: #999; }

  .resource-title {
    font-family: 'HelveticaNeueMedium', sans-serif;
    font-size: 26pt;
    margin: 0 0 5pt 0;
    line-height: 1.2;
  }

  .resource-author {
    font-size: 10pt;
    font-style: italic;
    margin-bottom: 8pt;
  }

  .resource-summary {
    font-size: 9pt;
    line-height: 1.4;
    color: limegreen;
    text-align: justify;
    margin-bottom: 10pt;
  }

  .resource-url {
    font-size: 7pt;
    color: #888;
    word-break: break-all;
    font-family: monospace;
    border: 1px solid #eee;
    padding: 4pt;
  }
}

  #print-area {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: white;
    color: black;
  }

  .print-page {
    page-break-after: always;
    padding: 2cm;
    box-sizing: border-box;
  }

  .print-cover {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
  }
  .print-cover h1 { font-size: 3em; margin-bottom: 0.5em; color: black; }
  .print-cover h2 { font-size: 1.5em; color: #555; margin-bottom: 2em; font-weight: normal;}

  .article-title {
    font-size: 24pt;
    font-weight: bold;
    margin-bottom: 5px;
    border-bottom: 2px solid black;
    padding-bottom: 10px;
  }

  .print-meta {
    font-size: 10pt;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
  }

  .print-hero-img {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    margin: 15px auto;
    display: block;
    border: 1px solid #eee;
  }

  .print-keywords {
    margin: 15px 0;
    font-size: 10pt;
  }
  
  .print-keywords span {
    background: #f0f0f0;
    padding: 3px 8px;
    margin-right: 5px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 5px;
  }

  .article-body {
    font-size: 12pt;
    line-height: 1.6;
    text-align: justify;
    margin-top: 20px;
    white-space: pre-wrap;
  }

  .article-footer {
    margin-top: 50px;
    font-size: 9pt;
    color: #999;
    text-align: center;
    border-top: 1px solid #ddd;
    padding-top: 10px;
  }


  .centered_content_container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
  }

  .centered_content {
    text-align: center;
    margin: auto;
    width: 50%;
    padding: 20px;
  }


}

body div.container form select option {
color: black !important;
}
