/**
 * wp-home.css
 * web/themes/custom/wallpaper_ui/css/wp-home.css
 *
 * Grille page d'accueil — 3 niveaux, hauteur commune = 1 unité
 * Unité = 1/3 de la largeur du conteneur (carré parfait)
 */

/* ── Variables locales ─────────────────────────────────────────── */
.wp-home {
  --unit: calc(var(--wp-home-width, 100vw) / 3);
  --gap: 1px;
  --color-stat-bg:    #2D3D2F;
  --color-stat-text:  #e0dbd0;
  --color-meth-bg:    #3D4E3F;
  --color-meth-text:  #e0dbd0;
  --color-proj-bg:    #4a5c4c;
  --color-proj-text:  #e0dbd0;
  --color-bib-bg:     #e8e4dc;
  --color-bib-text:   #2D3D2F;
  --color-part-bg:    #d8d2c6;
  --color-part-text:  #2D3D2F;
  --color-feat-bg:    #1a1a18;
  --color-feat-text:  rgba(255,255,255,.4);
  --serif: var(--wp-font-serif, 'Georgia', serif);
  --trans: .22s ease;
}

/* ── Conteneur ─────────────────────────────────────────────────── */
.wp-home {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  background: #ccc;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Ligne commune ─────────────────────────────────────────────── */
.wp-home__row {
  display: grid;
  gap: var(--gap);
  background: #ccc;
}

.wp-home__row--stats     { grid-template-columns: repeat(3, 1fr); }
.wp-home__row--main      { grid-template-columns: 1fr 2fr; }
.wp-home__row--secondary { grid-template-columns: repeat(3, 1fr); }

/* ── Base blocs ────────────────────────────────────────────────── */
.wp-home__stat,
.wp-home__block {
  position: relative;
  overflow: hidden;
}

.wp-home__stat           { aspect-ratio: 1 / 1; }
.wp-home__block--meth    { aspect-ratio: 1 / 1; }
.wp-home__block--proj    { aspect-ratio: 2 / 1; }
.wp-home__block--bib,
.wp-home__block--part,
.wp-home__block--featured { aspect-ratio: 1 / 1; }

/* ── Statistiques ──────────────────────────────────────────────── */
.wp-home__stat {
  background: var(--color-stat-bg);
  color: var(--color-stat-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
}

.wp-home__stat-label {
  font-size: clamp(8px, 1vw, 11px);
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .5;
  font-family: var(--serif);
}

.wp-home__stat-num {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 300;
  letter-spacing: -.03em;
  line-height: 1;
  transition: opacity .4s;
}

.wp-home__stat-num.is-loading { opacity: .3; }

.wp-home__stat-sub {
  font-size: clamp(8px, .9vw, 10px);
  opacity: .35;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ── Blocs liens ───────────────────────────────────────────────── */
.wp-home__block {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(16px, 2.5vw, 36px);
  gap: 6px;
  text-decoration: none;
  transition: opacity var(--trans), transform var(--trans);
}

.wp-home__block:hover { opacity: .88; }
.wp-home__block:hover .wp-home__block-arrow { transform: translateX(4px); }

.wp-home__block--meth  { background: var(--color-meth-bg);  color: var(--color-meth-text); }
.wp-home__block--proj  { background: var(--color-proj-bg);  color: var(--color-proj-text); }
.wp-home__block--bib   { background: var(--color-bib-bg);   color: var(--color-bib-text); }
.wp-home__block--part  { background: var(--color-part-bg);  color: var(--color-part-text); }

/* ── Typographie des blocs ─────────────────────────────────────── */
.wp-home__block-eyebrow {
  font-size: clamp(8px, .9vw, 10px);
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .45;
  font-family: var(--serif);
}

.wp-home__block-title {
  font-family: var(--serif);
  font-size: clamp(16px, 2.2vw, 28px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.01em;
}

.wp-home__block-desc {
  font-size: clamp(9px, 1vw, 12px);
  opacity: .5;
  line-height: 1.5;
  max-width: 28ch;
  margin-top: 2px;
}

.wp-home__block-arrow {
  font-size: clamp(14px, 1.5vw, 18px);
  margin-top: 8px;
  opacity: .4;
  transition: transform var(--trans);
  display: inline-block;
}

/* ── Bloc image vedette ────────────────────────────────────────── */
.wp-home__block--featured {
  background: var(--color-feat-bg);
  color: var(--color-feat-text);
  cursor: default;
  justify-content: center;
  align-items: center;
  min-height: 340px;
}

/* Fond dégradé parchemin → vert sapin */
.wp-home__block--featured::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(242,235,224,0.05) 0%,
    rgba(200,189,168,0.08) 40%,
    rgba(78,110,85,0.15)   75%,
    rgba(45,74,53,0.25)   100%
  );
  z-index: 2;
}

/* Overlay sombre au survol */
.wp-home__block--featured::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.5) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--trans);
  pointer-events: none;
  z-index: 3;
}

.wp-home__block--featured:hover::after { opacity: 1; }

/* Image */
.wp-home__block--featured img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  mix-blend-mode: normal;
  opacity: 1;
  z-index: 1;
  transition: transform .6s ease;
}

.wp-home__block--featured:hover img { transform: scale(1.03); }

/* Lien wrapper */
.wp-home__featured-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Caption */
.wp-home__featured-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(20, 32, 22, 0.72);
  backdrop-filter: blur(4px);
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(232, 224, 212, 0.12);
  color: #e8e0d4;
  font-size: 13px;
}

.wp-home__featured-eyebrow {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232, 224, 212, 0.45);
}

.wp-home__featured-title {
  font-size: 13px;
  color: #e8e0d4;
  line-height: 1.4;
}

.wp-home__featured-meta {
  font-size: 10px;
  color: rgba(232, 224, 212, 0.4);
  letter-spacing: 0.04em;
  margin-top: 1px;
}

/* Placeholder (aucun wallpaper publié) */
.wp-home__featured-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.wp-home__featured-placeholder span {
  font-size: clamp(8px, .9vw, 10px);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.wp-home__featured-hint {
  opacity: .35;
  font-size: 9px !important;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .wp-home__row--stats     { grid-template-columns: repeat(3, 1fr); }
  .wp-home__row--main      { grid-template-columns: 1fr; }
  .wp-home__row--secondary { grid-template-columns: 1fr 1fr; }

  .wp-home__block--meth,
  .wp-home__block--proj    { aspect-ratio: 2 / 1; }

  .wp-home__block--featured {
    grid-column: 1 / -1;
    aspect-ratio: 2 / 1;
  }
}

@media (max-width: 480px) {
  .wp-home__row--stats { grid-template-columns: 1fr; }

  .wp-home__stat {
    aspect-ratio: 3 / 1;
    flex-direction: row;
    justify-content: space-between;
    padding: 16px 20px;
  }

  .wp-home__stat-num { font-size: 32px; }
}
