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

#preloader {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: white;
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 9999;
	opacity: 1;
	transition: opacity 0.6s ease;
}

#preloader.fade-out {
	opacity: 0;
	pointer-events: none;
}

body {
    font-family: "Crimson Text", serif;
    line-height: 1.6;
    color: #000000;
    background: url("../images/fond.png") top/cover no-repeat;
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 2;
  margin: 0 0 0.5em 0;
}

p {font-size: 20px;;}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #bbbbbb;
}

p a {
  color: #ff6600;
  text-decoration: none;
}

/* Ligne Noire*/
.underline-center {
  position: relative;
  display: inline-block;
}

.underline-center::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0%;
  height: 4px;
  background: black;
  transform: translateX(-50%);
  animation: underline-grow 6s ease forwards;
}

/* Animation */
@keyframes underline-grow {
  from {
    width: 0%;
  }
  to {
    width: 160%;
  }
}

/* HEADER */
.site-header {
	position:relative ;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #e28003;
}

.logo img {
    height: clamp(100px, 18vw, 300px);
    width: auto;
    position: absolute;
    top: 6%;
    left: 3%;
}

.logo-rotate {
	animation: rotatePingPong 0.8s ease-in-out forwards;
}
	@keyframes rotatePingPong {
	0% { transform: rotate(0deg);
	}
	50% { transform: rotate(10deg);
	}
	60% { transform: rotate(-5deg);
	}
	100% { transform: rotate(0deg);
	}
}

/* Navigation */

/* Mobile */

.burger {
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 5px;
}
	
.burger span {
	width: 25px;
	height: 3px;
	background: #000000;
	display: block;
}

/* Menu caché par défaut */

.main-nav {
	position: absolute;
	top: 20px; /*50%*/
	right: 20px;
}

.main-nav ul {
    position: absolute;
    top: -15px;
    right: 35px;
    transform: translateX(10px);
    display: flex;
    gap: 1.2rem;
    background: #ffffff;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    list-style: none;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Menu Ouvert */

.main-nav ul.open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Liens */

.main-nav ul li {
    margin: 0;
}

.main-nav a {
    color: #000000;
    text-decoration: none;
    font-weight: 600;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.main-nav a:hover {
    background: rgba(0,0,0,0.05);
}

/* Mobile */

@media (max-width: 900px) {
    .main-nav ul {
        position: absolute;
        top: 0;
        right: 20px;
        flex-direction: column;
        gap: 0.8rem;
        transform: translateX(10px);
        opacity: 0;
        pointer-events: none;
    }

    .main-nav ul.open {
        opacity: 1;
        pointer-events: auto;
    }

    .main-nav ul.open::before {
        display: none; /* pas de croissant sur mobile */
    }
}

/*Croissant Menu*/

.main-nav ul.open::before {
    content: "";
    position: absolute;
    width: 24px;
    height: 48px;
    left: -11px;
    top: 50%;
    transform: translateY(-50%);
    background: #000000;
    border-radius: 26px 0 0 26px;
}

/* Hero */
.hero {
    height: 25vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 600px) {
    .hero {
        height: 10vh;
    }
}

.hero h1 {
    font-size: 3rem;
    color: #e28003;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* Contenu */

.content {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    text-align: center;
    border-radius: 6px;
    background-color:rgba(255, 255, 255, 0.6);
}

/* Formulaire Contact */

.contact-form {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    border-radius: 6px;
    background-color:rgba(255, 255, 255, 0.6);
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    margin-bottom: 8px;
}

input,
textarea {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    resize: none;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #e28003;
    box-shadow: 0 0 0 2px rgba(255, 127, 0, 0.2);
}

.btn-submit {
    background-color: #e28003;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-submit:hover {
    background-color: #c0a37e;
}

.btn-submit:hover:not(:disabled) {
    background-color: #c96f02;
}

.btn-submit:active:not(:disabled) {
    background-color: #a85d02;
    transform: scale(0.98);
}

.btn-submit:disabled {
    background-color: #bfbfbf;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 600;
    display: none;
}

.form-message.success {
    background-color: #e8f8e8;
    color: #4ba7f3;
    border: 1px solid #4ba7f3;
}

.form-message.error {
    background-color: #ffe8e8;
    color: #750505;
    border: 1px solid #750505;
}

.honeypot {
    display: none;
}

/* Grid Catalogue */

/* Grille (desktop) */

.saga-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px 0;
    padding: 20px 0;
    column-gap: 20px;
}

/* Cartes 3x2 */

.book-card {
    width: 31.5%;
    aspect-ratio: 3 / 4;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
}

/* Faces Supperposées */

.face {
    position: absolute;
    height: 100%;
    inset: 0;
    transition: opacity 0.4s ease;
}

.front {
    opacity: 1;

    backface-visibility: hidden;
}

.front img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.back {
    opacity: 0;
    background: #fafafa;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    visibility: hidden;
    height: 100%;
    z-index:0;
}

/* Contenu Face Arrière */

.back-content {
    position: relative;
    z-index: 2;
}

.back-content h3 {
    margin-top: 0;
    margin-bottom: 0.6rem;
    font-size: 1.4rem;
}

.back-content p {
    font-size: 1.05rem;
    line-height: 1.45;
}

/* Watermark Du Logo */

.logo-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    transform: translate(-50%, -50%);
    opacity: 0.2;
    z-index: 1;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Flip */

.book-card:hover .front {
    opacity: 0;
}

.book-card:hover .back {
    opacity: 1;
    visibility: visible;
}

/* Responsive Mobile */

@media (max-width: 700px) {
    .book-card {
        width: 100%;
        aspect-ratio: 3 / 4;
    }
}

/* Page Cartes */

.cartes-wrapper {
  display: inline-block;
  overflow-x: auto;
  padding: 1rem 0;
  min-width: 320px;
  display: flex;
  justify-content: center;
  background: url("../images/Fondcartes.svg") center/contain no-repeat;
}

.cartes-grid {
  display: grid;
  grid-template-columns: repeat(3, 250px);
  grid-template-rows: repeat(6, 250px);
  gap: 0.55rem;
  margin: 0 auto;
}

/* Cases */
.carte-ville {
  background: #fafafa;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carte-ville svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  overflow: hidden;
}

#liencartes {
    color: #ca3e3e;
}

/* Cases Vides */
.carte-vide {
  background: transparent;
  pointer-events: none;
}

/* Responsive Réduiction Taille Cases */

@media (max-width: 900px) {
  .cartes-grid {
    grid-template-columns: repeat(3, clamp(100px, 20vw, 150px));
    grid-template-rows: repeat(6, clamp(100px, 20vw, 150px));
  }
}

@media (max-width: 600px) {
  .cartes-grid {
    grid-template-columns: repeat(3, clamp(80px, 25vw, 120px));
    grid-template-rows: repeat(6, clamp(80px, 25vw, 120px));
  }
}

.pointerelement {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.25s ease;
  cursor: pointer;
}

.pointerelement:hover {
  transform: scale(1.1);
}

.pointerelement svg {
  overflow: visible;
}

.ville-label {
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.carte-ville svg {
  overflow: visible;
}

.pointerelement:hover .ville-label {
  opacity: 1;
}

.point-ville {
  position: relative;
  pointer-events: none;
}

.point-ville svg {
  width: 20%;
  min-width: 40px;
  height: auto;
}

 /* points tablette */
@media (max-width: 900px) {
  .point-ville svg {
    width: 26%;
    min-width: 35px;
  }
}

/* points mobile */
@media (max-width: 600px) {
  .point-ville svg {
    width: 26%;
    min-width: 40px;
  }
}

@media (max-width: 600px) {
  #flondre .point-label {
    transform: translate(-80%, 0.1em);
  }

  #buri .point-label {
    transform: translate(-10%, -5em);
  }

  #lauseclair .point-label {
    transform: translate(-10%, -5em);
  }
  #rinanth .point-label {
    transform: translate(-130%, -2.3em);
  }
}

.point-circle {
  pointer-events: auto;
  transform-origin: center;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.point-circle:hover {
  transform: scale(1.1);
}

.point-circle:hover + .point-label {
  opacity: 1;
}

.point-label {
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

#calaudrem svg {
  position: absolute;
  top: 20%;
  left: -4%;
}

#flondre svg {
  position: absolute;
  top: 52%;
  left: 68%;
}

#buri svg {
  position: absolute;
  top: 60%;
  left: 36%;
}

#lauseclair svg {
  position: absolute;
  top: 52%;
  left: -4%;
}

#roeracity svg {
  position: absolute;
  top: 36%;
  left: 20%;
}

#rinanth svg {
  position: absolute;
  top: 32%;
  left: 72%;
}

/* Page Distribution */

.liendistrib {
  color: #ca3e3e;
}

/* Footer */

.site-footer {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    padding: 10px;
    background: #e28003;
    margin-top: 40px;
	color: black;
}

/* Réseaux */

.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

.social-links a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: white;
    border: 3px solid black;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    font-size: 18px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-links a:hover {
    transform: scale(1.12);
    opacity: 0.8;
}

.social-links a img {
    width: 20px;
    height: 20px;
}