/* ============================================================
   TripMaster Blog — Editorial surface
   Scoped under .blog-page, inherits tokens from landing.css
   ============================================================ */

.blog-page {
    padding-top: 96px;     /* clears the fixed navbar */
    padding-bottom: 64px;
    background: var(--bg);
}

.blog-page .container { max-width: 1160px; }

/* ── Breadcrumb ───────────────────────────────────────── */
.blog-page .breadcrumb {
    font-size: .8125rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    background: transparent;
    padding: 0;
}

.blog-page .breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color .15s;
}

.blog-page .breadcrumb a:hover { color: var(--primary); }

.blog-page .breadcrumb-item + .breadcrumb-item::before { color: var(--border); }

.blog-page .breadcrumb-item.active { color: var(--text); }

/* ── Header (list + category) ─────────────────────────── */
.blog-page .blog-header {
    padding: 8px 0 36px;
    text-align: left;
}

.blog-page .blog-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -.025em;
    color: var(--text);
    margin-bottom: 12px;
}

.blog-page .blog-header .lead {
    font-size: 1.0625rem;
    color: var(--text-muted);
    max-width: 68ch;
    margin-bottom: 0;
}

/* ── Category chips ───────────────────────────────────── */
.blog-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.blog-chip {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: .8125rem;
    font-weight: 500;
    letter-spacing: .01em;
    text-decoration: none;
    transition: color .15s, border-color .15s, background .15s, box-shadow .15s;
}

.blog-chip:hover {
    color: var(--primary-dark);
    border-color: var(--primary-light);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.blog-chip.is-active {
    color: #fff;
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ── Article card (list + correlati + home snippet) ──── */
.blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: transform .25s, box-shadow .25s, border-color .25s;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
    color: var(--text);
}

.blog-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #eef2fa 0%, #dde6f5 100%);
}

.blog-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s;
}

.blog-card:hover .blog-card-cover img { transform: scale(1.03); }

.blog-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 22px 24px;
}

.blog-card-badge {
    display: inline-block;
    align-self: flex-start;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--primary-dark);
    background: #eaf1ff;
    border-radius: 999px;
    padding: 4px 10px;
    margin-bottom: 12px;
}

.blog-card-title {
    font-family: var(--font-display);
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -.015em;
    color: var(--text);
    margin: 0 0 10px;
}

.blog-card-excerpt {
    font-size: .9375rem;
    color: var(--text-muted);
    line-height: 1.55;
    flex: 1;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    font-size: .75rem;
    color: var(--text-muted);
    letter-spacing: .02em;
}

/* ── Pagination ───────────────────────────────────────── */
.blog-page .pagination { gap: 6px; }

.blog-page .page-link {
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .875rem;
    font-weight: 500;
    min-width: 38px;
    text-align: center;
    transition: color .15s, border-color .15s, background .15s;
}

.blog-page .page-link:hover {
    color: var(--primary-dark);
    border-color: var(--primary-light);
    background: #fff;
}

.blog-page .page-item.active .page-link {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

/* ── Article detail: hero ─────────────────────────────── */
.blog-article-header {
    max-width: 820px;
    margin: 0 auto 32px;
    padding-top: 4px;
}

.blog-article-header .blog-card-badge { margin-bottom: 18px; }

.blog-article-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.025em;
    color: var(--text);
    margin-bottom: 18px;
}

.blog-article-meta {
    font-size: .875rem;
    color: var(--text-muted);
    letter-spacing: .01em;
    margin-bottom: 28px;
}

.blog-article-cover {
    position: relative;
    width: 100%;
    max-width: 1080px;
    aspect-ratio: 16 / 9;
    margin: 0 auto 40px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, #eef2fa 0%, #dde6f5 100%);
    box-shadow: var(--shadow-md);
}

.blog-article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Article detail: reading column ───────────────────── */
.blog-content {
    max-width: 70ch;
    margin: 0 auto;
    font-size: 1.0625rem;
    line-height: 1.78;
    color: var(--text);
}

.blog-content > :first-child { margin-top: 0; }

.blog-content h2 {
    font-family: var(--font-display);
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.02em;
    margin: 2.2em 0 .6em;
    color: var(--text);
}

.blog-content h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 1.8em 0 .5em;
    color: var(--text);
}

.blog-content p { margin: 0 0 1.15em; }

.blog-content a {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color .15s;
}

.blog-content a:hover { color: var(--primary); }

.blog-content ul,
.blog-content ol { margin: 0 0 1.25em; padding-left: 1.4em; }

.blog-content li { margin-bottom: .35em; }

.blog-content blockquote {
    margin: 1.6em 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--primary);
    color: var(--text-muted);
    font-style: italic;
    font-size: 1.05rem;
}

.blog-content blockquote p { margin: 0 0 .5em; }
.blog-content blockquote p:last-child { margin-bottom: 0; }

.blog-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .875em;
    padding: 2px 6px;
    border-radius: 4px;
    background: #eef2fa;
    color: var(--primary-dark);
}

.blog-content pre {
    margin: 1.4em 0;
    padding: 18px 20px;
    border-radius: 10px;
    background: #0d1829;
    color: #e9eef9;
    overflow-x: auto;
    font-size: .875rem;
    line-height: 1.6;
}

.blog-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.4em 0;
    display: block;
}

.blog-content hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2.4em 0;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    font-size: .9375rem;
}

.blog-content th,
.blog-content td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.blog-content th { font-weight: 600; color: var(--text); background: #f7f9fd; }

/* ── Related section ──────────────────────────────────── */
.blog-related {
    max-width: 1080px;
    margin: 72px auto 0;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.blog-related h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.015em;
    margin-bottom: 24px;
    color: var(--text);
}

/* ── Home snippet "Ultime dal blog" ───────────────────── */
.blog-snippet {
    padding: 72px 0;
    background: var(--bg);
}

.blog-snippet .container { max-width: 1160px; }

.blog-snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 32px;
    gap: 16px;
    flex-wrap: wrap;
}

.blog-snippet-header h2 {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -.025em;
    margin: 0;
    color: var(--text);
}

.blog-snippet-header .blog-snippet-link {
    font-size: .875rem;
    font-weight: 500;
    color: var(--primary-dark);
    text-decoration: none;
    transition: color .15s;
}

.blog-snippet-header .blog-snippet-link:hover { color: var(--primary); }

/* ── Empty state ──────────────────────────────────────── */
.blog-empty {
    max-width: 540px;
    margin: 48px auto;
    padding: 48px 32px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 14px;
    color: var(--text-muted);
    font-size: .9375rem;
    background: var(--bg-surface);
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .blog-page { padding-top: 80px; padding-bottom: 48px; }
    .blog-article-cover { border-radius: 12px; margin-bottom: 28px; }
    .blog-content { font-size: 1rem; line-height: 1.72; }
    .blog-content h2 { font-size: 1.4rem; }
    .blog-content h3 { font-size: 1.15rem; }
    .blog-snippet { padding: 56px 0; }
    .blog-snippet-header h2 { font-size: 1.75rem; }
    .blog-related { margin-top: 56px; }
}

@media (prefers-reduced-motion: reduce) {
    .blog-card,
    .blog-card-cover img,
    .blog-chip,
    .blog-page .page-link { transition: none; }
    .blog-card:hover { transform: none; }
    .blog-card:hover .blog-card-cover img { transform: none; }
}
