/* =====================================
   COMPONENTS.CSS — VERSION CORRIGÉE & OPTIMISÉE
   - doublons supprimés
   - sélecteurs nettoyés
   - menu optimisé (pas de retour à la ligne sur desktop)
   - responsive conservé
   - lint-friendly (pas de 'adjoining classes')
===================================== */

/* ---------- HEADER ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  border-bottom: 1px solid var(--stroke);
  transition: padding .22s ease, background .22s ease;
}


.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 0;
}

.site-header.is-shrink .header-inner {
  padding: .55rem 0;
}

.site-header.is-solid {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: .85rem;
}

/* lint-friendly replacement for .brand.left / .brand.center */
[class~="brand"][class~="left"] {
  justify-content: flex-start;
}

[class~="brand"][class~="center"] {
  justify-content: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.site-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(1.4rem, 1vw + 1rem, 1.9rem);
  line-height: 1.05;
  letter-spacing: .2px;
  white-space: nowrap;
}

.site-tagline {
  font-size: .85rem;
  color: var(--muted);
  opacity: .9;
}

.brand-logo img {
  max-height: 46px;
  width: auto;
}

/* ---------- NAV ---------- */
.nav {
  display: flex;
  align-items: center;
  gap: .9rem;
  min-width: 0;
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  cursor: pointer;
}

.hamburger {
  display: inline-grid;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .2s ease, opacity .2s ease;
}

.nav.is-open .hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav.is-open .hamburger span:nth-child(2) {
  opacity: 0;
}

.nav.is-open .hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.nav-top {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-title {
  font-weight: 700;
}

.nav-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}

.menu {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: .5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu > li {
  position: relative;
  flex: 0 0 auto;
}

.menu-link {
  display: inline-flex;
  align-items: center;
  padding: .55rem .65rem;
  border-radius: 999px;
  color: color-mix(in srgb, var(--text) 92%, transparent);
  font-size: .95rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background .18s ease, transform .18s ease, background-size .18s ease;
}

.menu > li > .menu-link {
  background-image: linear-gradient(90deg, var(--primary), var(--accent));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 16px 90%;
}

.menu > li > .menu-link:hover {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  background-image: linear-gradient(90deg, var(--primary), var(--accent));
  background-repeat: no-repeat;
  background-position: 16px 90%;
  background-size: 65% 2px;
  transform: translateY(-1px);
}

.sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  margin: 0;
  padding: .55rem;
  list-style: none;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px) scale(.98);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.menu li:hover > .sub-menu,
.menu li:focus-within > .sub-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.sub-menu .menu-link {
  display: flex;
  width: 100%;
  padding: .7rem .75rem;
  border-radius: 14px;
}

.sub-menu .menu-link:hover {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--primary) 22%, transparent),
    color-mix(in srgb, var(--accent) 14%, transparent)
  );
}

.nav-desktop-right {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex: 0 0 auto;
}

.social-mini {
  display: flex;
  gap: .45rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  cursor: pointer;
}

/* Social links */
.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.social-link {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  font-weight: 800;
  transition: transform .18s ease, background .18s ease;
}

.social-link:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
}

/* lint-friendly replacement for .social-link.compact */
[class~="social-link"][class~="compact"] {
  width: 36px;
  height: 36px;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .75rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #fff;
}

.btn-ghost {
  background: transparent;
}

.link-more {
  display: inline-flex;
  color: color-mix(in srgb, var(--text) 92%, transparent);
}

.link-more:hover {
  color: var(--text);
}

/* ---------- HERO SLIDER ---------- */
.hero {
  position: relative;
}

.hero-shell {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--stroke);
}

.hero-track {
  display: flex;
  will-change: transform;
  transition: transform .6s cubic-bezier(.2, .85, .2, 1);
}

.hero-slide {
  position: relative;
  min-width: 100%;
  min-height: min(64vh, 720px);
}

.hero-media {
  position: absolute;
  inset: 0;
  display: block;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-placeholder {
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--surface) 65%, transparent);
}

.media-placeholder.small {
  height: 180px;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0,0,0,.70) 0%,
    rgba(0,0,0,.35) 45%,
    rgba(0,0,0,.15) 100%
  );
}

html[data-theme="light"] .hero-overlay {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,.82) 0%,
    rgba(255,255,255,.55) 45%,
    rgba(255,255,255,.35) 100%
  );
}

.hero-content {
  position: relative;
  max-width: 68ch;
  padding: clamp(2.2rem, 4vw, 4.2rem) 0;
}

.hero-badge {
  display: inline-flex;
  margin-bottom: .8rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--primary) 20%, transparent);
}

.hero-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  margin: 0 0 .7rem;
}

.hero-excerpt {
  margin: 0 0 1.2rem;
  color: color-mix(in srgb, var(--text) 86%, transparent);
}

.hero-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.35);
  color: #fff;
  cursor: pointer;
}

html[data-theme="light"] .hero-btn {
  background: rgba(255,255,255,.55);
  color: #111;
}

.hero-btn.prev { left: 12px; }
.hero-btn.next { right: 12px; }

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.30);
}

html[data-theme="light"] .hero-dots {
  background: rgba(255,255,255,.55);
}

.hero-dots button {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 99px;
  cursor: pointer;
  background: color-mix(in srgb, var(--text) 35%, transparent);
}

.hero-dots button.is-active {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* ---------- HOME GRID 70/30 ---------- */
.home-main {
  padding: 2.2rem 0;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 1.4rem;
  align-items: start;
}


.home-right {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-self: start;
}



.author-card {
  position: relative;
  top: auto;
  padding: 1.2rem;
  border-radius: 26px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: var(--shadow);
}


.author-top {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: .85rem;
}

.author-avatar {
  width: 160px;
  height: 160px;
  overflow: hidden;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,.15);
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.author-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.author-bio {
  margin: .35rem 0 1rem;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1.5;
  letter-spacing: .2px;
  font-weight: 500;
}

.author-bio,
.author-bio p,
.author-bio * {
  font-family: "Dancing Script", var(--font-title) !important;
}

.author-bio p {
  margin: 0 0 .9rem;
}

.author-bio p:last-child {
  margin-bottom: 0;
}

/* ---------- CARDS ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.cards-grid.compact {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  min-height: auto;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: 0 18px 60px rgba(0,0,0,.18);
  transform: translateY(0);
  transition: transform .2s ease, box-shadow .2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-media {
  display: block;
  border-bottom: 1px solid color-mix(in srgb, var(--stroke) 80%, transparent);
}

.card-media img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  transition: transform .35s ease;
}

.card:hover .card-media img {
  transform: scale(1.03);
}

.card-body {
  padding: .75rem .85rem;
}

.card-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.2;
  margin: .25rem 0 .2rem;
}

.card-excerpt {
  margin: 0 0 .45rem;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: .9rem;
  color: var(--muted);
}

/* ---------- CATEGORY BLOCK ---------- */
.category-block {
  margin: 1.3rem 0 2rem;
}

.category-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}

.category-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
}

/* ---------- SHOWCASE ---------- */
.cat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
}

.cat-chip {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  width: 180px;
  padding: 1rem .95rem;
  border-radius: 22px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  transition: transform .2s ease, box-shadow .2s ease;
}

.cat-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.cat-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--surface2) 75%, transparent);
}

.cat-name {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
}

.cat-meta {
  font-size: .92rem;
}

/* ---------- FOOTER ---------- */
.site-footer {
  padding: 2.2rem 0 1.2rem;
  border-top: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 1.2rem;
}

.footer-brand {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
}

.footer-desc {
  color: var(--muted);
}

.footer-title {
  margin: 0 0 .6rem;
  font-weight: 700;
}

.footer-menu {
  display: grid;
  gap: .4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-menu a {
  color: var(--muted);
}

.footer-menu a:hover {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--stroke);
}

/* ---------- MOBILE NAV OVERLAY ---------- */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .cards-grid,
  .cards-grid.compact {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 980px){
  .home-grid {
    grid-template-columns: 1fr;
  }

  .home-right {
    position: relative;
    top: auto;
  }

  .author-card {
    position: relative;
    top: auto;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-desktop-right {
    display: none;
  }

  .nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1001;
    width: min(360px, 90%);
    height: 100vh;
    overflow: auto;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    border-left: 1px solid var(--stroke);
    box-shadow: var(--shadow);
    transform: translateX(102%);
    transition: transform .22s ease;
  }

  .nav.is-open .nav-panel {
    transform: translateX(0);
  }

  .nav.is-open .nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-top {
    display: flex;
  }

  .menu {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: .2rem;
  }

  .menu-link {
    width: 100%;
    justify-content: space-between;
    font-size: .95rem;
    white-space: nowrap;
  }

  .sub-menu {
    position: relative;
    top: auto;
    left: auto;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
    background: transparent;
    border: none;
    padding: .2rem .2rem .5rem .6rem;
    display: none;
  }

  li.is-open > .sub-menu {
    display: block;
  }

  .cards-grid,
  .cards-grid.compact {
    grid-template-columns: 1fr;
  }
}

/* =====================================
   SAFE FIX — HEADER FLUIDE SANS CASSER LE DESIGN
===================================== */

/* On garde le style premium, mais plus léger */
.site-header{
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .2s ease, border-color .2s ease, padding .2s ease;
  will-change: auto;
}

/* On garde le header stable visuellement */
.site-header.is-solid{
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

/* Optimisation légère du rendu */
.header-inner{
  backface-visibility: hidden;
  transform: translateZ(0);
}


/* =====================================
   HOME SOCIAL WIDGET
===================================== */

.social-widget-card{
  margin-top: 1rem;
  padding: 1.1rem;
  border-radius: 22px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: var(--shadow);
}

.social-widget-title{
  font-family: var(--font-title);
  font-size: 1.35rem;
  margin: 0 0 .45rem;
}

.social-widget-text{
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
}

.social-widget-links{
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.social-widget-link{
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem .85rem;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--surface2) 72%, transparent);
  color: inherit;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.social-widget-link:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,.10);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--primary) 10%, transparent),
    color-mix(in srgb, var(--accent) 8%, transparent)
  );
}

.social-widget-icon{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  font-weight: 700;
  font-size: .95rem;
  flex-shrink: 0;
}