/* Custom base styles */
body {
  background-color: #F7F3E3; /* Nuova tonalità panna estratta dall'immagine */
  color: #2c2c2c;
  font-family: 'Inter', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', serif;
}

/* MailPoet Custom Styling Integration - Fix Larghezza e Layout */
.mailpoet-custom-container .mailpoet_form {
    display: flex !important;
    flex-direction: column;
    gap: 0.75rem !important;
    max-width: 40rem !important; /* Aumentato da 28rem a 40rem */
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: transparent !important;
}

@media (min-width: 640px) {
    .mailpoet-custom-container .mailpoet_form {
        flex-direction: row !important;
        align-items: stretch !important;
        flex-wrap: wrap !important; /* Permette ai messaggi di andare a capo */
        justify-content: center !important;
    }
}

/* Stile Input - Assicuriamo larghezza adeguata */
.mailpoet-custom-container .mailpoet_text,
.mailpoet-custom-container input[type="email"],
.mailpoet-custom-container input[type="text"] {
    appearance: none !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 9999px !important;
    border: none !important;
    background-color: #F7F3E3 !important;
    color: #111827 !important;
    width: 100% !important;
    min-width: 260px !important; /* Forza una larghezza minima decente */
    font-size: 1rem !important;
    line-height: 1.5 !important;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06) !important;
    height: 100% !important;
    min-height: 48px !important; /* Più alto */
    margin: 0 !important;
    font-family: 'Inter', sans-serif !important;
    text-align: left !important; /* Evita centratura testo */
}

/* Container Input Email - Deve espandersi */
.mailpoet-custom-container .mailpoet_paragraph:has(input[type="email"]),
.mailpoet-custom-container .mailpoet_paragraph:has(input[type="text"]) {
    flex: 1 1 250px !important; /* Cresce, si riduce, base 250px */
    width: 100% !important;
    max-width: 100% !important;
}

/* Stile Pulsante */
.mailpoet-custom-container .mailpoet_submit,
.mailpoet-custom-container input[type="submit"] {
    appearance: none !important;
    padding: 0 2rem !important; /* Padding laterale fisso, verticale zero per centrare */
    border-radius: 9999px !important;
    background-color: #C87960 !important;
    background-image: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    text-transform: none !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    height: 48px !important; /* Altezza fissa identica all'input */
    line-height: 48px !important; /* Centratura verticale */
    width: auto !important;
    min-width: 120px !important;
    margin: 0 !important;
    font-family: 'Inter', sans-serif !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Fix per input email per avere la stessa altezza esatta */
.mailpoet-custom-container .mailpoet_text,
.mailpoet-custom-container input[type="email"],
.mailpoet-custom-container input[type="text"] {
    appearance: none !important;
    padding: 0 1.5rem !important;
    border-radius: 9999px !important;
    border: none !important;
    background-color: #F7F3E3 !important;
    color: #111827 !important;
    width: 100% !important;
    min-width: 260px !important;
    font-size: 1rem !important;
    height: 48px !important; /* Altezza fissa identica al bottone */
    line-height: 48px !important;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06) !important;
    margin: 0 !important;
    font-family: 'Inter', sans-serif !important;
    text-align: left !important;
}

/* Messaggi di successo/errore - Devono andare sotto e prendere tutto lo spazio */
.mailpoet-custom-container .mailpoet_message {
    padding-top: 1rem !important;
    color: #F7F3E3 !important; /* Colore Crema Panna */
    font-family: 'Cormorant Garamond', serif !important;
    font-style: italic !important;
    font-size: 1.25rem !important; /* text-xl */
    line-height: 1.5 !important;
    text-align: center;
    width: 100% !important;
    flex-basis: 100% !important; /* Forza nuova riga nel flex wrap */
    order: 10 !important; /* Sposta alla fine */
    margin-top: 0.5rem !important;
}

.mailpoet-custom-container .mailpoet_validate_success {
    color: #F7F3E3 !important; /* Coerente con il tema */
    font-weight: 500 !important;
}

.mailpoet-custom-container .mailpoet_error {
    color: #fca5a5 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.875rem !important;
    font-style: normal !important;
}

/* ═══════════════════════════════════════════════════════════
   SINGLE ARTICLE — EDITORIAL STYLE
   ═══════════════════════════════════════════════════════════ */

/* ── Layout ── */
.single-article-editorial {
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
}

/* ── Breadcrumb ── */
.article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.825rem;
    font-weight: 500;
    color: #9a9880;
}
.article-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #9a9880;
    text-decoration: none;
    transition: color 0.2s;
}
.article-breadcrumb a:hover {
    color: #3C4133;
}
.breadcrumb-sep {
    color: #d8d3c8;
}

/* ── Title ── */
.single-article-editorial > h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2.75rem, 7vw, 4.5rem);
    font-weight: 400;
    line-height: 1.08;
    color: #3C4133;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #d8d3c8;
}

/* ── Meta Bar ── */
.article-meta-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(60,65,51,0.06);
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #5a5a40;
    font-weight: 500;
}
.meta-item svg {
    color: #D4A373;
    flex-shrink: 0;
    width: 16px !important;
    height: 16px !important;
}

/* Share button — mobile only */
.share-btn-mobile {
    display: none;
    margin-left: auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(212,163,115,0.15);
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: #D4A373;
    transition: background 0.2s, color 0.2s;
}
.share-btn-mobile svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
}
.share-btn-mobile:active {
    background: #D4A373;
    color: #fff;
}
@media (max-width: 767px) {
    .share-btn-mobile {
        display: flex;
    }
}

/* Like Button Styles */
.like-btn {
    min-width: 40px;
    height: 40px;
    border-radius: 99px;
    border: 1px solid rgba(212,163,115,0.2);
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #D4A373;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0 0.75rem;
    flex-shrink: 0;
    outline: none;
}
.like-btn svg {
    width: 18px !important;
    height: 18px !important;
    fill: transparent;
    stroke-width: 2px;
    transition: all 0.3s ease;
}
.like-count {
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}
.like-btn:hover {
    background: rgba(212,163,115,0.05);
    transform: scale(1.1);
}
.like-btn.is-liked {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}
.like-btn.is-liked svg {
    fill: #ef4444;
    filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.4));
}
.like-btn:active {
    transform: scale(0.9);
}

/* Meta bar specific adjustment */
.article-meta-bar .like-btn {
    margin-left: 0.5rem;
}


/* ── Featured Image ── */
.article-featured-image {
    border-radius: 1.25rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 20px 40px rgba(60,65,51,0.08);
}
.article-featured-image .featured-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ═══════════════════════════════════════════════════════════
   ARTICLE CONTENT — WordPress the_content() styling
   ═══════════════════════════════════════════════════════════ */
.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #4A4F41;
}

.article-content > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Hide empty Gutenberg blocks and paragraphs that cause spacing issues */
.article-content p:empty,
.article-content div:empty,
.article-content .intro:empty,
.article-content :where(p, div):is(:blank, :empty) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Fix for specific Gutenberg block gap */
.article-content .wp-block-group,
.article-content .wp-block-columns {
    margin-top: 0;
}

/* Paragraphs */
.article-content p {
    margin-bottom: 1.1rem;
    max-width: 65ch;
}
.article-content p:last-child {
    margin-bottom: 0;
}

/* INTRO block using Group with class "intro" */
.article-content .intro {
    background: white;
    border-left: 4px solid #D4A373;
    border-radius: 0.75rem;
    padding: 2rem 2.25rem;
    margin-bottom: 3.5rem;
    box-shadow: 0 12px 35px rgba(60,65,51,0.06);
}
.article-content .intro p {
    font-size: 0.95rem;
    color: #5a5a40;
    margin-bottom: 0.75rem;
    max-width: none;
}
.article-content .intro p:last-child {
    margin-bottom: 0;
}

/* Links */
.article-content a {
    color: #D4A373;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.article-content a:hover {
    color: #3C4133;
}

/* Headings (h2, h3, h4 from WordPress editor) */
.article-content h2,
.article-content h2.wp-block-heading {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #d8d3c8;
    margin-bottom: 1.75rem;
    margin-top: 3.5rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 500;
    color: #3C4133;
    line-height: 1.2;
}

/* Numbered Section Headers for H2 */
.article-content h2::before,
.article-content h2.wp-block-heading::before {
    counter-increment: section-counter;
    content: "0" counter(section-counter);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 300;
    color: #D4A373;
    line-height: 1;
    opacity: 0.7;
}

.article-content h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
    font-weight: 500;
    color: #3C4133;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.25;
}
.article-content h4 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #3C4133;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

/* Blockquotes */
.article-content blockquote {
    background: #E9E4D9;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border: none;
    border-left: none;
}
.article-content blockquote p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: 1.15rem;
    color: #5a5a40;
    line-height: 1.6;
    margin: 0;
    max-width: none;
}

/* CONCLUSION block using Group with class "conclusion" */
.article-content .conclusion {
    background: #3C4133;
    border-radius: 0.75rem;
    padding: 2.5rem;
    margin-top: 4rem;
    margin-bottom: 0;
    color: rgba(233,228,217,0.85);
}
.article-content .conclusion p.conclusion-label,
.article-content .conclusion h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #D4A373;
    margin-bottom: 1.25rem;
    margin-top: 0;
    border: none;
    padding: 0;
}
.article-content .conclusion p {
    color: rgba(233,228,217,0.85);
    font-size: 0.95rem;
    margin-bottom: 0.85rem;
    max-width: none;
}
.article-content .conclusion a.btn-email {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.65rem 1.5rem;
    background: #D4A373;
    color: #3C4133;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}
.article-content .conclusion a.btn-email:hover {
    background: #c08850;
    transform: translateY(-1px);
    color: #3C4133;
}
.article-content .conclusion a.btn-email svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
}

/* Lists */
.article-content ul {
    list-style: none;
    padding-left: 0;
    margin: 1.25rem 0;
}
.article-content ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.65rem;
}
.article-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #D4A373;
}

.article-content ol {
    padding-left: 1.75rem;
    margin: 1.25rem 0;
}
.article-content ol li {
    margin-bottom: 0.65rem;
    padding-left: 0.25rem;
}
.article-content ol li::marker {
    color: #D4A373;
    font-weight: 600;
}

/* Images inside content */
.article-content img {
    border-radius: 0.75rem;
    margin: 2rem 0;
    max-width: 100%;
    height: auto;
}
.article-content figure {
    margin: 2rem 0;
}
.article-content figcaption {
    font-size: 0.825rem;
    color: #9a9880;
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Code */
.article-content code {
    background: #E9E4D9;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}
.article-content pre {
    background: #3C4133;
    color: #E9E4D9;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.75rem 0;
    font-size: 0.875rem;
    line-height: 1.7;
}
.article-content pre code {
    background: none;
    padding: 0;
}

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75rem 0;
    font-size: 0.9rem;
}
.article-content th,
.article-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #d8d3c8;
}
.article-content th {
    font-weight: 600;
    color: #3C4133;
    background: #E9E4D9;
}

/* Horizontal rule */
.article-content hr {
    border: none;
    border-top: 1px solid #d8d3c8;
    margin: 3rem 0;
}

/* WordPress specific blocks */
.article-content .wp-block-separator {
    border: none;
    border-top: 1px solid #d8d3c8;
    margin: 3rem 0;
}

.article-content .wp-block-quote {
    background: #E9E4D9;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
    border-left: none;
}

.article-content .wp-block-image {
    margin: 2rem 0;
}
.article-content .wp-block-image img {
    border-radius: 0.75rem;
}

/* Embed / video */
.article-content .wp-block-embed {
    margin: 2rem 0;
}
.article-content iframe {
    border-radius: 0.75rem;
    max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   ARTICLE FOOTER
   ═══════════════════════════════════════════════════════════ */
.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #d8d3c8;
}
.footer-social {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.footer-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9a9880;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.social-icons {
    display: flex;
    gap: 0.5rem;
}
.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5a5a40;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.25s;
    text-decoration: none;
}
.social-icons a svg {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
}
.social-icons a:hover {
    color: white;
    transform: translateY(-1px);
}
.social-icons a:first-child:hover {
    background: #E4405F;
}
.social-icons a:last-child:hover {
    background: #0077B5;
}

/* Post navigation */
.article-footer .post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.article-footer .nav-links {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 1.5rem;
}
.article-footer .nav-links a {
    text-decoration: none;
    display: block;
}
.article-footer .nav-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: #9a9880;
    margin-bottom: 0.25rem;
}
.article-footer .nav-title {
    display: block;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.1rem;
    color: #3C4133;
    line-height: 1.3;
    transition: color 0.2s;
}
.article-footer .nav-links a:hover .nav-title {
    color: #D4A373;
}
.article-footer .nav-previous {
    text-align: left;
}
.article-footer .nav-next {
    text-align: right;
    margin-left: auto;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .single-article-editorial {
        padding: 2rem 1.25rem 4rem;
    }
    .article-meta-bar {
        gap: 1rem;
    }
    .article-featured-image {
        border-radius: 0.75rem;
    }
    .article-footer .nav-links {
        flex-direction: column;
        gap: 1.25rem;
    }
    .article-footer .nav-next {
        text-align: left;
    }
    .article-content .conclusion {
        padding: 1.75rem;
    }
    .article-content .conclusion a.btn-email {
        display: flex;
        width: 100%;
        justify-content: center;
        align-items: center;
        padding: 0.85rem 1rem;
        font-size: 0.85rem;
        box-sizing: border-box;
        text-align: center;
        white-space: nowrap;
        gap: 0.4rem;
    }
}