/* ==========================================================================
   Blog CMS - Public Site Styles
   Mobile-First Responsive Design
   ========================================================================== */

/* CSS Variables - Matching Main Site Theme */
:root {
    --color-primary: #003366;
    --color-primary-dark: #002244;
    --color-primary-light: #004d99;
    --color-accent: #ff6b00;
    --color-accent-dark: #e66000;
    --color-secondary: #64748b;
    --color-text: #2d3748;
    --color-text-light: #718096;
    --color-bg: #ffffff;
    --color-bg-light: #f7fafc;
    --color-bg-gray: #f1f5f9;
    --color-border: #e2e8f0;
    --color-success: #10b981;
    --color-error: #ef4444;

    --gradient-primary: linear-gradient(135deg, #003366 0%, #004d99 100%);
    --gradient-accent: linear-gradient(135deg, #ff6b00 0%, #e66000 100%);
    --gradient-light: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);

    --font-sans: 'Roboto', system-ui, -apple-system, sans-serif;
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: Georgia, 'Times New Roman', Times, serif;

    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08);
    --shadow-md: 0 4px 12px -2px rgb(0 0 0 / 0.12);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-colored: 0 10px 30px -5px rgba(0, 51, 102, 0.3);

    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-primary-dark);
}

/* Main Content Area - account for sticky header */
.main-content {
    padding-top: 1rem;
}

/* Page Intro - Enhanced */
.page-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.page-intro h1 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .page-intro h1 {
        font-size: 1.8rem;
    }
}

.page-intro p {
    color: var(--color-text-light);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.post-count {
    color: var(--color-text-light);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .page-intro h1 {
        font-size: 3.5rem;
    }
}

/* Masonry Grid - Mobile First */
.masonry-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Tablet: 2 columns */
@media (min-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .masonry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Blog Card - Modern Premium Design */
.blog-card {
    background: var(--gradient-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
}

.blog-card:hover::before {
    opacity: 1;
}

.blog-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px);
    border-color: rgba(14, 165, 233, 0.3);
}

.card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--color-bg-gray);
}

.card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.05) 100%);
    opacity: 0;
    transition: var(--transition);
}

.blog-card:hover .card-image::after {
    opacity: 1;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.blog-card:hover .card-image img {
    transform: scale(1.08);
}

.card-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
}

.card-category {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    align-self: flex-start;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    transition: var(--transition);
}

.card-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

.card-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    transition: var(--transition);
}

.card-title a {
    color: var(--color-text);
    background: linear-gradient(to right, var(--color-primary) 0%, var(--color-primary) 100%);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s ease;
    padding-bottom: 2px;
}

.card-title a:hover {
    color: var(--color-primary);
    background-size: 100% 2px;
}

.card-excerpt {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.7;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
    padding-top: 1.25rem;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.card-meta time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-meta time::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 0.25rem;
    background: var(--color-text-light);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Pagination - Modern Design */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 4rem;
}

.pagination-link,
.pagination-page {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-weight: 600;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: var(--color-bg);
    color: var(--color-text);
}

.pagination-link:hover,
.pagination-page:hover {
    background: var(--color-bg-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pagination-page.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-colored);
    transform: translateY(-2px);
}

.pagination-pages {
    display: flex;
    gap: 0.5rem;
}

/* Individual Post Page */
.post-content {
    background: var(--color-bg);
}

.post-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.post-header {
    text-align: center;
    margin-bottom: 2rem;
}

.post-category {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: var(--color-primary);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.post-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .post-title {
        font-size: 3rem;
    }
}

.post-meta {
    color: var(--color-text-light);
    font-size: 0.9375rem;
}

.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.0625rem;
    line-height: 1.8;
    margin-bottom: 3rem;
}

.post-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-body h3 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-body p {
    margin-bottom: 1rem;
}

.post-body ul,
.post-body ol {
    margin-bottom: 1rem;
    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 {
    text-decoration: underline;
}

.post-body blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--color-text-light);
}

.post-body code {
    background: var(--color-bg-light);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
    font-family: 'Courier New', monospace;
}

.post-body pre {
    background: var(--color-bg-light);
    padding: 1rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-body pre code {
    background: none;
    padding: 0;
}

/* Social Share Buttons - Modern Design */
.social-share {
    padding: 3rem 0;
    border-top: 2px solid var(--color-border);
    margin-top: 2rem;
}

.social-share h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.9375rem;
    color: white;
    transition: var(--transition);
    min-height: 48px;
    border: none;
    position: relative;
    overflow: hidden;
}

.share-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: var(--transition);
}

.share-btn:hover::before {
    opacity: 1;
}

.share-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.share-btn.facebook {
    background: linear-gradient(135deg, #1877f2 0%, #0d65d9 100%);
}

.share-btn.facebook:hover {
    box-shadow: 0 12px 24px rgba(24, 119, 242, 0.4);
}

.share-btn.twitter {
    background: linear-gradient(135deg, #1da1f2 0%, #0c85d0 100%);
}

.share-btn.twitter:hover {
    box-shadow: 0 12px 24px rgba(29, 161, 242, 0.4);
}

.share-btn.linkedin {
    background: linear-gradient(135deg, #0077b5 0%, #005582 100%);
}

.share-btn.linkedin:hover {
    box-shadow: 0 12px 24px rgba(0, 119, 181, 0.4);
}

.share-btn.whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #1da851 100%);
}

.share-btn.whatsapp:hover {
    box-shadow: 0 12px 24px rgba(37, 211, 102, 0.4);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

/* Post CTA - Book Appointment */
.post-cta {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--color-border);
}

.cta-card {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    text-align: center;
    color: white;
    box-shadow: var(--shadow-colored);
}

.cta-card h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.cta-card p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    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: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 1.1rem;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.cta-card .btn-whatsapp:hover {
    background: #1da851;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
}

/* Post Back Link */
.post-back {
    text-align: center;
    margin-top: 2rem;
    padding-bottom: 2rem;
}

/* Mobile Responsive - Post Page */
@media (max-width: 768px) {
    .post-container {
        padding: 0 0.5rem;
    }

    .post-title {
        font-size: 1.5rem !important;
    }

    .post-body {
        font-size: 1rem;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }

    .social-share h3 {
        text-align: center;
    }

    .post-featured-image {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        border-radius: 0;
    }

    .page-intro {
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .card-content {
        padding: 1.25rem;
    }

    .card-title {
        font-size: 1.125rem;
    }

    .masonry-grid {
        gap: 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
a:focus,
button:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {

    .site-header,
    .site-footer,
    .social-share {
        display: none;
    }
}