/* ==========================================================================
   Fouras-la-Joie — Main stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS custom properties
   -------------------------------------------------------------------------- */
:root {
    --color-white:        #ffffff;
    --color-sand:         #f5f1eb;
    --color-sand-dark:    #e8e0d0;
    --color-stone:        #c8b99a;
    --color-shutter:      #7a9bb5;
    --color-shutter-dark: #4d7a9a;
    --color-sea:          #2a7f8f;
    --color-sea-dark:     #1a5f6e;
    --color-green-accent: #6b9e8a;
    --color-text:         #1e2a2e;
    --color-text-muted:   #5a7070;

    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body:    'DM Sans', system-ui, sans-serif;

    --max-width:    1200px;
    --section-gap:  5rem;
    --border-radius: 4px;

    --transition: 0.2s ease;
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-white);
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--color-sea);
    text-decoration: none;
}

a:hover {
    color: var(--color-sea-dark);
}

/* --------------------------------------------------------------------------
   Typography helpers
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.25;
    color: var(--color-text);
}

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */
.container {
    width: min(var(--max-width), 100% - 2rem);
    margin-inline: auto;
}

section {
    padding-block: var(--section-gap);
    scroll-margin-top: 72px;
}

section:nth-child(even) {
    background: var(--color-sand);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition);
    text-align: center;
}

.btn-primary {
    background: var(--color-sea);
    color: var(--color-white);
    border-color: var(--color-sea);
}

.btn-primary:hover {
    background: var(--color-sea-dark);
    border-color: var(--color-sea-dark);
    color: var(--color-white);
}

.btn-outline {
    background: transparent;
    color: var(--color-sea);
    border-color: var(--color-sea);
}

.btn-outline:hover {
    background: var(--color-sea);
    color: var(--color-white);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--color-sand-dark);
}

.site-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 64px;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--color-text);
    white-space: nowrap;
}

.nav-logo span {
    color: var(--color-sea);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.nav-links a:hover {
    color: var(--color-sea);
}

.lang-toggle {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.lang-btn {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 2px;
    transition: color var(--transition);
}

.lang-btn.active,
.lang-btn:hover {
    color: var(--color-sea);
}

.lang-btn.active {
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    height: min(90vh, 680px);
    display: flex;
    align-items: flex-end;
    padding-bottom: 4rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(30, 42, 46, 0.1) 0%,
        rgba(30, 42, 46, 0.55) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--color-white);
}

.hero-eyebrow {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--color-white);
    margin-bottom: 0.5rem;
}

.hero-tagline {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    opacity: 0.9;
    margin-bottom: 1.75rem;
}

/* --------------------------------------------------------------------------
   Description (two-column)
   -------------------------------------------------------------------------- */
.description-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.description-text p + p {
    margin-top: 1rem;
}

.description-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.description-photos img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.description-photos img:first-child {
    grid-column: 1 / -1;
    height: 280px;
}

/* --------------------------------------------------------------------------
   Amenities
   -------------------------------------------------------------------------- */
.amenities-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2.5rem;
}

.amenity-group h3 {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-sea);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-sand-dark);
}

.amenity-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.amenity-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.amenity-list li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-stone);
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Photo gallery
   -------------------------------------------------------------------------- */
.gallery-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.gallery-scroll::-webkit-scrollbar {
    height: 4px;
}

.gallery-scroll::-webkit-scrollbar-track {
    background: var(--color-sand-dark);
}

.gallery-scroll::-webkit-scrollbar-thumb {
    background: var(--color-stone);
    border-radius: 2px;
}

.gallery-scroll img {
    height: 320px;
    width: auto;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: var(--border-radius);
    scroll-snap-align: start;
}

/* --------------------------------------------------------------------------
   Map
   -------------------------------------------------------------------------- */
.map-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2.5rem;
    align-items: start;
}

.map-address {
    font-style: normal;
    color: var(--color-text-muted);
    line-height: 1.9;
}

.map-address strong {
    display: block;
    color: var(--color-text);
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.map-frame {
    width: 100%;
    height: 360px;
    border: none;
    border-radius: var(--border-radius);
    filter: saturate(0.85);
}

/* --------------------------------------------------------------------------
   Calendar
   -------------------------------------------------------------------------- */
.calendar-wrapper {
    /* No max-width — fills the container so both months have comfortable room */
}

.calendar-nav {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.cal-nav-btn {
    background: none;
    border: 1px solid var(--color-sand-dark);
    border-radius: var(--border-radius);
    width: 36px;
    height: 36px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--color-text);
    transition: background var(--transition), border-color var(--transition);
}

.cal-nav-btn:hover:not(:disabled) {
    background: var(--color-sand-dark);
}

.cal-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.calendar-months {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem 3rem;
}

.cal-month {
    min-width: 0;
}

.cal-month-heading {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.cal-day-names {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.cal-day-names span {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 0;
}

.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: default;
    font-family: var(--font-body);
    color: var(--color-text);
    padding: 0;
    transition: background var(--transition), color var(--transition);
}

.cal-blank {
    visibility: hidden;
}

.cal-past,
.cal-midweek {
    color: var(--color-text-muted);
    opacity: 0.45;
}

.cal-blocked {
    background: var(--color-sand-dark);
    color: var(--color-text-muted);
    text-decoration: line-through;
    opacity: 0.6;
}

.cal-available {
    cursor: pointer;
    font-weight: 500;
    color: var(--color-sea);
}

.cal-available:hover {
    background: var(--color-shutter);
    color: var(--color-white);
}

/* Changeover Saturday: first day of a blocked period.
   Valid as a departure date only — diagonal split signals partial occupancy. */
.cal-changeover {
    cursor: pointer;
    font-weight: 500;
    background: linear-gradient(
        to bottom right,
        var(--color-sand-dark) 50%,
        transparent 50%
    );
    color: var(--color-text-muted);
}

.cal-changeover:hover {
    background: var(--color-shutter);
    color: var(--color-white);
}

.cal-sel-endpoint {
    background: var(--color-sea) !important;
    color: var(--color-white) !important;
    font-weight: 700;
}

.cal-sel-range {
    background: rgba(42, 127, 143, 0.15);
    border-radius: 0;
}

.cal-sel-hover {
    background: var(--color-shutter) !important;
    color: var(--color-white) !important;
}

.calendar-legend {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-available  { background: var(--color-sea); }
.legend-blocked    { background: var(--color-sand-dark); border: 1px solid var(--color-stone); }
.legend-selected   { background: var(--color-sea); opacity: 0.5; }

.cal-error {
    margin-top: 1rem;
    color: #c0392b;
    font-size: 0.9rem;
    min-height: 1.4em;
}

.cal-instruction {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.cal-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 0.9rem 1.1rem;
    background: var(--color-sand);
    border: 1px solid var(--color-sand-dark);
    border-radius: var(--border-radius);
    animation: calCtaIn 0.2s ease;
}

@keyframes calCtaIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cal-cta-dates {
    font-size: 0.95rem;
    color: var(--color-text);
}

.cal-cta-btn {
    flex-shrink: 0;
    padding: 0.55rem 1.1rem;
    background: var(--color-sea);
    color: var(--color-white);
    border: none;
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.cal-cta-btn:hover {
    background: var(--color-sea-dark);
}

/* --------------------------------------------------------------------------
   Form validation feedback
   -------------------------------------------------------------------------- */
.input-error {
    border-color: #c0392b !important;
}

.field-error {
    display: block;
    font-size: 0.8rem;
    color: #c0392b;
    margin-top: 0.25rem;
}

.form-error {
    background: #fdf0ee;
    border: 1px solid #e8b4ae;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    color: #922b21;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Booking form
   -------------------------------------------------------------------------- */
.booking-form-wrapper {
    max-width: 600px;
    margin-inline: auto;
}

.form-steps {
    display: flex;
    gap: 0;
    margin-bottom: 2.5rem;
    border-bottom: 2px solid var(--color-sand-dark);
}

.form-step-indicator {
    flex: 1;
    text-align: center;
    padding: 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition), border-color var(--transition);
}

.form-step-indicator.active {
    color: var(--color-sea);
    border-color: var(--color-sea);
}

.form-step-indicator.done {
    color: var(--color-green-accent);
}

.form-panel {
    display: none;
}

.form-panel.active {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--color-sand-dark);
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-white);
    transition: border-color var(--transition);
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-sea);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

/* Booking summary (step 3) */
.booking-summary {
    background: var(--color-sand);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.booking-summary dt {
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.75rem;
}

.booking-summary dd {
    color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--color-text);
    color: rgba(255, 255, 255, 0.7);
    padding-block: 3rem;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--color-white);
    margin-bottom: 0.5rem;
}

.footer-grid a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-grid a:hover {
    color: var(--color-white);
}

.footer-bottom {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   Modal lightbox
   -------------------------------------------------------------------------- */
#gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.18s ease;
}

#gallery-modal[hidden] {
    display: none;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 42, 46, 0.92);
    cursor: pointer;
}

.modal-figure {
    position: relative;
    z-index: 1;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: 90vw;
    max-height: 85vh;
}

.modal-img {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.modal-caption {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85rem;
    text-align: center;
    max-width: 60ch;
}

/* Close button */
.modal-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 44px;
    height: 44px;
    background: rgba(30, 42, 46, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--color-white);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.modal-close:hover {
    background: rgba(30, 42, 46, 0.95);
}

/* Prev / next arrows */
.modal-prev,
.modal-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 48px;
    height: 80px;
    background: rgba(30, 42, 46, 0.55);
    border: none;
    color: var(--color-white);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.modal-prev { left: 0; border-radius: 0 4px 4px 0; }
.modal-next { right: 0; border-radius: 4px 0 0 4px; }

.modal-prev:hover,
.modal-next:hover {
    background: rgba(30, 42, 46, 0.85);
}

/* Counter */
.modal-counter {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-family: var(--font-body);
    letter-spacing: 0.06em;
    pointer-events: none;
}

/* Body scroll lock */
body.modal-open {
    overflow: hidden;
}

/* Gallery thumbnails — pointer cursor */
.gallery-scroll img {
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .description-grid,
    .map-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    :root { --section-gap: 3rem; }

    .nav-links {
        display: none; /* hamburger menu TBD */
    }

    .description-photos img:first-child {
        height: 200px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .calendar-months {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .gallery-scroll img {
        height: 220px;
    }
}
