
/*
Theme Name: Kenz Lejdoud
Theme URI: https://kenzlejdoud.ma
Author: Kenz Lejdoud Dev Team
Author URI: https://kenzlejdoud.ma
Description: قالب ووردبريس مخصص لمتحف التراث المغربي "كنز الجدود". يجمع بين أصالة المعمار المغربي (الرياض، الزليج) وبساطة التصميم الحديث (Neo-Heritage).
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kenz-lejdoud
Tags: morocco, heritage, rtl, cultural, museum, custom-theme
*/

/* =========================================
   1. Imports & Fonts
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Aref+Ruqaa:wght@400;700&family=Tajawal:wght@300;400;500;700&display=swap');

/* =========================================
   2. CSS Variables (The Palette)
   ========================================= */
:root {
    /* Primary Colors */
    --color-majorelle: #0055A4;       /* أزرق ماجوريل */
    --color-royal-green: #00695C;     /* أخضر ملكي */
    --color-clay-red: #C62828;        /* أحمر طيني */
    
    /* Metallic/Precious */
    --color-copper: #B87333;          /* نحاسي */
    --color-gold: #D4AF37;            /* ذهبي */
    
    /* Base */
    --color-off-white: #F9F7F2;       /* أبيض جصي/ورقي */
    --color-text-dark: #2D2D2D;       /* أسود فاحم */
    --color-text-light: #757575;      /* رمادي حجري */

    /* Typography */
    --font-heading: 'Aref Ruqaa', serif;
    --font-body: 'Tajawal', sans-serif;
    --font-traditional: 'Amiri', serif;
}

/* =========================================
   3. Base Styles & Typography (RTL Optimized)
   ========================================= */
body {
    background-color: var(--color-off-white);
    color: var(--color-text-dark);
    font-family: var(--font-body);
    line-height: 1.6;
    
    /* Strict RTL Enforcement */
    direction: rtl; 
    text-align: start; /* Logical property: aligns right in RTL */
    
    /* Subtle Zellige Texture Overlay */
    background-image: url('https://www.transparenttextures.com/patterns/arabesque.png');
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-royal-green);
    margin-block-end: 1rem; /* Logical margin bottom */
}

p {
    margin-block-end: 1rem;
}

a {
    color: var(--color-majorelle);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Form Elements - RTL by Default */
input, textarea, select {
    font-family: var(--font-body);
    text-align: start;
    direction: rtl;
}

/* Helper for LTR inputs (Emails, URLs, Codes) */
.dir-ltr {
    direction: ltr !important;
    text-align: left !important;
}

/* =========================================
   4. Proverb Card & 3D Flip Styles
   ========================================= */

/* The Container */
.perspective-1000 {
    perspective: 1000px;
}

/* The 3D Space wrapper */
.transform-style-3d {
    transform-style: preserve-3d;
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Snappy easing */
}

/* The Flip Action */
/* In RTL, standard rotation still works physically */
.rotate-y-180 {
    transform: rotateY(180deg);
}

/* Face Visibility */
.backface-hidden {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Specific styling for the Back Face to ensure it layers correctly */
.bg-royalGreen.rotate-y-180 {
    transform: rotateY(180deg);
}

/* Decorative Pattern for Cards */
.card-pattern {
    background-image: radial-gradient(var(--color-gold) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
}

/* =========================================
   5. Custom Scrollbar (Neo-Heritage Style)
   ========================================= */
/* Desktop Only - Browsers typically place this on the left in RTL */
::-webkit-scrollbar {
    width: 8px; /* Slightly thinner for elegance */
}

::-webkit-scrollbar-track {
    background: var(--color-off-white);
}

::-webkit-scrollbar-thumb {
    background-color: var(--color-copper);
    border-radius: 99px;
    border: 2px solid var(--color-off-white);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-royal-green);
}

/* =========================================
   6. Custom Cursor (The Quill)
   ========================================= */

/* Only hide default cursor on devices that support hover (Desktop) */
@media (hover: hover) and (pointer: fine) {
    .cursor-none-on-desktop,
    .cursor-none-on-desktop * {
        cursor: none !important;
    }
}

/* =========================================
   7. Utilities & Animations
   ========================================= */
.text-gold { color: var(--color-gold); }
.text-copper { color: var(--color-copper); }
.bg-majorelle { background-color: var(--color-majorelle); }

/* Animation for rare items */
@keyframes shine {
    0% { background-position: 200% center; }   /* Starts from Right */
    100% { background-position: -200% center; } /* Moves to Left (Natural RTL flow) */
}

.rare-badge {
    background: linear-gradient(to right, var(--color-copper) 20%, var(--color-gold) 40%, var(--color-copper) 60%, var(--color-gold) 80%);
    background-size: 200% auto;
    color: #fff;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    font-weight: bold;
}

/* Utility for fade-in animations used in React components */
.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0); /* Vertical movement remains same for RTL */
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}
