/*
Theme Name: FMN
Theme URI: https://franquiciarminegocio.com
Author: FMN
Description: Tema custom per Franquiciar Mi Negocio.
Version: 1.0.9
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: fmn
*/

/* ==========================================================================
   Reset & base
   ========================================================================== */

:root {
    --c-navy: #0d1b3d;
    --c-navy-dark: #0a1530;
    --c-navy-footer: #1a1a1a;
    --c-yellow: #f0b800;
    --c-yellow-dark: #d9a600;
    --c-white: #ffffff;
    --c-gray-100: #f5f5f7;
    --c-gray-300: #d4d4d8;
    --c-gray-400: #a1a1aa;
    --c-gray-600: #52525b;
    --c-gray-800: #27272a;
    --c-text: #27272a;
    --c-border: #e4e4e7;

    --container: 1400px;
    --container-narrow: 1100px;
    --container-pad: 1.5rem;

    --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: var(--font-body);

    --radius: 4px;
    --shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-white);
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--c-navy); transition: color 0.2s ease; }
a:hover { color: var(--c-yellow-dark); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--c-navy);
    line-height: 1.25;
    margin: 0 0 0.75em;
    font-weight: 700;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }

p { margin: 0 0 1em; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

.container--narrow { max-width: var(--container-narrow); }

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--c-yellow);
    color: var(--c-navy);
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-body);
    border-radius: var(--radius);
    border: 0;
    cursor: pointer;
    transition: background 0.2s ease;
}
.btn:hover { background: var(--c-yellow-dark); color: var(--c-navy); }

button, input, select, textarea {
    font-family: inherit;
}

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px; height: 1px;
    overflow: hidden;
}

/* ==========================================================================
   Header — Grid 3 colonne x 2 righe
   ========================================================================== */

.site-header {
    background: var(--c-navy);
    color: var(--c-white);
    width: 100%;
    overflow-x: clip;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
    will-change: background-color;
}

/* Stato allo scroll: leggerissima opacità + blur + ombra sottile */
.site-header.is-scrolled {
    background-color: rgba(13, 27, 61, 0.94);
    box-shadow: 0 4px 20px rgba(13, 27, 61, 0.18);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
}

.site-header__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--container-pad);
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: stretch;
}

/* BLOCCO 1: logo colonna sinistra, sulle 2 righe */
.site-header__logo {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    padding: 0.75rem 2rem 0.75rem 0;
}

.site-header__logo img {
    height: 85px;
    width: auto;
}

/* BLOCCO 2a: banda gialla - SPANNA colonne 2 e 3 (sfondo sotto ai social)
   Clip-path "/" solo a sinistra, bordo destro dritto */
.site-header__yellow {
    grid-column: 2 / 4;
    grid-row: 1;
    background: var(--c-yellow);
    color: var(--c-navy);
    display: flex;
    align-items: center;
    padding: 0.6rem 2rem 0.6rem 3rem;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 30px 100%);
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 0;

    /* Estensione della banda gialla OLTRE il container, fino al bordo destro del viewport */
    margin-right: calc(-1 * max(var(--container-pad), (100vw - var(--container)) / 2 + var(--container-pad)));
}

.site-header__contact {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    flex-wrap: wrap;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--c-navy);
    text-decoration: none;
    white-space: nowrap;
}

a.contact-item:hover { text-decoration: underline; color: var(--c-navy); }

/* BLOCCO 2b: social - grid col 3 (SOPRA la banda gialla, colore scuro) */
.site-header__social {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.9rem;
    list-style: none;
    margin: 0;
    padding: 0 0.5rem 0 1.5rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.site-header__social a {
    color: var(--c-navy);
    display: inline-flex;
    transition: color 0.2s ease, opacity 0.2s ease;
}
.site-header__social a:hover { color: var(--c-navy); opacity: 0.65; }

/* Hamburger (solo mobile) */
.menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 0.5rem;
    color: var(--c-white);
    cursor: pointer;
}

.menu-toggle__bar {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--c-white);
    margin: 5px 0;
    transition: transform 0.3s, opacity 0.3s;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* BLOCCO 3: menu (riga 2, colonne 2-3) — centrato */
.site-header__nav {
    grid-column: 2 / 4;
    grid-row: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0 1rem;
}

.main-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-menu > li { position: relative; }

.main-menu a {
    color: var(--c-white);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    display: inline-block;
    transition: color 0.2s ease;
}

.main-menu a:hover,
.main-menu .current-menu-item > a,
.main-menu .current-menu-ancestor > a,
.main-menu .current_page_item > a { color: var(--c-yellow); }

.main-menu .menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 0; height: 0;
    margin-left: 0.4rem;
    vertical-align: 2px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--c-yellow);
}

.main-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--c-navy);
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 100;
}

.main-menu > li:hover > .sub-menu,
.main-menu > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-menu .sub-menu a {
    display: block;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
}

/* Placeholder menu admin */
.menu-placeholder {
    margin: 0.5rem 0;
    padding: 0.5rem 1rem;
    background: rgba(240, 184, 0, 0.15);
    border: 1px dashed var(--c-yellow);
    border-radius: var(--radius);
    font-size: 0.85rem;
}
.menu-placeholder a { color: var(--c-yellow); text-decoration: underline; }

/* ==========================================================================
   Main / body
   ========================================================================== */

.site-main {
    padding: 3rem 0;
    min-height: 50vh;
}

/* Home page (front-page.php) — full width, nessun padding, contenuto edge-to-edge */
.site-main--full {
    padding: 0;
    min-height: 0;
}

.entry-content--full {
    /* Reset spazio tra blocchi full-width (slider + sezioni) */
}

.entry-content--full > * {
    margin: 0;
}

/* Se dentro la home vuoi comunque sezioni con larghezza container, 
   avvolgile in <div class="home-section"> o usa il blocco Gruppo di Gutenberg */
.home-section {
    padding: 4rem 0;
}
.home-section--narrow {
    max-width: var(--container);
    margin: 0 auto;
    padding: 4rem var(--container-pad);
}

.page-header { margin-bottom: 2rem; }
.page-title { margin: 0 0 0.5rem; }

.entry-content > * + * { margin-top: 1rem; }
.entry-content img { border-radius: var(--radius); }

.entry-content blockquote {
    border-left: 4px solid var(--c-yellow);
    padding: 0.25rem 0 0.25rem 1.25rem;
    margin: 1.5rem 0;
    color: var(--c-gray-600);
    font-style: italic;
}

.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.post-card__thumb img { width: 100%; height: 200px; object-fit: cover; }
.post-card__body { padding: 1.25rem; }
.post-card__title { font-size: 1.125rem; margin: 0 0 0.5rem; }
.post-card__title a { color: var(--c-navy); text-decoration: none; }
.post-card__title a:hover { color: var(--c-yellow-dark); }
.post-card__meta {
    font-size: 0.8125rem;
    color: var(--c-gray-600);
    margin-bottom: 0.5rem;
}

.pagination {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--c-navy);
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--c-yellow);
    border-color: var(--c-yellow);
    color: var(--c-navy);
}

/* ==========================================================================
   Footer — fascia CTA (full width)
   ========================================================================== */

.footer-cta-bar {
    background: var(--c-navy);
    width: 100%;
}

.footer-cta-bar__inner {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 72px;
}

.footer-cta__text {
    background: var(--c-yellow);
    color: var(--c-navy);
    flex: 1;
    padding: 1.1rem 2.5rem 1.1rem max(var(--container-pad), calc(50vw - (var(--container) / 2) + var(--container-pad)));
    font-weight: 700;
    font-size: 1.15rem;
    text-align: center;
    clip-path: polygon(0 0, calc(100% - 40px) 0, 100% 100%, 0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

.footer-cta__btn-wrap {
    display: flex;
    align-items: center;
    padding: 0 max(var(--container-pad), calc(50vw - (var(--container) / 2) + var(--container-pad))) 0 1rem;
    flex-shrink: 0;
}

.footer-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--c-yellow);
    color: var(--c-navy);
    padding: 0.7rem 1.4rem;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.03em;
    border-radius: 2px;
    transition: background 0.2s ease;
}

.footer-cta__btn:hover { background: var(--c-yellow-dark); color: var(--c-navy); }

.footer-cta__btn-arrow {
    background: var(--c-navy);
    color: var(--c-yellow);
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
}

/* ==========================================================================
   Footer — main (full width)
   ========================================================================== */

.site-footer {
    background: var(--c-navy-footer);
    color: var(--c-gray-300);
    padding: 3.5rem 0 0;
    width: 100%;
}

.site-footer a { color: var(--c-gray-300); }
.site-footer a:hover { color: var(--c-yellow); }

.site-footer__cols {
    display: grid;
    grid-template-columns: 1.3fr 1.5fr 1fr;
    gap: 3rem;
    padding-bottom: 2.5rem;
}

.site-footer h4 {
    color: var(--c-white);
    font-size: 1.375rem;
    margin: 0 0 1.5rem;
    padding-bottom: 0.6rem;
    position: relative;
    font-weight: 700;
}

.site-footer h4::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--c-yellow);
}

.site-footer__about { font-size: 0.9rem; }

.site-footer__logo img {
    height: 80px;
    width: auto;
    margin: 0 auto 1.5rem;
}

.site-footer__about p,
.site-footer__about .contact-line {
    margin: 0 0 0.75rem;
    line-height: 1.55;
}

.site-footer__about .contact-email a {
    color: var(--c-yellow);
    text-decoration: none;
}
.site-footer__about .contact-email a:hover { text-decoration: underline; }

.site-footer__social {
    list-style: none;
    display: flex;
    gap: 0.6rem;
    margin: 1.25rem 0 0;
    padding: 0;
}

.site-footer__social a {
    width: 36px; height: 36px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    color: var(--c-white);
}
.site-footer__social a:hover { background: var(--c-yellow); color: var(--c-navy); }

.footer-blog { list-style: none; margin: 0; padding: 0; }

.footer-blog__item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.footer-blog__item:last-child { border-bottom: 0; }

.footer-blog__thumb {
    flex-shrink: 0;
    width: 70px;
    height: 60px;
    overflow: hidden;
    border-radius: 2px;
}
.footer-blog__thumb img { width: 100%; height: 100%; object-fit: cover; }
.footer-blog__thumb--placeholder { background: rgba(255, 255, 255, 0.05); }

.footer-blog__body { flex: 1; min-width: 0; }

.footer-blog__title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.35rem;
}

.footer-blog__title a { color: var(--c-yellow); text-decoration: none; }
.footer-blog__title a:hover { text-decoration: underline; }

.footer-blog__date {
    font-size: 0.8rem;
    color: var(--c-gray-400);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.site-footer__menu { list-style: none; margin: 0; padding: 0; }
.site-footer__menu li { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.site-footer__menu a {
    display: block;
    padding: 0.85rem 0;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s, padding-left 0.2s;
}
.site-footer__menu a:hover { color: var(--c-yellow); padding-left: 0.4rem; }

.site-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--c-gray-400);
}
.site-footer__bottom strong { color: var(--c-yellow); font-weight: 600; }
.site-footer__bottom a { color: var(--c-yellow); text-decoration: none; }
.site-footer__bottom a:hover { text-decoration: underline; }

/* ==========================================================================
   Floating buttons
   ========================================================================== */

.floating-actions {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.floating-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--c-white);
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
    border: 0;
    cursor: pointer;
}

.floating-btn:hover { transform: translateY(-3px); color: var(--c-white); }

.floating-btn--phone { background: #1e88e5; }
.floating-btn--whatsapp { background: #25d366; }
.floating-btn--top {
    background: var(--c-yellow);
    color: var(--c-navy);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
}
.floating-btn--top.is-visible { opacity: 1; visibility: visible; }
.floating-btn--top:hover { color: var(--c-navy); }

/* ==========================================================================
   404 & search
   ========================================================================== */

.error-404 { text-align: center; padding: 4rem 0; }
.error-404 h1 { font-size: 5rem; margin-bottom: 0.5rem; color: var(--c-yellow); }

.search-form { display: flex; max-width: 500px; margin: 1rem auto; }
.search-form input[type="search"] {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 1px solid var(--c-border);
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 1rem;
}
.search-form button {
    padding: 0.65rem 1.25rem;
    background: var(--c-yellow);
    color: var(--c-navy);
    border: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-weight: 600;
    cursor: pointer;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .site-header__yellow {
        padding: 0.6rem 1rem 0.6rem 2rem;
    }
    .site-header__contact {
        gap: 1rem;
        font-size: 0.8125rem;
    }
    .site-header__logo img { height: 70px; }
    .site-footer__cols { grid-template-columns: 1fr 1fr; }
    .site-footer__col--menu { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    /* Mobile: mantenuto come ti piaceva */
    .site-header__inner {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
        padding: 0;
    }

    /* Social sopra: barra GIALLA con icone navy */
    .site-header__social {
        grid-column: 1 / -1;
        grid-row: 1;
        justify-content: center;
        padding: 0.6rem 1rem;
        background: var(--c-yellow);
        z-index: auto;
    }
    .site-header__social a { color: var(--c-navy); }
    .site-header__social a:hover { color: var(--c-navy); opacity: 0.65; }

    .site-header__logo {
        grid-column: 1;
        grid-row: 2;
        padding: 0.5rem 1rem;
    }
    .site-header__logo img { height: 42px; }

    .menu-toggle {
        display: block;
        grid-column: 2;
        grid-row: 2;
        align-self: center;
        margin-right: 1rem;
    }

    .site-header__yellow { display: none; }

    .site-header__nav {
        grid-column: 1 / -1;
        grid-row: 3;
        display: block;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }

    .site-header__nav.is-open {
        max-height: 1000px;
        padding: 0.5rem 1rem 1rem;
    }

    .main-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }

    .main-menu > li { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
    .main-menu a { padding: 0.85rem 0.25rem; display: block; }

    .main-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(0, 0, 0, 0.2);
        box-shadow: none;
        padding: 0;
        display: none;
    }
    .main-menu .menu-item-has-children.is-open > .sub-menu { display: block; }
    .main-menu .sub-menu a { padding-left: 1.5rem; }

    /* Footer CTA stack */
    .footer-cta-bar__inner { flex-direction: column; }
    .footer-cta__text {
        clip-path: none;
        padding: 1rem;
        font-size: 1rem;
    }
    .footer-cta__btn-wrap {
        padding: 1rem;
        justify-content: center;
    }

    /* Footer cols */
    .site-footer__cols {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    .site-footer h4::after { left: 50%; transform: translateX(-50%); }
    .site-footer__social { justify-content: center; }
    .footer-blog__item { text-align: left; }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.375rem; }
}

@media (max-width: 480px) {
    .floating-actions { right: 12px; bottom: 12px; }
    .floating-btn { width: 42px; height: 42px; }
}
