/*
Theme Name: Onlycamp 2026
Theme URI: https://onlycampv2.local/
Author: Huttopia
Author URI: https://www.huttopia.com/
Description: Thème principal Onlycamp 2026.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: onlycamp-v3
*/

:root {
    --header-top: 0;
}

.admin-bar {
    --header-top: var(--wp-admin--admin-bar--height);
}

mark.has-inline-color {
    background-color: transparent;
}

.wp-block-image img[style*="aspect-ratio"] {
    width: 100%;
    height: auto;
}

body {
    padding-top: 60px;

    @media (min-width: 782px) {
        padding-top: 0;
    }

    &.page-no-hero {
        @media (min-width: 782px) {
            padding-top: 80px;
        }
    }
}

body.page-no-hero app-header.main-header {
    @media (min-width: 782px) {
        background-color: var(--wp--preset--color--base);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .header-nav {
        @media (min-width: 782px) {
            border-bottom-color: transparent;
        }

        a {
            @media (min-width: 782px) {
                color: var(--wp--preset--color--contrast);
            }
        }
    }

    .lang-switcher .lang-current::after {
        border-color: var(--wp--preset--color--contrast);
    }
}

app-header.main-header {
    position: fixed;
    top: var(--header-top);
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--wp--preset--color--secondary);
    z-index: 1000;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: 'burger logo utils';
    align-items: center;
    padding: 0 15px;

    @media (min-width: 782px) {
        height: 80px;
        grid-template-columns: auto 1fr auto;
        grid-template-areas: 'logo nav utils';
        padding: 0 max(40px, calc((100vw - var(--wp--style--global--wide-size)) / 2));
        background-color: transparent;
        transition: background-color 0.15s ease;
    }

    @media (min-width: 1400px) {
        padding-right: 0;
    }

    &.scrolled {
        @media (min-width: 782px) {
            background-color: var(--wp--preset--color--base);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
    }

    .header-logo {
        grid-area: logo;
        justify-self: center;
        display: flex;
        align-items: center;
        max-width: 150px;

        @media (min-width: 782px) {
            justify-self: start;
            height: 80px;
            max-width: none;
        }

        img {
            height: 40px;
            width: auto;
            max-width: 100%;
            object-fit: contain;

            @media (min-width: 782px) {
                height: 100%;
                width: auto;
                position: relative;
                top: 20px;
            }
        }
    }

    .menu-toggle {
        grid-area: burger;
        width: 32px;
        height: 32px;
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        position: relative;
        z-index: 1001;

        @media (min-width: 782px) {
            display: none;
        }

        span {
            position: absolute;
            left: 0;
            width: 100%;
            height: 2px;
            background-color: var(--wp--preset--color--base);
            border-radius: 2px;
            transition: transform 0.3s ease, opacity 0.3s ease;

            &:nth-child(1) {
                top: 6px;
            }

            &:nth-child(2) {
                top: 50%;
                transform: translateY(-50%);
            }

            &:nth-child(3) {
                top: auto;
                bottom: 6px;
            }
        }

        &.active span {
            &:nth-child(1) {
                top: 50%;
                transform: translateY(-50%) rotate(45deg);
            }

            &:nth-child(2) {
                opacity: 0;
            }

            &:nth-child(3) {
                top: 50%;
                bottom: auto;
                transform: translateY(-50%) rotate(-45deg);
            }
        }
    }

    .header-nav {
        position: fixed;
        top: 60px;
        left: -100%;
        height: calc(100vh - 60px);
        width: 100%;
        background-color: var(--wp--preset--color--base);
        transition: left 0.3s ease;
        z-index: 998;
        padding-top: 20px;
        overflow-y: auto;

        @media (min-width: 782px) {
            position: static;
            width: calc(100% - 80px);
            height: 79px;
            border-bottom: solid 1px white;
            display: flex;
            max-width: none;
            padding-top: 0;
            grid-area: nav;
            justify-self: center;
            background-color: transparent;
            margin: 0 40px;
            overflow: visible;
            justify-content: space-between;
        }

        &.active {
            left: 0;
        }

        ul {
            list-style: none;
            margin: 0;
            padding: 0;

            @media (min-width: 782px) {
                display: flex;
                gap: 20px;
                align-items: center;
            }
        }

        li {
            border-bottom: 1px solid var(--wp--preset--color--contrast-100);

            @media (min-width: 782px) {
                border-bottom: none;
                white-space: nowrap;
            }
        }

        a {
            display: block;
            padding: 16px 20px;
            color: var(--wp--preset--color--contrast);
            text-decoration: none;
            font-family: var(--wp--preset--font-family--montserrat);
            font-weight: 600;
            font-size: var(--wp--preset--font-size--small);

            @media (min-width: 782px) {
                padding: 8px 0;
                color: var(--wp--preset--color--base);
                text-transform: uppercase;
                transition: color 0.15s ease;
                font-size: var(--wp--preset--font-size--x-small);
            }

            @media (min-width: 782px) and (hover: hover) {
                &:hover {
                    color: var(--wp--preset--color--yellowcamp);
                }
            }

            li.current-menu-item & {
                color: var(--wp--preset--color--primary);
            }
        }

    }

    .lang-switcher {
        display: flex;
        padding: 20px;
        gap: 12px;
        align-items: center;

        @media (min-width: 782px) {
            padding: 0;
            gap: 0;
            position: relative;
        }

        .lang-current {
            background: none;
            border: none;
            padding: 8px;
            cursor: pointer;
            display: none;
            align-items: center;
            gap: 6px;

            @media (min-width: 782px) {
                display: flex;
            }

            img {
                width: 26px;
                height: 18px;
                display: block;
            }

            &::after {
                content: '';
                border: solid var(--wp--preset--color--base);
                border-width: 0 2px 2px 0;
                padding: 3px;
                transform: rotate(45deg);
                margin-top: -3px;
                transition: transform 0.2s ease, border-color 0.3s ease;
            }
        }

        .lang-dropdown {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            gap: 8px;

            @media (min-width: 782px) {
                display: block;
                position: absolute;
                top: 100%;
                right: 0;
                padding: 4px;
                background-color: var(--wp--preset--color--base);
                border-radius: 4px;
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
                opacity: 0;
                visibility: hidden;
                transform: translateY(-8px);
                transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
            }

            li {
                border-bottom: none;
            }

            a {
                display: block;
                padding: 8px;

                img {
                    width: 26px;
                    height: 18px;
                    display: block;
                }
            }
        }

        &.open {
            .lang-current::after {
                transform: rotate(-135deg);
                margin-top: 3px;
            }

            .lang-dropdown {
                @media (min-width: 782px) {
                    opacity: 1;
                    visibility: visible;
                    transform: translateY(0);
                }
            }
        }
    }

    &.scrolled .lang-switcher .lang-current::after {
        border-color: var(--wp--preset--color--contrast);
    }

    &.scrolled .header-nav a {
        @media (min-width: 782px) {
            color: var(--wp--preset--color--contrast);
        }

        @media (min-width: 782px) and (hover: hover) {
            &:hover {
                color: var(--wp--preset--color--yellowcamp);
            }
        }
    }

    &.scrolled .util-link {
        @media (min-width: 782px) {
            &.util-link-booking, &.util-link-client {
                background-color: var(--wp--preset--color--secondary);
            }

            &.util-link-contact {
                background-color: var(--wp--preset--color--orange);
            }
        }
    }

    &.scrolled .util-link-booking:hover,
    &.scrolled .util-link-client:hover {
        border-color: var(--wp--preset--color--secondary);
    }

    &.scrolled .util-link-contact:hover {
        border-color: var(--wp--preset--color--orange);
    }

    .header-utils {
        grid-area: utils;
        display: flex;
        gap: 6px;
        justify-self: end;

        @media (min-width: 1400px) {
            gap: 0;
        }
    }

    .util-link {
        display: flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        padding: 4px;
        border-radius: 5px;
        font-family: var(--wp--preset--font-family--montserrat);
        font-weight: 600;
        font-size: var(--wp--preset--font-size--x-small);
        border: 3px solid transparent;
        transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;

        @media (min-width: 1400px) {
            padding: 10px 16px;
            height: 100%;
            width: 150px;
            box-sizing: border-box;
            display: flex;
            border-radius: 0;
            flex-direction: column;
        }

        img {
            width: 24px;
            height: 24px;
            object-fit: contain;
            filter: brightness(0) invert(1);
        }

        span {
            display: none;

            @media (min-width: 1400px) {
                display: inline;
                color: var(--wp--preset--color--base);
            }
        }

        &.util-link-booking {
            @media (min-width: 1400px) {
                background-color: var(--wp--preset--color--secondary);
            }
        }

        &.util-link-client {
            @media (min-width: 1400px) {
                background-color: var(--wp--preset--color--secondary);
            }
        }

        &.util-link-contact {
            @media (min-width: 1400px) {
                background-color: var(--wp--preset--color--orange);
            }
        }

        @media (min-width: 1400px) and (hover: hover) {
            &:hover img {
                filter: none;
            }

            &.util-link-booking:hover {
                background-color: var(--wp--preset--color--base);

                span {
                    color: var(--wp--preset--color--secondary);
                }
            }

            &.util-link-client:hover {
                background-color: var(--wp--preset--color--base);

                span {
                    color: var(--wp--preset--color--secondary);
                }
            }

            &.util-link-contact:hover {
                background-color: var(--wp--preset--color--base);

                span {
                    color: var(--wp--preset--color--orange);
                }
            }
        }
    }
}

a, .wp-element-button {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

section.wp-block-group {
    margin-top: 40px;

    @media (min-width: 782px) {
        margin-top: 60px;
    }

    &:has(app-slide) {
        overflow: hidden;
    }
}

.wp-block-column.is-vertically-aligned-center {
    box-sizing: border-box;
}

.page-wrapper {
    position: relative;
    top: -90px;
    z-index: 1;
}

/* Camping Informations */

.campsite-informations {
    position: relative;

    .wp-block-columns {
        @media (min-width: 782px) {
            height: 150px;
            position: relative;

            &::before,
            &::after {
                content: '';
                position: absolute;
                top: 20%;
                height: 60%;
                width: 1px;
                background-color: var(--wp--preset--color--contrast-100);
            }

            &::before {
                left: 35%;
            }

            &::after {
                left: 66.66%;
            }
        }

        @media (max-width: 781px) {
            .wp-block-column + .wp-block-column {
                padding-top: var(--wp--preset--spacing--40);
                margin-top: var(--wp--preset--spacing--40);
                position: relative;

                &::before {
                    content: '';
                    position: absolute;
                    top: 0;
                    left: 50%;
                    transform: translateX(-50%);
                    width: 30%;
                    height: 1px;
                    background-color: var(--wp--preset--color--contrast-100);
                }
            }
        }
    }
}

/* Sticky CTA mobile */

app-sticky-cta {
    display: none;

    @media (max-width: 781px) {
        display: block;
    }
}

.sticky-cta {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--base);
    font-family: var(--wp--preset--font-family--montserrat);
    font-weight: 600;
    font-size: var(--wp--preset--font-size--small);
    text-decoration: none;
    text-transform: uppercase;
    padding: 14px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;

    &.visible {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

.campsite-prices {
    mark {
        background-color: transparent;
    }

    .wp-block-columns {
        position: relative;
        max-width: 900px;

        @media (min-width: 782px) {
            &::before,
            &::after {
                content: '';
                position: absolute;
                top: 20%;
                height: 60%;
                width: 1px;
                background-color: var(--wp--preset--color--contrast-100);
            }

            &::before {
                left: 33.33%;
            }

            &::after {
                left: 66.66%;
            }
        }

        @media (max-width: 781px) {
            .wp-block-column + .wp-block-column {
                padding-top: var(--wp--preset--spacing--40);
                margin-top: var(--wp--preset--spacing--40);
                position: relative;

                &::before {
                    content: '';
                    position: absolute;
                    top: 0;
                    left: 50%;
                    transform: translateX(-50%);
                    width: 30%;
                    height: 1px;
                    background-color: var(--wp--preset--color--contrast-100);
                }
            }
        }
    }
}

.campsite-prices-details {
    mark {
        background-color: transparent;
    }

    .prices-details-table {
        padding: var(--wp--preset--spacing--40);
        max-width: 900px;
    }

    .prices-details-header,
    .prices-details-row {
        margin-bottom: 0;
        align-items: center;

        p {
            margin: 0;
        }

        .wp-block-column:first-child {
            @media (min-width: 782px) {
                flex-basis: 40% !important;
                flex-grow: 0;
            }
        }

        .wp-block-column:not(:first-child) {
            @media (min-width: 782px) {
                flex-basis: 20% !important;
                flex-grow: 0;
            }
        }
    }

    .prices-details-header {
        .wp-block-column:first-child {
            @media (max-width: 781px) {
                display: none;
            }
        }
    }

    .prices-details-row {
        border-top: 1px solid var(--wp--preset--color--contrast-100);
        padding: var(--wp--preset--spacing--30) 0;

        @media (max-width: 781px) {
            flex-wrap: wrap;

            .wp-block-column:first-child {
                flex-basis: 100% !important;
                margin-bottom: var(--wp--preset--spacing--20);
            }

            .wp-block-column:not(:first-child) {
                flex-basis: 33.33% !important;
                flex-grow: 0;
            }
        }
    }

    .prices-details-row-main {
        border-top: none;
        padding-bottom: var(--wp--preset--spacing--40);
    }
}




/* Stars Rating */
h1.has-stars.stars-1 { --stars: 1; }
h1.has-stars.stars-2 { --stars: 2; }
h1.has-stars.stars-3 { --stars: 3; }
h1.has-stars.stars-4 { --stars: 4; }
h1.has-stars.stars-5 { --stars: 5; }

h1.has-stars::before {
    --star-width: 32px;
    --star-height: 25px;
    content: '';
    display: block;
    width: calc(var(--stars, 0) * var(--star-width));
    height: var(--star-height);
    /* SVG avec viewBox élargi (32x25) pour inclure le gap */
    background: url("data:image/svg+xml,%3Csvg width='32' height='25' viewBox='0 0 32 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.5749 0.361981L17.2423 7.86321L25.4467 9.06537C25.9698 9.1451 26.1826 9.79525 25.7995 10.1694L19.8636 16.0084L21.2624 24.2518C21.3536 24.7793 20.8002 25.1841 20.3319 24.9326L12.991 21.044L5.65023 24.9326C5.18192 25.1841 4.63456 24.7793 4.7197 24.2518L6.11853 16.0084L0.19479 10.1633C-0.182286 9.78912 0.0244976 9.13897 0.547539 9.05923L8.75198 7.85707L12.4254 0.361981C12.6626 -0.116429 13.3377 -0.116429 13.5749 0.361981Z' fill='%23FFD100'/%3E%3C/svg%3E") repeat-x left center;
    background-size: var(--star-width) var(--star-height);
    margin: 0 auto 16px;
}

/* Contact Form */
.contact-form {
    max-width: 900px;
    margin: var(--wp--preset--spacing--80) auto;
}

.contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--wp--preset--spacing--40);
    margin-top: var(--wp--preset--spacing--40);
}

.contact-form .form-row:first-child {
    margin-top: 0;
}

.contact-form .form-row:has(textarea),
.contact-form .form-row:has(input[name="subject"]) {
    grid-template-columns: 1fr;
}

.contact-form .gender-row {
    display: flex;
    gap: var(--wp--preset--spacing--60);
}

.contact-form .radio-label {
    display: flex;
    align-items: center;
    gap: var(--wp--preset--spacing--20);
    cursor: pointer;
}

.contact-form input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 1px solid var(--wp--preset--color--contrast-100);
    border-radius: 3px;
    background: var(--wp--preset--color--base);
    cursor: pointer;
    margin: 0;
}

.contact-form input[type="radio"]:checked {
    background: var(--wp--preset--color--primary);
    border-color: var(--wp--preset--color--primary);
}

.contact-form input[type="text"],
.contact-form input[type="tel"],
.contact-form input[type="email"],
.contact-form textarea {
    font-family: inherit;
    font-size: var(--wp--preset--font-size--small);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: 1px solid var(--wp--preset--color--primary);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #999;
}

.contact-form textarea {
    resize: vertical;
    min-height: 180px;
}

.contact-form .form-cnil {
    margin-top: var(--wp--preset--spacing--40);
    font-size: var(--wp--preset--font-size--x-small);
    color: var(--wp--preset--color--contrast-400);
    line-height: 1.6;
}

.contact-form .wp-element-button {
    margin-top: var(--wp--preset--spacing--40);
    text-transform: uppercase;
}

.form-status {
    max-width: 900px;
    margin: var(--wp--preset--spacing--40) auto;
    padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
    border-radius: 6px;
    font-size: var(--wp--preset--font-size--small);
}

.form-status.success {
    background: var(--wp--preset--color--tertiary);
    color: var(--wp--preset--color--primary);
    border: 1px solid var(--wp--preset--color--primary);
}

.form-status.error {
    background: #fef2f2;
    color: var(--wp--preset--color--orange);
    border: 1px solid var(--wp--preset--color--orange);
}

@media (max-width: 781px) {
    .contact-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* Footer */
.site-footer {
    background-color: var(--wp--preset--color--lightyellowbg);
}

.footer-main {
    max-width: var(--wp--style--global--wide-size);
    margin: 0 auto;
    padding: 50px 20px 40px;
    display: grid;
    gap: 40px;

    @media (min-width: 782px) {
        grid-template-columns: 1.2fr 1fr 1fr 1fr;
        gap: 30px;
        padding: 60px 40px 50px;
    }
}

.footer-brand {
    .footer-logo {
        display: block;
        max-width: 120px;

        img {
            width: 100%;
            height: auto;
        }
    }

    .footer-baseline {
        margin: 12px 0 20px;
        font-family: var(--wp--preset--font-family--montserrat);
        font-size: var(--wp--preset--font-size--x-small);
        color: var(--wp--preset--color--primary);
    }

    .footer-socials {
        display: flex;
        gap: 12px;

        a {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            border-radius: 8px;
            background-color: var(--wp--preset--color--primary);
            color: var(--wp--preset--color--base);
            transition: background-color 0.3s ease;
        }

        @media (hover: hover) {
            a:hover {
                background-color: var(--wp--preset--color--secondary);
            }
        }

        svg {
            width: 18px;
            height: 18px;
        }
    }
}

.footer-menu-onlycamp,
.footer-menu-camping {
    h3 {
        font-family: var(--wp--preset--font-family--montserrat);
        font-weight: 700;
        font-size: var(--wp--preset--font-size--medium);
        color: var(--wp--preset--color--contrast-600);
        margin: 0 0 16px;
    }

    ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    li + li {
        margin-top: 8px;
    }

    a {
        color: var(--wp--preset--color--contrast-400);
        text-decoration: none;
        font-family: var(--wp--preset--font-family--montserrat);
        font-size: var(--wp--preset--font-size--x-small);
        transition: color 0.2s ease;
    }

    @media (hover: hover) {
        a:hover {
            color: var(--wp--preset--color--primary);
        }
    }
}

.footer-ctas {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.footer-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--wp--preset--color--contrast-100);
    text-decoration: none;
    color: var(--wp--preset--color--contrast);
    font-family: var(--wp--preset--font-family--montserrat);
    font-weight: 600;
    font-size: var(--wp--preset--font-size--small);
    transition: color 0.2s ease;

    &:first-child {
        border-top: 1px solid var(--wp--preset--color--contrast-100);
    }

    img {
        width: 24px;
        height: 24px;
        object-fit: contain;
    }

    span {
        flex: 1;
    }

    .footer-cta-chevron {
        color: var(--wp--preset--color--primary);
        flex-shrink: 0;
    }

    @media (hover: hover) {
        &:hover {
            color: var(--wp--preset--color--primary);
        }
    }
}

.footer-legal {
    border-top: 1px solid var(--wp--preset--color--contrast-100);
    max-width: var(--wp--style--global--wide-size);
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    justify-content: center;

    @media (min-width: 782px) {
        padding: 20px 40px;
    }

    a {
        color: var(--wp--preset--color--contrast-400);
        text-decoration: none;
        font-size: var(--wp--preset--font-size--xx-small);
        font-family: var(--wp--preset--font-family--montserrat);
        transition: color 0.2s ease;
    }

    @media (hover: hover) {
        a:hover {
            color: var(--wp--preset--color--primary);
        }
    }
}

.is-site-accent {
    color: var(--wp--preset--color--primary);
}

.is-site-accent a {
    color: inherit;
}

body.site-baignade .is-site-accent {
    color: var(--wp--preset--color--onlyblue);
}
