/* Blog Integration Styles */
:root {
    --blog-primary-color: #2563eb;
    --blog-primary-hover: #1d4ed8;
    --blog-bg-color: #f8fafc;
    --blog-card-bg: #ffffff;
    --blog-text-main: #1e293b;
    --blog-text-muted: #64748b;
    --blog-border-color: #e2e8f0;
    --blog-font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --blog-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --blog-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --blog-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --blog-radius-md: 0.75rem;
    --blog-radius-lg: 1rem;
    --blog-transition: all 0.3s ease;
}

/* Blog Grid & Components */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding-bottom: 4rem;
}

.blog-card {
    background: var(--blog-card-bg);
    border-radius: var(--blog-radius-lg);
    overflow: hidden;
    box-shadow: var(--blog-shadow-md);
    transition: var(--blog-transition);
    border: 1px solid var(--blog-border-color);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--blog-shadow-lg);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--blog-text-muted);
}

.tag {
    background-color: #e0e7ff;
    color: var(--blog-primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: var(--blog-text-main);
}

.card-hook {
    color: var(--blog-text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--blog-border-color);
    padding-top: 1rem;
    margin-top: auto;
}

.read-more {
    color: var(--blog-primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--blog-transition);
}

.read-more:hover {
    color: var(--blog-primary-hover);
    transform: translateX(3px);
}

.card-date {
    font-size: 0.85rem;
    color: var(--blog-text-muted);
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--blog-text-muted);
    font-size: 1.2rem;
}

.controls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.tag-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: none;
    border: 1px solid var(--blog-border-color);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--blog-text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    transition: var(--blog-transition);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--blog-primary-color);
    color: white;
    border-color: var(--blog-primary-color);
}

.view-toggle button {
    background: none;
    border: 1px solid var(--blog-border-color);
    border-radius: var(--blog-radius-md);
    padding: 0.5rem;
    cursor: pointer;
    color: var(--blog-text-muted);
    transition: var(--blog-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle button:hover,
.view-toggle button.active {
    background-color: var(--blog-primary-color);
    color: white;
    border-color: var(--blog-primary-color);
}

.blog-grid.list-view {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}

.blog-grid.list-view .blog-card {
    flex-direction: row;
    align-items: stretch;
    height: auto;
}

.blog-grid.list-view .card-image {
    width: 250px;
    height: auto;
    object-fit: cover;
    min-height: 200px;
}

.blog-grid.list-view .card-content {
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
}

.blog-grid.list-view .card-title {
    font-size: 1.5rem;
    margin-bottom: auto;
}

.blog-grid.list-view .card-footer {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .blog-grid.list-view .blog-card {
        flex-direction: column;
    }

    .blog-grid.list-view .card-image {
        width: 100%;
        height: 200px;
    }
}

/* Article Specific Styles */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    background: white;
    border-radius: var(--blog-radius-lg);
    box-shadow: var(--blog-shadow-md);
}

.article-header {
    margin-bottom: 2rem;
    text-align: center;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    color: var(--blog-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--blog-text-main);
}

.article-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--blog-radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--blog-shadow-md);
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--blog-text-main);
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--blog-text-main);
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 2rem;
    color: var(--blog-primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--blog-transition);
}

.back-link:hover {
    color: var(--blog-primary-hover);
    transform: translateX(-5px);
}

.hidden {
    display: none !important;
}

/* Full Screen Article Mode */
body.article-open #hero,
body.article-open #main>section:not(#blog),
body.article-open #footer {
    display: none !important;
}

/* body.article-open #main: No margin override needed, keep sidebar space */

body.article-open .article-container {
    margin-top: 0;
    max-width: 100%;
    /* Use available space */
    padding: 2rem;
    /* Add some padding */
}

body.article-open #blog {
    padding-top: 2rem;
    /* Reduced padding */
}

/* Card Link Styles */
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: var(--blog-transition);
}

.card-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--blog-transition);
}

.card-title a:hover {
    color: var(--blog-primary-color);
}

/* Remove Timeline from Activities */
.resume .resume-item {
    border-left: none;
    padding-left: 0;
    margin-top: 0;
}

.resume .resume-item::before {
    display: none;
}

/* Activity Specific List View Styles */
#activity-container.blog-grid.list-view {
    max-width: 100%;
}

#activity-container.blog-grid.list-view .card-image {
    width: 200px;
    height: 100px;
    min-height: 0;
}

#activity-container.blog-grid.list-view .card-content {
    padding: 0.75rem 1rem;
    justify-content: center;
}

#activity-container.blog-grid.list-view .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    /* Ensure full height if not already */
}

/* Hero Slider Styles */
.hero-slider-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 90%;
    height: auto;
    z-index: 10;
    /* Ensure it's above other content */
    text-align: center;
}

.hero-slider {
    position: relative;
    width: 100%;
    display: inline-block;
}

.hero-slide {
    display: none;
    /* Hide by default */
    flex-direction: row;
    /* Align tag and title horizontally */
    justify-content: center;
    /* Center content */
    align-items: center;
    cursor: pointer;
    text-align: center;
    color: white;
    gap: 10px;
    white-space: nowrap;
    /* Keep on one line if possible */
}

.hero-slide.active {
    display: flex;
    /* Show active slide */
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-tag {
    font-size: 0.9rem;
    font-weight: bold;
    color: #ffd700;
    /* Gold color for label */
    white-space: nowrap;
    margin-right: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.slide-title {
    font-size: 1.1rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    color: white;
    transition: color 0.3s ease;
    /* Ensure full title is visible */
    white-space: normal;
    overflow: visible;
}

.hero-slide:hover .slide-title {
    color: #ffd700;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .hero-slider-container {
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        max-width: 95%;
        width: 100%;
    }

    .hero-slide {
        flex-direction: column;
        /* Stack on very small screens if needed, otherwise row */
        align-items: center;
        gap: 2px;
        white-space: normal;
    }

    .slide-tag {
        font-size: 0.8rem;
    }

    .slide-title {
        font-size: 1rem;
    }
}