@font-face {
    font-family: 'Poppins-ExtraLight';
    src: url('Poppins-ExtraLight/Poppins-ExtraLight.ttf.woff') format('woff'),
    url('Poppins-ExtraLight/Poppins-ExtraLight.ttf.svg#Poppins-ExtraLight') format('svg'),
    url('Poppins-ExtraLight/Poppins-ExtraLight.ttf.eot'),
    url('Poppins-ExtraLight/Poppins-ExtraLight.ttf.eot?#iefix') format('embedded-opentype');
    font-weight: normal;
    font-style: normal;
}

/* open-sans-regular - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400;
    src: url('./fonts/open-sans-v44-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* open-sans-700 - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 700;
    src: url('./fonts/open-sans-v44-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* open-sans-800 - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 800;
    src: url('./fonts/open-sans-v44-latin-800.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

:root {
    --bg-color: #000000;
    --bg-glow: #101010;
    --panel-color: transparent;
    --text-color: #e0e0dd;
    --muted-text: #aaaaaa;
    --accent-color: #8a8178;
    --border-color: #2a2a2a;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --skeleton-base: #1c1c1c;
    --skeleton-highlight: #242424;
    --font-serif: serif;
    --font-sans: Open Sans, Poppins-ExtraLight, sans-serif;
}

body {
    background-color: var(--bg-glow);
    color: var(--text-color);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header & Lang Switch --- */
header {
    padding: 40px 40px 20px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.locale-switch {
    position: absolute;
    top: 40px;
    right: 40px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    cursor: pointer;
    letter-spacing: 1px;
}

.locale-switch .active {
    font-weight: 600;
    text-decoration: underline;
}

h1 {
    text-align: center;
    margin: 0;
}

.title-img {
    max-height: 160px;
    width: auto;
    display: block;
}

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


a:hover {
    color: var(--accent-color);
}

input {
    color: var(--text-color);
}

/* --- Main Container --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0;
    width: 100%;
    box-sizing: border-box;
}

/* --- Project 3-column layout --- */
.container:has(.project-layout) {
    max-width: 1850px;
}

.project-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1850px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.project-col {
    display: none;
}

@media (min-width: 1200px) {
    .project-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 40px;
    }

    .project-col {
        display: block;
        flex: 0 0 280px;
    }

    .project-col-left {
        order: -1;
        padding-top: 340px;
    }

    .project-col-right {
        order: 1;
        padding-top: 270px;
    }

    .project-layout .text-page {
        flex: 1;
        min-width: 0;
    }
}

.project-photo {
    margin: 0 0 30px 0;
}

.project-photo img {
    width: 100%;
    height: auto;
    display: block;
}

.project-photo figcaption, .project-photo div {
    font-size: 1rem;
    color: var(--text-color);
    margin: 12px 0;
    text-align: center;
    white-space: pre-line;
}

/* Photos shown below text on small screens, hidden on desktop */
.project-photos-mobile {
    margin: 40px auto;
    max-width: 360px;
}

@media (min-width: 1200px) {
    .project-photos-mobile {
        display: none;
    }
}

/* --- Text Pages (Contact / Project) --- */
.text-page {
    text-align: left;
    margin-top: 40px;
    font-size: 1.2rem;
}

.text-page p {
    margin-bottom: 1.2em;
}

.text-page h2 {
    font-style: italic;
    font-weight: 400;
    font-size: 2rem;
    margin-bottom: 30px;
}

.text-page h3 {
    font-style: italic;
    font-weight: 400;
    font-size: 1.5rem;
    margin-top: 40px;
    margin-bottom: 20px;
}

.contact-link {
    font-size: 1.5rem;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 5px;
}

/* --- Selector Section --- */
.search-section {
    text-align: center;
    margin-bottom: 50px;
    width: 100%;
}

.cta-title {
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--muted-text);
    font-weight: 600;
}

.date-inputs {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: baseline;
    flex-wrap: wrap;
}

/* Styles pour les nouveaux inputs date (remplace select) */
.date-input {
    font-family: var(--font-sans);
    font-size: 2rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--text-color);
    padding: 5px 0;
    color: var(--text-color);
    text-align: center;
    width: 100px; /* Taille fixe et équilibrée */
    appearance: textfield; /* Standard */
    -moz-appearance: textfield; /* Firefox */
    font-weight: 600;
}

/* Cache les flèches up/down des inputs number */
.date-input::-webkit-outer-spin-button,
.date-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.date-input:focus {
    outline: none;
    border-bottom: 2px solid var(--accent-color);
}

.date-input::placeholder {
    color: rgba(224, 224, 221, 0.3);
    font-size: 1.5rem;
}

.date-cta {
    font-size: 1.2rem;
    color: var(--text-color);
    text-align: center;
    margin-top: -50px;
    margin-bottom: 50px;
}

/* Animation d'erreur (Flash Rouge) */
@keyframes shake-red {
    0%, 100% {
        border-bottom-color: var(--text-color);
        color: var(--text-color);
        transform: translateX(0);
    }
    20% {
        border-bottom-color: #ff4444;
        color: #ff4444;
        transform: translateX(-5px);
    }
    40% {
        border-bottom-color: #ff4444;
        color: #ff4444;
        transform: translateX(5px);
    }
    60% {
        border-bottom-color: #ff4444;
        color: #ff4444;
        transform: translateX(-5px);
    }
    80% {
        border-bottom-color: #ff4444;
        color: #ff4444;
        transform: translateX(5px);
    }
}

.input-error {
    animation: shake-red 0.6s ease-in-out;
}

/* --- Intro Text --- */
.intro-text {
    text-align: center;
    max-width: 700px;
    color: var(--text-color);
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: 0.85rem;
    white-space: pre-line;
}

.intro-text p {
    margin: 0;
}

.intro-preview {
    font-size: 0.95rem;
}

.intro-invitation.intro-invitation {
    font-weight: 700;
    color: var(--text-color);
    margin-top: 16px;
}

.intro-question {
    font-weight: 700;
    color: var(--text-color);
    margin-top: 16px;
}

/* --- Message CTA Label --- */
.message-cta {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    text-transform: none !important;
    color: var(--text-color) !important;
    white-space: pre-line;
    line-height: 1.5 !important;
}

/* --- Triptych View --- */
#display-area {
    width: 100%;
    position: relative;
}

#display-area.active {
    min-height: 300px;
    margin-bottom: 60px;
}

.triptych {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    opacity: 0;
    transition: opacity 1s ease;
}

.triptych.visible {
    opacity: 1;
}

.triptych-label {
    text-align: center;
    margin-top: 10px;
}

.triptych-hint {
    font-style: italic;
    font-size: 0.8rem;
    text-align: right;
    position: relative;
    width: 300px;
    height: 0;
    overflow: visible;
    white-space: nowrap;
}

.pano-hint-arrow {
    display: inline-block;
    vertical-align: middle;
    margin-left: 5px;
    opacity: 0.5;
    position: absolute;
    bottom: 0;
    right: -33px;
}

.frame {
    background: var(--panel-color);
    box-shadow: 0 6px 18px var(--shadow-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
}

.frame img, .frame iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Panorama viewer (Photo Sphere Viewer) */
#pano-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#pano-viewer {
    width: 100%;
    height: 100%;
}

.pano-credit {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.pano-fallback {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    font-style: italic;
    background: var(--panel-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.pano-fallback a {
    text-decoration: underline;
    color: var(--accent-color);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-top: 8px;
}

/* Map section (below triptych) */
#map-section {
    width: 100%;
    margin-top: 20px;
    margin-bottom: 10px;
}

#map-container {
    width: 100%;
    height: 200px;
}

/* --- Loading State --- */
.loading-placeholder {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    pointer-events: none;
    width: 960px;
}

.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#loading-text {
    background: rgba(18, 18, 18, 0.95);
    padding: 15px 30px;
    border: 1px solid var(--accent-color);
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.3rem;
    color: var(--text-color);
    min-width: 280px;
    text-align: center;
    box-shadow: 0 6px 20px var(--shadow-color);
    animation: fadeInOut 0.8s ease-in-out;
}

@keyframes fadeInOut {
    0% {
        opacity: 0.5;
        transform: translateY(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.skeleton {
    height: 300px;
    background: var(--skeleton-base);
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        background-color: var(--skeleton-base);
    }
    50% {
        background-color: var(--skeleton-highlight);
    }
    100% {
        background-color: var(--skeleton-base);
    }
}

/* --- Not Found --- */
.not-found-message {
    text-align: center;
    font-size: 1.4rem;
    padding: 40px;
    border: 1px dashed var(--border-color);
    font-style: italic;
}

/* --- Quote --- */
.quote-display {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 10px;
    display: none;
}

.quote-display.visible {
    display: block;
}

.quote-text {
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 10px;
}

.quote-author {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* --- Save Section --- */
#save-section {
    width: 100%;
    max-width: 600px;
    /*border-top: 1px solid var(--border-color);*/
    padding-top: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    transition-behavior: allow-discrete; /* Allows animating display */
    pointer-events: none;
    display: none; /* Hide from layout initially */
}

#save-section.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    display: block; /* Show in layout */
}

/* Defines the starting state for the enter animation */
@starting-style {
    #save-section.active {
        opacity: 0;
        transform: translateY(20px);
    }
}

.save-header {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-style: italic;
    margin-bottom: 20px;
    text-align: center;
}

.save-form {
    display: flex;
    flex-direction: column;
}

.save-form > .input-group {
    margin-top: 20px;
}

.save-form > .input-group:first-child {
    margin-top: 0;
}

.tab-switch {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding-bottom: 8px;
    /*border-bottom: 1px solid var(--border-color);*/
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--muted-text);
    color: var(--text-color);
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 16px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    font-size: 1.1rem;
    font-weight: 600;
}

.hidden {
    display: none;
}

.tab-btn:hover {
    color: var(--text-color);
    border: 1px solid white;
}

.tab-btn.is-active {
    color: var(--text-color);
    border-color: transparent;
    border-bottom-color: white;
}

.tab-panel {
    width: 100%;
}

.share-preview-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-top: 10px;
    background: transparent;
    align-items: flex-start;
}

.preview-box {
    flex: 1; /* Prend 50% */
    width: 100%;
    background: transparent;
    overflow: hidden;
}

.preview-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.share-controls {
    flex: 1; /* Prend 50% */
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-right: 2px;
}

.share-text-area {
    width: 100%;
    height: 147px;
    background: var(--bg-glow);
    border: 1px solid var(--border-color);
    padding: 10px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--muted-text);
    resize: none;
    box-sizing: border-box;
}

.share-submit-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 2px;
    margin-right: 2px;
}

.input-group label {
    position: relative;
}

.input-group label {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--muted-text);
    display: block;
    margin-bottom: 5px;
}


.save-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.action-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 16px;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

.action-btn.icon-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
}

.action-icon svg {
    width: 18px;
    height: 18px;
}

.minimal-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    padding: 5px 0;
    transition: border-color 0.3s;
}

.minimal-input:focus {
    outline: none;
    border-bottom-color: var(--text-color);
}

.reveal-block {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    overflow: hidden;
    margin-top: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    visibility: hidden;
    height: 0;
}

.reveal-block.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    margin-top: 20px;
    visibility: visible;
    height: auto;
}

.permalink-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: 10px;
    margin-left: 2px;
}

.permalink-input {
    flex-grow: 1;
    background: var(--bg-glow);
    border: none;
    padding: 8px 12px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--muted-text);
}

.icon-btn {
    background: none;
    border: 1px solid var(--border-color);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;

    svg {
        color: var(--text-color);
    }
}

.copy-btn .icon-set {
    width: 18px;
    height: 18px;
    display: inline-flex;
}

.copy-btn svg {
    width: 18px;
    height: 18px;
}

.copy-btn .icon-check {
    display: none;
}

.copy-btn[data-copied="true"] .icon-copy {
    display: none;
}

.copy-btn[data-copied="true"] .icon-check {
    display: block;
}

.icon-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

.bookmark-hint {
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--muted-text);
    display: none;
}

.bookmark-hint.visible {
    display: block;
}

/* --- Footer --- */
footer {
    margin-top: 10px;
    padding: 20px 20px 40px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted-text);
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    border-top: 1px solid var(--border-color);
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.footer-nav a {
    text-decoration: none;
    color: var(--muted-text);
}

.footer-nav a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.footer-legals {
    font-size: 0.8rem;
    color: var(--muted-text);
    text-align: center;
}

.footer-legals p {
    margin: 0;
    padding: 6px 0;
    line-height: 1.5;
    white-space: normal;
    text-align: center;
}

.footer-legals-bold {
    font-weight: 700;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .date-cta {
        margin-top: 0;
    }
    .triptych, .loading-placeholder {
        grid-template-columns: 1fr;
        gap: 10px;
        justify-items: center;
    }

    .triptych-label {
        margin: 0;
        display: none;
    }

    .loading-placeholder {
        width: auto;
    }

    .frame, .skeleton {
        height: 230px;
        max-width: 320px;
        width: 100%;
    }

    .frame img {
        object-fit: cover;
    }

    .title-img {
        max-height: 120px;
    }

    .locale-switch {
        position: static;
        text-align: center;
        margin-bottom: 10px;
    }

    header {
        flex-direction: column;
    }

    select {
        font-size: 1.5rem;
    }

    .search-section {
        margin-top: 0;
        margin-bottom: 20px;
    }

    .container {
        padding-top: 0;
    }

    header {
        padding: 20px 30px 10px 30px;
    }

    .tab-btn {
        font-size: 0.75rem;
        padding: 5px 8px;
        letter-spacing: 0.5px;
    }

    #display-area {
        margin-bottom: 20px;
    }

    .share-preview-container {
        flex-direction: column;
    }

    .preview-box, .share-controls {
        width: 100%;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    border: 0;
    padding: 0;

    white-space: nowrap;
    clip-path: inset(100%);
    clip: rect(0 0 0 0);
    overflow: hidden;
}
