/*
 Theme Name:   Astra Child for Games
 Theme URI:    https://yourdomain.com/
 Description:  A customized child theme for high-performance game downloads.
 Author:       Riad Abu Mahmoud
 Author URI:   https://yourdomain.com/
 Template:     astra
 Version:      1.0.0
 Text Domain:  astra-child
*/

/* ========== Base ========== */
:root{
    --bg: #f3f4f6;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --border-soft: #eef2f7;
    --green: #22c55e;
    --green-dark: #16a34a;
    --blue: #2563eb;
    --shadow-sm: 0 6px 18px rgba(15,23,42,.06);
    --shadow-md: 0 10px 30px rgba(15,23,42,.08);
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 24px;
}

html, body{
    overflow-x: hidden;
}

body{
    background: var(--bg);
    color: var(--text);
}

/* ========== Generic buttons ========== */
.download-button,
.game-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 700;
    transition: .25s ease;
    border: 0;
    cursor: pointer;
}

.download-button{
    background: var(--green);
    color: #fff;
    padding: 15px 25px;
    border-radius: 10px;
}

.download-button:hover{
    background: var(--green-dark);
    color: #fff;
}

.game-btn--primary{
    background: var(--green);
    color: #fff;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(34,197,94,.25);
}

.game-btn--primary:hover{
    background: var(--green-dark);
    color: #fff;
    transform: translateY(-1px);
}

.game-btn--secondary{
    background: #eff6ff;
    color: var(--blue);
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
}

.game-btn--secondary:hover{
    background: #dbeafe;
    color: #1d4ed8;
}

.game-btn-big{
    font-size: 18px;
    padding: 18px 40px;
    min-height: 56px;
    border-radius: 14px;
}

/* ========== Layout ========== */
#primary,
.site-main,
.ast-container,
.game-single-container{
    width: 100%;
}

.ast-container{
    max-width: 100% !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

.ast-separate-container #primary,
.ast-separate-container.ast-right-sidebar #primary,
.ast-separate-container.ast-left-sidebar #primary{
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.app-main{
    padding-top: 86px;
    background: var(--bg);
    min-height: 100vh;
}

.app-container{
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ========== Hero slider / archives ========== */
.hero-slider-section{
    padding: 8px 0 28px;
}

.hero-slider-grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.hero-slide-card{
    display: block;
    text-decoration: none;
}

.hero-slide-thumb{
    position: relative;
    height: 240px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    background: #dbe2ea;
}

.hero-slide-thumb img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-slide-overlay{
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    background: linear-gradient(to top, rgba(0,0,0,.58), rgba(0,0,0,.12));
}

.hero-slide-overlay h2{
    margin: 0 0 10px;
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.hero-slide-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 74px;
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--green-dark);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.archive-header-section{
    padding: 0 0 18px;
}

.archive-header-card{
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.archive-title{
    margin: 0 0 10px;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--text);
}

.archive-desc{
    color: var(--muted);
    line-height: 1.8;
    font-size: 15px;
}

.featured-grid-section{
    padding: 0 0 40px;
}

.section-heading-wrap{
    margin-bottom: 18px;
}

.section-title{
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
}

.section-icon{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: linear-gradient(180deg,#4CCB70 0%,#3DBA60 100%);
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(69,195,104,.3);
}

/* ========== Game grid cards ========== */
.game-grid,
.game-cards-grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 0;
}

.game-card{
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    transition: none;
}

.game-card-link{
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.game-card-inner{
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: .25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.game-card-link:hover .game-card-inner{
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15,23,42,.10);
}

.game-card-top{
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.game-card-thumb-wrap{
    position: relative;
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
}

.game-card-thumb,
.game-card-thumb-fallback,
.game-card-image img{
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    display: block;
    background: #dbe2ea;
    box-shadow: 0 8px 18px rgba(0,0,0,.08);
}

.game-card-image img{
    width: 100%;
    height: 180px;
    border-radius: 16px;
    box-shadow: none;
}

.game-card-status{
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 14px;
    height: 14px;
    background: var(--green);
    border: 2px solid #fff;
    border-radius: 50%;
}

.game-card-top-content{
    min-width: 0;
    flex: 1;
}

.game-card-title{
    margin: 0 0 8px;
    font-size: 21px;
    line-height: 1.25;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.game-card-rating{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #4b5563;
}

.rating-star{
    color: #facc15;
}

.game-card-excerpt{
    font-size: 13px;
    line-height: 1.75;
    color: var(--muted);
    margin-bottom: 18px;
    min-height: 68px;
}

.game-card-meta-line,
.game-meta-info{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 13px;
    color: #4b5563;
}

.meta-chip{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

.game-card-bottom{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
}

.game-card-bottom-left{
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-width: 0;
}

.game-card-category,
.game-card-dev{
    font-size: 13px;
    color: var(--muted);
}

.game-card-badge,
.badge-fix,
.badge-safe{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.game-card-badge{
    background: #dcfce7;
    color: #15803d;
}

.badge-fix{
    background: #d63384;
    color: #fff;
}

.badge-safe{
    background: #28a745;
    color: white;
    padding: 5px 12px;
    font-size: 12px;
    margin: 5px;
}

.game-card-download-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 98px;
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--green);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
}

.no-posts-box{
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border);
    grid-column: 1 / -1;
    text-align: center;
}

/* ========== Single game page ========== */
.game-single-wrap{
    padding: 18px 0 40px;
}

.game-single-container{
    max-width: 1180px;
    margin: 0 auto;
}

.game-hero{
    display: block !important;
}

.game-content-card{
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow-md);
    padding: 24px;
}

.game-breadcrumbs{
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
}

.game-breadcrumbs a{
    color: #2563eb;
    text-decoration: none;
}

.game-breadcrumbs a:hover{
    text-decoration: underline;
}

.game-above-header-ad,
.game-middle-content-ad{
    margin: 0 0 20px;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    min-height: 90px;
    padding: 16px;
}

.game-middle-content-ad{
    margin-top: 24px;
    margin-bottom: 24px;
}

.game-top-featured-image{
    margin-bottom: 24px;
}

.game-top-featured-image img{
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    margin-bottom: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.game-entry-header{
    margin-bottom: 22px;
}

.game-title{
    margin: 0 0 14px;
    font-size: 38px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--text);
}

.game-meta-row{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.game-meta-pill{
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.game-mini-badges{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.game-badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: #f3f4f6;
    color: #111827;
}

.game-badge--blue{
    background: #dbeafe;
    color: #1d4ed8;
}

.game-badge--accent{
    background: #ecfccb;
    color: #3f6212;
}

.game-summary{
    font-size: 16px;
    line-height: 1.9;
    color: #4b5563;
    margin-bottom: 8px;
}

.game-section{
    margin-top: 26px;
}

.game-section-title{
    margin: 0 0 16px;
    font-size: 26px;
    line-height: 1.25;
    font-weight: 800;
    color: var(--text);
}

.game-content-body{
    font-size: 16px;
    line-height: 1.95;
    color: #374151;
	text-align: justify;
}

.game-content-body p{
    margin-bottom: 1.2em;
}

.game-content-body img{
    max-width: 100%;
    height: auto;
    border-radius: 14px;
}

.game-content-body h2,
.game-content-body h3,
.game-content-body h4{
    margin-top: 1.5em;
    margin-bottom: .7em;
    color: var(--text);
    line-height: 1.35;
}

.game-content-body ul,
.game-content-body ol{
    padding-inline-start: 22px;
    margin-bottom: 1.2em;
}

.game-info-grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.game-info-card{
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
}

.game-info-icon{
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 12px;
}

.game-info-label{
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.game-info-value{
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    font-weight: 700;
    word-break: break-word;
}

.game-install-box,
.game-editor-note,
.download-box-area{
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 22px;
}

.download-box-area{
    border: 2px dashed #93c5fd;
    text-align: center;
    margin-top: 40px;
}

.game-note-text{
    margin: 0;
    font-size: 15px;
    line-height: 1.9;
    color: #475569;
}

.game-download-bottom{
    margin-top: 34px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* ========== Related posts ========== */
.related-section{
    margin-top: 34px;
}

.related-posts-grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.related-post-card{
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-post-inner{
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    height: 100%;
    transition: .25s ease;
}

.related-post-card:hover .related-post-inner{
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15,23,42,.10);
}

.related-post-thumb{
    margin-bottom: 12px;
}

.related-post-thumb img{
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
}

.related-post-title{
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 800;
    color: var(--text);
}

.related-post-meta{
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}

.related-post-badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ========== Comments ========== */
.comments-wrap{
    margin-top: 36px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

/* ========== Pagination ========== */
.app-pagination{
    margin-top: 24px;
}

.app-pagination .nav-links{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.app-pagination .page-numbers{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.app-pagination .page-numbers.current{
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

/* ========== Sticky download ========== */
.game-sticky-download{
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 14px;
    z-index: 999;
    display: none;
}

.game-sticky-download-inner{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: rgba(17,24,39,.95);
    backdrop-filter: blur(10px);
    color: #fff;
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,.25);
}

.game-sticky-download-text{
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.game-sticky-download-label{
    font-size: 12px;
    color: #cbd5e1;
    margin-bottom: 2px;
}

.game-sticky-download-name{
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== Dark mode ========== */
body.dark .app-main,
.dark .app-main{
    background: #1f2937;
}

body.dark .archive-header-card,
body.dark .game-card-inner,
body.dark .no-posts-box,
body.dark .game-content-card,
body.dark .related-post-inner,
body.dark .comments-wrap,
.dark .archive-header-card,
.dark .game-card-inner,
.dark .no-posts-box,
.dark .game-content-card,
.dark .related-post-inner,
.dark .comments-wrap{
    background: #273d52;
    border-color: #334155;
}

body.dark .archive-title,
body.dark .section-title,
body.dark .game-card-title,
body.dark .game-title,
body.dark .game-section-title,
body.dark .related-post-title,
body.dark .no-posts-box h2,
.dark .archive-title,
.dark .section-title,
.dark .game-card-title,
.dark .game-title,
.dark .game-section-title,
.dark .related-post-title,
.dark .no-posts-box h2{
    color: #fff;
}

body.dark .archive-desc,
body.dark .game-card-excerpt,
body.dark .game-card-category,
body.dark .game-card-dev,
body.dark .meta-chip,
body.dark .game-card-rating,
body.dark .game-summary,
body.dark .game-content-body,
body.dark .game-note-text,
body.dark .game-info-label,
body.dark .related-post-meta,
body.dark .no-posts-box p,
.dark .archive-desc,
.dark .game-card-excerpt,
.dark .game-card-category,
.dark .game-card-dev,
.dark .meta-chip,
.dark .game-card-rating,
.dark .game-summary,
.dark .game-content-body,
.dark .game-note-text,
.dark .game-info-label,
.dark .related-post-meta,
.dark .no-posts-box p{
    color: #cbd5e1;
}

body.dark .game-card-bottom,
.dark .game-card-bottom{
    border-top-color: #334155;
}

body.dark .game-info-card,
body.dark .game-install-box,
body.dark .game-editor-note,
body.dark .game-above-header-ad,
body.dark .game-middle-content-ad,
.dark .game-info-card,
.dark .game-install-box,
.dark .game-editor-note,
.dark .game-above-header-ad,
.dark .game-middle-content-ad{
    background: #223244;
    border-color: #334155;
}

body.dark .game-info-value,
body.dark .game-meta-pill,
body.dark .game-badge,
.dark .game-info-value,
.dark .game-meta-pill,
.dark .game-badge{
    color: #fff;
}

body.dark .game-meta-pill,
.dark .game-meta-pill{
    background: #223244;
    border-color: #334155;
}

body.dark .app-pagination .page-numbers,
.dark .app-pagination .page-numbers{
    background: #273d52;
    border-color: #334155;
    color: #fff;
}

body.dark .app-pagination .page-numbers.current,
.dark .app-pagination .page-numbers.current{
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

/* ========== Responsive ========== */
@media (max-width: 1100px){
    .game-grid,
    .game-cards-grid,
    .game-info-grid,
    .related-posts-grid{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .game-title{
        font-size: 34px;
    }
}

@media (max-width: 768px){
    .app-main{
        padding-top: 74px;
    }

    .hero-slider-grid{
        grid-template-columns: 1fr;
    }

    .hero-slide-thumb{
        height: 220px;
    }

    .archive-title{
        font-size: 26px;
    }

    .section-title,
    .game-section-title{
        font-size: 24px;
    }

    .game-grid,
    .game-cards-grid,
    .game-info-grid,
    .related-posts-grid{
        grid-template-columns: 1fr;
    }

    .game-card-title{
        font-size: 19px;
    }

    .game-title{
        font-size: 28px;
    }

    .game-content-card,
    .comments-wrap{
        padding: 18px;
        border-radius: 20px;
    }

    .game-top-featured-image img{
        border-radius: 16px;
    }

    .game-sticky-download{
        display: block;
    }

    .game-sticky-download .game-btn{
        min-height: 44px;
        padding: 0 18px;
        font-size: 14px;
    }
}