/*
Theme Name: Gymnastics Pro Theme
Theme URI: https://gymnasticscourse.com
Author: Advanced Agent
Author URI: https://gymnasticscourse.com
Description: A lightning-fast, highly optimized SEO-friendly modern theme designed specifically for Gymnastics. Supports Gutenberg blocks globally.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gymnastics-pro
Tags: modern, fast, custom-header, rtl-language-support, translation-ready, block-styles, full-width-template
*/

/* ========================================================
   CSS Variables & Typography
   ======================================================== */
:root {
    --gym-blue: #1e3a8a;
    --gym-blue-light: #3b82f6;
    --gym-green: #10b981;
    --gym-bg: #f8fafc;
    --gym-text: #334155;
    --gym-text-light: #64748b;
    --gym-nav-height: 75px;
    --wp--custom--layout--content-size: 1200px;
    --wp--custom--layout--wide-size: 1400px;
    --gym-header-bg: rgba(255, 255, 255, 0.95);
}

@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&display=swap');

body, a, h1, h2, h3, h4, h5, button {
    font-family: 'Almarai', sans-serif !important;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Almarai', sans-serif;
    background-color: var(--gym-bg);
    color: var(--gym-text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

/* ========================================================
   Header (Glassmorphism Sticky)
   ======================================================== */
.site-header {
    position: sticky;
    top: 0;
    min-height: var(--gym-nav-height);
    background: var(--gym-header-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    z-index: 9999;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    padding: 10px 0;
}

/* Fix for WordPress Admin Bar Overlap */
.admin-bar .site-header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    .site-header {
        position: relative; /* Change from sticky to relative on mobile to avoid overlap bugs with Safari */
        background: #ffffff !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        z-index: 999999;
    }
    .admin-bar .site-header {
        top: 0;
    }
}

.site-header-inner {
    max-width: var(--wp--custom--layout--wide-size);
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.site-branding {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-right-side {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-grow: 1;
    justify-content: flex-end;
}

.site-branding img.custom-logo {
    max-height: 50px;
    width: auto;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Almarai', sans-serif;
}
.site-title a {
    color: var(--gym-blue);
    text-decoration: none;
}

.main-navigation {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}
.main-navigation li a {
    color: var(--gym-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    white-space: nowrap;
    font-family: 'Almarai', sans-serif;
}
.main-navigation li a:hover {
    color: var(--gym-blue-light);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: nowrap;
}

.lang-switcher {
    font-weight: 700;
    color: var(--gym-text);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 5px 12px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    background: transparent;
    cursor: pointer;
    font-family: 'Almarai', sans-serif !important;
}
.lang-switcher:hover {
    background: rgba(0,0,0,0.05);
}

/* Hide annoying Google top bar completely */
.VIpgJd-ZVi9od-ORHb-OEVmcd { display: none !important; }
.skiptranslate iframe { display: none !important; }
body { top: 0 !important; }

.mobile-menu-btn {
    display: none !important;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gym-text);
    padding: 5px;
}

/* ========================================================
   Main Content Area
   ======================================================== */
.site-content {
    margin-top: var(--gym-nav-height);
    min-height: calc(100vh - var(--gym-nav-height) - 100px);
}

.container {
    max-width: var(--wp--custom--layout--content-size);
    margin: 0 auto;
    padding: 40px 20px;
}

/* Adjust Full-width blocks for native Gutenberg */
.alignfull {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    width: 100vw;
}

/* Base Content Formatting for Articles */
.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #334155;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.entry-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    margin: 20px 0;
}

.entry-content iframe,
.entry-content video {
    max-width: 100%;
    border-radius: 8px;
}

.entry-content p {
    margin-bottom: 20px;
}

.entry-content h2, .entry-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #0f172a;
}

.entry-content ul, .entry-content ol {
    margin-bottom: 20px;
    padding-inline-start: 20px;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    display: block;
    overflow-x: auto;
}

.entry-content th, .entry-content td {
    padding: 10px;
    border: 1px solid #e2e8f0;
}

/* ========================================================
   Footer
   ======================================================== */
.site-footer {
    background: #0f172a; /* Always dark for premium feel */
    color: #f8fafc;
    padding: 60px 20px 20px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget .widget-title {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-description {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links ul li {
    margin-bottom: 10px;
}
.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-links a:hover {
    color: var(--gym-blue-light);
}

.social-icons {
    display: flex;
    gap: 15px;
}
.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;
}
.social-icon:hover {
    background: var(--gym-blue-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #64748b;
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* ========================================================
   Responsive
   ======================================================== */
@media (max-width: 1024px) {
    .header-right-side {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    :root {
        --gym-nav-height: 60px;
    }
    
    .site-title {
        font-size: 1.2rem;
    }
    
    .site-header-inner {
        padding: 0 15px;
    }
    
    .mobile-menu-btn {
        display: block !important;
    }
    
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        inset-inline-end: 15px; /* Automatically maps to Left in Arabic / Right in English */
        width: 250px;
        background: var(--gym-header-bg);
        box-shadow: 0 10px 25px rgba(0,0,0,0.15);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(0,0,0,0.05);
        border-radius: 12px;
        margin-top: 5px;
        padding: 5px 0;
        text-align: start; /* Automatically maps to Right in Arabic / Left in English */
        z-index: 99999;
    }
    
    .main-navigation.active {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    
    .main-navigation li a {
        display: block;
        padding: 12px 20px;
        border-bottom: 1px solid rgba(0,0,0,0.03);
        font-size: 1rem;
        transition: background 0.2s;
        text-align: start;
    }
    .main-navigation li:last-child a {
        border-bottom: none;
    }
    .main-navigation li a:hover {
        background: rgba(0,0,0,0.03);
    }
    
    .header-action-btn {
        display: none;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .glass-card {
        padding: 25px 20px;
    }
    
    .glass-card h3 {
        font-size: 1.25rem !important;
        margin-bottom: 10px;
    }
    
    .icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
}
