/*
Theme Name: Home as Territory
Theme URI: 
Author: 
Description: Un thème minimaliste pour afficher des cartes organisées par catégories
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: home-as-territory
*/

:root {
    --card-width: 192px;
    --card-height: 96px;
    --card-padding: 8px;
    --transition-speed: 0.2s;
    --global-scale: 0.8;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: Arial, sans-serif;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('img/back_river.gif');
    background-size: auto;
    background-repeat: no-repeat;
    background-position: left center;
    transform: translateY(-50%);
    z-index: -1;
    transition: background-position 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animation de flottement */
@keyframes float {
    0% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-15px);
    }
    100% {
        transform: translateX(-50%) translateY(0);
    }
}

/* Nouveau fond pour le deuxième écran */
body::after {
    display: none;
    content: '';
    position: fixed;
    top: 0;
    left: 50%;
    width: 100%;
    height: 100%;
    background-image: url('img/back_infobulle.gif');
    background-size: 90%;
    background-repeat: no-repeat;
    background-position: center top;
    transform: translateX(-50%);
    opacity: 0;
    z-index: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Ajuster la position de l'image quand on est sur le deuxième écran */
body.second-screen::before {
    background-position: right center;
}

/* Afficher le nouveau fond sur le deuxième écran */
body.second-screen::after {
    opacity: 1;
    animation: float 6s ease-in-out infinite;
}

/* Header styles */
.site-header {
    display: none;
}

/* Main content */
.cards-container {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: nowrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    overflow-x: auto;
}

.category-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

/* Styles pour la colonne Assets */
.assets-column {
    display: flex;
    flex-direction: column;
    width: calc(var(--card-width) * 2 + 10px);
}

/* Ajuster la largeur de la colonne Assets sur le deuxième écran */
.main-content .assets-column {
    width: calc(var(--card-width) * 0.75 * 2 + 10px);
}

.assets-column .category-header {
    width: 100%;
}

/* Conteneur pour les cartes Assets */
.assets-column::after {
    content: '';
    display: block;
    clear: both;
}

/* Conteneur pour les cartes */
.assets-column .cards-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.assets-column .card {
    width: var(--card-width);
    height: var(--card-height);
    margin: 0;
}

/* Ajuster les courbes pour la colonne Assets */
.assets-column + .category-column .category-curve {
    width: 340px;
}

/* Courbe avant Assets */
.category-column:has(+ .assets-column) .category-curve {
    width: 340px;
}

/* Courbe de la dernière colonne */
.category-column:last-child .category-curve {
    width: 180px;
}

.category-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
}

.category-icon {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    stroke: currentColor;
}

.category-icon svg * {
    fill: currentColor;
    stroke: currentColor;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-info {
    position: relative;
    display: block;
    text-align: center;
}

.category-info h2 {
    position: relative;
    margin: 0;
    padding-right: 10px;
    display: inline-block;
}

.category-subtitle {
    margin: 3px 0 0 0;
    font-size: 0.72em;
    line-height: 1.3;
    display: block;
}

.card {
    color: #fff;
    width: var(--card-width);
    height: var(--card-height);
    border-radius: 15px;
    padding: var(--card-padding);
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    cursor: pointer;
}

.card:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.card-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    overflow: hidden;
}

.card:hover .card-preview {
    opacity: 1;
}

.card-preview img,
.card-preview canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 2/1;
    display: block;
}

.card-preview.pdf-preview {
    background: #f5f5f5;
    padding: 0;
}

.card-preview.pdf-preview canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 2/1;
    display: block;
}

.card h3 {
    margin: 0;
    padding: 0;
    text-align: left;
    position: relative;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.card:hover h3 {
    opacity: 0;
}

#pdf-canvas,.lightbox-file img {
    border-radius: 28px;
}

/* Lightbox styles */
.lightbox {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 5vh;
    backdrop-filter: blur(0px);
}

.lightbox.active {
    opacity: 1;
    backdrop-filter: blur(8px);
}

.lightbox-content {
    position: relative;
    width: 80%;
    max-width: 80vw;
    margin: 0;
    border-radius: 30px;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox.active .lightbox-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    right: -6px;
    top: -6px;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    color: white;
    z-index: 1001;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
}

.lightbox-close:hover {
    background: rgba(0,0,0,0.9);
    transform: rotate(90deg);
}

.lightbox-file {
    background: white;
    padding: 20px;
    border-radius: 30px 30px 0 0;
    margin-bottom: 10px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Style spécifique pour les cartes d'introduction */
.introduction-column .card ~ .lightbox .lightbox-file,
.lightbox[data-category="introduction"] .lightbox-file {
    border-radius: 30px;
}

.lightbox.active .lightbox-file {
    transform: translateY(0);
    opacity: 1;
}

.lightbox-file img,
.lightbox-file canvas,
.lightbox-file .pdf-preview {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: scale(1);
}

.lightbox-file.sliding img,
.lightbox-file.sliding canvas,
.lightbox-file.sliding .pdf-preview {
    opacity: 0;
    transform: scale(0.95);
}

.related-cards {
    background: white;
    padding: 20px;
    border-radius: 0 0 30px 30px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);

}

.lightbox.active .related-cards {
    transform: translateY(0);
    opacity: 1;
}

.related-cards h3 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
}

.related-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.related-cards-grid .card {
    width: 100%;
    height: 80px;
    padding: 8px;
}

.related-cards-grid .card h3 {
    font-size: 0.9em;
    line-height: 1.2;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.8);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    z-index: 1001;
    opacity: 1;
    visibility: visible;
}

.lightbox-nav.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.lightbox-nav:hover {
    background: rgba(0,0,0,0.9);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: -18px;
}

.lightbox-next {
    right: -18px;
}

.lightbox-nav svg {
    width: 18px;
    height: 18px;
}

.category-column:last-child {
    margin-left: 0;
}

.main-content .category-column:last-child {
    margin-left: 60px;
}

.category-column:last-child .category-info h2::after {
    display: none;
}

.category-curve {
    display: block;
    margin: -24px auto 0 auto;
    color: var(--category-color);
    max-width: 90%;
    height: auto;
    pointer-events: none;
    position: absolute;
    top: 10px;
    left: 70%;
}

.lightbox-category {
    width: 100%;
    text-align: right;
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 4em;
    margin-bottom: -40px;
    margin-top: 0;
    margin-right: 24%;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    transform: translateY(40px);
    transition:
        opacity 0.7s cubic-bezier(.22,1,.36,1) 0.3s,
        transform 0.9s cubic-bezier(.22,1,.36,1) 0.3s;
    visibility: hidden;
}

.lightbox-category.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.category-column:nth-last-child(2) .category-curve {
    width: 180px;
    max-width: none;
}

@media (max-width: 700px) {
    .lightbox-content {
        width: 98vw;
        max-width: 98vw;
        font-size: 0.95em;
        border-radius: 18px;
        padding: 8px;
    }
    .lightbox-category {
        font-size: 2em;
        margin-right: 0;
        padding-right: 0;
        margin-bottom: -10px;
    }
    .lightbox {
        padding: 0;
    }
}

/* Page d'accueil */
.front-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 4rem;
    gap: 4rem;
}

.front-page.slide-out {
    transform: translateX(-100%);
}

.front-content {
    text-align: left;
    padding: 2rem;
    max-width: 600px;
}

.introduction-column {
    width: var(--card-width);
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-right: 60px;
}

.introduction-column .category-header {
    margin-bottom: 12px;
}

.introduction-column .category-info h2 {
    font-size: 1.2em;
    color: #4b87c7;
}

.introduction-column .category-subtitle {
    font-size: 0.8em;
    color: #4b87c7;
}

.introduction-column .card {
    background-color: #4b87c7;
    color: white;
    transition: all 0.3s ease;
}

.introduction-column .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(75, 135, 199, 0.3);
}

.introduction-column .category-curve {
    display: none;
}

.explore-column {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 2rem;
    margin-right: -2rem;
}

.enter-button {
    position: relative;
    cursor: pointer;
    z-index: 100;
    opacity: 1;
    outline: none;
    border: none;
    background: none;
    padding: 0;
    color: #4b87c7;
    animation: bounceRight 1.5s infinite;
}

.enter-button:hover {
    background: none;
    transform: none;
}

.enter-button svg {
    width: 32px;
    height: 32px;
}

.enter-button svg path {
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke: #4b87c7;
}

@keyframes bounceRight {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
}

.site-logo {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.site-logo img {
    width: 100%;
    height: auto;
    display: block;
}

.site-description {
    font-size: 1.2rem;
    color: #4a87c7;
    margin-bottom: 3rem;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    font-weight: bold;
}

/* Contenu principal */
.main-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translateX(100%);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    z-index: 1;
}

.main-content.slide-in {
    transform: translateX(0);
}

/* Ajuster le conteneur de cartes pour le défilement horizontal */
.cards-container {
    margin-top: 120px; /* Augmentation de la marge depuis le header */
    height: calc(100% - 120px);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2rem;
}

/* Masquer la barre de défilement tout en gardant la fonctionnalité */
.cards-container::-webkit-scrollbar {
    display: none;
}

.cards-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Flèche de retour */
.back-arrow {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
    animation: bounceLeft 1.5s infinite;
    outline: none;
    border: none;
    background: none;
    padding: 0;
    color: #4b87c7;
}

.back-arrow.visible {
    opacity: 1;
}

.back-arrow svg {
    width: 32px;
    height: 32px;
    transform: rotate(180deg);
}

.back-arrow svg path {
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke: #4b87c7;
}

@keyframes bounceLeft {
    0%, 100% {
        transform: translateY(-50%) translateX(0);
    }
    50% {
        transform: translateY(-50%) translateX(10px);
    }
}

/* Styles pour les cartes non liées */
.card.non-related-card {
    filter: grayscale(100%) brightness(1);
    opacity: 0.1;
    transition: all 0.3s ease;
    cursor: not-allowed;
}

.card.non-related-card .card-preview {
    filter: none;
}

/* Suppression des anciens styles */
.card[data-category="stories"]:hover ~ .card,
.card[data-category="stories"]:hover {
    border: none;
    box-shadow: none;
}

.category-column:has(.card[data-category="stories"]:hover) .card {
    border: none;
    box-shadow: none;
}

.introduction-column .card:first-child {
    position: relative;
    animation: pulseCard 2s infinite;
}

.introduction-column .card:first-child::after {
    display: none;
}

@keyframes pulseCard {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(75, 135, 199, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(75, 135, 199, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(75, 135, 199, 0);
    }
}

/* Classe pour désactiver l'animation après le premier clic */
.introduction-column .card:first-child.clicked {
    animation: none;
}

/* Animation pour l'image start-here */
@keyframes fadeInOut {
    0%, 57% { opacity: 0; }
    60% { opacity: 1; }
    95% { opacity: 1; }
    100% { opacity: 0; }
}

.start-here-image {
    position: relative;
    top: 0px;
    left: 30%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeInOut 4s infinite 2.5s;
    z-index: 10;
    width: 45px;
    height: auto;
}

/* Réduction de la taille des cartes sur le deuxième écran */
.main-content .card {
    width: calc(var(--card-width) * 0.75);
    height: calc(var(--card-height) * 0.75);
    padding: calc(var(--card-padding) * 0.75);
}

.main-content .card h3 {
    font-size: 0.85em;
    line-height: 1.2;
}

/* Ajuster la taille des cartes liées dans la lightbox */
.related-cards-grid .card {
    width: calc(var(--card-width) * 0.75);
    height: calc(var(--card-height) * 0.75);
    padding: calc(var(--card-padding) * 0.75);
}

.related-cards-grid .card h3 {
    font-size: 0.85em;
    line-height: 1.2;
}

/* Réduction de la taille des en-têtes de catégorie sur le deuxième écran */
.main-content .category-header {
    margin-bottom: 8px;
    gap: 6px;
}

.main-content .category-icon {
    width: 26px;
    height: 26px;
}

.main-content .category-info h2 {
    font-size: 1.2em;
}

.main-content .category-subtitle {
    font-size: 0.65em;
    margin-top: 2px;
}

/* Schéma courbe et bulles (deuxième écran) */
.schema-curve-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    min-width: 1400px;
    height: 480px;
    pointer-events: none;
    z-index: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.schema-curve {
    position: absolute;
    left: 0;
    top: 40px;
    width: 100vw;
    min-width: 1400px;
    height: 840px;
    pointer-events: none;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-30%);
    opacity: 0;
}

/* Ajuster la position du schéma quand on est sur le deuxième écran */
body.second-screen .schema-curve-container {
    opacity: 1;
    transform: translateX(0%);
}

body.second-screen .schema-curve {
    transform: translateX(0%);
    opacity: 1;
}

/* Styles pour les courbes */
.schema-curve path.cls-1 {
    fill: url(#bubblePattern);
    opacity: 1;
}

.schema-curve text {
    font-family: Arial, sans-serif;
    font-weight: bold;
    opacity: 1;
    padding: 5px;
}
.schema-curve text[x="180"] {
    font-size: 1.1em;
}
.schema-curve text[x="480"] {
    font-size: 1.4em;
}
.schema-curve text[x="800"] {
    font-size: 1.1em;
}
@media (max-width: 900px) {
    .schema-curve-container, .schema-curve {
        height: 320px;
    }
    .bubble-houses { left: 20px; top: 220px; min-width: 120px; padding: 16px 24px; }
    .bubble-capacity { left: 40px; top: 120px; min-width: 130px; padding: 16px 24px; }
    .bubble-autonomy { right: 10px; top: 20px; min-width: 160px; padding: 16px 24px; }
}

/* Animation de flottement */
@keyframes floating {
    0% {
        transform: translate(var(--x, 0), var(--y, 0));
    }
    50% {
        transform: translate(var(--x, 0), calc(var(--y, 0) - 12px));
    }
    100% {
        transform: translate(var(--x, 0), var(--y, 0));
    }
}

.floating {
    animation: floating 3s ease-in-out infinite;
    transform-origin: center;
} 