/* ==========================================================================
   Blog CMS - Public Site Styles (Main Site Theme)
   ========================================================================== */

:root {
    --primary: #0B3D91;
    --primary-dark: #072A66;
    --primary-light: #E8F0FE;
    --primary-50: #F0F5FF;
    --secondary: #00B4D8;
    --accent: #F59E0B;
    --accent-light: #FEF3C7;
    --neutral-50: #FAFBFC;
    --neutral-100: #F3F4F6;
    --neutral-200: #E5E7EB;
    --neutral-300: #D1D5DB;
    --neutral-400: #9CA3AF;
    --neutral-500: #6B7280;
    --neutral-600: #4B5563;
    --neutral-700: #374151;
    --neutral-800: #1F2937;
    --neutral-900: #111827;
    --white: #ffffff;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.1), 0 8px 20px rgba(0, 0, 0, 0.05);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    line-height: 1.6;
    color: var(--neutral-800);
    background: var(--neutral-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    color: var(--neutral-900);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── NAVBAR ─── */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(11, 61, 145, 0.06);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.logo a {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--neutral-600);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links .btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: var(--white) !important;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    transition: all 0.3s !important;
    box-shadow: 0 4px 12px rgba(11, 61, 145, 0.25);
}

.nav-links .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(11, 61, 145, 0.35) !important;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--neutral-700);
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ─── MAIN CONTENT ─── */
.main-content {
    padding-top: 3rem;
    flex: 1;
}

/* ─── BLOG HEADER BANNER ─── */
.blog-header {
    position: relative;
    min-height: 320px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    margin-top: 0;
}

.blog-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(11,61,145,0.88) 0%, rgba(7,42,102,0.8) 100%);
    display: flex;
    align-items: center;
}

.blog-header-overlay h1 {
    color: #fff;
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.blog-header-overlay p {
    color: rgba(255,255,255,0.85);
    font-size: 1.1rem;
    max-width: 560px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .blog-header {
        min-height: 220px;
    }
    .blog-header-overlay h1 {
        font-size: 1.75rem;
    }
    .blog-header-overlay p {
        font-size: 1rem;
    }
}

/* ─── BLOG GRID ─── */
.masonry-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.blog-card {
    background: var(--white);
    border: 1px solid var(--neutral-100);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(11, 61, 145, 0.1);
}

.card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--neutral-100);
}

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

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

.card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-category {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 50px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.card-category:hover {
    background: var(--primary);
    color: var(--white);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.35;
}

.card-title a {
    color: var(--neutral-800);
    transition: color 0.2s;
}

.card-title a:hover {
    color: var(--primary);
}

.card-excerpt {
    color: var(--neutral-500);
    font-size: 0.9rem;
    line-height: 1.7;
    flex: 1;
    margin-bottom: 16px;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--neutral-400);
    padding-top: 14px;
    border-top: 1px solid var(--neutral-100);
}

.card-meta time {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── PAGINATION ─── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 48px;
}

.pagination-link,
.pagination-page {
    padding: 10px 18px;
    border: 1.5px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: var(--white);
    color: var(--neutral-600);
    text-decoration: none;
}

.pagination-link:hover,
.pagination-page:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pagination-page.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(11, 61, 145, 0.25);
}

.pagination-pages {
    display: flex;
    gap: 6px;
}

/* ─── POST PAGE ─── */
.post-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.post-header {
    margin-bottom: 2rem;
}

.post-category {
    display: inline-block;
    padding: 4px 14px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 50px;
    margin-bottom: 16px;
}

.post-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .post-title {
        font-size: 1.6rem;
    }
}

.post-meta {
    color: var(--neutral-500);
    font-size: 0.9rem;
}

.post-featured-image {
    margin-bottom: 2rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
}

.post-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--neutral-700);
    margin-bottom: 3rem;
}

.post-body h2 {
    font-size: 1.65rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--neutral-900);
}

.post-body h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-body p {
    margin-bottom: 1.25rem;
}

.post-body ul,
.post-body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.post-body li {
    margin-bottom: 0.5rem;
}

.post-body img {
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
}

.post-body a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-body a:hover {
    color: var(--primary-dark);
}

.post-body blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--neutral-500);
    background: var(--neutral-50);
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.post-body code {
    background: var(--neutral-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: 'Courier New', monospace;
}

.post-body pre {
    background: var(--neutral-900);
    color: #e5e7eb;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ─── TAGGED DOCTOR CARD ─── */
.post-doctor-card {
    background: var(--primary-50);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: all 0.2s;
}

.post-doctor-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.doctor-card-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.doctor-card-avatar {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
}

.doctor-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doctor-card-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
}

.doctor-card-info {
    flex: 1;
    min-width: 180px;
}

.doctor-card-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--neutral-400);
    font-weight: 600;
    margin-bottom: 2px;
}

.doctor-card-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}

.doctor-card-name:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.doctor-card-specialty {
    font-size: 0.85rem;
    color: var(--neutral-500);
}

.doctor-card-location {
    font-size: 0.8rem;
    color: var(--neutral-400);
    margin-top: 2px;
}

.doctor-card-cta {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(11, 61, 145, 0.2);
    transition: all 0.3s;
}

.doctor-card-cta:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11, 61, 145, 0.35);
}

@media (max-width: 600px) {
    .doctor-card-inner {
        flex-direction: column;
        text-align: center;
    }
    .doctor-card-avatar {
        width: 64px;
        height: 64px;
    }
    .doctor-card-info {
        align-items: center;
    }
}

/* ─── SOCIAL SHARE ─── */
.social-share {
    padding: 2.5rem 0;
    border-top: 1px solid var(--neutral-200);
    margin-top: 2rem;
}

.social-share h3 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.linkedin {
    background: #0077b5;
}

.share-btn.whatsapp {
    background: #25D366;
}

@media (max-width: 768px) {
    .share-buttons {
        flex-direction: column;
    }
    .share-btn {
        width: 100%;
        justify-content: center;
    }
    .social-share h3 {
        text-align: center;
    }
}

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--neutral-500);
}

/* ─── POST CTA ─── */
.post-cta {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--neutral-200);
}

.cta-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(11, 61, 145, 0.3);
}

.cta-card h3 {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.cta-card p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-card .btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #25D366;
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s;
    border: none;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.cta-card .btn-whatsapp:hover {
    color: #fff;
    background: #1da851;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
}

/* ─── POST BACK ─── */
.post-back {
    text-align: center;
    margin-top: 2rem;
    padding-bottom: 2rem;
}

.post-back a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 600;
}

.post-back a:hover {
    gap: 10px;
}

/* ─── FOOTER ─── */
.site-footer {
    background: var(--neutral-900);
    color: rgba(255, 255, 255, 0.8);
    padding: 64px 0 32px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.7;
    margin-top: 12px;
}

.footer-col h4 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .footer-grid > :first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ─── RESPONSIVE NAV ─── */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 20px 24px;
        gap: 16px;
        border-bottom: 1px solid var(--neutral-200);
        box-shadow: var(--shadow-md);
    }

    .nav-links.nav-active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }

    .main-content {
        padding-top: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    .card-content {
        padding: 16px;
    }
    .card-title {
        font-size: 1.05rem;
    }
    .masonry-grid {
        gap: 16px;
    }
}

/* ─── ACCESSIBILITY ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

a:focus,
button:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media print {
    header,
    .site-footer,
    .social-share {
        display: none;
    }
}
