/* ==========================================================================
   CLAN V3 — Page de clan cinématique
   Camarilla Dauphinoise
   Tout est scopé sous .clan-v3 pour ne rien casser dans Minimal Mistakes.
   ========================================================================== */

.clan-v3 {
  /* --- Palette ---
     Se raccorde aux jetons du theme du site (camarilla.css).
     Les valeurs apres la virgule servent de repli si le theme est absent. */
  --v3-ink:        var(--cd-black,     #111111);
  --v3-ink-2:      var(--cd-dark,      #171513);
  --v3-ink-3:      var(--cd-dark-2,    #211d18);
  --v3-parchment:  var(--cd-paper,     #d8cdb8);
  --v3-muted:      var(--cd-paper-dim, #96897a);
  --v3-gold:       var(--cd-gold,      #9a7b45);
  --v3-blood:      var(--cd-red,       #4a1018);
  --v3-blood-lit:  var(--cd-red-lit,   #8c2230);
  --v3-line:       var(--cd-line,      #4d412d);

  /* --v3-accent est injecte par le layout (front matter `accent:`) */
  --v3-accent:     var(--cd-gold, #9a7b45);

  /* --- Typo --- */
  --v3-display: var(--cd-display, "Cinzel", Georgia, serif);
  --v3-body:    var(--cd-read, "Cormorant Garamond", Garamond, Georgia, serif);
  --v3-ui:      var(--cd-body, "Inter", system-ui, sans-serif);

  /* --- Rythme --- */
  --v3-gutter: clamp(1.25rem, 5vw, 6rem);
  --v3-max: 1240px;

  /* Sortie de la colonne du thème : pleine largeur */
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  position: relative;
  background: var(--v3-ink);
  color: var(--v3-parchment);
  font-family: var(--v3-body);
  font-size: 1.05rem;
  line-height: 1.7;
  overflow-x: clip;
  isolation: isolate;
}

.clan-v3 *,
.clan-v3 *::before,
.clan-v3 *::after { box-sizing: border-box; }

.clan-v3 p { color: color-mix(in srgb, var(--v3-parchment) 88%, #000); }
.clan-v3 a { color: var(--v3-accent); text-decoration: none; }
.clan-v3 img { max-width: 100%; display: block; }
.clan-v3 :focus-visible {
  outline: 2px solid var(--v3-accent);
  outline-offset: 3px;
}

/* Grain de pellicule — ambiance, très léger */
.clan-v3::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Utilitaires
   -------------------------------------------------------------------------- */
.v3-wrap {
  max-width: var(--v3-max);
  margin-inline: auto;
  padding-inline: var(--v3-gutter);
}

.v3-eyebrow {
  font-family: var(--v3-ui);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--v3-accent);
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: 0 0 1.1rem;
}
.v3-eyebrow::after {
  content: "";
  height: 1px;
  flex: 1;
  max-width: 120px;
  background: linear-gradient(90deg, var(--v3-accent), transparent);
}

.v3-h2 {
  font-family: var(--v3-display);
  font-weight: 900;
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  line-height: 1;
  letter-spacing: .01em;
  color: var(--v3-parchment);
  margin: 0 0 1.6rem;
  text-transform: uppercase;
}

/* Le sceau, transformé en forme pleine quelle que soit la couleur du fichier */
.v3-seal {
  -webkit-mask-image: var(--v3-seal);
          mask-image: var(--v3-seal);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  background-color: currentColor;
}

/* --------------------------------------------------------------------------
   1. HÉROS
   -------------------------------------------------------------------------- */
.v3-hero {
  position: relative;
  min-height: min(100svh, 980px);
  display: flex;
  align-items: flex-end;
  padding: 8rem 0 clamp(3rem, 8vh, 7rem);
  overflow: hidden;
}

.v3-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.06);
  animation: v3-drift 26s ease-in-out infinite alternate;
}
@keyframes v3-drift {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to   { transform: scale(1.14) translate3d(-1.5%, -1.5%, 0); }
}

.v3-hero__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 78% 30%, transparent 0%, rgba(8,6,10,.35) 45%, rgba(8,6,10,.9) 100%),
    linear-gradient(180deg, rgba(8,6,10,.72) 0%, rgba(8,6,10,.25) 38%, rgba(8,6,10,.92) 88%, var(--v3-ink) 100%),
    linear-gradient(90deg, rgba(8,6,10,.85) 0%, transparent 62%);
}

/* Le sceau géant, gravé dans le fond */
.v3-hero__sigil {
  position: absolute;
  right: -4vw;
  top: 50%;
  translate: 0 -50%;
  width: min(58vh, 46vw);
  aspect-ratio: 1;
  color: var(--v3-accent);
  opacity: .13;
  animation: v3-breathe 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes v3-breathe {
  0%, 100% { opacity: .10; scale: 1; }
  50%      { opacity: .17; scale: 1.035; }
}

.v3-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
}

.v3-hero__eyebrow {
  font-family: var(--v3-ui);
  font-size: clamp(.7rem, 1.1vw, .82rem);
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--v3-gold);
  margin: 0 0 1.4rem;
}

.v3-hero__name {
  font-family: var(--v3-display);
  font-weight: 900;
  font-size: clamp(3.6rem, 14vw, 11rem);
  line-height: .82;
  letter-spacing: -.015em;
  text-transform: uppercase;
  margin: 0;
  color: #fff;
  text-shadow: 0 .18em .5em rgba(0,0,0,.55);
}

.v3-hero__caption {
  font-family: var(--v3-ui);
  font-size: clamp(.95rem, 2vw, 1.35rem);
  font-weight: 400;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--v3-accent);
  margin: 1.4rem 0 0;
}

.v3-hero__rule {
  width: clamp(120px, 22vw, 280px);
  height: 2px;
  border: 0;
  margin: 1.9rem 0;
  background: linear-gradient(90deg, var(--v3-blood-lit), var(--v3-accent) 55%, transparent);
}

.v3-hero__devise {
  font-family: var(--v3-body);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.2rem, 2.6vw, 1.9rem);
  line-height: 1.4;
  color: var(--v3-parchment);
  max-width: 34ch;
  margin: 0;
}
.v3-hero__devise::before { content: "« "; color: var(--v3-accent); }
.v3-hero__devise::after  { content: " »"; color: var(--v3-accent); }

/* Traits (optionnel) — barres segmentées, style fiche de perso */
.v3-traits {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.2rem, 3vw, 2.6rem);
  margin-top: 2.8rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--v3-line);
  max-width: 620px;
}
.v3-trait__label {
  font-family: var(--v3-ui);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--v3-muted);
  margin-bottom: .5rem;
}
.v3-trait__pips { display: flex; gap: 4px; }
.v3-trait__pip {
  width: 22px;
  height: 4px;
  background: rgba(236,229,216,.14);
}
.v3-trait__pip.is-on { background: var(--v3-accent); }

/* Invitation au scroll */
.v3-scrollcue {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  translate: -50% 0;
  z-index: 3;
  font-family: var(--v3-ui);
  font-size: .66rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--v3-muted);
  display: grid;
  justify-items: center;
  gap: .7rem;
}
.v3-scrollcue span::after {
  content: "";
  display: block;
  width: 1px;
  height: 46px;
  margin: .7rem auto 0;
  background: linear-gradient(180deg, var(--v3-accent), transparent);
  animation: v3-cue 2.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes v3-cue {
  0%, 100% { scale: 1 .35; opacity: .35; }
  50%      { scale: 1 1;   opacity: 1; }
}

/* --------------------------------------------------------------------------
   2. BARRE DE NAVIGATION COLLANTE + JAUGE DE SANG
   -------------------------------------------------------------------------- */
.v3-subnav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(8,6,10,.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-block: 1px solid var(--v3-line);
}
.v3-subnav__inner {
  max-width: var(--v3-max);
  margin-inline: auto;
  padding-inline: var(--v3-gutter);
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.4rem);
  min-height: 62px;
}

/* Le sceau se remplit de sang au fil de la lecture */
.v3-gauge {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}
.v3-gauge__base,
.v3-gauge__fill { position: absolute; inset: 0; }
.v3-gauge__base { color: rgba(236,229,216,.2); }
.v3-gauge__fill {
  color: var(--v3-blood-lit);
  clip-path: inset(calc(100% - var(--v3-progress, 0%)) 0 0 0);
  transition: clip-path .12s linear;
}

.v3-subnav__links {
  display: flex;
  gap: clamp(.9rem, 2.4vw, 2rem);
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0;
  padding: 0;
  list-style: none;
}
.v3-subnav__links::-webkit-scrollbar { display: none; }
.v3-subnav__links a {
  font-family: var(--v3-ui);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--v3-muted);
  white-space: nowrap;
  padding: .55rem 0;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.v3-subnav__links a:hover { color: var(--v3-parchment); }
.v3-subnav__links a.is-active {
  color: var(--v3-accent);
  border-bottom-color: var(--v3-accent);
}

/* --------------------------------------------------------------------------
   Sections génériques
   -------------------------------------------------------------------------- */
.v3-section {
  position: relative;
  padding-block: clamp(4rem, 11vh, 8.5rem);
  scroll-margin-top: 74px;
}
.v3-section--alt { background: var(--v3-ink-2); }

/* --------------------------------------------------------------------------
   3. NATURE (le texte de lore)
   -------------------------------------------------------------------------- */
.v3-lore { display: grid; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 900px) {
  .v3-lore { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); align-items: start; }
}

.v3-lore__body {
  font-size: clamp(1.08rem, 1.5vw, 1.28rem);
  line-height: 1.78;
  max-width: 68ch;
}
.v3-lore__body > p { margin: 0 0 1.35rem; }
.v3-lore__body > p:first-of-type::first-letter {
  float: left;
  font-family: var(--v3-display);
  font-weight: 900;
  font-size: 4.2em;
  line-height: .78;
  padding: .06em .14em 0 0;
  color: var(--v3-accent);
}
.v3-lore__body h2,
.v3-lore__body h3 {
  font-family: var(--v3-display);
  color: var(--v3-parchment);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 2.4rem 0 1rem;
}
.v3-lore__body a { border-bottom: 1px solid var(--v3-line); }

/* Encart latéral */
.v3-aside {
  border-left: 2px solid var(--v3-accent);
  padding: .4rem 0 .4rem 1.6rem;
}
.v3-aside__label {
  font-family: var(--v3-ui);
  font-size: .72rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--v3-muted);
  margin: 0 0 .6rem;
}
.v3-aside__value {
  font-family: var(--v3-display);
  font-size: 1.15rem;
  color: var(--v3-parchment);
  margin: 0 0 1.8rem;
}

/* --------------------------------------------------------------------------
   4. DISCIPLINES — sélecteur type fiche d'agent
   -------------------------------------------------------------------------- */
.v3-disc {
  display: grid;
  gap: clamp(1.6rem, 4vw, 3.5rem);
}
@media (min-width: 900px) {
  .v3-disc { grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); }
}

.v3-disc__list {
  display: flex;
  flex-direction: row;
  gap: .5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: .25rem;
}
.v3-disc__list::-webkit-scrollbar { display: none; }
@media (min-width: 900px) {
  .v3-disc__list { flex-direction: column; overflow: visible; gap: .35rem; }
}

.v3-disc__tab {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  color: var(--v3-muted);
  cursor: pointer;
  text-align: left;
  width: 100%;
  min-width: 190px;
  transition: background .22s, color .22s, border-color .22s;
  font-family: var(--v3-ui);
}
.v3-disc__tab:hover { background: rgba(236,229,216,.045); color: var(--v3-parchment); }
.v3-disc__tab[aria-selected="true"] {
  background: linear-gradient(90deg, rgba(255,255,255,.07), transparent);
  border-left-color: var(--v3-accent);
  color: var(--v3-parchment);
}

.v3-disc__icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: var(--v3-muted);
  transition: color .22s, filter .22s, scale .22s;
}
.v3-disc__tab:hover .v3-disc__icon { color: var(--v3-parchment); }
.v3-disc__tab[aria-selected="true"] .v3-disc__icon {
  color: var(--v3-accent);
  scale: 1.08;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--v3-accent) 55%, transparent));
}

.v3-disc__tabname {
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* Panneau */
.v3-disc__panel { position: relative; min-height: 300px; }
.v3-disc__pane {
  display: none;
  grid-template-columns: 1fr;
  gap: 1.8rem;
}
.v3-disc__pane.is-active { display: grid; animation: v3-fade .45s ease both; }
@keyframes v3-fade {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (min-width: 1080px) {
  .v3-disc__pane.is-active { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; }
}

.v3-disc__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--v3-line);
  background: var(--v3-ink-3);
}
.v3-disc__media img,
.v3-disc__media video { width: 100%; height: 100%; object-fit: cover; }
.v3-disc__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(8,6,10,.6));
  pointer-events: none;
}

.v3-disc__name {
  font-family: var(--v3-display);
  font-weight: 900;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  text-transform: uppercase;
  line-height: 1;
  margin: 0 0 1rem;
  color: var(--v3-parchment);
}
.v3-disc__desc {
  font-size: clamp(1.05rem, 1.4vw, 1.22rem);
  line-height: 1.75;
  max-width: 52ch;
  margin: 0;
}

/* --------------------------------------------------------------------------
   5. HIÉRARCHIE
   -------------------------------------------------------------------------- */
.v3-ranks {
  display: grid;
  gap: 1px;
  background: var(--v3-line);
  border: 1px solid var(--v3-line);
}
@media (min-width: 780px) {
  .v3-ranks { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

.v3-rank {
  background: var(--v3-ink);
  padding: clamp(1.6rem, 3vw, 2.4rem);
  position: relative;
  transition: background .3s;
}
.v3-rank:hover { background: var(--v3-ink-3); }
.v3-rank__num {
  font-family: var(--v3-display);
  font-size: .95rem;
  letter-spacing: .3em;
  color: var(--v3-accent);
  margin: 0 0 1.4rem;
}
.v3-rank__title {
  font-family: var(--v3-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--v3-parchment);
  margin: 0 0 .7rem;
}
.v3-rank__desc { margin: 0; font-size: 1.02rem; color: var(--v3-muted); }

/* --------------------------------------------------------------------------
   6. CHRONIQUES — ligne de sang
   -------------------------------------------------------------------------- */
.v3-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 2.2rem;
  position: relative;
  max-width: 780px;
}
.v3-timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: .6em;
  bottom: .6em;
  width: 1px;
  background: linear-gradient(180deg, var(--v3-accent), var(--v3-blood) 60%, transparent);
}
.v3-timeline li {
  position: relative;
  padding: 0 0 2rem;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: color-mix(in srgb, var(--v3-parchment) 88%, #000);
}
.v3-timeline li::before {
  content: "";
  position: absolute;
  left: -2.2rem;
  top: .62em;
  width: 11px;
  height: 11px;
  background: var(--v3-accent);
  rotate: 45deg;
}
.v3-timeline li:last-child { padding-bottom: 0; }

/* --------------------------------------------------------------------------
   7. GALERIE
   -------------------------------------------------------------------------- */
.v3-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.v3-gallery button {
  padding: 0;
  border: 1px solid var(--v3-line);
  background: none;
  cursor: zoom-in;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}
.v3-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(.55) contrast(1.05);
  transition: filter .5s, scale .7s;
}
.v3-gallery button:hover img { filter: none; scale: 1.05; }

/* Visionneuse */
.v3-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  place-items: center;
  padding: 3vh 4vw;
  background: rgba(4,3,5,.94);
  backdrop-filter: blur(6px);
}
.v3-lightbox.is-open { display: grid; }
.v3-lightbox img { max-width: 100%; max-height: 94vh; object-fit: contain; }
.v3-lightbox__close {
  position: absolute;
  top: 1.4rem;
  right: 1.6rem;
  background: none;
  border: 1px solid var(--v3-line);
  color: var(--v3-parchment);
  font-family: var(--v3-ui);
  letter-spacing: .2em;
  text-transform: uppercase;
  font-size: .78rem;
  padding: .6rem 1.1rem;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   8. PIED DE PAGE — navigation entre clans
   -------------------------------------------------------------------------- */
.v3-foot {
  border-top: 1px solid var(--v3-line);
  background: var(--v3-ink-2);
}
.v3-foot__inner {
  max-width: var(--v3-max);
  margin-inline: auto;
  padding: 2.4rem var(--v3-gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.v3-foot__link {
  font-family: var(--v3-ui);
  font-size: .84rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--v3-muted);
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  transition: color .2s;
}
.v3-foot__link:hover { color: var(--v3-accent); }
.v3-foot__link .v3-seal { width: 30px; height: 30px; color: currentColor; }

/* --------------------------------------------------------------------------
   Révélations au défilement
   -------------------------------------------------------------------------- */
.v3-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s cubic-bezier(.22,.61,.36,1), transform .8s cubic-bezier(.22,.61,.36,1);
}
.v3-reveal.is-in { opacity: 1; transform: none; }

/* Séquence d'ouverture du héros */
.v3-hero .v3-intro {
  opacity: 0;
  transform: translateY(30px);
  animation: v3-intro .95s cubic-bezier(.22,.61,.36,1) forwards;
}
.v3-hero .v3-intro:nth-child(1) { animation-delay: .12s; }
.v3-hero .v3-intro:nth-child(2) { animation-delay: .24s; }
.v3-hero .v3-intro:nth-child(3) { animation-delay: .38s; }
.v3-hero .v3-intro:nth-child(4) { animation-delay: .48s; }
.v3-hero .v3-intro:nth-child(5) { animation-delay: .58s; }
.v3-hero .v3-intro:nth-child(6) { animation-delay: .70s; }
@keyframes v3-intro { to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Accessibilité : mouvement réduit
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .clan-v3 *,
  .clan-v3 *::before,
  .clan-v3 *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
  .v3-reveal { opacity: 1; transform: none; }
  .v3-hero .v3-intro { opacity: 1; transform: none; }
  .v3-hero__bg { transform: scale(1.02); }
}

/* --------------------------------------------------------------------------
   Neutralisation de quelques styles Minimal Mistakes
   -------------------------------------------------------------------------- */
.clan-v3 table,
.clan-v3 td,
.clan-v3 th { border: 0; background: none; }
