/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Header */
header {
    width: 100%;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-image {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

.header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* Navigation */
.main-nav {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: 1rem;
    cursor: pointer;
    color: #333;
    transition: color 0.3s ease;
}

.menu-toggle:hover {
    color: #5ac8fa;
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
    color: #5ac8fa;
    border-bottom-color: #5ac8fa;
    background-color: #f8f8f8;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.widget {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.widget h3 {
    color: #5ac8fa;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.widget-title.collapsible {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

.widget-title.collapsible:hover {
    color: #4ab8ea;
}

.toggle-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.widget-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: #555;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #5ac8fa;
    box-shadow: 0 0 0 3px rgba(90, 200, 250, 0.1);
}

#reset-filters {
    width: 100%;
    padding: 0.75rem;
    background: #5ac8fa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

#reset-filters:hover {
    background: #4ab8ea;
}

#archive-list {
    max-height: 300px;
    overflow-y: auto;
}

.archive-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: color 0.3s ease;
}

.archive-item:hover {
    color: #5ac8fa;
}

.stats-widget p {
    margin-bottom: 0.5rem;
}

/* Main content */
.content {
    min-height: 400px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.blog-post {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.blog-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.blog-post-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #e0e0e0;
}

.blog-post-content {
    padding: 1.5rem;
}

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

.blog-post-date {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.blog-post-country {
    background: #5ac8fa;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.blog-post h2 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: #333;
}

.blog-post-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    color: #5ac8fa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #4ab8ea;
}

.no-results {
    background: white;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    color: #999;
    font-size: 1.1rem;
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }

    .widget {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .main-nav ul.active {
        max-height: 500px;
    }

    .main-nav a {
        text-align: center;
        border-bottom: 1px solid #eee;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
    padding: 2vh 0;
}

.modal-content {
    background-color: white;
    margin: 0 auto;
    padding: 0;
    width: 90%;
    max-width: 1100px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 96vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    outline: none;
}

.modal-content:focus {
    outline: none;
}

.modal-close {
    color: #999;
    position: sticky;
    top: 0;
    right: 0;
    float: right;
    font-size: 36px;
    font-weight: 300;
    padding: 10px 20px;
    cursor: pointer;
    transition: color 0.3s ease;
    background: white;
    z-index: 10;
    border-radius: 0 12px 0 0;
}

.modal-close:hover,
.modal-close:focus {
    color: #5ac8fa;
}

.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.5);
    font-size: 48px;
    font-weight: 300;
    cursor: pointer;
    user-select: none;
    padding: 20px 15px;
    z-index: 1001;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.modal-nav:hover {
    background: rgba(90, 200, 250, 0.8);
    color: white;
}

.modal-prev {
    left: calc(50% - 600px);
}

.modal-next {
    right: calc(50% - 600px);
}

/* For narrower screens, move arrows closer to edges */
@media (max-width: 1400px) {
    .modal-prev {
        left: 20px;
    }

    .modal-next {
        right: 20px;
    }
}

/* Markdown Content Styling */
.markdown-content {
    padding: 2rem 3rem;
    line-height: 1.8;
    color: #333;
}

.markdown-content h1 {
    color: #5ac8fa;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.markdown-content h2 {
    color: #333;
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.markdown-content h3 {
    color: #555;
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.markdown-content p {
    margin-bottom: 1.5rem;
    color: #444;
}

.markdown-content strong {
    color: #5ac8fa;
    font-weight: 600;
}

.markdown-content img {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    width: auto;
    border-radius: 8px;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.markdown-content video,
.markdown-content .blog-video {
    max-width: 100%;
    max-height: 80vh;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #000;
    object-fit: contain;
}

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

.markdown-content li {
    margin-bottom: 0.5rem;
}

.markdown-content blockquote {
    border-left: 4px solid #5ac8fa;
    padding-left: 1.5rem;
    margin: 2rem 0;
    color: #666;
    font-style: italic;
}

.markdown-content code {
    background: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.markdown-content pre code {
    background: none;
    padding: 0;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-post {
    animation: fadeIn 0.5s ease forwards;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 85vh;
    }

    .markdown-content {
        padding: 1.5rem;
    }

    .markdown-content h1 {
        font-size: 2rem;
    }

    .markdown-content h2 {
        font-size: 1.5rem;
    }

    .modal-close {
        font-size: 28px;
        padding: 8px 15px;
    }

    .modal-nav {
        font-size: 32px;
        padding: 10px 8px;
    }

    .modal-prev {
        left: 10px;
    }

    .modal-next {
        right: 10px;
    }
}

/* Image Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
}

.lightbox-content {
    position: absolute;
    max-width: 90%;
    max-height: 90%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: #5ac8fa;
}

.lightbox .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 60px;
    font-weight: 300;
    cursor: pointer;
    user-select: none;
    padding: 0 20px;
    z-index: 2001;
    transition: color 0.3s ease;
}

.lightbox .lightbox-nav:hover {
    color: #5ac8fa;
}

.lightbox .lightbox-prev {
    left: 20px;
}

.lightbox .lightbox-next {
    right: 20px;
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem 2rem;
    border-radius: 8px;
    max-width: 80%;
    transition: background 0.3s ease, transform 0.3s ease;
}

.lightbox-caption a {
    color: white !important;
    text-decoration: none !important;
}

.lightbox-caption:hover {
    background: rgba(90, 200, 250, 0.8);
    transform: translateX(-50%) scale(1.05);
    cursor: pointer;
}

/* Comments Section */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.comments-title {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment {
    background: #f9f9f9;
    border-left: 4px solid #5ac8fa;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comment:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-author {
    color: #5ac8fa;
    font-size: 1rem;
    font-weight: 600;
}

.comment-date {
    color: #999;
    font-size: 0.85rem;
    font-style: italic;
}

.comment-body {
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .comments-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .comments-title {
        font-size: 1.25rem;
    }

    .comment {
        padding: 0.875rem 1rem;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
