:root {
    --primary: #009ad8;
    --primary-glow: rgba(0, 154, 216, 0.3);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Outfit', sans-serif;
    transition: var(--transition);
}

/* Dark Mode (Default) */
.dark-mode {
    background-color: #0f172a;
    color: #f1f5f9;
}

.dark-mode .site-header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Light Mode */
.light-mode {
    background-color: #f8fafc;
    color: #1e293b;
}

.light-mode .site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-bottom: 2px solid var(--primary);
}

/* Custom Card / Post Styling */
.forecast-card {
    /* background: #323544; REMOVED to let theme.css control it */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.light-mode .forecast-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.forecast-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 154, 216, 0.15);
}

.entry-title {
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.forecast-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.light-mode .forecast-meta {
    border-bottom-color: #f1f5f9;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #94a3b8;
}

.light-mode .meta-item {
    color: #64748b;
}

.meta-item i {
    color: var(--primary);
}

.temp-badge {
    padding: 6px 15px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
}

.temp-min {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.temp-max {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.image-placeholder {
    background: linear-gradient(135deg, rgba(0, 154, 216, 0.1), rgba(0, 0, 0, 0.2));
    height: 300px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.emoji-large {
    font-size: 5rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.3));
}

/* Theme Toggle Custom */
.theme-switcher {
    margin-left: 20px;
}

.theme-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: #1e293b;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
}

.light-mode .theme-toggle {
    background: #f1f5f9;
    color: #1e293b;
}

/* Adsense Premium Look */
.adsense-widget {
    background: linear-gradient(145deg, rgba(255, 193, 7, 0.05), rgba(255, 152, 0, 0.1));
    border: 2px solid rgba(255, 152, 0, 0.3);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    backdrop-filter: blur(10px);
    margin: 40px 0;
}

.adsense-title {
    color: #f59e0b;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 15px;
}

/* Sidebar Widgets */
.widget {
    background: #262936;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.light-mode .widget {
    background: white;
    border-color: #e2e8f0;
}

.widget-title {
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary);
}

.facebook-link {
    background: #1877f2;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 24px;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.2);
}

.facebook-link:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 30px rgba(24, 119, 242, 0.4);
}

.empty-state {
    text-align: center;
    padding: 100px 60px;
    background: var(--surface-light, #323544);
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 120px !important;
}

/* Detail Section Styling */
.forecast-card.expanded .read-more-btn {
    display: none;
}

.forecast-card.expanded .full-content {
    display: block;
}

/* Gallery Styling */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px; /* Increased from 15px to 30px to avoid images being too close */
    margin-bottom: 25px;
}

.gallery-item {
    width: 100%;
    height: 300px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    transition: var(--transition);
    cursor: zoom-in;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    border-color: var(--primary);
}

.main-featured-image {
    width: 100%;
    height: 500px;
    border-radius: 15px;
    margin-bottom: 25px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- STACKED GALLERY SYSTEM --- */
.stacked-gallery-container {
    width: 100%;
    position: relative;
    z-index: 10;
}

.stacked-gallery {
    position: relative;
    height: 600px;
    width: 100%;
    max-width: 1100px;
    margin: 20px auto;
    /* Compact margin for better text integration */
    perspective: 3000px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stacked-card {
    position: absolute;
    width: 550px;
    height: 550px;
    background: #1e293b;
    border-radius: 40px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transform-origin: center center;
    left: 50%;
    margin-left: -275px;
    opacity: 1;
    /* Removed transparency as requested */
}

.stacked-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Straight Distributed Layout (Default State) */
.stacked-card:nth-child(1) {
    transform: translateX(-420px) scale(0.9);
    z-index: 10;
}

.stacked-card:nth-child(2) {
    transform: translateX(-210px) scale(0.95);
    z-index: 20;
}

.stacked-card:nth-child(3) {
    transform: translateX(0) scale(1);
    z-index: 30;
}

.stacked-card:nth-child(4) {
    transform: translateX(210px) scale(0.95);
    z-index: 20;
}

.stacked-card:nth-child(5) {
    transform: translateX(420px) scale(0.9);
    z-index: 10;
}

/* Mazo Formulation stability rule */
.stacked-card {
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Active State (Zoom & Center Focus) */
.stacked-card.active {
    transform: translateX(0) scale(1.18) translateY(-60px) !important;
    z-index: 5000 !important;
    border-color: var(--primary);
    box-shadow: 0 50px 100px rgba(0, 154, 216, 0.8);
    filter: brightness(1.2) !important;
    opacity: 1 !important;
}

/* Base Hover Feedback (No moving/stack jump) */
.stacked-gallery .stacked-card:hover {
    filter: brightness(1.1) !important;
    border-color: rgba(255, 255, 255, 0.4);
}

.stacked-gallery:hover .stacked-card {
    opacity: 1 !important;
}

/* Fullscreen Lightbox */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(15px);
    animation: fadeIn 0.3s ease-out;
}

#lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: 0 0 100px rgba(0, 154, 216, 0.3);
    object-fit: contain;
    transition: transform 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    transition: 0.3s;
    background: none;
    border: none;
}

.lightbox-close:hover {
    transform: rotate(90deg);
    color: var(--primary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.stack-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
    position: relative;
    z-index: 50;
}

.stack-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.stack-dot.active {
    background: var(--primary);
    transform: scale(1.4);
    border-color: rgba(255, 255, 255, 0.5);
}

#forecast-detail-container {
    display: none;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 30px;
    transition: var(--transition);
    padding: 10px 20px;
    background: rgba(0, 154, 216, 0.1);
    border-radius: 30px;
    text-decoration: none;
}

.back-button:hover {
    background: var(--primary);
    color: white;
    transform: translateX(-5px);
}

.read-more-btn {
    background: var(--primary-glow);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    display: inline-block;
    margin-top: 15px;
    transition: var(--transition);
    cursor: pointer;
}

.read-more-btn:hover {
    background: var(--primary);
    color: white;
}

/* Margin Utility */
.mb-5 {
    margin-bottom: 40px !important;
}

/* --- MOBILE RESPONSIVENESS FOR DETAIL VIEW --- */
@media screen and (max-width: 768px) {
    .stacked-gallery {
        height: 350px;
    }

    .stacked-card {
        width: 300px;
        height: 300px;
        margin-left: -150px;
        border-radius: 20px;
    }

    .stacked-card.active {
        transform: translateX(0) scale(1.05) translateY(-10px) !important;
    }

    .main-featured-image {
        height: auto;
        max-height: 350px;
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .gallery-item {
        height: 180px;
    }
}