﻿/**
 * Klasican Gejming - Critical Fixes v3
 */

/* SHARE BUTTONS FIX */
.share-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.share-btn i {
    margin: 0 !important;
    font-size: 16px !important;
}

/* PWA BANNER FIX */
#pwaInstallBanner:not(.visible),
.pwa-install-banner:not(.visible) {
    display: none !important;
    height: 0 !important;
}

html, body {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.site-footer {
    margin-bottom: 0 !important;
}

/* ARTICLE LIST INDENT */
.article-body ul,
.article-body ol {
    padding-left: 30px !important;
    margin-left: 10px !important;
}

.article-body ul li,
.article-body ol li {
    padding-left: 8px !important;
    margin-bottom: 10px !important;
}

/* HEADINGS */
.article-body h2 {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin: 40px 0 20px !important;
    border-bottom: 2px solid #ff2d75;
    padding-bottom: 10px;
}

.article-body h3 {
    font-size: 1.35rem !important;
    color: #fff !important;
    margin: 30px 0 15px !important;
}

.article-body h4 {
    font-size: 1.15rem !important;
    color: #00d4ff !important;
    margin: 25px 0 12px !important;
}

.article-body p strong:only-child {
    display: block;
    font-size: 1.15rem;
    color: #fff;
    margin: 20px 0 12px;
}


/* ===== PORTRAIT / TALL-NARROW DEVICE FIXES ===== */

/* Portrait screens with enough width to show sidebar (tablets, portrait monitors) */
@media (orientation: portrait) and (min-width: 768px) {
    /* Hero should be taller on portrait */
    .hero-section {
        aspect-ratio: 16/9 !important;
        min-height: 300px;
        max-height: 50vh;
    }

    .hero-slide {
        aspect-ratio: 16/9 !important;
    }

    /* Keep two-column layout on portrait tablets/monitors */
    .main-grid {
        grid-template-columns: 1fr 300px !important;
        gap: 20px;
    }

    .sidebar {
        display: block !important;
    }
}

/* Portrait phones - optimize vertical space usage */
@media (orientation: portrait) and (max-width: 767px) {
    /* Hero: balanced aspect ratio for portrait phones */
    .hero-section {
        aspect-ratio: 4/3 !important;
        min-height: 200px;
        max-height: 40vh;
    }

    .hero-slide {
        aspect-ratio: 4/3 !important;
    }

    /* News cards: slightly taller images on portrait */
    .news-card .card-image {
        aspect-ratio: 16/10 !important;
    }

    .news-card.featured .card-image {
        aspect-ratio: 16/12 !important;
    }

    /* Prevent excessive vh-based heights */
    .page-content,
    .article-content {
        min-height: auto !important;
    }
}

/* Very tall narrow screens (max-aspect-ratio 3/4, e.g. 768x1366) */
@media (max-aspect-ratio: 3/4) and (min-width: 600px) {
    /* Cap hero height to avoid wasting screen */
    .hero-section {
        max-height: 45vh !important;
    }

    /* Don't let padding-top with vh get too large */
    .search-overlay .search-container {
        padding-top: 10vh !important;
    }

    /* Prevent oversized empty sections */
    .category-page-hero,
    .page-hero {
        max-height: 30vh !important;
    }
}

/* Ultra-narrow portrait (phones < 400px) */
@media (max-width: 399px) and (orientation: portrait) {
    .hero-section {
        aspect-ratio: 1/1 !important;
        max-height: 35vh;
    }

    .hero-slide {
        aspect-ratio: 1/1 !important;
    }

    /* Stack news cards properly */
    .news-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .news-card .card-image {
        aspect-ratio: 16/10 !important;
    }

    /* Font size adjustments for very narrow screens */
    .hero-title {
        font-size: 1.2rem !important;
    }

    .hero-excerpt {
        font-size: 0.85rem !important;
        -webkit-line-clamp: 2;
    }
}

/* ===== COMPACT SPACING - Reduce whitespace between sections ===== */

/* Hero section - reduce bottom margin */
.hero-section {
    margin-bottom: 8px !important;
    padding: 12px 0 !important;
}

/* Banner between hero and news - minimal padding */
.homepage-banner-section {
    padding: 4px 0 !important;
}

/* Main grid - reduce top padding and gap */
.main-grid {
    padding: 12px 0 !important;
    gap: 24px !important;
}

/* Section headers - tighter */
.section-header {
    margin-bottom: 14px !important;
    padding-bottom: 10px !important;
}

/* News grid - slightly tighter */
.news-grid {
    gap: 18px !important;
}

/* Categories section - much less padding */
.categories-section {
    padding: 30px 0 !important;
}

/* Newsletter section - less padding */
.newsletter-section {
    padding: 24px 0 !important;
}

/* Reduce spacing on mobile too */
@media (max-width: 768px) {
    .hero-section {
        margin-bottom: 4px !important;
        padding: 8px 0 !important;
    }

    .homepage-banner-section {
        padding: 2px 0 !important;
    }

    .main-grid {
        padding: 8px 0 !important;
        gap: 16px !important;
    }

    .section-header {
        margin-bottom: 10px !important;
        padding-bottom: 8px !important;
    }

    .categories-section {
        padding: 20px 0 !important;
    }

    .newsletter-section {
        padding: 16px 0 !important;
    }
}


/* ===== Banner Slider (Homepage Rotation) ===== */
.banner-slider {
    position: relative;
    overflow: hidden;
}

.banner-slide {
    display: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.banner-slide.active {
    display: block;
    opacity: 1;
}

.banner-slider-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    padding: 4px 0;
}

.banner-slider-prev,
.banner-slider-next {
    background: var(--bg-card, #1a1a2e);
    border: 1px solid var(--border-color, #2d2d44);
    color: var(--text-primary, #fff);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.banner-slider-prev:hover,
.banner-slider-next:hover {
    background: var(--accent-pink, #ff2d75);
    border-color: var(--accent-pink, #ff2d75);
}

.banner-slider-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--text-muted, #6b7280);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.banner-dot.active {
    background: var(--accent-pink, #ff2d75);
    opacity: 1;
    transform: scale(1.3);
}

.banner-dot:hover {
    opacity: 0.8;
}


/* ===== Clickable Banner Link ===== */
.banner-clickable-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: inherit;
}

.banner-clickable-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    color: inherit;
}

.banner-clickable-link:active {
    transform: translateY(0);
}

.banner-clickable-link .banner-content {
    cursor: pointer;
}
