/* ==========================================================================
   Single Post — Lindhaus custom template
   ========================================================================== */

/* ---------- Design tokens (shared) ---------- */
:root {
    --lh-blue: #4992BB;
    --lh-blue-light: #DCEBF3;
    --lh-gray-bg: #EBEBEB;
    --lh-text: #565656;
    --lh-text-dark: #333;
    --lh-footer-gray: #777474;
    --lh-white: #fff;
    --lh-radius: 10px;
    --lh-container: 1140px;
    --lh-gap: 24px;
    --lh-section-spacing: 60px;
    --lh-font-heading: 'Inter', sans-serif;
    --lh-font-body: 'Inter', sans-serif;
    --lh-font-btn: 'Roboto', sans-serif;
}

/* ---------- Base ---------- */
.lh-single-post {
    color: var(--lh-text);
    font-family: var(--lh-font-body);
    font-weight: 400;
    line-height: 1.6;
}

.lh-single-post *,
.lh-single-post *::before,
.lh-single-post *::after {
    box-sizing: border-box;
}

.lh-single-post img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   1. Hero
   ========================================================================== */
.lh-single-hero {
    position: relative;
    overflow: hidden;
    background-color: var(--lh-blue-light);
    background-position: right center;
    background-repeat: no-repeat;
    background-size: contain;
    min-height: 60vh;
    min-height: 60dvh;
}

/* Diagonal overlay — azzurro chiaro */
.lh-single-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: var(--lh-blue-light);
    clip-path: polygon(0 0, 55% 0, 50% 100%, 0 100%);
    z-index: 1;
}

.lh-single-hero__inner {
    position: relative;
    z-index: 2;
    max-width: var(--lh-container);
    margin: 0 auto;
    padding: 0 20px;
    min-height: 60vh;
    min-height: 60dvh;
    display: flex;
    align-items: center;
}

.lh-single-hero__text-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 400px;
}

.lh-single-hero__title {
    font-family: var(--lh-font-heading);
    font-size: 28px;
    font-weight: 400;
    line-height: 1.3;
    margin: 0 0 20px;
    color: var(--e-global-color-text);
}

/* Pills — categorie e tag */
.lh-single-hero__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.lh-single-hero__pills+.lh-single-hero__pills {
    margin-top: 10px;
}

.lh-single-hero__pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

/* Categoria pills */
.lh-single-hero__pill--cat {
    border: 1px solid var(--lh-blue);
    color: var(--lh-blue);
    background: transparent;
}

.lh-single-hero__pill--cat:hover {
    background: var(--lh-blue);
    color: var(--lh-white);
}

/* Tag pills */
.lh-single-hero__pill--tag {
    border: 1px solid var(--lh-footer-gray);
    color: var(--lh-text);
    background: transparent;
}

.lh-single-hero__pill--tag:hover {
    background: var(--lh-footer-gray);
    color: var(--lh-white);
}

/* ==========================================================================
   2. Breadcrumb
   ========================================================================== */
.lh-single-breadcrumb {
    background: #ebebeb;
    padding: 60px 0;
    font-size: 13px;
    color: var(--lh-footer-gray);
}

.lh-single-breadcrumb__inner {
    max-width: var(--lh-container);
    margin: 0 auto;
    padding: 0 20px;
}

.lh-single-breadcrumb__inner p {
    margin: 0;
}

.lh-single-breadcrumb__inner span:last-child {
    color: var(--lh-text-dark);
}

.lh-single-breadcrumb a {
    color: var(--lh-blue);
    text-decoration: none;
}

.lh-single-breadcrumb a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   3. Body — 2/3 article + 1/3 sidebar
   ========================================================================== */
.lh-single-body {
    background: var(--lh-gray-bg);
    padding: 0 0 var(--lh-section-spacing);
}

.lh-single-body__inner {
    max-width: var(--lh-container);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 40px;
}

/* ---------- Article content ---------- */
.lh-single-body__article {
    flex: 2;
    min-width: 0;
    background: var(--lh-white);
    border-radius: var(--lh-radius);
    padding: 40px;
}

.lh-single-body__article>*:first-child {
    margin-top: 0;
}

.lh-single-body__article>*:last-child {
    margin-bottom: 0;
}

/* Article typography */
.lh-single-body__article p {
    font-size: 16px;
    line-height: 1.8;
    margin: 0 0 1.2em;
}

.lh-single-body__article h2 {
    font-family: var(--lh-font-heading);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    margin: 40px 0 16px;
    color: var(--lh-text-dark);
    scroll-margin-top: 20px;
}

.lh-single-body__article h3 {
    font-family: var(--lh-font-heading);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    margin: 32px 0 12px;
    color: var(--lh-text-dark);
}

.lh-single-body__article h4 {
    font-family: var(--lh-font-heading);
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 10px;
    color: var(--lh-text-dark);
}

.lh-single-body__article img {
    border-radius: var(--lh-radius);
    margin: 24px 0;
}

.lh-single-body__article a {
    color: var(--lh-blue);
    text-decoration: underline;
}

.lh-single-body__article a:hover {
    text-decoration: none;
}

.lh-single-body__article ul,
.lh-single-body__article ol {
    padding-left: 24px;
    margin: 0 0 1.2em;
}

.lh-single-body__article li {
    margin-bottom: 6px;
    line-height: 1.7;
}

.lh-single-body__article blockquote {
    border-left: 4px solid var(--lh-blue);
    margin: 24px 0;
    padding: 16px 24px;
    background: var(--lh-blue-light);
    border-radius: 0 var(--lh-radius) var(--lh-radius) 0;
    font-style: italic;
    color: var(--lh-text-dark);
}

.lh-single-body__article blockquote p:last-child {
    margin-bottom: 0;
}

.lh-single-body__article pre,
.lh-single-body__article code {
    font-size: 14px;
}

.lh-single-body__article pre {
    background: var(--lh-gray-bg);
    padding: 16px;
    border-radius: var(--lh-radius);
    overflow-x: auto;
    margin: 24px 0;
}

.lh-single-body__article table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.lh-single-body__article th,
.lh-single-body__article td {
    border: 1px solid #ddd;
    padding: 10px 14px;
    text-align: left;
    font-size: 14px;
}

.lh-single-body__article th {
    background: var(--lh-blue-light);
    font-weight: 600;
    color: var(--lh-text-dark);
}

/* ==========================================================================
   4. Sidebar
   ========================================================================== */
.lh-single-sidebar {
    flex: 1;
    min-width: 280px;
}

.lh-single-sidebar__box {
    position: sticky;
    top: calc(var(--lh-header-height, 80px) + 20px);
    background: var(--lh-blue-light);
    border-radius: var(--lh-radius);
    padding: 24px;
}

/* ---------- Progress bar ---------- */
.lh-single-sidebar__progress {
    margin-bottom: 24px;
}

.lh-single-sidebar__progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--lh-text-dark);
    margin-bottom: 8px;
}

.lh-single-sidebar__progress-track {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.lh-single-sidebar__progress-bar {
    height: 100%;
    width: 0%;
    background: var(--lh-blue);
    border-radius: 2px;
    transition: width 0.15s ease-out;
}

/* ---------- Accordion sections ---------- */
.lh-single-sidebar__section {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 16px;
    margin-top: 16px;
}

.lh-single-sidebar__section:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.lh-single-sidebar__section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: var(--lh-font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--lh-text-dark);
    text-align: left;
}

.lh-single-sidebar__section-header:hover {
    color: var(--lh-blue);
}

.lh-single-sidebar__chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

/* Chevron rotates when closed */
.lh-single-sidebar__section:not(.is-open) .lh-single-sidebar__chevron {
    transform: rotate(180deg);
}

/* Accordion body */
.lh-single-sidebar__section-body {
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
    opacity: 1;
    margin-top: 12px;
}

.lh-single-sidebar__section:not(.is-open) .lh-single-sidebar__section-body {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

/* ---------- TOC ---------- */
.lh-single-sidebar__toc {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lh-single-sidebar__toc li {
    margin: 0;
}

.lh-single-sidebar__toc a {
    display: block;
    padding: 6px 0;
    font-size: 13px;
    color: var(--lh-text);
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1.4;
}

.lh-single-sidebar__toc a:hover {
    color: var(--lh-blue);
}

.lh-single-sidebar__toc a.is-active {
    color: var(--lh-blue);
    font-weight: 600;
}

/* ---------- Related articles ---------- */
.lh-single-sidebar__related {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lh-single-sidebar__related-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
}

.lh-single-sidebar__related-item+.lh-single-sidebar__related-item {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.lh-single-sidebar__related-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.lh-single-sidebar__related-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--lh-text-dark);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lh-single-sidebar__related-title:hover {
    color: var(--lh-blue);
}

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

/* Tablet large (new breakpoint) */
@media (max-width: 1100px) {
    .lh-single-hero {
        background-size: cover;
    }

    .lh-single-hero::before {
        display: none;
    }

    .lh-single-hero__text-col {
        max-width: 100%;
        padding: 20px;
        background: rgba(220, 235, 243, 0.95);
        border-radius: var(--lh-radius);
    }
}

/* Tablet */
@media (max-width: 768px) {
    .lh-single-hero {
        min-height: auto;
    }

    .lh-single-hero__inner {
        min-height: auto;
        padding: 40px 20px;
    }

    .lh-single-hero__title {
        font-size: 30px;
    }

    .lh-single-body__inner {
        flex-direction: column;
    }

    .lh-single-sidebar {
        min-width: 0;
        width: 100%;
    }

    .lh-single-sidebar__box {
        position: static;
    }

    .lh-single-body__article {
        padding: 30px 24px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .lh-single-hero {
        min-height: 300px;
    }

    .lh-single-hero__inner {
        padding: 20px;
    }

    .lh-single-hero__title {
        font-size: 26px;
    }

    .lh-single-body__article {
        padding: 24px 16px;
    }

    .lh-single-body__article h2 {
        font-size: 20px;
        margin-top: 32px;
    }

    .lh-single-body__article h3 {
        font-size: 18px;
    }
}