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

 /* ═══════════════════════════════════════════
   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);
}

/* ═══════════════════════════════════════════
   VARIABILI BRAND RE MERCATO (sync con blog-remercato.css)
   ═══════════════════════════════════════════ */
: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);
    --rm-shadow-md:    0 4px 16px rgba(0, 0, 0, 0.10);
}


/* ═══════════════════════════════════════════
   RESET LAYOUT TEMA PADRE
   ═══════════════════════════════════════════ */
.rm-single-fullwidth #sidebar,
.rm-single-fullwidth .sidebar,
.rm-single-fullwidth aside.widget-area,
.rm-single-fullwidth .wpb_sidebar,
.rm-single-fullwidth [id*="sidebar"],
.rm-single-fullwidth [class*="sidebar"]:not(.rm-single-sidebar) {
    display: none !important;
}

.rm-single-fullwidth #content,
.rm-single-fullwidth .site-content,
.rm-single-fullwidth #primary,
.rm-single-fullwidth .content-area {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
}


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


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

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


/* ═══════════════════════════════════════════
   BREADCRUMB (sopra l'articolo)
   ═══════════════════════════════════════════ */
.rm-single-breadcrumb {
    font-size: 12px;
    color: var(--rm-muted);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

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

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

.rm-single-breadcrumb__sep {
    color: var(--rm-border);
    margin: 0 2px;
}

.rm-single-breadcrumb__current {
    color: var(--rm-muted);
    font-weight: 500;
}


/* ═══════════════════════════════════════════
   ARTICOLO PRINCIPALE
   ═══════════════════════════════════════════ */
.rm-single-article {
    background: var(--rm-white);
    border: 1px solid var(--rm-border);
    border-radius: var(--rm-radius-lg);
    overflow: hidden;
}


/* IMMAGINE HERO */
.rm-single-hero {
    position: relative;
    width: 100%;
    max-height: 420px;
    overflow: hidden;
    background: var(--rm-bg);
}

.rm-single-hero__img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

.rm-single-hero__placeholder {
    width: 100%;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rm-green-light);
    font-size: 80px;
}

/* Overlay gradiente sul fondo dell'immagine */
.rm-single-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(26, 43, 107, 0.65) 0%, transparent 100%);
    pointer-events: none;
}

/* CATEGORIE sull'immagine */
.rm-single-hero__cats {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    z-index: 2;
}

/* Badge data sull'immagine */
.rm-single-date-badge {
    position: absolute;
    bottom: 18px;
    left: 20px;
    background: var(--rm-blue);
    color: var(--rm-white);
    border: 2px solid var(--rm-yellow);
    border-radius: 50%;
    width: 62px;
    height: 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

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

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


/* CORPO ARTICOLO */
.rm-single-body {
    padding: 28px 32px 32px;
}

@media (max-width: 600px) {
    .rm-single-body {
        padding: 20px 18px 24px;
    }
}


/* META (autore, data) */
.rm-single-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

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

.rm-single-meta__item svg {
    flex-shrink: 0;
    color: var(--rm-green);
}

.rm-single-meta__item a {
    color: var(--rm-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.rm-single-meta__item a:hover {
    color: var(--rm-blue);
}


/* TITOLO */
.rm-single-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--rm-blue);
    line-height: 1.25;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--rm-yellow);
}

@media (max-width: 600px) {
    .rm-single-title {
        font-size: 20px;
    }
}


/* CONTENUTO */
.rm-single-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--rm-text);
}

.rm-single-content p {
    margin: 0 0 18px;
}

.rm-single-content p:last-child {
    margin-bottom: 0;
}

.rm-single-content h2,
.rm-single-content h3,
.rm-single-content h4 {
    color: var(--rm-blue);
    font-weight: 700;
    margin: 28px 0 12px;
    line-height: 1.3;
}

.rm-single-content h2 { font-size: 20px; }
.rm-single-content h3 { font-size: 17px; }
.rm-single-content h4 { font-size: 15px; }

.rm-single-content a {
    color: var(--rm-green);
    text-decoration: underline;
    text-decoration-color: rgba(106, 170, 42, 0.35);
    transition: color 0.15s, text-decoration-color 0.15s;
}

.rm-single-content a:hover {
    color: var(--rm-blue);
    text-decoration-color: rgba(26, 43, 107, 0.4);
}

.rm-single-content ul,
.rm-single-content ol {
    padding-left: 22px;
    margin: 0 0 18px;
}

.rm-single-content li {
    margin-bottom: 6px;
}

.rm-single-content blockquote {
    border-left: 4px solid var(--rm-yellow);
    background: var(--rm-bg);
    margin: 22px 0;
    padding: 14px 18px;
    border-radius: 0 var(--rm-radius) var(--rm-radius) 0;
    font-style: italic;
    color: var(--rm-muted);
    font-size: 15px;
}

.rm-single-content blockquote p {
    margin: 0;
}

.rm-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--rm-radius);
    margin: 10px 0 18px;
}

.rm-single-content figure {
    margin: 22px 0;
}

.rm-single-content figcaption {
    font-size: 12px;
    color: var(--rm-muted);
    text-align: center;
    margin-top: 6px;
}

.rm-single-content code {
    background: var(--rm-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--rm-blue);
    font-family: monospace;
}

.rm-single-content pre {
    background: var(--rm-blue);
    color: var(--rm-white);
    padding: 16px 20px;
    border-radius: var(--rm-radius);
    overflow-x: auto;
    font-size: 13px;
    margin: 20px 0;
}

.rm-single-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Separatore dopo il contenuto */
.rm-single-content-end {
    border: none;
    border-top: 1px solid var(--rm-border);
    margin: 28px 0 0;
}


/* ═══════════════════════════════════════════
   TAGS INLINE
   ═══════════════════════════════════════════ */
.rm-single-tags {
    padding: 18px 32px;
    border-top: 1px solid var(--rm-border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.rm-single-tags__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rm-blue);
    flex-shrink: 0;
}

.rm-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    background: var(--rm-bg);
    color: var(--rm-blue);
    padding: 4px 11px;
    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);
    text-decoration: none;
}

@media (max-width: 600px) {
    .rm-single-tags {
        padding: 14px 18px;
    }
}


/* ═══════════════════════════════════════════
   SOCIAL SHARE
   ═══════════════════════════════════════════ */
.rm-single-share {
    padding: 16px 32px;
    border-top: 1px solid var(--rm-border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.rm-single-share__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rm-blue);
    flex-shrink: 0;
}

.rm-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 6px 14px;
    border-radius: 5px;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
    line-height: 1;
}

.rm-share-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    text-decoration: none;
}

.rm-share-btn--fb  { background: #1877f2; color: #fff; }
.rm-share-btn--tw  { background: #000;    color: #fff; }
.rm-share-btn--li  { background: #0a66c2; color: #fff; }
.rm-share-btn--wa  { background: #25d366; color: #fff; }

.rm-share-btn svg  { flex-shrink: 0; }

@media (max-width: 600px) {
    .rm-single-share {
        padding: 14px 18px;
    }
}


/* ═══════════════════════════════════════════
   NAVIGAZIONE PRECEDENTE / SUCCESSIVO
   ═══════════════════════════════════════════ */
.rm-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 24px;
}

@media (max-width: 600px) {
    .rm-post-nav {
        grid-template-columns: 1fr;
    }
}

.rm-post-nav__link {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 16px 18px;
    background: var(--rm-white);
    border: 1px solid var(--rm-border);
    border-radius: var(--rm-radius-lg);
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rm-post-nav__link:hover {
    border-color: var(--rm-blue);
    box-shadow: var(--rm-shadow);
    text-decoration: none;
}

.rm-post-nav__link--next {
    text-align: right;
}

.rm-post-nav__dir {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rm-green);
    display: flex;
    align-items: center;
    gap: 5px;
}

.rm-post-nav__link--next .rm-post-nav__dir {
    justify-content: flex-end;
}

.rm-post-nav__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--rm-blue);
    line-height: 1.35;
}


/* ═══════════════════════════════════════════
   PILL CATEGORIE (sync con blog)
   ═══════════════════════════════════════════ */
.rm-cat-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 11px;
    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);
}


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

/* Widget generico (sync con blog-remercato.css) */
.rm-single-sidebar .rm-widget {
    background: var(--rm-white);
    border: 1px solid var(--rm-border);
    border-radius: var(--rm-radius-lg);
    overflow: hidden;
}

.rm-single-sidebar .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-single-sidebar .rm-widget__head svg {
    color: var(--rm-yellow);
    flex-shrink: 0;
}

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

/* Articoli correlati nella sidebar */
.rm-related-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

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

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

.rm-related-item__thumb--placeholder {
    font-size: 24px;
}

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

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

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

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

/* Categorie sidebar */
.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;
}

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

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

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

.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);
}

/* Search form sidebar */
.rm-single-sidebar .rm-search-form {
    display: flex;
    gap: 6px;
}

.rm-single-sidebar .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-single-sidebar .rm-search-input:focus {
    border-color: var(--rm-blue);
}

.rm-single-sidebar .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-single-sidebar .rm-search-btn:hover {
    background: var(--rm-green);
}

body.wpb-js-composer #main, body.blog #main, body.single #main, body.archive #main {
    padding-bottom: 23rem!important;
}
/* ═══════════════════════════════════════════
   RESPONSIVE — TABLET / MOBILE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {

    .rm-single-hero__img {
        height: 260px;
    }

    .rm-single-title {
        font-size: 21px;
    }

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

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

@media (max-width: 480px) {

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

    .rm-single-hero__img {
        height: 210px;
    }

    .rm-single-title {
        font-size: 18px;
    }

    .rm-post-nav {
        grid-template-columns: 1fr;
    }

    .rm-single-share__label,
    .rm-single-tags__label {
        width: 100%;
    }
}
