/*
Theme Name: Quran Web Learning
Theme URI: https://quranweblearning.com
Author: Quran Web Learning Development Team
Author URI: https://quranweblearning.com
Description: A premium WordPress theme for online Quran education platforms. Features Modern Islamic Minimalism design, full RTL support, bilingual (AR/EN), Elementor compatible, WooCommerce ready, WPML compatible. Built with WordPress Coding Standards, optimized for performance and SEO with Schema.org markup.
Version: 3.2.1
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: qwlearn-quran
Domain Path: /languages
Tags: education, religion, multilingual, rtl-language-support, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, block-styles, wide-blocks, accessibility-ready, e-commerce, blog
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# CSS Reset & Base (تمت إضافته لحماية الموبايل)
# CSS Variables (Design Tokens)
# Typography
# Layout & Containers
# WordPress Core Classes
# Accessibility
----------------------------------------------------------------*/

/* The main styles are in assets/css/main.css */
/* This file contains the WordPress required header and base WP classes */

/*--------------------------------------------------------------
# CSS Reset & Base (السيطرة الصارمة على التمرير الأفقي والموبايل)
--------------------------------------------------------------*/
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: clip !important;
    position: relative;
}

.elementor-page, .site, #page, #wrapper, .elementor-section-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: clip !important;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

/*--------------------------------------------------------------
# CSS Variables (Brand Identity)
--------------------------------------------------------------*/
:root {
    --qwlearn-primary: #10B981;
    --qwlearn-secondary: #064E3B;
    --qwlearn-cta: #FCD34D;
    --qwlearn-bg: #F0FDF4;
    --qwlearn-white: #FFFFFF;
    --qwlearn-text: #1A1A1A;
    --qwlearn-text-muted: #6B7280;
    --qwlearn-border: #E5E7EB;
    --qwlearn-success: #10B981;
    --qwlearn-danger: #EF4444;

    --qwlearn-font-ar-heading: 'Amiri Quran', 'Amiri', 'Cairo', system-ui, sans-serif;
    --qwlearn-font-ar-body: 'Amiri Quran', 'Amiri', system-ui, sans-serif;
    --qwlearn-font-en-heading: 'Playfair Display', Georgia, serif;
    --qwlearn-font-en-body: 'Inter', system-ui, sans-serif;

    --qwlearn-radius-sm: 0.375rem;
    --qwlearn-radius-md: 0.75rem;
    --qwlearn-radius-lg: 1.25rem;
    --qwlearn-radius-xl: 2rem;

    --qwlearn-shadow-sm: 0 1px 2px rgba(6, 78, 59, 0.05);
    --qwlearn-shadow-md: 0 4px 12px rgba(6, 78, 59, 0.08);
    --qwlearn-shadow-lg: 0 12px 32px rgba(6, 78, 59, 0.12);
    --qwlearn-shadow-xl: 0 24px 60px rgba(6, 78, 59, 0.18);

    --qwlearn-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --qwlearn-container-max: 1280px;
}

/*--------------------------------------------------------------
# WordPress Core Classes (Required)
--------------------------------------------------------------*/
.alignleft {
    display: inline;
    float: left;
    margin-right: 1.5rem;
}

.alignright {
    display: inline;
    float: right;
    margin-left: 1.5rem;
}

.aligncenter {
    clear: both;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignwide {
    max-width: 1100px;
}

.alignfull {
    max-width: 100vw;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* إصلاح المشكلة الأساسية في الجوال لكلاس alignfull */
@media screen and (max-width: 768px) {
    .alignfull {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* RTL Adjustments */
.rtl .alignleft {
    float: right;
    margin-right: 0;
    margin-left: 1.5rem;
}

.rtl .alignright {
    float: left;
    margin-left: 0;
    margin-right: 1.5rem;
}

/* WordPress Block Editor Defaults */
.wp-caption {
    margin-bottom: 1.5rem;
    max-width: 100%;
}

.wp-caption img[class*="wp-image-"] {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption .wp-caption-text {
    margin: 0.8em 0;
    font-size: 0.875rem;
    color: var(--qwlearn-text-muted);
    text-align: center;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    -webkit-clip-path: none;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Skip to content */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--qwlearn-primary);
    color: #fff;
    padding: 1rem 1.5rem;
    z-index: 999999;
    text-decoration: none;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

/* دعم الاتجاه العربي لزر التخطي */
.rtl .skip-link {
    left: auto;
    right: -9999px;
}

.rtl .skip-link:focus {
    left: auto;
    right: 1rem;
}

/* Sticky Posts */
.sticky {
    display: block;
}

/* Comments */
.bypostauthor {
    display: block;
}

/* Gallery */
.gallery {
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.gallery-columns-6 { grid-template-columns: repeat(6, 1fr); }

.gallery-item {
    margin: 0;
}

.gallery-item img {
    border: 1px solid #cfcfcf;
    max-width: 100%;
    height: auto;
}

.gallery-caption {
    display: block;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Gallery Responsiveness (استعلامات الوسائط للتجاوب مع الجوال) */
@media screen and (max-width: 768px) {
    .gallery,
    .gallery-columns-3,
    .gallery-columns-4,
    .gallery-columns-5,
    .gallery-columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .gallery,
    .gallery-columns-2,
    .gallery-columns-3,
    .gallery-columns-4,
    .gallery-columns-5,
    .gallery-columns-6 {
        grid-template-columns: 1fr;
    }
}

/* The actual styles are loaded from assets/css/main.css via wp_enqueue_style */