/* ==========================================================================
   TracciaRoma — Template Singolo Articolo
   --------------------------------------------------------------------------
   Stili applicati SOLO alla pagina del singolo post.
   Header e footer del tema/Elementor rimangono invariati.
   --------------------------------------------------------------------------
   Font:    Cinzel (titoli) + Inter (corpo)
   Palette: #2F2F2F testo · #7B1F1A titoli · #B90E05 accento · #f5f4f1 sfondo
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* Variabili & reset minimo — applicate solo nelle nostre sezioni */
.tr-hero,
.tr-body-section,
.tr-tags-wrap,
.tr-author-section,
.tr-related-section {
    --tr-content-width: 760px;
    --tr-radius: 4px;
    --tr-font-display: 'Cinzel', Georgia, serif;
    --tr-font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --tr-font-meta:    'Inter', Helvetica, Arial, sans-serif;
    --tr-text:       #2F2F2F;
    --tr-titles:     #7B1F1A;
    --tr-accent:     #B90E05;
    --tr-bg-soft:    #f5f4f1;
    --tr-dark:       #2F2F2F;
    --tr-on-dark:    #f5f4f1;
    --tr-muted:      #8a8580;
    --tr-border:     #e3e1dc;
    --tr-highlight:  #d4b896;

    box-sizing: border-box;
}

.tr-hero *,
.tr-body-section *,
.tr-tags-wrap *,
.tr-author-section *,
.tr-related-section * {
    box-sizing: border-box;
}

/* ==========================================================================
   1. HERO — sforra il container Elementor per andare a tutta larghezza
   ========================================================================== */

.tr-hero {
    position: relative;
    min-height: 60vh;
    background-color: #7B1F1A;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 80px 0 60px;

    /* Sfora il container del tema per andare full-width */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: -2rem;
    margin-bottom: 0;
}

.tr-hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.tr-hero__breadcrumb {
    font-family: var(--tr-font-meta);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tr-highlight);
    font-weight: 600;
    margin-bottom: 18px;
}

.tr-hero__breadcrumb a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.tr-hero__breadcrumb a:hover {
    opacity: 0.7;
}

.tr-hero__breadcrumb .tr-sep {
    margin: 0 10px;
    opacity: 0.5;
}

.tr-hero__title {
    font-family: var(--tr-font-display);
    font-size: clamp(1.75rem, 4.2vw, 3.25rem);
    line-height: 1.2;
    color: #ffffff;
    margin: 0 0 28px;
    font-weight: 600;
    letter-spacing: 0.02em;
    max-width: 22ch;
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.tr-hero__meta {
    font-family: var(--tr-font-meta);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.04em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-weight: 400;
}

.tr-hero__meta .tr-meta__sep {
    margin: 0 12px;
    opacity: 0.5;
}

.tr-hero__meta .tr-meta__author {
    font-weight: 500;
}

/* ==========================================================================
   2. CORPO ARTICOLO
   ========================================================================== */

.tr-body-section {
    padding: 70px 0 50px;
}

.tr-body {
    font-family: var(--tr-font-body);
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--tr-text);
    max-width: var(--tr-content-width);
    margin: 0 auto;
    font-weight: 400;
    padding: 0 24px;
}

.tr-body > p:first-of-type::first-letter {
    font-family: var(--tr-font-display);
    font-size: 4rem;
    line-height: 0.9;
    float: left;
    margin: 0.5rem 0.7rem 0 0;
    color: var(--tr-accent);
    font-weight: 600;
}

.tr-body p {
    margin: 0 0 1.4em;
}

.tr-body p strong {
    color: var(--tr-text);
    font-weight: 600;
}

.tr-body h2 {
    font-family: var(--tr-font-display);
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    line-height: 1.3;
    font-weight: 600;
    margin: 2.5em 0 0.7em;
    color: var(--tr-titles);
    position: relative;
    padding-left: 1.4rem;
    letter-spacing: 0.02em;
}

.tr-body h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 0.9rem;
    height: 3px;
    background: var(--tr-accent);
}

.tr-body h3 {
    font-family: var(--tr-font-display);
    font-size: 1.3rem;
    font-weight: 500;
    margin: 2em 0 0.6em;
    color: var(--tr-titles);
    line-height: 1.35;
    letter-spacing: 0.02em;
}

.tr-body h4 {
    font-family: var(--tr-font-body);
    font-size: 1rem;
    font-weight: 600;
    margin: 1.8em 0 0.5em;
    color: var(--tr-text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tr-body a {
    color: var(--tr-text);
    text-decoration: underline;
    text-decoration-color: var(--tr-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.tr-body a:hover {
    color: var(--tr-accent);
}

.tr-body blockquote {
    margin: 2em -8px;
    padding: 1.2em 1.5em;
    border-left: 3px solid var(--tr-accent);
    background: rgba(185, 14, 5, 0.04);
    font-family: var(--tr-font-body);
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--tr-text);
    border-radius: 0 var(--tr-radius) var(--tr-radius) 0;
    font-weight: 400;
}

.tr-body blockquote p {
    margin: 0;
}

.tr-body img,
.tr-body figure {
    max-width: 100%;
    height: auto;
    border-radius: var(--tr-radius);
    margin: 1.5em auto;
    display: block;
}

.tr-body figcaption {
    font-family: var(--tr-font-body);
    font-style: italic;
    font-size: 0.875rem;
    color: var(--tr-muted);
    text-align: center;
    margin-top: 0.6em;
}

.tr-body ul,
.tr-body ol {
    padding-left: 1.5em;
    margin: 0 0 1.4em;
}

.tr-body li {
    margin-bottom: 0.6em;
}

.tr-body code {
    background: var(--tr-bg-soft);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
}

/* ==========================================================================
   3. TAG
   ========================================================================== */

.tr-tags-wrap {
    max-width: var(--tr-content-width);
    margin: 3em auto 0;
    padding: 0 24px;
}

.tr-tags-wrap .tr-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 1.5em 0;
    border-top: 1px solid var(--tr-border);
    border-bottom: 1px solid var(--tr-border);
}

.tr-tags__label {
    font-family: var(--tr-font-meta);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--tr-muted);
    font-weight: 600;
}

.tr-tags__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tr-tag {
    font-family: var(--tr-font-meta);
    font-size: 12px;
    padding: 5px 12px;
    border: 1px solid var(--tr-accent);
    color: var(--tr-accent);
    border-radius: 999px;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.tr-tag:hover {
    background: var(--tr-accent);
    color: #ffffff;
}

/* ==========================================================================
   4. AUTORE — full-width sforando il container
   ========================================================================== */

.tr-author-section {
    background: var(--tr-dark);
    color: var(--tr-on-dark);
    padding: 50px 24px;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.tr-author {
    max-width: var(--tr-content-width);
    margin: 0 auto;
    display: flex;
    gap: 20px;
    align-items: center;
}

.tr-author__avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--tr-highlight);
    display: block;
}

.tr-author__label {
    font-family: var(--tr-font-meta);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--tr-highlight);
    font-weight: 600;
}

.tr-author__name {
    font-family: var(--tr-font-display);
    font-size: 1.35rem;
    margin: 4px 0 8px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.tr-author__name a {
    color: var(--tr-on-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.tr-author__name a:hover {
    color: var(--tr-highlight);
}

.tr-author__bio {
    font-family: var(--tr-font-body);
    font-size: 0.95rem;
    color: rgba(245, 244, 241, 0.85);
    line-height: 1.6;
    margin: 0;
    max-width: 60ch;
    font-weight: 400;
}

/* ==========================================================================
   5. ARTICOLI CORRELATI — full-width
   ========================================================================== */

.tr-related-section {
    background: var(--tr-bg-soft);
    padding: 70px 24px;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.tr-related {
    max-width: 1200px;
    margin: 0 auto;
}

.tr-related__head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 2.5em;
}

.tr-related__divider {
    flex: 0 0 60px;
    height: 1px;
    background: var(--tr-muted);
    opacity: 0.4;
}

.tr-related__title {
    font-family: var(--tr-font-meta);
    font-size: 12px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--tr-muted);
    margin: 0;
    font-weight: 600;
}

.tr-related__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.tr-card {
    background: #ffffff;
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tr-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(47, 47, 47, 0.12);
}

.tr-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.tr-card__img-wrap {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--tr-bg-soft);
}

.tr-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tr-card:hover .tr-card__img-wrap img {
    transform: scale(1.05);
}

.tr-card__body {
    padding: 16px 20px 20px;
}

.tr-card__cat {
    font-family: var(--tr-font-meta);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tr-accent);
    font-weight: 600;
}

.tr-card__title {
    font-family: var(--tr-font-display);
    font-size: 1.1rem;
    line-height: 1.35;
    margin: 10px 0 8px;
    font-weight: 600;
    color: var(--tr-titles);
    letter-spacing: 0.02em;
}

.tr-card__date {
    font-family: var(--tr-font-meta);
    font-size: 12px;
    color: var(--tr-muted);
    font-weight: 400;
}

/* ==========================================================================
   6. NAVIGAZIONE PREV/NEXT
   ========================================================================== */

.tr-nav-posts {
    margin: 3em auto 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding-top: 2em;
    border-top: 1px solid var(--tr-border);
}

.tr-nav-posts__item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    padding: 16px 20px;
    border-radius: var(--tr-radius);
    transition: background 0.2s ease;
}

.tr-nav-posts__item:hover {
    background: rgba(185, 14, 5, 0.05);
}

.tr-nav-posts__item--next {
    text-align: right;
    align-items: flex-end;
}

.tr-nav-posts__label {
    font-family: var(--tr-font-meta);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tr-accent);
    font-weight: 600;
}

.tr-nav-posts__title {
    font-family: var(--tr-font-display);
    font-size: 1rem;
    line-height: 1.35;
    color: var(--tr-titles);
    font-weight: 500;
    transition: color 0.2s ease;
    letter-spacing: 0.02em;
}

.tr-nav-posts__item:hover .tr-nav-posts__title {
    color: var(--tr-accent);
}

/* ==========================================================================
   7. RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .tr-hero {
        min-height: 50vh;
        padding: 60px 0 40px;
    }

    .tr-hero__title {
        font-size: 1.6rem;
        max-width: 100%;
        line-height: 1.25;
    }

    .tr-hero__meta {
        font-size: 12px;
    }

    .tr-hero__meta .tr-meta__sep {
        margin: 0 8px;
    }

    .tr-body-section {
        padding: 50px 0 40px;
    }

    .tr-body {
        font-size: 1rem;
    }

    .tr-body > p:first-of-type::first-letter {
        font-size: 3.2rem;
    }

    .tr-author-section {
        padding: 40px 20px;
    }

    .tr-author {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }

    .tr-author__bio {
        max-width: 100%;
    }

    .tr-related-section {
        padding: 50px 20px;
    }

    .tr-nav-posts {
        grid-template-columns: 1fr;
    }

    .tr-nav-posts__item--next {
        text-align: left;
        align-items: flex-start;
    }
}
