:root {
    --primary: #2563eb;
    --border: #e5e7eb;
    --cFond: #F8ECE3;
    --cTitres: #C8531A;
    --cSousTitre: #F5A668;
    --cTexte: #7c7c7c;
    --cLinks: #000000;
    --cSuccess: #2e7d32;
    --cError: #c62828;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--cFond);
}

h1 {
    margin: 0 0 12px;
    font-size: clamp(1.4rem, 4vw, 2.5rem);
    color: var(--cTitres);
}

p {
    margin: 8px 0;
    color: var(--cTexte);
}

/* ===== HEADER ===== */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--cTitres);
    border-bottom: 2px solid var(--cTitres);
}

.nav {
    max-width: 1100px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
}

.logo {
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    color: white;
}

.lang-flag {
    background-color: transparent;
    border: none;
    cursor: pointer;
    min-width: 40px;
    padding: 4px;
}
.menu {
    display: flex;
    gap: clamp(12px, 3vw, 20px);
}
.menu a {
    text-decoration: none;
    color: white;
    font-weight: 500;
    font-size: clamp(0.9rem, 2vw, 1rem);
    white-space: nowrap;
}

/* ===== BURGER ===== */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}

.burger span {
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ===== HERO SECTION ===== */
.hero-background {
    position: relative;
    background-image: url('img/fond-paysage.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--cFond);
    padding: 20px;
}

.hero-background::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1;
}

.hero-background .hero {
    position: relative;
    z-index: 2;
    padding: 20px;
    font-family: "Palatino Linotype", "Palatino", "URW Palladio L", serif;
    max-width: 1200px;
    width: 100%;
}

#hero-text {
    color: white;
}

.hero-background h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 15px;
    color: white;
}

.hero-background p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    max-width: 800px;
    margin: 0 auto 30px auto;
    line-height: 1.6;
    color: white;
}

/* Compte à rebours */
.hero-background .countdown-container {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(10px, 3vw, 20px);
    margin-bottom: 30px;
}

.hero-background .countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.hero-background .countdown-item .number {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: bold;
}

.hero-background .countdown-item .label {
    font-size: clamp(0.8rem, 2vw, 1rem);
}

/* ===== TIMELINE ===== */
.timeline-title {
    text-align: center;
    margin-top: 40px;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 80px auto;
    padding: 0 20px;
}

#deroulement {
    scroll-margin-top: 80px;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 30%;
    width: 2px;
    transform: translateX(-50%);
    background: var(--cSousTitre);
}

.timeline-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 50px 0;
    position: relative;
}

.timeline-item .time {
    width: 25%;
    text-align: right;
    font-weight: bold;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    padding-right: 30px;
    opacity: 0;
    transform: translateX(-50px);
    color: var(--cSousTitre);
}

.timeline-item .content {
    width: 65%;
    padding-left: 30px;
    opacity: 0;
    transform: translateX(50px);
}

.content-header {
    display: flex;
    align-items: center;
    min-height: 32px;
    color: var(--cSousTitre);
}

.content-header h3 {
    margin: 0;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
}

.toggle-details {
    margin-top: 10px;
    background: none;
    border: none;
    color: var(--cLinks);
    text-decoration: underline;
    cursor: pointer;
    font-size: clamp(0.9rem, 2vw, 1rem);
    padding: 4px 8px;
}

.ceremony-details,
.vin-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.8s ease;
    margin-top: 10px;
}

.ceremony-details.open,
.vin-details.open {
    max-height: 1000px;
    opacity: 1;
    transform: scale(1);
}

.ceremony-details img,
.vin-details img {
    width: 100%;
    max-width: 700px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.ceremony-details a,
.vin-details a {
    display: inline-block;
    color: var(--cLinks);
    text-decoration: underline;
    word-break: break-word;
}

.timeline-item.show .time,
.timeline-item.show .content {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.8s ease;
}

/* ===== PLAYLIST SPOTIFY ===== */
.playlist-btn {
    display: inline-block;
    margin-top: 15px;
    text-decoration: none;
    font-weight: 500;
}

.playlist-qrcode {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.playlist-qrcode img {
    max-width: 200px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.playlist-btn-container {
    text-align: center;
}

/* ===== INSCRIPTION ===== */
.registration {
    max-width: 700px;
    margin: 80px auto;
    padding: 20px;
}

.registration h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    text-align: center;
}

.date-limite {
    font-weight: 700;
}

.inscription-check {
    display: block;
    font-weight: 500;
    margin: 8px 0;
}

.inscription-fields {
    width: 100%;
    border: none;
    border-bottom: 2px solid var(--cSousTitre);
    background: transparent;
    outline: none;
    padding: 8px 4px;
    color: black;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.inscription-fields:focus {
    border-bottom-color: var(--cTitres);
}

.aperitif-quantity {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 35px;
    align-items: center;
}

.aperitif-quantity p {
    margin: 0;
    white-space: nowrap;
    flex: 0 0 auto;
}

.aperitif-quantity input {
    width: 120px;
    text-align: center;
    flex-shrink: 0;
}

#invite-code {
    max-width: 200px;
}

.guest-line {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.guest-line input {
    flex: 1;
    min-width: 120px;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 10px;
    background-color: var(--cTitres);
    color: white;
    padding: 10px 20px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

#submit-btn {
    margin-top: 16px;
}

.btn:hover {
    background-color: var(--cSousTitre);
}

.btn:active {
    transform: scale(0.97);
}

#add-person {
    margin-top: 15px;
    margin-bottom: 35px;
}

#aperitif-check {
    margin-top: 35px;
    margin-bottom: 35px;
}

#decrire-aperitif {
    margin-bottom: 35px;
}

#nous-completerons {
    margin: 35px 0;
}

.soiree-line {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.code-area {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.proposer-animation {
    text-align: center;
    font-weight: 600;
    margin: 35px 0;
}

.proposer-animation u {
    color: black;
}

.success {
    color: var(--cSuccess);
    margin-top: 1rem;
}

.error {
    color: var(--cError);
    margin-top: 1rem;
}

/* ===== SE LOGER ===== */
.photo-loger {
    padding: clamp(40px, 8vw, 80px) 20px;
    background: var(--cFond);
    text-align: center;
}

.logement-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
}

.logement-proche {
    color: var(--cSousTitre);
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
}

.logement-loin {
    margin-top: 35px;
    color: var(--cSousTitre);
}

.hotel-name {
    color: var(--cSousTitre);
}

.carousel-link {
    display: inline-block;
    text-decoration: none;
    font-weight: bold;
    color: #000;
    border-bottom: 2px solid currentColor;
    word-break: break-word;
}

/* ===== PHOTOS ===== */
.photo-section {
    padding: clamp(40px, 8vw, 80px) 20px;
}

.photo-header {
    max-width: 900px;
    margin: 0 auto 40px;
    text-align: center;
}

.photo-header h2 {
    font-size: clamp(1.6rem, 4vw, 2rem);
    margin-bottom: 10px;
}

.photo-header p {
    margin-bottom: 35px;
}

.photo-link {
    font-weight: bold;
    text-decoration: none;
    border-bottom: 2px solid currentColor;
    word-break: break-word;
}
#info-loin {
    margin-bottom: 30px;
}
#sois-meme {
    margin-top: 30px;
}

p a {
    color: black;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.photo-item {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.photo-item img {
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

/* ===== LISTE DES CADEAUX ===== */
.cadeaux {
    padding: clamp(40px, 8vw, 80px) 20px;
    background: var(--cFond);
    text-align: center;
}

.cadeaux h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
}

.cadeaux h2 {
    color: var(--cSousTitre);
    font-size: clamp(1.2rem, 3vw, 1.5rem);
}

.cadeaux-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.cadeau-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cadeau-card img {
    width: 100%;
    height: 280px;
    object-fit: scale-down;
    border-radius: 8px;
}

.cadeau-card h3 {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin: 0;
}

.progress-bar {
    height: 10px;
    background: #eee;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--cTitres);
    width: 0;
    transition: width .3s ease;
}

.cadeau-reste {
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    color: var(--cSousTitre);
    margin: 0;
}

.cadeau-btn {
    margin-top: auto;
}

/* ===== MODALE ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    background: var(--cFond);
    padding: clamp(20px, 5vw, 30px);
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.modal-close:hover {
    color: #000;
    transform: scale(1.1);
}
.modal-content h3 {
    color: var(--cSousTitre);
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-top: 0;
}
.form-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.form-row label {
    font-weight: 500;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: clamp(0.9rem, 2vw, 1rem);
}
.form-row input {
    flex: 1 1 auto;
    min-width: 0;
}
#paiement-montant {
    max-width: 300px;
}
.paiement-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px 0;
    color: var(--cSousTitre);
    font-size: clamp(0.85rem, 2vw, 0.9rem);
}
.paiement-separator::before,
.paiement-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: currentColor;
}
.paiement-separator span {
    padding: 0 10px;
    white-space: nowrap;
}
.paiement-infos {
    text-align: center;
    margin: 20px 0;
    gap: 12px;
    display: flex;
    flex-direction: column;
}
.paiement-twint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.paiement-twint p {
    margin: 0;
}
.twint {
    width: 50px;
    height: auto;
    flex-shrink: 0;
}
.qr {
    max-width: 200px;
    width: 100%;
    height: auto;
    margin-bottom: 10px;
}
.paiement-coords {
    margin: 0;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
}
.paiement-coords p {
    margin: 0;
    line-height: 1.4;
    word-break: break-all;
}
#info-virement {
    margin-bottom: 1rem;
}

#paiement-info {
    padding-bottom: 2rem;
}
.paiement-merci {
    padding-top: 10px;
}
.galerie-photos {
    padding: clamp(40px, 8vw, 80px) 20px;
    background: var(--cFond);
    text-align: center;
}

.galerie-header {
    max-width: 1200px;
    margin: 0 auto 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.galerie-header h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin: 0;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    align-self: self-end;
}

.btn-download svg {
    transition: transform 0.3s ease;
}

.btn-download:hover svg {
    transform: translateY(2px);
}

.galerie-grid {
    max-width: 1400px;
    margin: 0 auto;
    column-count: 4;
    column-gap: 16px;
}

.galerie-item {
    break-inside: avoid;
    margin-bottom: 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.galerie-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.galerie-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.galerie-item:hover img {
    transform: scale(1.05);
}

.galerie-loading {
    text-align: center;
    padding: 40px;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
}

/* ===== LIGHTBOX ===== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 3001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.lightbox-close:hover {
    transform: scale(1.2);
}

.lightbox-download {
    position: absolute;
    top: 20px;
    right: 90px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 3001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.lightbox-download:hover {
    transform: scale(1.2);
}

.lightbox-download svg {
    transition: transform 0.3s ease;
}

.lightbox-download:hover svg {
    transform: translateY(2px);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: white;
    background: rgba(255,255,255,0.1);
    border: none;
    cursor: pointer;
    padding: 20px;
    transition: background 0.3s ease;
    z-index: 3001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

#lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 18px;
    background: rgba(0,0,0,0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

/* Responsive pour la galerie */
@media (max-width: 1200px) {
    .galerie-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .galerie-grid {
        column-count: 2;
        column-gap: 12px;
    }
    
    .galerie-item {
        margin-bottom: 12px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        padding: 15px;
        font-size: 30px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-download {
        top: 80px;
        right: 10px;
        width: 45px;
        height: 45px;
    }

    .lightbox-close {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .galerie-grid {
        column-count: 1;
    }
    
    #lightbox-img {
        max-width: 95%;
    }
}

/* ===== FOOTER ===== */
footer {
    background: var(--cTitres);
    color: white;
    padding: clamp(40px, 6vw, 60px) 20px;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(30px, 5vw, 60px);
}

.footer-contact {
    text-align: center;
}

.footer-contact h3 {
    margin: 0 0 12px;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: white;
}

.footer-contact p {
    margin: 4px 0;
    color: white;
    font-size: clamp(0.9rem, 2vw, 1rem);
    line-height: 1.5;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablettes (768px et moins) */
@media (max-width: 768px) {
    .menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--cTitres);
        flex-direction: column;
        padding: 16px;
        gap: 12px;
        display: none;
    }

    .menu.open {
        display: flex;
    }

    .burger {
        display: flex;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        flex-direction: column;
        padding-left: 40px;
    }

    .timeline-item .time,
    .timeline-item .content {
        width: 100%;
        text-align: left;
        padding: 0;
    }

    .timeline-item .time {
        margin-bottom: 10px;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .aperitif-quantity {
        flex-direction: column;
        align-items: stretch;
    }

    .aperitif-quantity input {
        width: 100%;
        max-width: 300px;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .form-row label {
        text-align: left;
    }

    #paiement-montant {
        max-width: 100%;
    }

    .cadeaux-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .modal-content {
        padding: 20px;
    }

    .paiement-twint {
        flex-direction: column;
        text-align: center;
    }

    .guest-line {
        flex-direction: column;
    }

    .guest-line input {
        width: 100%;
        min-width: 0;
    }

    .code-area {
        flex-direction: column;
    }

    .code-area input,
    .code-area button {
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Petits mobiles (480px et moins) */
@media (max-width: 480px) {
    .nav {
        padding: 12px;
    }

    .registration {
        padding: 15px;
        margin: 40px auto;
    }

    .timeline {
        margin: 40px auto;
        padding: 0 15px;
    }

    .timeline-item {
        margin: 30px 0;
        padding-left: 30px;
    }

    .photo-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .cadeaux-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cadeau-card img {
        height: 200px;
    }

    .modal {
        padding: 10px;
    }

    .modal-content {
        padding: 15px;
        max-height: 95vh;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .qr {
        max-width: 150px;
    }

    #add-person,
    #submit-btn {
        width: 100%;
    }
}

/* Très petits écrans (360px et moins) */
@media (max-width: 360px) {
    .hero-background h1 {
        font-size: 1.5rem;
    }

    .hero-background .countdown-item {
        min-width: 50px;
    }

    .cadeau-card {
        padding: 12px;
    }

    .cadeau-card img {
        height: 180px;
    }
}