@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lato:ital,wght@0,400;0,700;1,400&display=swap');


:root {
  /* Couleurs principales */
  --brun-fonce: #3b2313;
  --brun-hero: #4a2e14;
  --or: #c9a84c;
  --or-clair: #e8d085;
  --or-pale: #f0e2b6;
  --beige-fond: #f5e6c8;
  --creme-carte: #f5f0e8;
  --bordure-fine: #d4b896;
  --texte-brun: #3b2313;
  --texte-clair: #8b6239;
  
  /* Maisons (utilisées pour les badges) */
  --gryffondor: #7a1f1f;
  --serpentard: #2d5a27;
  --poufsouffle: #b8860b;
  --serdaigle: #1a3c6e;
  --gris-maison: #666666;

  /* Polices */
  --font-titre: 'Cinzel', serif;
  --font-texte: 'Lato', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-texte);
  background-color: var(--beige-fond);
  color: var(--texte-brun);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

.cinzel {
  font-family: var(--font-titre);
  color: var(--or);
  text-shadow: 0 0 8px rgba(201, 168, 76, 0.4), 0 0 20px rgba(201, 168, 76, 0.15);
}

header {
  background-color: var(--brun-fonce);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.logo {
  color: var(--or);
  font-family: var(--font-titre);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant: small-caps;
}

nav {
  display: flex;
  gap: 2.5rem;
}

nav a {
  font-variant: small-caps;
  font-family: var(--font-titre);
  font-size: 1.1rem;
  color: var(--or);
  transition: opacity 0.3s;
  letter-spacing: 1px;
}

nav a:hover {
  opacity: 0.8;
}

nav a.active {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.recherche-wrapper::before,
.recherche-wrapper::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    top: 20px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='10' y1='10' x2='10' y2='70' stroke='%23c8a84b' stroke-width='1'/%3E%3Cline x1='10' y1='10' x2='70' y2='10' stroke='%23c8a84b' stroke-width='1'/%3E%3Ccircle cx='10' cy='10' r='3' fill='%23c8a84b'/%3E%3Ccircle cx='70' cy='10' r='2' fill='none' stroke='%23c8a84b' stroke-width='1'/%3E%3Ccircle cx='10' cy='70' r='2' fill='none' stroke='%23c8a84b' stroke-width='1'/%3E%3Cpath d='M 28 10 Q 38 28 10 28' stroke='%23c8a84b' stroke-width='0.8' fill='none'/%3E%3Cpath d='M 10 28 Q 28 38 10 50' stroke='%23c8a84b' stroke-width='0.8' fill='none'/%3E%3Cpath d='M 28 10 Q 50 10 50 28 Q 50 50 28 50 Q 10 50 10 65' stroke='%23c8a84b' stroke-width='0.8' fill='none'/%3E%3Ccircle cx='50' cy='28' r='2' fill='none' stroke='%23c8a84b' stroke-width='0.8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.7;
    pointer-events: none;
}

.recherche-wrapper {
    position: relative;
}

.recherche-wrapper::before {
    left: 20px;
}

.recherche-wrapper::after {
    right: 20px;
    transform: scaleX(-1);
}

/* recherche + stats (FOND BRUN)*/
.recherche-wrapper {
  background-color: var(--brun-hero);
  padding: 4rem 2rem;
  text-align: center;
}

.recherche .ornament {
  color: var(--or-clair);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.recherche h1 {
  color: var(--or);
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.recherche .subtitle {
  font-style: italic;
  color: var(--or-pale);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2.5rem auto;
}

.search-bar {
  display: flex;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto 3rem auto;
}

.search-bar input {
  flex: 1;
  padding: 0.8rem 1rem;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--or);
  border-right: none;
  color: var(--or-pale);
  font-family: var(--font-texte);
  outline: none;
}

.search-bar input::placeholder {
  color: var(--or-pale);
  opacity: 0.7;
}

.search-bar button {
  padding: 0.8rem 1.5rem;
  background-color: transparent;
  border: 1px solid var(--or);
  color: var(--or);
  font-family: var(--font-titre);
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  transition: background-color 0.3s;
}

.search-bar button:hover {
  background-color: rgba(201, 168, 76, 0.1);
}

/* Statistiques */
.stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-box {
  background-color: var(--brun-fonce);
  border: 1px solid var(--or);
  padding: 1.5rem 2.5rem;
  min-width: 200px;
}

.stat-box .number {
  font-size: 2.8rem;
  color: var(--or);
  margin-bottom: 0.2rem;
  line-height: 1;
}

.stat-box .text {
  color: var(--or-pale);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---- Silhouette Poudlard (avant le footer) ---- */
.poudlard-skyline {
    width: 100%;
    line-height: 0;
    margin: 0;
    padding: 0;
}

.poudlard-skyline img {
    width: 100%;
    height: auto;
    min-height: 120px;
    display: block;
}

/* corps */
.main-container {
  display: flex;
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 2rem;
  gap: 3rem;
}

/* SIDEBAR (filtre) */
.sidebar {
  width: 220px;
  flex-shrink: 0;
}

.filter-group {
  background-color: var(--creme-carte);
  border: 1px solid var(--bordure-fine);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.filter-group h3 {
  color: var(--brun-fonce);
  font-size: 1.1rem;
  text-transform: uppercase;
  margin-bottom: 1rem;
  font-weight: bold;
}

.filter-group ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--texte-clair);
  transition: transform 0.2s;
}

.filter-group a:hover {
  transform: translateX(5px);
}

/* GRILLE DE CARTES */
.content {
  flex: 1;
}

.section-title {
  color: var(--gryffondor);
  font-size: 1.5rem;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-title::before, .section-title::after {
  content: "";
  display: block;
  flex: 1;
  max-width: 50px;
  height: 1px;
  background-color: var(--gryffondor);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  background-color: var(--creme-carte);
  border: 1px solid var(--bordure-fine);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 15px 20px rgba(0,0,0,0.08), 0 0 12px rgba(201, 168, 76, 0.5), 0 0 25px rgba(201, 168, 76, 0.2);
  transform: translateY(-5px);
  border-color: var(--or);
}

.card-img-wrapper {
    background: #2a1a08;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    overflow: hidden;
}

.card img {
    width: 85%;
    height: 260px;
    object-fit: contain;
    background: transparent;
    transform: rotate(-45deg) scale(1.1);
    border-bottom: none;
}

/* Désactive la rotation pour les placeholders */
.card img[src*="placehold"],
.card img[src*="non-trouve"] {
    transform: none;
    width: 100%;
    height: 220px;
    object-fit: cover;
    opacity: 0.5;
}

.card-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-title {
  font-size: 1rem;
  color: var(--or);
  text-transform: uppercase;
  font-weight: bold;
  line-height: 1.3;
  text-shadow: 0 0 8px rgba(201, 168, 76, 0.5);
}

/* ── CADRE DORÉ AU HOVER DES CARTES ── */
.card {
    position: relative;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    transition: border-color 0.3s, box-shadow 0.3s;
    pointer-events: none;
    z-index: 3;
}

.card:hover::after {
    border-color: #d4a843;
    box-shadow: 0 0 18px rgba(212, 168, 67, 0.35), inset 0 0 10px rgba(212, 168, 67, 0.08);
}

.badge {
  font-size: 0.65rem;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  text-transform: uppercase;
  color: #ffffff;
  font-weight: bold;
  letter-spacing: 0.5px;
  white-space: nowrap;
  background-color: var(--gris-maison);
  display: inline-block;
}

.badge.gryffondor { background-color: var(--gryffondor); }
.badge.serpentard { background-color: var(--serpentard); }
.badge.poufsouffle { background-color: var(--poufsouffle); }
.badge.serdaigle { background-color: var(--serdaigle); }
.badge.inconnue { background-color: var(--gris-maison); }

.btn-center {
  text-align: center;
  margin-top: 3rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  border: 1px solid var(--brun-fonce);
  color: var(--brun-fonce);
  text-transform: uppercase;
  font-family: var(--font-titre);
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn:hover {
  background-color: var(--brun-fonce);
  color: var(--beige-fond);
}

/* FOOTER */
footer {
  background-color: var(--brun-fonce);
  color: var(--or-pale);
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;/* Pousse le footer en bas de la page */
  font-size: 0.85rem;
}

.footer-logo {
  color: var(--or);
  font-size: 1.1rem;
}

footer a {
  color: var(--or-pale);
  transition: color 0.3s;
}

footer a:hover {
  color: var(--or);
  text-decoration: underline;
}

/* PAGES SECONDAIRES */
.page-container {
  max-width: 900px;
  margin: 3rem auto;
  background-color: var(--creme-carte);
  border: 1px solid var(--bordure-fine);
  padding: 2.5rem;
}

.detail-container {
  max-width: 1000px;
}

/* Page Détail */
.detail-img {
    object-fit: contain;
    background: transparent;
    width: 100%;
    height: 650px;
    border: none;
    transform: rotate(-45deg) scale(0.85);
}

.detail-img[src*="placehold"],
.detail-img[src*="non-trouve"] {
    transform: none;
    width: 100%;
    height: 450px;
    object-fit: cover;
    opacity: 0.3;
}

.detail-img-wrapper {
    background: #2a1a08;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: none;
    height: 450px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bordure-fine);
}

.detail-title {
  font-size: 2.2rem;
  color: var(--brun-fonce);
  text-transform: uppercase;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

/* Page Ajouter (Formulaire) */
.page-title {
  text-align: center;
  color: var(--brun-fonce);
  font-size: 1.8rem;
  margin-bottom: 2rem;
  text-transform: uppercase;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media screen and (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-section-title {
  font-size: 0.9rem;
  color: var(--or);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--or);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group label {
  display: block;
  font-weight: bold;
  font-size: 0.8rem;
  color: var(--brun-fonce);
}

/* input[type="number"] et input[type="date"] reçoivent le même style que les text inputs */
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea,
.form-group input[type="file"] {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--bordure-fine);
  background-color: #fff;
  font-family: var(--font-texte);
  color: var(--texte-brun);
  font-size: 0.9rem;
  border-radius: 3px;
}

.form-group textarea {
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--or);
  box-shadow: 0 0 4px rgba(201,168,76,0.3);
}

.btn-submit {
  width: 100%;
  padding: 1rem;
  background-color: var(--brun-fonce);
  color: var(--or);
  border: none;
  font-family: var(--font-titre);
  font-size: 1.1rem;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.3s;
  margin-top: 1rem;
}

.btn-submit:hover {
  opacity: 0.9;
}

/* Page A Propos */
.apropos-section {
  margin-bottom: 2rem;
}

.apropos-section h2 {
  color: var(--brun-fonce);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--bordure-fine);
  padding-bottom: 0.5rem;
}

.apropos-section h3 {
  color: var(--brun-fonce);
  margin: 1.5rem 0 0.5rem 0;
}

.apropos-section p {
  margin-bottom: 1rem;
}

.apropos-section ul {
  list-style: disc;
  margin-left: 2rem;
  margin-bottom: 1rem;
}

/* Page Détail — bouton retour */
.btn-retour {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--brun-fonce);
  color: var(--brun-fonce);
  font-family: var(--font-titre);
  font-weight: bold;
  text-transform: uppercase;
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
}

.btn-retour:hover {
  background-color: var(--brun-fonce);
  color: var(--beige-fond);
}

/* RESPONSIVE */

/* En dessous de 768px : mobile  */
@media screen and (max-width: 767px) {
  header {
    flex-direction: column;
    gap: 1rem;
  }
  
  nav {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .recherche h1 {
    font-size: 2rem;
  }
  
  .search-bar {
    flex-direction: column;
  }
  
  .search-bar input {
    border-right: 1px solid var(--or);
    border-bottom: none;
  }
  
  .main-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .stats {
    flex-direction: column;
    align-items: center;
  }
  
  footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Entre 768px et 1023px : desktop compact (sidebar + 2 colonnes) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .sidebar {
    width: 180px;
  }
}

/* Bouton réinitialiser les filtres */
.btn-reset-filtres {
  background: #fff;
  border: 1px solid var(--bordure-fine);
  color: var(--texte-brun);
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 3px;
  font-family: var(--font-texte);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.btn-reset-filtres:hover {
  border-color: var(--or);
  box-shadow: 0 0 4px rgba(201,168,76,0.3);
}

/* Sélecteur de tri (même taille que le bouton reset) */
#select-tri {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  border: 1px solid var(--bordure-fine);
  border-radius: 3px;
  font-family: var(--font-texte);
  background: #fff;
  color: var(--texte-brun);
  cursor: pointer;
}
