/* Blog Navigation */
.blog-nav {
    background-color: #0a5567;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Legal pages layout */
.legal-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.06);
    padding: 2rem;
    max-width: var(--post-max);
    margin: 2.5rem auto;
}
.legal-card h2 { color: #0a5567; margin: 2rem 0 0.75rem; font-size: 1.5rem; }
.legal-card h3 { color: #0a5567; margin: 1.25rem 0 0.5rem; font-size: 1.125rem; }
.legal-card p { color: #444; line-height: 1.8; margin: 0 0 1rem; }
.legal-card ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.legal-card li { margin: 0.5rem 0; }
.legal-meta { font-size: 0.9rem; color: #666; margin: 0.5rem 0 1rem; }
.legal-toc {
    background: #fafafa;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin: 1rem 0 1.5rem;
}
.legal-toc a { color: #0a5567; text-decoration: none; font-weight: 600; }
.legal-toc a:hover { color: #e09615; }

/* Table of Contents */
.post-toc {
    border: 1px solid #eaeaea;
    background: #fafafa;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 1rem 0 2rem 0;
}
.post-toc h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #0a5567;
}
.post-toc ul { margin: 0; padding-left: 1.25rem; }
.post-toc li { margin: 0.35rem 0; }

/* Hide static TOC title (we'll use a compact toggle instead) */
.post-toc h3 { display: none !important; }

/* Collapsible TOC */
.post-toc {
    position: relative;
}
.post-toc .toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
}
.post-toc .toc-title { font-size: .95rem; color: #0a5567; font-weight: 700; }
.post-toc .toc-toggle {
    appearance: none;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    padding: .25rem .5rem;
    cursor: pointer;
    color: #0a5567;
    font-weight: 600;
    line-height: 1;
}
.post-toc .toc-toggle:hover { border-color: #0a5567; }
.post-toc .toc-icon { display: inline-block; width: 1em; text-align: center; }
.post-toc .toc-content { margin-top: .25rem; }
.post-toc.is-collapsed .toc-content { display: none; }

/* Related posts */
.related-posts {
    margin-top: 0.5rem;
    margin-bottom: 3.5rem; /* despegar del footer */
}
.related-posts h3 {
    font-size: 1.25rem;
    color: #0a5567;
    margin-bottom: 1rem;
}
.related-posts-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.related-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    transition: transform .2s ease, box-shadow .2s ease;
    text-decoration: none;
    color: inherit;
}
.related-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.related-thumb { height: 140px; overflow: hidden; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-content { padding: 0.9rem 1rem; }
.related-title { font-size: 1rem; font-weight: 700; color: #0a5567; margin: 0 0 .5rem; }
.related-meta { font-size: .85rem; color: #777; }

.blog-nav .nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-nav .logo {
    color: white;
    text-decoration: none;
}

.blog-nav .logo-name {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.blog-nav .logo-surname {
    font-size: 0.875rem;
    font-weight: 400;
    opacity: 0.95;
}

.blog-nav .nav-links {
    display: flex;
    gap: 0.5rem;
}

.blog-nav .nav-link {
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 1.5px solid transparent;
}

.blog-nav .nav-link:hover {
    border-color: #f5a623;
}

.blog-nav .nav-link.active {
    background-color: #f5a623;
    border-color: #f5a623;
}

/* Blog Header */
.blog-header {
    background: linear-gradient(135deg, #0a5567 0%, #0d6a7f 100%);
    padding: 4rem 0;
    text-align: center;
    color: white;
}

.blog-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.blog-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.95;
}

/* Blog Main */
.blog-main {
    padding: 4rem 0;
    background-color: #f8f9fa;
}

/* Category Filter */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
    justify-content: center;
}

.category-btn {
    background-color: white;
    color: #0a5567;
    border: 2px solid #e0e0e0;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover {
    border-color: #0a5567;
    transform: translateY(-2px);
}

.category-btn.active {
    background-color: #0a5567;
    color: white;
    border-color: #0a5567;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2.5rem;
}

/* Make entire card clickable while preserving styles */
.blog-card-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
}
.blog-card-wrapper:focus-visible .blog-card,
.blog-card-wrapper:hover .blog-card {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.blog-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.blog-card-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: #f5a623;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-card-content {
    padding: 2rem;
}

.blog-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #999;
}

.blog-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0a5567;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.blog-card-excerpt {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.blog-card-link {
    color: #f5a623;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.blog-card-link:hover {
    color: #e09615;
}

:root {
    /* Single source of truth for post page max width */
    --post-max: 840px; /* +100px para mejorar legibilidad */
}

/* Post Page Styles */
.post-header {
    background: linear-gradient(135deg, #0a5567 0%, #0d6a7f 100%);
    padding: 6rem 0 4rem;
    color: white;
}

/* Constrain post header content width to avoid full-bleed layout */
.post-header .container {
    max-width: var(--post-max);
}

/* Align inner content container width with header and article */
.post-content-wrapper .container {
    max-width: var(--post-max);
}

.post-category {
    display: inline-block;
    background-color: #f5a623;
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

.post-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-wrap: balance; /* improve wrapping */
    max-width: 100%;
    overflow-wrap: anywhere;
}

.post-meta {
    display: flex;
    gap: 2rem;
    font-size: 1rem;
    opacity: 0.9;
}

.post-content {
    max-width: 100%; /* fill the container to match header width */
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.9;
    color: #444;
    word-break: break-word; /* improve H1 wrapping */
}

.post-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #0a5567;
    margin: 2.5rem 0 1.5rem;
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0a5567;
    margin: 2rem 0 1rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content ul,
.post-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.75rem;
}

.post-content strong {
    color: #0a5567;
    font-weight: 600;
}

.post-back-link {
    display: inline-block;
    color: #0a5567;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.post-back-link:hover {
    color: #f5a623;
}

/* Author Box */
.post-author-box {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 3rem; /* espaciado extra antes de relacionados */
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    max-width: var(--post-max);
    margin-left: auto;
    margin-right: auto;
}

.author-box-inner { display: flex; gap: 1.25rem; align-items: flex-start; }

.author-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #0a5567;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e6f0f3;
    color: #0a5567;
    font-weight: 800;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.author-avatar.no-avatar::after {
    content: "AD";
    font-size: 1.1rem;
}

.author-info {
    flex: 1;
}

.author-name {
    margin: 0 0 0.25rem 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0a5567;
}

.author-name a {
    color: inherit;
    text-decoration: none;
}
.author-name a:hover {
    color: #e09615;
}

.author-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: #666;
}

.author-bio {
    margin: 0 0 0.75rem 0;
    color: #555;
    line-height: 1.6;
}

.author-links a {
    display: inline-block;
    color: #f5a623;
    text-decoration: none;
    font-weight: 600;
}

.author-links a:hover {
    color: #e09615;
}

.post-disclaimer {
    margin-top: 1rem;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    color: #8c6d1f;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.92rem;
}

/* Responsive */
@media (max-width: 968px) {
    .blog-nav .nav-content {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .blog-title {
        font-size: 2.5rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .post-title {
        font-size: 2.25rem;
    }
}

@media (max-width: 640px) {
    .blog-header {
        padding: 3rem 0;
    }
    
    .blog-title {
        font-size: 2rem;
    }
    
    .blog-subtitle {
        font-size: 1rem;
    }
    
    .category-filter {
        gap: 0.5rem;
    }
    
    .category-btn {
        font-size: 0.85rem;
        padding: 0.625rem 1.25rem;
    }
    
    .post-header {
        padding: 4rem 0 3rem;
    }
    
    .post-title {
        font-size: 1.75rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
    }

    .author-box-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Footer fixes for blog/legal/post pages to match rounded container aesthetics */
.footer {
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    overflow: hidden; /* ensure yellow bar respects rounding */
}

.footer-bottom {
    padding: 0.75rem 0; /* thinner yellow bar */
}

@media (max-width: 640px) {
    .footer-bottom { padding: 0.6rem 0; }
}

/* Tighter legal links to avoid wrapping on ES labels */
.footer-legal { gap: 1rem; }
.footer-legal-link { font-size: 0.85rem; }

/* Keep bottom content compact and avoid mid-word breaks */
.footer-bottom-content { flex-wrap: wrap; row-gap: 0.25rem; }
.footer-legal-link { white-space: nowrap; }

@media (max-width: 1200px) {
    .footer-legal { gap: 0.75rem; }
    .footer-legal-link { font-size: 0.8rem; }
}

