:root {
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary-color: #a78bfa;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-title {
    text-align: center;
    padding: 5rem 2rem 1rem;
    margin: 0 auto 2rem;
    position: relative;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-color);
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-radius: 1rem;
    overflow: hidden;
}

.page-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

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

@media (min-width: 1200px) {
    .blog-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .blog-grid {
        grid-template-columns: 1fr;
        padding: 1rem 0;
    }

    .page-title {
        font-size: 2rem;
        padding: 3rem 1.5rem 1rem;
    }

    .page-title::after {
        bottom: 1rem;
    }
}

.blog-card {
    background: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.blog-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.blog-card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

.blog-card:hover .blog-card-image::before {
    opacity: 1;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.blog-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 1rem;
    line-height: 1.4;
    transition: var(--transition);
}

.blog-card:hover .blog-card-content h3 {
    color: var(--primary-color);
}

.blog-card-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 1.25rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: auto;
    transition: var(--transition);
    padding: 0.5rem 0;
    width: fit-content;
}

.read-more::after {
    content: '→';
    display: inline-block;
    transition: var(--transition);
}

.blog-card:hover .read-more {
    color: var(--primary-hover);
}

.blog-card:hover .read-more::after {
    transform: translateX(4px);
}

/* Loading state */
.blog-card.skeleton .blog-card-image,
.blog-card.skeleton h3,
.blog-card.skeleton p {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

.blog-card.skeleton .blog-card-image {
    height: 200px;
    margin-bottom: 1rem;
}

.blog-card.skeleton h3 {
    height: 24px;
    width: 80%;
    margin-bottom: 1rem;
}

.blog-card.skeleton p {
    height: 16px;
    margin-bottom: 0.5rem;
}

.blog-card.skeleton p:last-child {
    width: 40%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.blog-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.blog-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.blog-card a {
    text-decoration: none;
    color: #333;
    display: block;
}

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card-content {
    padding: 15px;
}

.blog-card-content h3 {
    font-size: 18px;
    margin: 0;
}

.blog-detail-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
}

.blog-detail-title {
    font-size: 36px;
    margin-bottom: 20px;
}

.blog-detail-image {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 20px;
}

.blog-detail-content {
    font-size: 16px;
    line-height: 1.6;
}

.blog-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
}

.blog-detail-info {
    text-align: center;
}

.blog-navigation a {
    text-decoration: none;
    color: #007bff;
    font-size: 18px;
    font-weight: bold;
}

/* Blog Image Grid Styles */
.gallery-heading {
    text-align: center;
    font-size: 2em;
    margin: 40px 0 20px;
    color: #333;
    font-weight: bold;
    text-transform: uppercase;
}

.blog-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0 40px;
    padding: 0 15px;
}

/* Responsive grid for tablets */
@media (max-width: 768px) {
    .blog-image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .gallery-heading {
        font-size: 1.75em;
    }
}

/* Responsive grid for mobile */
@media (max-width: 480px) {
    .blog-image-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .gallery-heading {
        font-size: 1.5em;
    }
}

.blog-grid-item {
    position: relative;
    padding-bottom: 100%;
    /* Creates a square aspect ratio */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.blog-grid-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Video gallery styles */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0 40px;
    padding: 0 15px;
}

.video-box {
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    background: #000;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 2;
}

.video-play-button::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
    margin-left: 5px;
}

.video-box:hover .video-play-button {
    background: rgba(255, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-embed iframe,
.video-embed video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-embed.playing iframe,
.video-embed.playing video {
    opacity: 1;
}

.video-embed.playing .video-thumbnail,
.video-embed.playing .video-play-button {
    opacity: 0;
    pointer-events: none;
}

/* Video Modal/Lightbox */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.video-modal.active {
    opacity: 1;
    visibility: visible;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16/9;
}

.video-modal-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: #000;
    transition: background 0.3s ease;
}

.video-modal-close:hover {
    background: #f00;
    color: #fff;
}

@media (max-width: 768px) {
    .video-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .video-gallery {
        grid-template-columns: 1fr;
    }
}

.blog-grid-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-grid-item:hover .blog-grid-image {
    transform: scale(1.05);
}

/* Simple Image Modal Styles */
.simple-image-modal {
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
}

.simple-image-modal.active {
    display: flex;
    /* Show when active */
}

.simple-image-modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: auto;
    max-width: 90%;
    max-height: 90vh;
}

#simple-modal-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    display: block;
}

.simple-image-modal-close {
    position: absolute;
    top: -30px;
    right: -5px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.simple-image-modal-close:hover,
.simple-image-modal-close:focus {
    color: #bbb;
    text-decoration: none;
}

/* Photo Lightbox/Slider */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.photo-modal.active {
    visibility: visible;
    opacity: 1;
}

.photo-modal-content {
    position: relative;
    width: 94%;
    max-width: 1100px;
}

.photo-modal-image {
    width: 100%;
    height: auto;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

.photo-modal-close,
.photo-modal-prev,
.photo-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 10px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 22px;
}

.photo-modal-close {
    right: -50px;
    top: -50px;
    transform: none;
}

.photo-modal-prev {
    left: -60px;
}

.photo-modal-next {
    right: -60px;
}

@media (max-width: 768px) {
    .photo-modal-prev {
        left: 10px;
    }

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

    .photo-modal-close {
        right: 10px;
        top: 10px;
        transform: none;
    }
}

.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-link .blog-grid-image {
    pointer-events: none;
}