/**
 * Main Stylesheet
 * Nizar Bookstore Theme
 *
 * @package Nizar_Bookstore
 * @since 1.0.0
 */

/* ==========================================================================
   CSS VARIABLES (Design System)
   ========================================================================== */

:root {
    /* Colors - Primary */
    --color-primary: #2C5F2D;
    --color-primary-light: #4A9B4D;
    --color-primary-dark: #1B3F1C;
    
    /* Colors - Neutrals */
    --color-neutral-900: #1A1A1A;
    --color-neutral-800: #2D2D2D;
    --color-neutral-700: #4A4A4A;
    --color-neutral-500: #8A8A8A;
    --color-neutral-300: #D4D4D4;
    --color-neutral-200: #E8E8E8;
    --color-neutral-100: #F5F5F5;
    --color-neutral-50: #FAFAFA;
    
    /* Colors - Accents */
    --color-accent-warm: #D4A574;
    --color-accent-cool: #5B8FA3;
    
    /* Colors - Semantic */
    --color-success: #3A7D44;
    --color-warning: #D97D3C;
    --color-error: #C53D3D;
    --color-info: #5B8FA3;
    
    /* Typography */
    --font-primary: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Font Sizes */
    --font-size-h1: 2.5rem;
    --font-size-h2: 2rem;
    --font-size-h3: 1.5rem;
    --font-size-h4: 1.25rem;
    --font-size-h5: 1.125rem;
    --font-size-h6: 1rem;
    --font-size-body: 1rem;
    --font-size-small: 0.875rem;
    --font-size-xs: 0.75rem;
    
    /* Font Weights */
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line Heights */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-loose: 1.8;
    
    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;
    --space-10: 4rem;
    --space-12: 6rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* Container */
    --container-max: 1280px;
    --container-padding: var(--space-6);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-primary);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);
    color: var(--color-neutral-800);
    background-color: var(--color-neutral-50);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-4);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-neutral-900);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }
h5 { font-size: var(--font-size-h5); }
h6 { font-size: var(--font-size-h6); }

p {
    margin: 0 0 var(--space-4);
}

a {
    color: var(--color-accent-cool);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    padding: var(--space-8) 0;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
    background: white;
    border-bottom: 1px solid var(--color-neutral-200);
    padding: var(--space-4) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
}

.site-branding {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.site-title {
    margin: 0;
    font-size: var(--font-size-h4);
}

.site-title a {
    color: var(--color-neutral-900);
}

.main-navigation {
    flex: 1;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: var(--space-5);
}

.menu a {
    color: var(--color-neutral-800);
    font-weight: var(--font-weight-medium);
    padding: var(--space-2) 0;
    display: block;
}

.menu a:hover {
    color: var(--color-primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.button,
button,
input[type="submit"],
.wp-block-button__link {
    display: inline-block;
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-primary);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    text-align: center;
    text-decoration: none;
    color: white;
    background-color: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: white;
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.book-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    box-shadow: var(--shadow-md);
}

.book-card__image {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--color-neutral-100);
}

.book-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-card__content {
    padding: var(--space-4);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-card__title {
    font-size: var(--font-size-h5);
    margin: 0 0 var(--space-2);
    line-height: var(--line-height-tight);
}

.book-card__title a {
    color: var(--color-neutral-900);
}

.book-card__author {
    font-size: var(--font-size-small);
    color: var(--color-neutral-700);
    margin-bottom: var(--space-3);
}

.book-card__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.book-card__price {
    font-size: var(--font-size-h5);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    background: var(--color-neutral-900);
    color: var(--color-neutral-300);
    margin-top: auto;
}

.footer-widgets {
    padding: var(--space-10) 0;
}

.footer-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-8);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-6) 0;
}

.footer-bottom a {
    color: var(--color-neutral-300);
}

.footer-bottom a:hover {
    color: white;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    :root {
        --container-padding: var(--space-4);
        --font-size-h1: 2rem;
        --font-size-h2: 1.75rem;
    }
    
    .menu {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .site-main {
        padding: var(--space-6) 0;
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
}

.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
