/*
Theme Name: Riserva della Cascina
Theme URI: https://www.riservadellacascina.it/
Author: Francesco Passeri
Author URI: https://francescopasseri.com
Description: Replica WordPress del sito Riserva della Cascina — vini biologici nel Parco dell'Appia Antica.
Version: 1.4.2
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: riserva-cascina
*/

html {
    margin-top: 0 !important;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Il wrapper WP non deve alterare il layout Bootstrap originale. */
.riserva-page-content {
    display: contents;
}

.riserva-page-content p:empty {
    display: none;
    margin: 0;
    padding: 0;
}

.section-title p:empty {
    display: none;
    margin: 0;
    padding: 0;
}

.riserva-page-content h2,
.riserva-page-content h3 {
    margin-top: 50px;
}

.riserva-page-content .section-title h3 {
    margin-top: 50px;
}

.riserva-page-content #recent-work h3,
.riserva-page-content #recent-work h2 {
    margin-top: 50px;
}

.riserva-page-content .span4 h4 {
    margin-top: 10px;
    margin-bottom: 10px;
}

body.admin-bar .navbar-fixed-top {
    top: 32px;
}

body.admin-bar .backstretch,
body.admin-bar .backstretch .backstretch-item {
    top: 32px !important;
}

@media screen and (max-width: 782px) {
    body.admin-bar .navbar-fixed-top {
        top: 46px;
    }

    body.admin-bar .backstretch,
    body.admin-bar .backstretch .backstretch-item {
        top: 46px !important;
    }
}

.riserva-page-content img {
    max-width: 100%;
    height: auto;
}

/* Titoli e colonne Bootstrap su mobile */
@media (max-width: 767px) {
    .riserva-page-content h2 {
        font-size: clamp(1.6rem, 7vw, 2.75rem);
        line-height: 1.15;
        word-wrap: break-word;
    }

    .riserva-page-content .container,
    .riserva-page-content .row-fluid {
        max-width: 100%;
    }

    .riserva-page-content input[type="text"],
    .riserva-page-content input[type="email"],
    .riserva-page-content textarea {
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* Hero con foto di sfondo (Visite, legacy section-header, ecc.) */
.riserva-page-hero,
.riserva-visite-hero,
section.section-header[style*="background"] {
    position: relative;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat;
    min-height: clamp(280px, 38vh, 460px);
    padding: 0;
    overflow: visible;
}

.riserva-page-hero::before,
.riserva-visite-hero::before,
section.section-header[style*="background"]::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(20, 24, 18, 0.35) 0%,
        rgba(20, 24, 18, 0.62) 45%,
        rgba(20, 24, 18, 0.78) 100%
    );
}

.riserva-visite-hero__overlay {
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    min-height: inherit;
    padding: 96px 0 2.5rem;
    background: linear-gradient(
        180deg,
        rgba(20, 24, 18, 0.35) 0%,
        rgba(20, 24, 18, 0.62) 45%,
        rgba(20, 24, 18, 0.78) 100%
    );
}

.riserva-page-hero > .container,
.riserva-page-hero > .container .row-fluid,
.riserva-page-hero > .container .span12,
.riserva-visite-hero__content,
section.section-header[style*="background"] > .container,
section.section-header[style*="background"] .spaziatura-alta {
    position: relative;
    z-index: 1;
}

.riserva-page-hero > .container,
section.section-header[style*="background"] > .container {
    padding-top: clamp(5.5rem, 14vh, 7rem);
    padding-bottom: 2.5rem;
}

.riserva-visite-hero__content {
    padding-top: 0.5rem;
}

.riserva-page-hero h1,
.riserva-page-hero h2,
.riserva-page-hero h3,
.riserva-page-hero h4,
.riserva-page-hero p,
.riserva-page-hero i,
.riserva-visite-hero h1,
.riserva-visite-hero h2,
.riserva-visite-hero h3,
.riserva-visite-hero h4,
.riserva-visite-hero p,
.riserva-visite-hero i,
section.section-header[style*="background"] h1,
section.section-header[style*="background"] h2,
section.section-header[style*="background"] h3,
section.section-header[style*="background"] h4,
section.section-header[style*="background"] p,
section.section-header[style*="background"] i {
    color: #fff;
    text-align: left;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.riserva-page-hero h3,
.riserva-visite-hero h3,
section.section-header[style*="background"] h3 {
    border-bottom: none;
    margin-top: 1.25rem;
}

.riserva-page-hero .title_visite,
.riserva-visite-hero .title_visite,
section.section-header[style*="background"] .title_visite {
    border: none;
    border-bottom: 4px solid #fff;
    display: inline-block;
    font-family: 'Titillium Web', sans-serif;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 200;
    line-height: 1.15;
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: 0.65rem;
    text-transform: uppercase;
}

.riserva-visite-hero__lead,
.riserva-page-hero__lead {
    border: none;
    font-family: 'Titillium Web', sans-serif;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.35;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.riserva-visite-hero__text,
.riserva-page-hero__text {
    color: rgba(255, 255, 255, 0.94);
    font-size: 1.05rem;
    line-height: 1.65;
    margin-bottom: 0;
    max-width: 46rem;
}

/*
 * Hero backstretch (#page-title) — Famiglia, Vini, Eventi, singoli vini, ecc.
 * Allineato al layout originale (250px + padding-top su .hero-text), senza taglio titoli.
 */
#page-title,
#page-title > .overlay {
    height: auto !important;
    min-height: 250px;
    overflow: visible;
}

#page-title {
    position: relative;
}

#page-title > .overlay {
    position: relative;
    z-index: 1;
    padding: 0;
    box-sizing: border-box;
}

#page-title .hero-text {
    padding-top: clamp(5.5rem, 22vh, 8.75rem);
    padding-bottom: 1.5rem;
    box-sizing: border-box;
}

#page-title .hero-text h1,
#page-title .hero-text h1 .light-grey {
    color: #fff;
    line-height: 1.05;
    margin: 0;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

#page-title .backstretch {
    z-index: 0 !important;
    overflow: hidden;
}

/* Evita sovrapposizione del blocco contenuti sul titolo hero */
#page-title + section,
#page-title + #content,
#page-title + #featured-project,
#page-title + #content-two {
    position: relative;
    z-index: 2;
}

body.riserva-page-visite .riserva-visite-listing-wrap {
    padding-top: 2rem;
}

/* FP Experiences — lista prenotazioni su pagina Visite */
body.riserva-page-visite .riserva-page-content .fp-exp.fp-listing {
    max-width: 100%;
}

body.riserva-page-visite .riserva-page-content .fp-listing__grid {
    margin-top: 1.5rem;
}

body.riserva-single-experience .riserva-page-content,
body.riserva-fp-experiences.riserva-single-experience .riserva-page-content {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

body.riserva-page-visite .riserva-page-content .fp-exp.fp-listing > h2:first-child {
    font-family: 'Titillium Web', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    margin-top: 0;
    text-transform: none;
}

/* FP Experiences — verde ufficiale Riserva (#628704) al posto del blu predefinito */
body.riserva-page-visite .fp-exp,
body.riserva-fp-experiences .fp-exp,
body.riserva-page-visite .fp-exp-scope,
body.riserva-fp-experiences .fp-exp-scope {
    --fp-color-primary: #628704;
    --fp-color-secondary: #4a6b0a;
    --fp-color-accent: #4a6b0a;
    --fp-color-section-icon-background: #628704;
    --fp-exp-color-primary: #628704;
    --fp-exp-color-secondary: #4a6b0a;
    --fp-exp-color-accent: #4a6b0a;
    --fp-exp-color-section-icon-background: #628704;
}

.riserva-page-content form .btn-black {
    cursor: pointer;
}

.riserva-cookie-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: #f2f2f2;
    border-top: 1px solid #ccc;
    font-size: 14px;
}

/* display:flex sopra annullava l'attributo HTML hidden — il banner non si chiudeva */
.riserva-cookie-bar[hidden],
.riserva-cookie-bar.is-dismissed {
    display: none !important;
}

.riserva-cookie-bar p {
    margin: 0;
    flex: 1;
}

.riserva-cookie-bar a {
    text-decoration: underline;
    color: inherit;
}

.riserva-cookie-bar .btn-success {
    background: #5cb85c;
    border: none;
    color: #fff;
    padding: 8px 16px;
    white-space: nowrap;
}

.alert-success {
    background: #dff0d8;
    border: 1px solid #d6e9c6;
    padding: 12px;
    margin-bottom: 16px;
}

.alert-error {
    background: #f2dede;
    border: 1px solid #ebccd1;
    padding: 12px;
    margin-bottom: 16px;
}

/* Pagina Vini — griglia etichette (background JPG da assets/img) */
#content-two .ch-item[class*="ch-"] {
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

#content-two .ch-grid {
    margin-bottom: 2rem;
}

#content-two .ch-grid li {
    vertical-align: top;
}

/* Sezione Stile — testo completo leggibile, colonne allineate */
#featured-project {
    padding-bottom: 2rem;
}

#featured-project .featured-image {
    padding-top: 0;
}

#featured-project .span6.section-title p {
    line-height: 1.65;
    margin-bottom: 1.25rem;
    overflow: visible;
    max-height: none;
}

@media (max-width: 979px) {
    #featured-project .span6,
    #featured-project .featured-image {
        width: 100%;
        float: none;
        margin-left: 0;
    }

    #featured-project .featured-image {
        margin-top: 1.5rem;
        text-align: center;
    }
}

/* Form contatti — honeypot nascosto */
.riserva-contact-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.riserva-contact-form .control-group label {
    display: inline;
}

/* WooCommerce checkout — verde Riserva */
body.woocommerce-checkout .woocommerce .button.alt,
body.woocommerce-cart .woocommerce .button.checkout,
body.woocommerce-account .woocommerce .button {
    background-color: #628704;
    border-color: #4a6b0a;
}

body.woocommerce-checkout .woocommerce .button.alt:hover,
body.woocommerce-cart .woocommerce .button.checkout:hover {
    background-color: #4a6b0a;
}
