/* ==============================================================================
   TEAM FISHER — MÉDIATHÈQUE HUB & CATALOGUES SPÉCIALISÉS (CSS OFFICIEL)
   Architecture éditoriale en 3 sous-sections + catalogues dédiés
   Charte : Bleu institutionnel, Jaune/Or, Blanc, cartes épurées, responsive
   ============================================================================== */

/* --- 1. En-tête et barre de retour --- */
.tf-hub-return-bar {
  margin-bottom: 2rem;
}

.tf-hub-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--tf-blue-primary, #002b66);
  background: var(--tf-blue-subtle, rgba(0, 43, 102, 0.06));
  padding: 0.6rem 1.15rem;
  border-radius: 9999px;
  border: 1px solid var(--tf-gray-200, #e2e8f0);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tf-hub-back-btn:hover {
  background: var(--tf-blue-primary, #002b66);
  color: #ffffff;
  transform: translateX(-3px);
  box-shadow: 0 4px 12px rgba(0, 43, 102, 0.15);
}

.tf-hub-back-btn:focus-visible {
  outline: 3px solid var(--tf-gold-accent, #ffb800);
  outline-offset: 2px;
}

/* --- 2. Sections de l'accueil Médiathèque (Hub) --- */
.tf-hub-section {
  margin-bottom: 4rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--tf-gray-200, #e2e8f0);
}

.tf-hub-section:last-of-type {
  border-bottom: none;
  margin-bottom: 2rem;
}

.tf-hub-section-header {
  margin-bottom: 1.75rem;
}

.tf-hub-section-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tf-gold-accent, #fec301);
  background: var(--tf-blue-primary, #00007f);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  margin-bottom: 0.6rem;
  box-shadow: 0 2px 6px rgba(0, 0, 127, 0.2);
}

.tf-hub-section-title {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 800;
  color: var(--tf-blue-primary, #002b66);
  margin: 0 0 0.5rem 0;
  line-height: 1.25;
}

.tf-hub-section-desc {
  font-size: 0.95rem;
  color: var(--tf-gray-600, #475569);
  max-width: 820px;
  margin: 0;
  line-height: 1.5;
}

/* --- 3. Grille responsive 4 colonnes (Aperçus Hub) --- */
.tf-hub-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .tf-hub-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.15rem;
  }
}

@media (max-width: 640px) {
  .tf-hub-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* --- 4. Boutons permanents "Voir plus de..." --- */
.tf-hub-more-wrap {
  text-align: center;
  margin-top: 1.5rem;
}

.tf-hub-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tf-blue-primary, #002b66);
  background: var(--tf-white, #ffffff);
  border: 2px solid var(--tf-blue-primary, #002b66);
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.tf-hub-more-btn svg {
  transition: transform 0.25s ease;
}

.tf-hub-more-btn:hover {
  background: var(--tf-blue-primary, #002b66);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 43, 102, 0.2);
}

.tf-hub-more-btn:hover svg {
  transform: translateX(4px);
}

.tf-hub-more-btn:focus-visible {
  outline: 3px solid var(--tf-gold-accent, #ffb800);
  outline-offset: 3px;
}

/* --- 5. Cartes Aperçu Photos --- */
.tf-hub-photo-card {
  background: var(--tf-white, #ffffff);
  border: 1px solid var(--tf-gray-200, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tf-hub-photo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 43, 102, 0.1);
  border-color: var(--tf-blue-primary, #002b66);
}

.tf-hub-photo-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--tf-gray-100, #f1f5f9);
  overflow: hidden;
  cursor: pointer;
}

.tf-hub-photo-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.tf-hub-photo-card:hover .tf-hub-photo-media img {
  transform: scale(1.04);
}

.tf-hub-photo-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: rgba(0, 43, 102, 0.88);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.tf-hub-photo-zoom-btn {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  border: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s, background 0.2s;
}

.tf-hub-photo-zoom-btn:hover {
  opacity: 1;
  background: var(--tf-blue-primary, #002b66);
}

.tf-hub-photo-body {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tf-hub-photo-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--tf-blue-primary, #002b66);
  margin: 0 0 0.4rem 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tf-hub-photo-meta {
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--tf-gray-500, #64748b);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* --- 6. Cartes Documents (Hub & Page Catalogue) --- */
.tf-hub-doc-card {
  background: var(--tf-white, #ffffff);
  border: 1px solid var(--tf-gray-200, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.tf-hub-doc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 43, 102, 0.08);
  border-color: var(--tf-blue-primary, #002b66);
}

.tf-hub-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tf-hub-doc-icon {
  width: 40px;
  height: 40px;
  background: var(--tf-blue-subtle, rgba(0, 43, 102, 0.08));
  color: var(--tf-blue-primary, #002b66);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tf-hub-doc-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  background: var(--tf-blue-subtle, #f0f4f9);
  color: var(--tf-blue-primary, #002b66);
}

.tf-hub-doc-badge.is-doc {
  background: rgba(201, 136, 0, 0.12);
  color: var(--tf-blue-dark, #001a40);
}

.tf-hub-doc-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--tf-blue-primary, #002b66);
  margin: 0 0 0.4rem 0;
  line-height: 1.35;
}

.tf-hub-doc-desc {
  font-size: 0.83rem;
  color: var(--tf-gray-600, #475569);
  margin: 0 0 1rem 0;
  line-height: 1.45;
  flex: 1;
}

.tf-hub-doc-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--tf-gray-100, #f1f5f9);
}

.tf-hub-doc-date {
  font-size: 0.78rem;
  color: var(--tf-gray-500, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tf-hub-doc-btn {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

/* --- 7. Grille complète documents-publics.html --- */
.tf-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .tf-docs-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }
}

/* --- 8. État d'erreur / vide propre --- */
.tf-hub-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--tf-gray-50, #f8fafc);
  border: 1px solid var(--tf-gray-200, #e2e8f0);
  border-radius: 12px;
}

.tf-hub-empty-icon {
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
}

.tf-hub-empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tf-gray-700, #334155);
  margin-bottom: 0.35rem;
}

.tf-hub-empty-desc {
  font-size: 0.88rem;
  color: var(--tf-gray-500, #64748b);
  margin: 0;
}
