/*
Theme Name: AtoClick Blog
Theme URI: https://atoclick.com/blog
Author: AtoClick
Author URI: https://atoclick.com
Description: A custom WordPress theme for the AtoClick blog, designed to seamlessly integrate with the main React-based website. Features dark mode design, optimized performance (95+ Lighthouse score), RTL support, and modern typography.
Version: 2.3.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: atoclick-blog
Tags: blog, dark-mode, translation-ready, rtl-language-support, custom-logo, custom-menu, featured-images, threaded-comments

This theme is designed to match the main AtoClick website branding.
*/

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
    /* Primary Palette */
    --primary-dark: #0F2E2A;
    --primary-medium: #1F3D3A;
    --accent-green: #35C28D;
    --accent-light: #6FE0B8;
    --text-white: #FFFFFF;
    --text-gray: #9CA3AF;
    --text-light-gray: #D1D5DB;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-arabic: 'Cairo', 'Inter', sans-serif;
    --font-size-base: 16px;
    --line-height-body: 1.6;
    --line-height-heading: 1.2;

    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Layout */
    --container-max: 1280px;
    --content-max: 800px;
    --sidebar-width: 320px;
    --header-height: 72px;
    --header-height-slim: 56px;

    /* Borders */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);

    /* Z-index layers */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;
}

/* ==========================================================================
   Critical CSS - Above the fold styles
   ========================================================================== */

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-body);
    color: var(--text-light-gray);
    background-color: var(--primary-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-heading);
    color: var(--text-white);
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: var(--font-weight-extrabold);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

h4 {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--accent-green);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover,
a:focus {
    color: var(--accent-light);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lists */
ul,
ol {
    padding-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

li {
    margin-bottom: var(--spacing-xs);
}

/* Focus states for accessibility */
:focus-visible {
    outline: 2px solid var(--accent-green);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background-color: var(--accent-green);
    color: var(--primary-dark);
}

/* Screen reader only */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--primary-medium);
    clip: auto !important;
    clip-path: none;
    color: var(--text-white);
    display: block;
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--accent-green);
    color: var(--primary-dark);
    padding: var(--spacing-sm) var(--spacing-md);
    z-index: var(--z-tooltip);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--spacing-xl);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    line-height: 1.5;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 44px;
    min-width: 44px;
}

.btn-primary {
    background-color: var(--accent-green);
    color: var(--primary-dark);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--accent-light);
    color: var(--primary-dark);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-white);
    border: 1px solid var(--text-gray);
}

.btn-secondary:hover,
.btn-secondary:focus {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

/* Form elements */
input,
textarea,
select {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-white);
    background-color: var(--primary-medium);
    border: 1px solid transparent;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    width: 100%;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(53, 194, 141, 0.2);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-gray);
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-accent {
    color: var(--accent-green);
}

.bg-medium {
    background-color: var(--primary-medium);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mt-xl {
    margin-top: var(--spacing-xl);
}

.mb-xl {
    margin-bottom: var(--spacing-xl);
}

/* ==========================================================================
   FIXES - Layout Helper
   ========================================================================== */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1 0 auto;
}

.site-footer {
    flex-shrink: 0;
    width: 100%;
}