/* ============================================================
   Les Pierres de la Paix — Cercle Sacre
   Light theme — lumineux, blanc, paix
   ============================================================ */

/* --- Container & Canvas --- */

.pdp-cercle-container {
    position: relative;
    width: 100vw !important;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 80vh;
    min-height: 500px;
    background: linear-gradient(180deg, #f0ece3 0%, #ddd5c5 50%, #c8bea8 100%);
    overflow: hidden;
    box-sizing: border-box;
}

#pdp-cercle-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific */
    .pdp-cercle-container {
        -webkit-overflow-scrolling: touch;
    }
}

/* --- Hover label --- */

.pdp-hover-label {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 24px;
    background: rgba(255, 255, 255, 0.9);
    color: #8B6914;
    font-family: 'Georgia', serif;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    border: 1px solid rgba(139, 105, 20, 0.3);
    border-radius: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.pdp-hover-label.visible {
    opacity: 1;
}

/* --- Session button --- */

.pdp-session-btn {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 32px;
    background: linear-gradient(135deg, #ffd700 0%, #DAA520 100%);
    color: #3a2e0a;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 28px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(218, 165, 32, 0.3);
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.pdp-session-btn:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 30px rgba(218, 165, 32, 0.5);
}

/* --- Fiche Panel --- */

.pdp-fiche-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 100%;
    background: rgba(255, 255, 255, 0.96);
    border-left: 1px solid rgba(139, 105, 20, 0.15);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 20;
    padding: 0;
    box-shadow: -4px 0 20px rgba(0,0,0,0.08);
}

.pdp-fiche-panel.open {
    transform: translateX(0);
}

.pdp-fiche-close {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.98);
    color: #8B6914;
    font-family: 'Georgia', serif;
    font-size: 0.95rem;
    border: none;
    border-bottom: 1px solid rgba(139, 105, 20, 0.1);
    cursor: pointer;
    text-align: left;
    z-index: 21;
    transition: background 0.2s ease;
}

.pdp-fiche-close:hover {
    background: rgba(255, 248, 220, 0.9);
}

.pdp-fiche-content {
    padding: 24px 20px 40px;
}

/* --- Fiche Photo --- */

.pdp-fiche-photo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.pdp-fiche-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #DAA520;
    box-shadow: 0 0 24px rgba(218, 165, 32, 0.2);
    cursor: zoom-in;
}

/* --- Fiche Text --- */

.pdp-fiche-nom {
    color: #8B6914;
    font-family: 'Georgia', serif;
    font-size: 1.5rem;
    text-align: center;
    margin: 0 0 8px;
}

.pdp-fiche-description {
    color: #555;
    font-size: 0.95rem;
    text-align: center;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* --- Fiche Details Grid --- */

.pdp-fiche-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.pdp-fiche-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pdp-fiche-label {
    color: #a08040;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pdp-fiche-value {
    color: #333;
    font-size: 0.95rem;
}

/* --- Temoignages --- */

.pdp-fiche-temoignages h3 {
    color: #8B6914;
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(139, 105, 20, 0.15);
}

.pdp-fiche-temoignages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.pdp-temoignage-item {
    padding: 12px;
    background: rgba(255, 248, 220, 0.5);
    border-radius: 8px;
    border-left: 2px solid #DAA520;
}

.pdp-temoignage-item .temoignage-text {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 6px;
}

.pdp-temoignage-item .temoignage-meta {
    color: #a08040;
    font-size: 0.75rem;
}

.pdp-fiche-temoignages-empty {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

/* --- Historique --- */

.pdp-fiche-historique-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: transparent;
    color: #8B6914;
    font-size: 0.9rem;
    border: 1px solid rgba(139, 105, 20, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 12px;
}

.pdp-fiche-historique-btn:hover {
    background: rgba(255, 248, 220, 0.5);
}

.pdp-fiche-historique {
    display: none;
}

.pdp-fiche-historique.open {
    display: block;
}

.pdp-historique-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: #666;
    font-size: 0.85rem;
}

.pdp-historique-item .historique-annee {
    color: #8B6914;
    font-weight: 700;
    margin-right: 8px;
}

/* --- Loading spinner --- */

.pdp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8B6914;
    font-size: 0.9rem;
    padding: 20px;
}

.pdp-loading::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid rgba(139, 105, 20, 0.2);
    border-top-color: #8B6914;
    border-radius: 50%;
    animation: pdp-spin 0.8s linear infinite;
    margin-right: 10px;
}

@keyframes pdp-spin {
    to { transform: rotate(360deg); }
}

/* --- Navigation arrows (on 3D scene) --- */

.pdp-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(139, 105, 20, 0.3);
    color: #8B6914;
    font-size: 36px;
    line-height: 1;
    width: 50px;
    height: 70px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.pdp-arrow:hover {
    background: rgba(255, 248, 220, 0.9);
    border-color: #DAA520;
}
.pdp-arrow-prev { left: 16px; }
.pdp-arrow-next { right: 416px; }
.pdp-arrow.visible { display: block; }

/* ============================================================
   Responsive — Tablet (iPad portrait/landscape)
   ============================================================ */

@media (max-width: 1024px) {
    .pdp-fiche-panel {
        width: 350px;
    }

    .pdp-arrow-next { right: 366px; }
}

/* ============================================================
   Responsive — Mobile bottom sheet
   ============================================================ */

@media (max-width: 768px) {
    .pdp-cercle-container {
        height: 70vh;
        min-height: 400px;
    }

    .pdp-fiche-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 60%;
        border-left: none;
        border-top: 1px solid rgba(139, 105, 20, 0.15);
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .pdp-fiche-panel.open {
        transform: translateY(0);
    }

    .pdp-fiche-photo {
        width: 120px;
        height: 120px;
    }

    .pdp-fiche-nom {
        font-size: 1.25rem;
    }

    .pdp-fiche-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .pdp-hover-label {
        font-size: 1rem;
    }

    .pdp-session-btn {
        bottom: 16px;
        padding: 10px 24px;
        font-size: 0.9rem;
    }

    .pdp-arrow-next { right: 16px; }
    .pdp-arrow {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 12px;
        transform: none;
        border-radius: 50%;
    }
    .pdp-arrow-prev { left: 12px; }
    .pdp-arrow-next { right: 12px; }
}

/* --- Photo zoom overlay --- */

.pdp-photo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: zoom-out;
}

.pdp-photo-overlay img {
    max-width: 80vw;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(218,165,32,0.3);
    pointer-events: none;
}

.pdp-photo-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255,255,255,0.9);
    border: none;
    color: #333;
    font-size: 20px;
    line-height: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdp-photo-close:hover {
    background: #fff;
}

/* ── Temoignages section (below 3D circle, server-rendered) ── */

.pdp-temoignages-section {
    max-width: 700px;
    margin: 40px auto;
    padding: 0 20px;
}

.pdp-temoignages-section h3 {
    font-family: 'Georgia', serif;
    color: #8B6914;
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 24px;
}

.pdp-temoignage-card {
    background: #fff;
    border-left: 3px solid #DAA520;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.pdp-temoignage-text {
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
    margin: 0 0 12px;
    font-style: italic;
    white-space: pre-line;
}

.pdp-temoignage-footer {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: #999;
}

.pdp-temoignage-gardien {
    color: #8B6914;
    font-weight: 600;
}

.pdp-temoignage-pierre {
    color: #666;
}

.pdp-temoignage-annee {
    color: #999;
}

/* ── iPad/tablet landscape ── */

@media (min-width: 768px) and (orientation: landscape) {
    .pdp-cercle-container {
        height: 100vh;
        min-height: 400px;
    }
    .pdp-fiche-panel {
        width: 45%;
        max-width: 450px;
    }
    .pdp-arrow-next {
        right: calc(45% + 16px);
    }
}

@media (min-width: 1024px) and (orientation: landscape) {
    .pdp-cercle-container {
        height: 100vh;
        min-height: 500px;
    }
}

/* ── Scroll hint arrow ── */

.pdp-scroll-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    cursor: pointer;
    animation: pdp-bounce 2s ease infinite;
}

.pdp-scroll-arrow {
    font-size: 28px;
    color: rgba(139, 105, 20, 0.5);
    line-height: 1;
}

.pdp-scroll-hint:hover .pdp-scroll-arrow {
    color: #8B6914;
}

@keyframes pdp-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}

/* ========================================================================
   Search overlay
   ======================================================================== */

.pdp-search-wrapper {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 320px;
    max-width: calc(100% - 40px);
    z-index: 10;
    pointer-events: none;
}

.pdp-search-input,
.pdp-search-clear {
    pointer-events: auto;
}

/* Override du theme Astra (input[type=text] { color:#666; background:... })
   qui a une specificite equivalente a notre classe. On prefixe avec input
   et on met !important sur les proprietes cles pour garantir l'override. */
input.pdp-search-input,
.pdp-search-input {
    width: 100% !important;
    padding: 10px 38px 10px 38px !important;
    border: 1px solid rgba(218, 165, 32, 0.4) !important;
    background-color: rgba(0, 0, 0, 0.55) !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.75)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: 12px center !important;
    color: #fff !important;
    border-radius: 20px !important;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box !important;
    height: auto !important;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: border-color 200ms ease;
}

input.pdp-search-input::placeholder,
.pdp-search-input::placeholder {
    color: rgba(255, 255, 255, 0.75) !important;
    opacity: 1 !important;
}

input.pdp-search-input:focus,
.pdp-search-input:focus {
    color: #fff !important;
    border-color: rgba(218, 165, 32, 0.9) !important;
    outline: 2px solid rgba(218, 165, 32, 0.8) !important;
    outline-offset: 2px !important;
}

.pdp-search-clear {
    position: absolute;
    right: 10px;
    top: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    display: none;
    padding: 0;
    line-height: 1;
}

.pdp-search-clear.visible {
    display: block;
}

.pdp-search-clear:hover {
    color: #fff;
}

.pdp-search-count {
    margin-top: 6px;
    padding-left: 14px;
    text-align: left;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    min-height: 16px;
    pointer-events: none;
}

/* Bande a droite : laisse passer le scroll de page.
   Visible tres legerement sur desktop pour que l'utilisateur la trouve,
   totalement transparente sur mobile. */
.pdp-scroll-gutter {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60px;
    z-index: 5;
    background: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.04) 100%);
    pointer-events: auto;
    touch-action: pan-y;
    cursor: ns-resize;
}

@media (max-width: 480px) {
    .pdp-search-wrapper {
        top: 10px;
        left: 10px;
        max-width: calc(100% - 60px);
    }
    input.pdp-search-input,
    .pdp-search-input {
        padding: 9px 34px 9px 36px !important;
        font-size: 13px !important;
    }
    /* Sur mobile la bande reste totalement transparente, elle est ressentie
       par le doigt via touch-action, pas visuellement. */
    .pdp-scroll-gutter {
        width: 40px;
        background: transparent;
        cursor: default;
    }
}
