/*
Theme Name: Cust.place Artefacts
Theme URI: https://cust.place
Author: Mustapha Imghi
Description: Thème minimaliste dédié à l'hébergement d'artefacts interactifs (scrollytelling, infographies) générés en dehors du site Business.
Version: 1.0
Text Domain: cust-place-theme
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap');

/* Reset minimal */
*{box-sizing:border-box;margin:0;padding:0}

html,body{
  font-family:'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color:#FFFFFF;
  background-image:
    radial-gradient(at 8% 12%, rgba(62,92,255,0.22) 0%, transparent 58%),
    radial-gradient(at 92% 8%, rgba(253,202,49,0.16) 0%, transparent 50%),
    radial-gradient(at 95% 92%, rgba(239,171,255,0.4) 0%, transparent 60%),
    radial-gradient(at 5% 95%, rgba(27,14,60,0.12) 0%, transparent 55%),
    radial-gradient(at 50% 50%, rgba(239,171,255,0.06) 0%, transparent 75%);
  color:#1B0E3C;
  color:#1B0E3C;
}

h1,h2,h3{
  font-family:'Plus Jakarta Sans', sans-serif;
  font-weight:800;
}

a{color:inherit}

/* Header : uniquement le logo, centré horizontalement sur toute la largeur */
.site-header{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100%;
  padding:24px 32px;
  border-bottom:1px solid #eee;
}
.site-header-logo{
  display:block;
  text-decoration:none;
  font-family:'Plus Jakarta Sans', sans-serif;
  font-weight:700;
  font-size:18px;
  color:#1B0E3C;
}
.site-header .custom-logo-link img,
.site-header-logo img{
  max-height:60px;
  width:auto;
  display:block;
}
.site-content{
  max-width:900px;
  margin:0 auto;
  padding:48px 24px;
}
.site-content-wide{
  max-width:1200px;
}
.site-footer{
  padding:24px 32px;
  text-align:center;
  color:#999;
  font-size:13px;
  border-top:1px solid #eee;
}

#back-to-top{
  position:fixed;
  bottom:24px;
  right:24px;
  width:48px;
  height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fff;
  border:1px solid rgba(27,14,60,.09);
  border-radius:50%;
  box-shadow:0 4px 12px rgba(0,0,0,.12);
  cursor:pointer;
  z-index:9000;
  opacity:0;
  visibility:hidden;
  transform:translateY(8px);
  transition:opacity 200ms ease, transform 200ms ease, visibility 200ms, border-color 150ms ease;
}
#back-to-top.is-visible{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}
#back-to-top:hover{
  border-color:rgba(27,14,60,.2);
}
#back-to-top svg{
  width:20px;
  height:20px;
  color:#1B0E3C;
}

.artefact-list{
  list-style:none;
}
.artefact-list li{
  padding:16px 0;
  border-bottom:1px solid #eee;
}
.artefact-list a{
  font-size:18px;
  font-weight:600;
  text-decoration:none;
}
.artefact-list a:hover{
  text-decoration:underline;
}


/* Page catalogue des artefacts (patron repris du blog Custplace) */

.archive-hero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:20px;
  margin-bottom:40px;
}
.archive-hero h1{
  font-size:32px;
  font-weight:700;
}
.artefact-search{
  display:flex;
  align-items:center;
  gap:8px;
  background:#FAF9F5;
  border:1px solid rgba(27,14,60,.09);
  border-radius:100px;
  padding:6px 6px 6px 20px;
}
.artefact-search input[type="text"]{
  border:0;
  background:none;
  font-family:'Inter', sans-serif;
  font-size:14px;
  color:#1B0E3C;
  min-width:220px;
}
.artefact-search input[type="text"]::placeholder{
  color:#999;
}
.artefact-search input[type="text"]:focus{
  outline:none;
}
.artefact-search button{
  font-family:'Inter', sans-serif;
  font-size:14px;
  font-weight:600;
  color:#fff;
  background:#3E5CFF;
  border:0;
  border-radius:100px;
  padding:10px 20px;
  cursor:pointer;
  transition:background 150ms ease;
}
.artefact-search button:hover{
  background:#2845D4;
}

.archive-hero-controls{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
}

.filter-dropdown{
  position:relative;
}
.filter-dropdown-toggle{
  display:flex;
  align-items:center;
  gap:6px;
  background:#fff;
  border:1px solid rgba(27,14,60,.09);
  border-radius:100px;
  padding:10px 18px;
  font-family:'Inter', sans-serif;
  font-size:14px;
  font-weight:400;
  color:#1B0E3C;
  cursor:pointer;
  transition:border-color 150ms ease;
}
.filter-dropdown-toggle:hover,
.filter-dropdown-toggle[aria-expanded="true"]{
  border-color:rgba(27,14,60,.2);
}
.filter-dropdown-current{
  font-weight:600;
}
.filter-dropdown-arrow{
  display:flex;
  color:#555;
}
.filter-dropdown-arrow svg{
  width:12px;
  height:12px;
  display:block;
}
.filter-dropdown-menu{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  z-index:20;
  min-width:220px;
  background:#fff;
  border:1px solid rgba(27,14,60,.09);
  border-radius:16px;
  box-shadow:0 4px 12px rgba(0,0,0,.08);
  padding:8px;
}
.filter-dropdown-item{
  display:block;
  padding:10px 14px;
  border-radius:10px;
  font-family:'Inter', sans-serif;
  font-size:14px;
  font-weight:400;
  color:#1B0E3C;
  text-decoration:none;
}
.filter-dropdown-item:hover{
  background:#F0EAFF;
}
.filter-dropdown-item.active{
  color:#3E5CFF;
  font-weight:600;
}

.artefact-categories{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
  gap:16px;
  margin-bottom:48px;
}
.category-card{
  display:block;
  padding:20px;
  background:#fff;
  border:1px solid rgba(27,14,60,.09);
  border-radius:20px;
  text-decoration:none;
  transition:border-color 150ms ease, box-shadow 150ms ease;
}
.category-card:hover{
  border-color:rgba(27,14,60,.15);
  box-shadow:0 4px 12px rgba(0,0,0,.08);
}
.category-card.active{
  background:#1B0E3C;
  border-color:#1B0E3C;
}
.category-card h2{
  font-size:17px;
  font-weight:700;
  margin-bottom:6px;
  color:#1B0E3C;
}
.category-card p{
  font-family:'Inter', sans-serif;
  font-size:13px;
  font-weight:400;
  color:#555;
}
.category-card.active h2,
.category-card.active p{
  color:#fff;
}

.artefact-cards{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(240px, 1fr));
  gap:20px;
}
.artefact-card{
  display:block;
  background:#fff;
  border:1px solid rgba(27,14,60,.09);
  border-radius:20px;
  overflow:hidden;
  text-decoration:none;
  color:inherit;
  transition:border-color 150ms ease, box-shadow 150ms ease;
}
.artefact-card:hover{
  border-color:rgba(27,14,60,.15);
  box-shadow:0 4px 12px rgba(0,0,0,.08);
}
.artefact-card-cover{
  position:relative;
  height:150px;
  background:#FAF9F5;
}
.artefact-card-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.artefact-card-placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  font-family:'Plus Jakarta Sans', sans-serif;
  font-size:36px;
  font-weight:800;
  color:rgba(27,14,60,.2);
}
.artefact-card-date{
  position:absolute;
  bottom:10px;
  left:10px;
  font-family:'Inter', sans-serif;
  font-size:12px;
  font-weight:600;
  color:#1B0E3C;
  background:rgba(255,255,255,.9);
  border-radius:20px;
  padding:4px 10px;
}
.artefact-card-body{
  padding:16px 20px 20px;
}
.artefact-card-body h3{
  font-size:16px;
  font-weight:700;
  margin-top:8px;
  color:#1B0E3C;
}
.artefact-badge{
  display:inline-block;
  font-size:12px;
  font-weight:600;
  padding:4px 12px;
  border-radius:12px;
  background:#EFABFF;
  color:#1B0E3C;
  white-space:nowrap;
}

/* Vue plein écran d'un artefact (single-artefact.php) : badge de catégorie
   en overlay au-dessus de l'iframe. */
.artefact-view{
  position:relative;
  width:100%;
  height:100vh;
  height:100dvh;
}
.artefact-view-badge{
  position:absolute;
  top:16px;
  left:16px;
  z-index:10;
  font-family:'Inter', sans-serif;
  box-shadow:0 4px 12px rgba(0,0,0,.15);
}

.pagination{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:40px;
}
.pagination .page-numbers{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:36px;
  height:36px;
  padding:0 10px;
  border-radius:100px;
  border:1px solid rgba(27,14,60,.09);
  text-decoration:none;
  font-family:'Inter', sans-serif;
  font-size:14px;
  color:#1B0E3C;
}
.pagination .page-numbers.current{
  background:#3E5CFF;
  border-color:#3E5CFF;
  color:#fff;
}
.pagination .page-numbers:hover:not(.current){
  border-color:rgba(27,14,60,.15);
}

.empty-state{
  color:#999;
  font-style:italic;
  padding:24px 0;
}

/* Mobile/tablette : le champ de recherche a un min-width:220px qui,
   additionné au bouton "Rechercher" et au bouton "Filtrer par :", ne tient
   plus sur une seule ligne dès qu'on descend sous ~768px. Sans ce
   breakpoint, .archive-hero-controls (flex-wrap:wrap par défaut) laisserait
   les deux contrôles retomber à la ligne de façon imprévisible plutôt que de
   s'empiler proprement en colonne — et sur le catalogue, où le débordement
   horizontal est carrément coupé (overflow:hidden) plutôt que scrollable, un
   mauvais retour à la ligne peut couper une partie des contrôles. */
@media screen and (max-width: 768px){
  .archive-hero{
    flex-direction:column;
    align-items:stretch;
  }
  .archive-hero h1{
    font-size:26px;
  }
  .archive-hero-controls{
    flex-direction:column;
    align-items:stretch;
    width:100%;
  }
  .filter-dropdown,
  .filter-dropdown-toggle{
    width:100%;
  }
  .filter-dropdown-toggle{
    justify-content:space-between;
  }
  .filter-dropdown-menu{
    left:0;
    right:0;
    width:auto;
    min-width:0;
  }
  .artefact-search{
    width:100%;
  }
  .artefact-search input[type="text"]{
    min-width:0;
    flex:1;
  }
}

/* Le catalogue tient exactement dans l'écran : header/recherche/catégories/
   footer restent toujours visibles, seule la grille de résultats défile en
   interne si elle déborde. "post-type-archive-artefact" est la classe que
   WordPress ajoute automatiquement au <body> sur l'archive /artefact/ ;
   "home" est ajoutée sur la page d'accueil (is_front_page()), qui affiche
   le même catalogue (voir template-parts/artefact-catalogue.php). */
body.post-type-archive-artefact,
body.home{
  height:100vh;
  height:100dvh; /* tient compte de la barre d'adresse dynamique des navigateurs mobiles, où 100vh dépasse souvent la zone réellement visible */
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
/* La barre d'administration WordPress (visible pour un utilisateur connecté)
   ajoute 32px (46px en dessous de 782px) en haut de la page : sans en tenir
   compte, 100vh dépasse la fenêtre réelle et pousse le footer hors champ. */
body.admin-bar.post-type-archive-artefact,
body.admin-bar.home{
  height:calc(100vh - 32px);
  height:calc(100dvh - 32px);
}
@media screen and (max-width: 782px){
  body.admin-bar.post-type-archive-artefact,
  body.admin-bar.home{
    height:calc(100vh - 46px);
    height:calc(100dvh - 46px);
  }
}
body.post-type-archive-artefact .site-header,
body.post-type-archive-artefact .site-footer,
body.home .site-header,
body.home .site-footer{
  flex-shrink:0;
}
body.post-type-archive-artefact .site-content,
body.home .site-content{
  width: 100%;
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding-top:32px;
  padding-bottom:24px;
}
body.post-type-archive-artefact .archive-hero,
body.post-type-archive-artefact .artefact-categories,
body.home .archive-hero,
body.home .artefact-categories{
  flex-shrink:0;
}
body.post-type-archive-artefact .archive-hero,
body.home .archive-hero{
  margin-bottom:24px;
}
body.post-type-archive-artefact .artefact-categories,
body.home .artefact-categories{
  margin-bottom:24px;
}
body.post-type-archive-artefact .artefact-results,
body.home .artefact-results{
  flex:1;
  min-height:0;
  overflow-y:auto;
  padding-right:4px;
}

/* Sur mobile/tablette, on abandonne le "fit exact dans l'écran" (où seule
   .artefact-results défilait en interne) au profit d'un défilement normal
   de toute la page — plus confortable sur petit écran, et on n'a plus besoin
   de faire tenir recherche + filtre + grille dans une hauteur fixe.
   Répété avec .admin-bar pour prendre le pas sur les règles plus haut (elles
   sont plus spécifiques via cette classe en plus). */
@media screen and (max-width: 768px){
  body.post-type-archive-artefact,
  body.home,
  body.admin-bar.post-type-archive-artefact,
  body.admin-bar.home{
    height:auto;
    overflow:visible;
  }
  body.post-type-archive-artefact .site-content,
  body.home .site-content{
    flex:none;
    overflow:visible;
  }
  body.post-type-archive-artefact .artefact-results,
  body.home .artefact-results{
    flex:none;
    overflow-y:visible;
    padding-right:0;
  }
}