/* Kit pirate v2 - La Cale Seche
   Les chemins des textures sont relatifs a ce fichier : garder le dossier tex/ a cote. */

/* ---------- enseigne suspendue a sa potence ---------- */
.pk-pancarte{position:absolute;z-index:3;top:calc(var(--top,88px) - 6px);right:0;width:clamp(330px,40vw,600px);cursor:grab;-webkit-tap-highlight-color:transparent;user-select:none}
.pk-canvas{display:block}
.pk-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (max-width:640px){.pk-pancarte{width:min(78vw,300px);top:calc(var(--top,72px) - 4px)}}

/* ---------- en-tete en planches de bois (ajouter la classe "poutre" sur header.top) ---------- */
.top.poutre,.top.poutre.plein{
  background:
    linear-gradient(180deg,rgba(255,226,180,.12) 0,rgba(0,0,0,0) 22%,rgba(0,0,0,0) 70%,rgba(0,0,0,.45) 100%),
    url(tex/poutre-entete.jpg) center/auto 100% repeat-x,
    #3A2616;
  box-shadow:0 10px 22px rgba(0,0,0,.5);
  backdrop-filter:none;-webkit-backdrop-filter:none
}
.top.poutre::after{content:"";position:absolute;left:0;right:0;bottom:-9px;height:13px;pointer-events:none;
  background:url(tex/corde-h.png) left center/auto 100% repeat-x;filter:drop-shadow(0 3px 3px rgba(0,0,0,.6))}
.top.poutre nav a{color:#F6EBD6;text-shadow:0 1px 2px rgba(0,0,0,.8)}

/* ---------- drapeau d'intro ---------- */
.pk-drapeau{display:block;position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;z-index:0;background:#0E0A08}
/* plein ecran : le pavillon remplit tout l'ecran, mat hors champ */
.pk-drapeau.pk-plein{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;aspect-ratio:auto;z-index:0;background:#0E0A08}

/* l'ancien drapeau CSS (mat + tranches) ne doit plus jamais s'afficher */
.drapeau-intro .mat,.drapeau-intro .scene,.drapeau-intro .drapeau{display:none!important}

/* ---------- mer : houle + navires (PirateKit.mer) ---------- */
.mer.pk-mer,.pk-mer{position:absolute;left:0;right:0;bottom:0;height:clamp(170px,19vw,280px);pointer-events:none;overflow:hidden;z-index:0}
.mer-equipage.pk-mer{height:clamp(130px,13vw,200px)}
.pk-mer-canvas{display:block;width:100%;height:100%}
/* la section garde de la place pour la mer (les mats depassent au-dessus de l'eau) */
.bord:has(> .pk-mer){padding-bottom:clamp(170px,19vw,280px)}
.equipage:has(> .pk-mer){padding-bottom:clamp(130px,13vw,200px)}

/* ---------- hublots : cerclage de laiton boulonne + corde de chanvre ----------
   Le cadre est dessine DANS le hublot (la mise en page ne bouge pas), la photo est
   ramenee au centre. Variante corde seule : ajouter la classe pk-hublot-corde sur <body>. */
:root{--pk-trou:66%;--pk-marge:17%;--pk-cadre:url(tex/hublot-laiton-corde.png)}
:root .pk-hublot-corde{--pk-trou:70%;--pk-marge:15%;--pk-cadre:url(tex/hublot-corde.png)}
:root .hublot{overflow:visible;background:none;box-shadow:none;border-radius:50%}
:root .hublot>img,:root .hublot>iframe{position:absolute;left:var(--pk-marge);top:var(--pk-marge);width:var(--pk-trou);height:var(--pk-trou);border-radius:50%;object-fit:cover;
  box-shadow:inset 0 0 30px 6px rgba(0,0,0,.6)}
:root .hublot::before{inset:var(--pk-marge);z-index:2}
:root .hublot::after{content:"";position:absolute;inset:-2%;z-index:3;pointer-events:none;border-radius:0;
  background:var(--pk-cadre) center/100% 100% no-repeat;-webkit-mask:none;mask:none;
  filter:drop-shadow(0 10px 14px rgba(0,0,0,.6))}

/* ---------- chute du pavillon au clic (pav.tomber) ---------- */
.pk-tombe{background:transparent!important;background-image:none!important}
.pk-tombe::before,.pk-tombe::after{opacity:0!important;transition:opacity .5s}
.pk-tombe .entrer,.pk-tombe p{opacity:0;transition:opacity .35s}
.pk-navire-survol,.pk-navire-survol *{cursor:pointer!important}

/* ---------- galerie : avis de recherche discrets cloues sur un mur de planches ----------
   La photo va jusqu'au bord (dechire, parfois brule), seule une bande de papier en bas porte "BOUNTY".
   La photo reste nette ; au clic la visionneuse du site l'affiche en grand. 4 variantes de cadre. */
.hublots-sec{background:linear-gradient(rgba(14,9,6,.55),rgba(14,9,6,.25) 30%,rgba(14,9,6,.55)),url(tex/planches-mur.jpg) center/640px repeat}
:root .hublots-sec .hublot{border-radius:0;aspect-ratio:auto;overflow:visible;background:none;box-shadow:none;padding:0;
  filter:drop-shadow(0 10px 12px rgba(0,0,0,.55));transition:transform .35s cubic-bezier(.2,.8,.2,1),filter .35s}
:root .hublots-sec .hublot::after,:root .hublots-sec .hublot::before{content:none}
.hublots-sec .hublot .pk-affiche{display:block;position:relative;aspect-ratio:600/700;
  background:url(tex/papier.jpg) center/cover;
  -webkit-mask:url(tex/affiche-masque-1.png) center/100% 100% no-repeat;mask:url(tex/affiche-masque-1.png) center/100% 100% no-repeat}
:root .hublots-sec .hublot .pk-affiche img{position:absolute;left:0;top:0;width:100%;height:85.7%;border-radius:0;box-shadow:none;object-fit:cover;filter:none;transform:none}
/* bande de papier en bas : BOUNTY, discret */
.hublots-sec .hublot .pk-affiche::before{content:"BOUNTY";position:absolute;left:0;right:0;bottom:0;height:14.3%;display:flex;align-items:center;justify-content:center;
  font-family:var(--titre,serif);font-size:clamp(.72rem,1.15vw,1rem);letter-spacing:.32em;padding-left:.32em;color:rgba(46,28,14,.78);
  border-top:1px solid rgba(60,36,16,.35)}
/* froissage leger par-dessus tout */
.hublots-sec .hublot .pk-affiche::after{content:"";position:absolute;inset:0;pointer-events:none;background:url(tex/froisse.png) center/cover;mix-blend-mode:soft-light;opacity:.45}
/* usure / brulure du bord, propre a chaque variante */
.hublots-sec .hublot .pk-bord{position:absolute;inset:0;pointer-events:none;background:url(tex/affiche-bord-1.png) center/100% 100% no-repeat;z-index:1}
.hublots-sec li:nth-child(4n+2) .pk-affiche{-webkit-mask-image:url(tex/affiche-masque-2.png);mask-image:url(tex/affiche-masque-2.png)}
.hublots-sec li:nth-child(4n+2) .pk-bord{background-image:url(tex/affiche-bord-2.png)}
.hublots-sec li:nth-child(4n+3) .pk-affiche{-webkit-mask-image:url(tex/affiche-masque-3.png);mask-image:url(tex/affiche-masque-3.png)}
.hublots-sec li:nth-child(4n+3) .pk-bord{background-image:url(tex/affiche-bord-3.png)}
.hublots-sec li:nth-child(4n) .pk-affiche{-webkit-mask-image:url(tex/affiche-masque-4.png);mask-image:url(tex/affiche-masque-4.png)}
.hublots-sec li:nth-child(4n) .pk-bord{background-image:url(tex/affiche-bord-4.png)}
/* clou rouille en haut */
.hublots-sec .hublot .pk-clou{position:absolute;z-index:2;left:50%;top:3%;width:12px;height:12px;margin-left:-6px;border-radius:50%;
  background:radial-gradient(circle at 35% 30%,#b0927a,#5b3a26 55%,#22150c);box-shadow:0 2px 2px rgba(0,0,0,.6)}
.hublots-sec li:nth-child(4n) .pk-clou{top:9%}
/* chaque affiche un peu de travers, elle se redresse au survol */
.hublots-sec li:nth-child(4n+1) .hublot{transform:rotate(-2.2deg)}
.hublots-sec li:nth-child(4n+2) .hublot{transform:rotate(1.6deg)}
.hublots-sec li:nth-child(4n+3) .hublot{transform:rotate(-.8deg)}
.hublots-sec li:nth-child(4n) .hublot{transform:rotate(2.4deg)}
:root .hublots-sec .hublot:hover{transform:rotate(0) scale(1.04);filter:drop-shadow(0 16px 18px rgba(0,0,0,.6))}
