/*
 * Re Mercato — Blog Page Styles
 * File: /wp-content/themes/NOME-CHILD-THEME/css/blog-remercato.css
 *
 * Da accodare in functions.php del child theme con:
 *   wp_enqueue_style(
 *       'rm-blog-style',
 *       get_stylesheet_directory_uri() . '/css/blog-remercato.css',
 *       array(),
 *       '1.0.0'
 *   );
 *
 * Oppure incollare direttamente in style.css del child theme.
 * ─────────────────────────────────────────────────────────────
 */

/* ═══════════════════════════════════════════
   VARIABILI BRAND RE MERCATO
   ═══════════════════════════════════════════ */
:root {
    --rm-blue:         #1a2b6b;
    --rm-blue-hover:   #243580;
    --rm-yellow:       #f5c518;
    --rm-yellow-dark:  #c9a20d;
    --rm-green:        #6aaa2a;
    --rm-green-hover:  #559120;
    --rm-green-light:  #e8f5d6;
    --rm-white:        #ffffff;
    --rm-bg:           #f5f5f5;
    --rm-border:       #e2e2e2;
    --rm-text:         #222222;
    --rm-muted:        #666666;
    --rm-radius:       8px;
    --rm-radius-lg:    12px;
    --rm-shadow:       0 2px 8px rgba(0, 0, 0, 0.07);
}


/* ═══════════════════════════════════════════
   WRAPPER PAGINA
   ═══════════════════════════════════════════ */
.rm-blog-page {
    max-width: 1140px;
    margin: 0 auto;
    padding: 32px 20px 60px;
    box-sizing: border-box;
}


/* ═══════════════════════════════════════════
   HERO BANNER
   ═══════════════════════════════════════════ */
.rm-blog-hero {
    background: var(--rm-blue);
    margin-bottom: 32px;
    overflow: hidden;
    position: relative;
    min-height: 20rem;
}

.rm-blog-hero::after {
    content: 'BLOG';
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 80px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.05);
    letter-spacing: 6px;
    pointer-events: none;
    line-height: 1;
}

.rm-blog-hero__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 36px;
    position: relative;
    z-index: 1;
}

.rm-blog-hero__title {
    font-size: 28px;
    font-weight: 800;
    color: var(--rm-white);
    margin: 0 0 6px;
    line-height: 1.2;
}

.rm-blog-hero__title span {
    color: var(--rm-yellow);
}

.rm-blog-hero__badge {
    background: var(--rm-yellow);
    color: var(--rm-blue);
    font-size: 11px;
    font-weight: 800;
    padding: 7px 18px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════
   BREADCRUMB
   ═══════════════════════════════════════════ */
.rm-breadcrumb {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rm-breadcrumb a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.15s;
}

.rm-breadcrumb a:hover {
    color: var(--rm-yellow);
}

.rm-breadcrumb__sep {
    margin: 0 2px;
    opacity: 0.4;
}

.rm-breadcrumb__current {
    color: var(--rm-yellow);
}


/* ═══════════════════════════════════════════
   LAYOUT: FEED + SIDEBAR
   ═══════════════════════════════════════════ */
.rm-blog-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 30px;
    align-items: start;
}

@media (max-width: 900px) {
    .rm-blog-layout {
        grid-template-columns: 1fr;
    }
    .rm-blog-sidebar {
        order: -1;
    }
}


/* ═══════════════════════════════════════════
   FEED ARTICOLI
   ═══════════════════════════════════════════ */
.rm-blog-feed {
    display: flex;
    flex-direction: column;
    gap: 24px;
}


/* ═══════════════════════════════════════════
   CARD ARTICOLO
   ═══════════════════════════════════════════ */
.rm-article {
    background: var(--rm-white);
    border: 1px solid var(--rm-border);
    border-radius: var(--rm-radius-lg);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rm-article:hover {
    border-color: var(--rm-blue);
    box-shadow: var(--rm-shadow);
}


/* IMMAGINE */
.rm-article__img-wrap {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: var(--rm-bg);
}

.rm-article__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.rm-article:hover .rm-article__img {
    transform: scale(1.03);
}

.rm-article__img--placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rm-green-light);
    font-size: 60px;
}

/* PILL CATEGORIE */
.rm-article__cats {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.rm-cat-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 20px;
    text-decoration: none;
    line-height: 1.4;
    transition: opacity 0.15s;
}

.rm-cat-pill:hover {
    opacity: 0.85;
    text-decoration: none;
}

.rm-cat-pill--primary {
    background: var(--rm-yellow);
    color: var(--rm-blue);
}

.rm-cat-pill--secondary {
    background: var(--rm-green);
    color: var(--rm-white);
}

/* BADGE DATA */
.rm-date-badge {
    position: absolute;
    bottom: 14px;
    left: 14px;
    background: var(--rm-blue);
    color: var(--rm-white);
    border: 2px solid var(--rm-yellow);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.rm-date-badge__day {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    display: block;
}

.rm-date-badge__month {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.8;
    display: block;
}


/* CORPO */
.rm-article__body {
    padding: 18px 24px 22px;
}

.rm-article__meta {
    display: flex;
    gap: 14px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.rm-article__meta-item {
    font-size: 12px;
    color: var(--rm-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.rm-article__meta-item svg {
    flex-shrink: 0;
    color: var(--rm-muted);
}

.rm-article__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.3;
}

.rm-article__title a {
    color: var(--rm-blue);
    text-decoration: none;
    transition: color 0.15s;
}

.rm-article__title a:hover {
    color: var(--rm-green);
}

.rm-article__excerpt {
    font-size: 14px;
    color: var(--rm-muted);
    line-height: 1.7;
    margin-bottom: 14px;
}

.rm-article__excerpt p {
    margin: 0;
}


/* BOTTONE LEGGI DI PIÙ */
.rm-read-more {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--rm-blue);
    color: var(--rm-white);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 8px 18px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.rm-read-more:hover {
    background: var(--rm-green);
    color: var(--rm-white);
    text-decoration: none;
}

.rm-read-more svg {
    transition: transform 0.2s ease;
}

.rm-read-more:hover svg {
    transform: translateX(3px);
}


/* ═══════════════════════════════════════════
   PAGINAZIONE
   ═══════════════════════════════════════════ */
.rm-pagination {
    margin-top: 12px;
}

.rm-pagination .page-numbers {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.rm-pagination .page-numbers li {
    margin: 0;
}

.rm-pagination .page-numbers a,
.rm-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--rm-border);
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rm-blue);
    text-decoration: none;
    transition: all 0.15s ease;
    background: var(--rm-white);
}

.rm-pagination .page-numbers a:hover {
    background: var(--rm-blue);
    color: var(--rm-white);
    border-color: var(--rm-blue);
}

.rm-pagination .page-numbers .current {
    background: var(--rm-blue);
    color: var(--rm-white);
    border-color: var(--rm-blue);
}

.rm-pagination .page-numbers .prev,
.rm-pagination .page-numbers .next {
    font-size: 12px;
    padding: 0 14px;
}


/* NESSUN ARTICOLO */
.rm-no-posts {
    background: var(--rm-white);
    border: 1px solid var(--rm-border);
    border-radius: var(--rm-radius-lg);
    padding: 40px 24px;
    text-align: center;
    color: var(--rm-muted);
    font-size: 15px;
}


/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */
.rm-blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Widget generico */
.rm-widget {
    background: var(--rm-white);
    border: 1px solid var(--rm-border);
    border-radius: var(--rm-radius-lg);
    overflow: hidden;
}

.rm-widget__head {
    background: var(--rm-blue);
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--rm-white);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rm-widget__head svg {
    color: var(--rm-yellow);
    flex-shrink: 0;
}

.rm-widget__body {
    padding: 14px 16px;
}

.rm-widget__empty {
    font-size: 13px;
    color: var(--rm-muted);
    margin: 0;
}


/*
 * NEUTRALIZZA SIDEBAR DEL TEMA PADRE
 * Impedisce che il tema inietti la propria sidebar dentro .rm-blog-page.
 * Sovrascrive i layout a colonne del tema padre (es. WPBakery, Avada, ecc.)
 */
.rm-blog-fullwidth .rm-blog-page {
    width: 100% !important;
    max-width: 1140px !important;
    float: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Nasconde la sidebar nativa del tema quando siamo nel template blog */
.rm-blog-fullwidth #sidebar,
.rm-blog-fullwidth .sidebar,
.rm-blog-fullwidth aside.widget-area,
.rm-blog-fullwidth .wpb_sidebar,
.rm-blog-fullwidth [id*="sidebar"],
.rm-blog-fullwidth [class*="sidebar"]:not(.rm-blog-sidebar) {
    display: none !important;
}

/* Reset layout colonne del tema padre sull'area contenuto */
.rm-blog-fullwidth #content,
.rm-blog-fullwidth .site-content,
.rm-blog-fullwidth .entry-content,
.rm-blog-fullwidth #primary,
.rm-blog-fullwidth .content-area {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
}


/* FORM DI RICERCA CUSTOM */
.rm-search-form {
    display: flex;
    gap: 6px;
}

.rm-search-input {
    flex: 1;
    font-size: 13px;
    padding: 8px 10px;
    border: 1px solid var(--rm-border);
    border-radius: 5px;
    color: var(--rm-text);
    background: var(--rm-white);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
    font-family: inherit;
}

.rm-search-input:focus {
    border-color: var(--rm-blue);
}

.rm-search-btn {
    background: var(--rm-blue);
    color: var(--rm-white);
    border: none;
    border-radius: 5px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.rm-search-btn:hover {
    background: var(--rm-green);
}

/* Override stile nativo WP get_search_form() se presente */
.rm-widget .search-form {
    display: flex;
    gap: 6px;
}
.rm-widget .search-form label { flex: 1; margin: 0; }
.rm-widget .search-field {
    width: 100%; font-size: 13px; padding: 8px 10px;
    border: 1px solid var(--rm-border); border-radius: 5px;
    color: var(--rm-text); outline: none; box-sizing: border-box;
}
.rm-widget .search-field:focus { border-color: var(--rm-blue); }
.rm-widget .search-submit {
    background: var(--rm-blue); color: var(--rm-white); border: none;
    border-radius: 5px; padding: 8px 12px; font-size: 13px;
    font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.rm-widget .search-submit:hover { background: var(--rm-green); }


/* LISTA CATEGORIE */
.rm-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rm-cat-list__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid #f0f0f0;
}

.rm-cat-list__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rm-cat-list__link {
    font-size: 13px;
    color: var(--rm-text);
    text-decoration: none;
    transition: color 0.15s;
}

.rm-cat-list__link:hover,
.rm-cat-list__link--active {
    color: var(--rm-blue);
    font-weight: 600;
}

.rm-count {
    font-size: 10px;
    font-weight: 700;
    background: var(--rm-blue);
    color: var(--rm-white);
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}


/* ARTICOLI RECENTI */
.rm-recent-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.rm-recent-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rm-recent-item__thumb {
    width: 46px;
    height: 46px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--rm-green-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rm-recent-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rm-recent-item__thumb--placeholder {
    font-size: 22px;
}

.rm-recent-item__info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
}

.rm-recent-item__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--rm-blue);
    text-decoration: none;
    line-height: 1.35;
    transition: color 0.15s;
}

.rm-recent-item__title:hover {
    color: var(--rm-green);
}

.rm-recent-item__date {
    font-size: 11px;
    color: var(--rm-muted);
}


/* TAG CLOUD */
.rm-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rm-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    background: var(--rm-bg);
    color: var(--rm-blue);
    padding: 4px 10px;
    border-radius: 20px;
    text-decoration: none;
    border: 1px solid var(--rm-border);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.rm-tag:hover {
    background: var(--rm-blue);
    color: var(--rm-white);
    border-color: var(--rm-blue);
}


/* ARCHIVI */
.rm-arch-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rm-arch-list__item,
.rm-arch-list li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.rm-arch-list__item:last-child,
.rm-arch-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rm-arch-list a {
    font-size: 13px;
    color: var(--rm-text);
    text-decoration: none;
    transition: color 0.15s;
}

.rm-arch-list a:hover {
    color: var(--rm-blue);
}

body.wpb-js-composer #main, body.blog #main, body.single #main, body.archive #main {
    padding-bottom: 23rem!important;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — TABLET
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {

    .rm-blog-hero__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 20px 24px;
    }

    .rm-blog-hero__title {
        font-size: 22px;
    }

    .rm-blog-hero::after {
        font-size: 50px;
    }

    .rm-article__img-wrap {
        height: 180px;
    }

    .rm-article__title {
        font-size: 17px;
    }
}


/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE
   ═══════════════════════════════════════════ */
@media (max-width: 480px) {

    .rm-blog-page {
        padding: 20px 14px 40px;
    }

    .rm-blog-hero__inner {
        padding: 16px 18px;
    }

    .rm-blog-hero__title {
        font-size: 18px;
    }

    .rm-blog-hero__badge {
        font-size: 10px;
        padding: 5px 12px;
    }

    .rm-article__img-wrap {
        height: 160px;
    }

    .rm-article__body {
        padding: 14px 16px 16px;
    }

    .rm-article__title {
        font-size: 15px;
    }

    .rm-date-badge {
        width: 48px;
        height: 48px;
    }

    .rm-date-badge__day {
        font-size: 15px;
    }
}
