/* ==========================================================
   PHEEAC — Publications HAL
   ========================================================== */

/* ----------------------------------------------------------
   1. Variables
   ---------------------------------------------------------- */

.pheeac-hal-publications {
  --hal-blue: #082f7e;
  --hal-blue-medium: #0750a4;
  --hal-blue-light: #174d95;
  --hal-text: #243b5f;
  --hal-text-muted: #666;
  --hal-border: #dce6f4;
  --hal-border-light: #e2eaf5;
  --hal-background: #f3f7fd;
  --hal-background-alt: #eef4fb;
  --hal-white: #fff;

  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  box-sizing: border-box;
}

.pheeac-hal-publications *,
.pheeac-hal-publications *::before,
.pheeac-hal-publications *::after {
  box-sizing: border-box;
}


/* ----------------------------------------------------------
   2. Introduction
   ---------------------------------------------------------- */

.pheeac-hal-introduction {
  max-width: 920px;
  margin: 0 0 1.75rem;
}

.pheeac-hal-introduction p {
  margin: 0;
  color: var(--hal-text);
  font-size: 1.05rem;
  line-height: 1.75;
}


/* ----------------------------------------------------------
   3. Bandeau statistique
   ---------------------------------------------------------- */

.pheeac-hal-stats {
  width: 100%;
  margin-bottom: 1.5rem;
  padding: 1.4rem 1.5rem;
  background: var(--hal-white);
  border: 1px solid var(--hal-border);
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(8, 45, 120, 0.04);
}

.pheeac-hal-stats-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  align-items: stretch;
  width: 100%;
}

.pheeac-hal-stat {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-width: 0;
  padding: 0 1.1rem;
}

.pheeac-hal-stat:first-child {
  padding-left: 0.5rem;
}

.pheeac-hal-stat:last-child {
  padding-right: 0.5rem;
}

.pheeac-hal-stat::after {
  position: absolute;
  top: 2px;
  right: 0;
  width: 1px;
  height: calc(100% - 4px);
  background: #dfe8f4;
  content: "";
}

.pheeac-hal-stat:last-child::after {
  display: none;
}

.pheeac-hal-stat-icon {
  display: flex;
  flex: 0 0 28px;
  align-items: flex-start;
  justify-content: center;
  width: 28px;
  height: 32px;
  margin-right: 0.75rem;
  color: var(--hal-blue-medium);
}

.pheeac-hal-stat-icon svg {
  display: block;
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pheeac-hal-stat-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pheeac-hal-stat-content strong {
  display: block;
  margin: 0;
  color: var(--hal-blue);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.pheeac-hal-stat-content > span {
  display: block;
  width: 100%;
  margin-top: 0.45rem;
  color: #17386e;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}


/* ----------------------------------------------------------
   4. Formulaire de recherche
   ---------------------------------------------------------- */

.pheeac-hal-filters {
  margin-bottom: 2rem;
}

.pheeac-hal-filters.pheeac-hal-advanced-search {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 1rem;
  align-items: end;
  padding: 1.5rem 1.75rem;
  background: linear-gradient(
    100deg,
    var(--hal-background) 0%,
    var(--hal-background-alt) 100%
  );
  border: 0;
  border-radius: 12px;
  box-shadow: none;
}

.pheeac-hal-filter {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pheeac-hal-filter-wide {
  grid-column: span 4;
}

.pheeac-hal-filter label {
  color: #14366c;
  font-size: 0.75rem;
  font-weight: 600;
}

.pheeac-hal-filter input,
.pheeac-hal-filter select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0.7rem 0.9rem;
  color: #21385d;
  font-size: 0.9rem;
  font-family: inherit;
  background-color: var(--hal-white);
  border: 1px solid #cbd8eb;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(10, 48, 111, 0.03);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.pheeac-hal-filter select {
  padding-right: 2.5rem;
  cursor: pointer;
}

.pheeac-hal-filter input::placeholder {
  color: #8392aa;
  opacity: 1;
}

.pheeac-hal-filter input:focus,
.pheeac-hal-filter select:focus {
  outline: none;
  border-color: #1d5eb5;
  box-shadow: 0 0 0 3px rgba(29, 94, 181, 0.12);
}

.pheeac-hal-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pheeac-hal-actions button {
  min-height: 46px;
  padding: 0.7rem 1.5rem;
  color: var(--hal-white);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  background: linear-gradient(
    135deg,
    #082d78 0%,
    #064b9f 100%
  );
  border: 0;
  border-radius: 5px;
  box-shadow: 0 5px 12px rgba(8, 45, 120, 0.16);
  cursor: pointer;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.pheeac-hal-actions button:hover {
  background: linear-gradient(
    135deg,
    #062563 0%,
    #043d84 100%
  );
  box-shadow: 0 7px 16px rgba(8, 45, 120, 0.22);
  transform: translateY(-1px);
}

.pheeac-hal-actions button:focus-visible {
  outline: 3px solid rgba(29, 94, 181, 0.25);
  outline-offset: 2px;
}

.pheeac-hal-reset {
  color: var(--hal-blue-light);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.pheeac-hal-reset:hover {
  text-decoration: underline;
}


/* ----------------------------------------------------------
   5. Nombre de résultats
   ---------------------------------------------------------- */

.pheeac-hal-count {
  margin: 0 0 1.5rem;
  color: #555;
  font-size: 0.95rem;
}


/* ----------------------------------------------------------
   6. Liste des publications
   ---------------------------------------------------------- */

.pheeac-hal-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pheeac-hal-item {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.pheeac-hal-item h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  line-height: 1.4;
}

.pheeac-hal-item h2 a {
  color: inherit;
  text-decoration: none;
}

.pheeac-hal-item h2 a:hover {
  text-decoration: underline;
}

.pheeac-hal-authors {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.pheeac-hal-date,
.pheeac-hal-submitted-date {
  margin: 0 0 0.45rem;
  color: var(--hal-text-muted);
  font-size: 0.88rem;
}

.pheeac-hal-date time {
  font-weight: 600;
}

.pheeac-hal-meta {
  margin: 0;
  color: var(--hal-text-muted);
  font-size: 0.85rem;
}

.pheeac-hal-meta span:not(:last-child)::after {
  content: " · ";
}

.pheeac-hal-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--hal-blue-light);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ----------------------------------------------------------
   7. Pagination
   ---------------------------------------------------------- */

.pheeac-hal-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 2rem;
}

.pheeac-hal-pagination a,
.pheeac-hal-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  color: var(--hal-blue);
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
}

.pheeac-hal-pagination a:hover {
  background: var(--hal-background);
  border-color: #b9cce6;
}

.pheeac-hal-pagination .current {
  color: var(--hal-white);
  background: var(--hal-blue);
  border-color: var(--hal-blue);
}


/* ----------------------------------------------------------
   8. Responsive — Écrans intermédiaires
   ---------------------------------------------------------- */

@media (max-width: 1150px) {
  .pheeac-hal-stats-list {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 1.5rem 0;
  }

  .pheeac-hal-stat {
    min-height: 66px;
  }

  .pheeac-hal-stat:nth-child(3n)::after {
    display: none;
  }

  .pheeac-hal-stat:nth-child(3n + 1) {
    padding-left: 0.5rem;
  }
}


/* ----------------------------------------------------------
   9. Responsive — Tablette
   ---------------------------------------------------------- */

@media (max-width: 900px) {
  .pheeac-hal-filters.pheeac-hal-advanced-search {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .pheeac-hal-filter-wide {
    grid-column: span 2;
  }
}

@media (max-width: 800px) {
  .pheeac-hal-stats {
    padding: 1.25rem;
  }

  .pheeac-hal-stats-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 0;
  }

  .pheeac-hal-stat {
    padding: 0 1rem;
  }

  .pheeac-hal-stat:nth-child(3n)::after {
    display: block;
  }

  .pheeac-hal-stat:nth-child(2n)::after {
    display: none;
  }

  .pheeac-hal-stat:nth-child(3n + 1) {
    padding-left: 1rem;
  }

  .pheeac-hal-stat:nth-child(2n + 1) {
    padding-left: 0;
  }
}


/* ----------------------------------------------------------
   10. Responsive — Mobile
   ---------------------------------------------------------- */

@media (max-width: 640px) {
  .pheeac-hal-introduction {
    margin-bottom: 1.35rem;
  }

  .pheeac-hal-introduction p {
    font-size: 0.98rem;
    line-height: 1.65;
  }

  .pheeac-hal-filters.pheeac-hal-advanced-search {
    display: block;
    padding: 1.25rem;
  }

  .pheeac-hal-filter,
  .pheeac-hal-actions {
    margin-bottom: 1rem;
  }

  .pheeac-hal-actions {
    flex-wrap: wrap;
  }

  .pheeac-hal-actions button {
    width: 100%;
  }

  .pheeac-hal-reset {
    display: inline-block;
  }
}

@media (max-width: 520px) {
  .pheeac-hal-stats-list {
    display: block;
  }

  .pheeac-hal-stat {
    min-height: auto;
    padding: 0 0 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--hal-border-light);
  }

  .pheeac-hal-stat:first-child,
  .pheeac-hal-stat:nth-child(2n + 1),
  .pheeac-hal-stat:nth-child(3n + 1) {
    padding-left: 0;
  }

  .pheeac-hal-stat:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
  }

  .pheeac-hal-stat::after {
    display: none !important;
  }

  .pheeac-hal-stat-content strong {
    font-size: 1.3rem;
  }

  .pheeac-hal-stat-content > span {
    font-size: 0.78rem;
  }
}