/* ==========================================================================
   SUNYA - Page Templates
   Full Width, Canvas, Landing Page
   ========================================================================== */


/* --------------------------------------------------------------------------
   Full Width template
   -------------------------------------------------------------------------- */

.sunya-main--fullwidth {
    width: 100%;
}

.sunya-article--fullwidth .sunya-article__content {
    /* Blocchi interni usano sunya-container, ma il content è full */
    width: 100%;
}

/* Contenuto testuale dentro full width: max-width leggibile */
.sunya-article--fullwidth .sunya-article__content > *:not(.alignfull):not(.alignwide):not(.wp-block-cover):not(.wp-block-group):not(.wp-block-columns):not(.woocommerce):not([class*="sunya-section"]) {
    max-width: var(--sunya-content-width, 800px);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--sunya-spacing-md);
    padding-right: var(--sunya-spacing-md);
}


/* --------------------------------------------------------------------------
   Hero (Full Width + Landing)
   -------------------------------------------------------------------------- */

.sunya-article__hero,
.sunya-landing-hero {
    position: relative;
    width: 100%;
    min-height: 50vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.sunya-landing-hero {
    min-height: 70vh;
    align-items: center;
}

.sunya-article__hero-img,
.sunya-landing-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sunya-article__hero-overlay,
.sunya-landing-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.65) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        transparent 100%
    );
}

.sunya-landing-hero__overlay {
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.25) 100%
    );
}

.sunya-article__hero-content,
.sunya-landing-hero__content {
    position: relative;
    z-index: 1;
    color: #ffffff;
}

.sunya-article__hero-content {
    padding-bottom: var(--sunya-spacing-2xl);
}

.sunya-landing-hero__content {
    max-width: 650px;
    padding: var(--sunya-spacing-section) 0;
}

.sunya-article__hero-title {
    font-size: clamp( 2rem, 5vw, 3.5rem );
    color: #ffffff;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sunya-landing-hero__title {
    font-size: clamp( 2.5rem, 6vw, 4.5rem );
    color: #ffffff;
    margin: 0 0 var(--sunya-spacing-md);
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sunya-landing-hero__subtitle {
    font-size: var(--sunya-font-size-xl);
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 var(--sunya-spacing-xl);
    line-height: var(--sunya-line-height-body);
}

.sunya-landing-hero__cta {
    display: inline-flex;
}


/* --------------------------------------------------------------------------
   Canvas template (no header/footer)
   -------------------------------------------------------------------------- */

.sunya-canvas {
    /* Reset padding che l'header normalmente riserva */
    padding-top: 0 !important;
}

.sunya-main--canvas {
    min-height: 100vh;
    width: 100%;
}

.sunya-article--canvas .sunya-article__content {
    width: 100%;
}


/* --------------------------------------------------------------------------
   Landing Page template
   -------------------------------------------------------------------------- */

.sunya-main--landing {
    width: 100%;
}

.sunya-article--landing .sunya-article__content {
    width: 100%;
}

/* Contenuto testuale landing: centrato e leggibile */
.sunya-article--landing .sunya-article__content > *:not(.alignfull):not(.alignwide):not(.wp-block-cover):not(.wp-block-group):not(.wp-block-columns):not(.woocommerce):not([class*="sunya-section"]) {
    max-width: var(--sunya-content-width, 800px);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--sunya-spacing-md);
    padding-right: var(--sunya-spacing-md);
}


/* --------------------------------------------------------------------------
   WordPress alignments (alignwide / alignfull)

   Con theme.json attivo (WP 6.x+), il layout engine di WordPress
   gestisce direttamente le larghezze via is-layout-constrained.
   .sunya-entry-content non è wrappato in un container, quindi
   .alignfull è già full-width senza hack con margin negativi.
   -------------------------------------------------------------------------- */

.sunya-article__content .alignfull {
    width: 100%;
    max-width: none;
}

.sunya-article__content .alignwide {
    width: 100%;
    max-width: var(--sunya-wide-width, 1400px);
    margin-left: auto;
    margin-right: auto;
}


/* --------------------------------------------------------------------------
   Sections system (per blocchi full-width nel contenuto)
   
   Classe CSS .sunya-section su un blocco Group per creare sezioni
   full-width con padding e sfondo.
   -------------------------------------------------------------------------- */

/*
 * Se .sunya-section è usato dentro .sunya-entry-content (già full-width),
 * non servono i margin negativi. Se usato dentro .sunya-container,
 * serve il fallback con margin negativi.
 */
.sunya-entry-content [class*="sunya-section"] {
    width: 100%;
    max-width: none;
    padding: var(--sunya-spacing-section) var(--sunya-spacing-md);
}

.sunya-container [class*="sunya-section"] {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc( -50vw + 50% );
    margin-right: calc( -50vw + 50% );
    padding: var(--sunya-spacing-section) var(--sunya-spacing-md);
}

[class*="sunya-section"] > .wp-block-group__inner-container,
[class*="sunya-section"] > * {
    max-width: var(--sunya-container-width, 1200px);
    margin-left: auto;
    margin-right: auto;
}

/* Varianti sezione */
.sunya-section--light {
    background-color: var(--sunya-color-bg-alt, #f7f7f7);
}

.sunya-section--dark {
    background-color: var(--sunya-color-primary);
    color: #ffffff;
}

.sunya-section--accent {
    background-color: var(--sunya-color-accent);
    color: #ffffff;
}

.sunya-section--narrow > .wp-block-group__inner-container,
.sunya-section--narrow > * {
    max-width: var(--sunya-content-width, 800px);
}


/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media screen and (max-width: 768px) {

    .sunya-article__hero,
    .sunya-landing-hero {
        min-height: 40vh;
    }

    .sunya-landing-hero {
        min-height: 55vh;
    }

    .sunya-landing-hero__content {
        padding: var(--sunya-spacing-2xl) 0;
    }
}


/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .sunya-article__hero-img,
    .sunya-landing-hero__img {
        transition: none;
    }
}
