/*
Theme Name: Aqlam
Theme URI: https://example.com/aqlam
Author: Anees Montasser
Author URI: https://example.com
Description: Aqlam (أقلام) is a fully multilingual (Arabic / English / French) WordPress theme built for writers and critics. It ships a Publications custom post type, an About page, an Articles blog, a secure Contact page, front-end user accounts, RTL support, and hardened security defaults. Compatible with block editor, Polylang/WPML, WooCommerce, and Contact Form 7.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.6
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: aqlam
Domain Path: /languages
Tags: multilingual, rtl-language-support, translation-ready, custom-menu, custom-logo, featured-images, block-styles, threaded-comments, e-commerce
*/

/* ==========================================================================
   1. Design tokens (colour scheme from the supplied mockups)
   ========================================================================== */
:root{
    --aq-cream:        #FBF1DA;
    --aq-cream-deep:   #F6E8C8;
    --aq-terracotta:   #C86B3C;
    --aq-terracotta-d: #B25A2E;
    --aq-teal:         #127C7B;
    --aq-teal-dark:    #0E6362;
    --aq-ink:          #34302A;
    --aq-muted:        #7A756C;
    --aq-line:         #E7DCC2;
    --aq-white:        #FFFFFF;
    --aq-danger:       #B23A48;
    --aq-success:      #2E7D5B;

    --aq-radius:       10px;
    --aq-radius-lg:    18px;
    --aq-shadow:       0 12px 30px rgba(52,48,42,.10);
    --aq-shadow-sm:    0 4px 14px rgba(52,48,42,.08);
    --aq-maxw:         1200px;
    --aq-font-head:    "Poppins","Segoe UI",Tahoma,"Tajawal",sans-serif;
    --aq-font-body:    "Inter","Segoe UI",Tahoma,"Tajawal",sans-serif;
    --aq-transition:   .22s ease;
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */
*,*::before,*::after{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
    margin:0;
    font-family:var(--aq-font-body);
    color:var(--aq-ink);
    background:var(--aq-cream);
    line-height:1.65;
    font-size:17px;
    -webkit-font-smoothing:antialiased;
}
img{max-width:100%;height:auto;display:block;}
a{color:var(--aq-teal);text-decoration:none;transition:color var(--aq-transition);}
a:hover{color:var(--aq-teal-dark);}
h1,h2,h3,h4,h5,h6{font-family:var(--aq-font-head);color:var(--aq-terracotta);line-height:1.15;margin:0 0 .5em;font-weight:700;}
h1{font-size:clamp(2.2rem,5vw,3.5rem);}
h2{font-size:clamp(1.8rem,4vw,2.6rem);}
h3{font-size:1.4rem;}
p{margin:0 0 1.1em;}
ul,ol{padding-inline-start:1.4em;}
blockquote{
    margin:1.5em 0;padding:1em 1.4em;
    border-inline-start:4px solid var(--aq-teal);
    background:var(--aq-cream-deep);border-radius:var(--aq-radius);
    color:var(--aq-ink);font-style:italic;
}
code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;background:var(--aq-cream-deep);border-radius:6px;}
code{padding:.15em .4em;}
pre{padding:1em;overflow:auto;}
hr{border:none;border-top:1px solid var(--aq-line);margin:2em 0;}
:focus-visible{outline:3px solid var(--aq-teal);outline-offset:2px;}

/* accessibility helpers */
.screen-reader-text{
    border:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%);
    height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;word-wrap:normal!important;
}
.skip-link{
    position:absolute;left:-999px;top:0;z-index:100000;background:var(--aq-terracotta);
    color:#fff;padding:.7em 1.2em;border-radius:0 0 var(--aq-radius) 0;
}
.skip-link:focus{left:0;color:#fff;}

/* ==========================================================================
   3. Layout helpers
   ========================================================================== */
.aq-container{width:min(100% - 2.5rem,var(--aq-maxw));margin-inline:auto;}
.aq-section{padding:clamp(3rem,7vw,6rem) 0;}
.aq-grid{display:grid;gap:2rem;}
.aq-eyebrow{display:inline-flex;align-items:center;gap:.6rem;color:var(--aq-teal);font-weight:600;letter-spacing:.02em;margin-bottom:1rem;text-transform:capitalize;}
.aq-eyebrow::before{content:"";width:34px;height:2px;background:var(--aq-teal);display:inline-block;}

/* ==========================================================================
   4. Buttons
   ========================================================================== */
.aq-btn,
.aq-content .wp-block-button__link,
button,input[type="submit"],input[type="button"],.wp-block-button__link{
    display:inline-flex;align-items:center;gap:.55rem;justify-content:center;
    background:var(--aq-terracotta);color:#fff;font-family:var(--aq-font-head);
    font-weight:600;font-size:1rem;padding:.8em 1.6em;border:none;border-radius:var(--aq-radius);
    cursor:pointer;transition:background var(--aq-transition),transform var(--aq-transition);
    text-align:center;line-height:1.2;
}
.aq-btn:hover,button:hover,input[type="submit"]:hover{background:var(--aq-terracotta-d);color:#fff;transform:translateY(-2px);}
.aq-btn--ghost{background:transparent;color:var(--aq-teal);padding-inline:0;}
.aq-btn--ghost:hover{background:transparent;color:var(--aq-teal-dark);transform:none;}
.aq-btn--teal{background:var(--aq-teal);}
.aq-btn--teal:hover{background:var(--aq-teal-dark);}
.aq-btn--block{width:100%;}

/* ==========================================================================
   5. Header / navigation
   ========================================================================== */
.aq-header{background:var(--aq-cream);border-bottom:1px solid var(--aq-line);position:sticky;top:0;z-index:900;}
.aq-header__bar{display:flex;align-items:center;justify-content:space-between;gap:1.5rem;padding:.9rem 0;}
.aq-brand{display:flex;align-items:center;gap:.6rem;font-family:var(--aq-font-head);font-weight:700;font-size:1.4rem;color:var(--aq-teal);}
.aq-brand img{max-height:44px;width:auto;}
.aq-brand a{color:var(--aq-teal);}
.aq-nav ul{list-style:none;display:flex;gap:1.6rem;margin:0;padding:0;align-items:center;}
.aq-nav a{color:var(--aq-ink);font-weight:500;font-family:var(--aq-font-head);padding:.3em 0;position:relative;}
.aq-nav a:hover,.aq-nav .current-menu-item>a{color:var(--aq-teal);}
.aq-nav .current-menu-item>a::after{content:"";position:absolute;bottom:-4px;inset-inline:0;height:2px;background:var(--aq-teal);}
.aq-nav .sub-menu{position:absolute;background:#fff;box-shadow:var(--aq-shadow);border-radius:var(--aq-radius);padding:.6rem;min-width:200px;display:none;flex-direction:column;gap:.2rem;z-index:20;}
.aq-nav li{position:relative;}
.aq-nav li:hover>.sub-menu{display:flex;}
.aq-nav .sub-menu a{padding:.5em .8em;border-radius:6px;}
.aq-nav .sub-menu a:hover{background:var(--aq-cream-deep);}
.aq-header__actions{display:flex;align-items:center;gap:1rem;}

/* language switcher */
.aq-lang{display:flex;gap:.4rem;align-items:center;}
.aq-lang a,.aq-lang span{font-size:.85rem;font-weight:600;font-family:var(--aq-font-head);padding:.25em .55em;border-radius:6px;color:var(--aq-muted);}
.aq-lang .is-active,.aq-lang a:hover{background:var(--aq-teal);color:#fff;}

/* mobile toggle */
.aq-nav-toggle{display:none;background:transparent;padding:.4em;border-radius:8px;}
.aq-nav-toggle span,.aq-nav-toggle span::before,.aq-nav-toggle span::after{
    content:"";display:block;width:24px;height:2px;background:var(--aq-ink);position:relative;transition:var(--aq-transition);
}
.aq-nav-toggle span::before{position:absolute;top:-7px;}
.aq-nav-toggle span::after{position:absolute;top:7px;}

/* ==========================================================================
   6. Latest-publications ribbon (header showcase)
   ========================================================================== */
.aq-latest{background:var(--aq-teal);color:#fff;font-size:.9rem;}
.aq-latest__inner{display:flex;align-items:center;gap:1rem;padding:.5rem 0;overflow:hidden;}
.aq-latest__label{font-family:var(--aq-font-head);font-weight:600;white-space:nowrap;background:rgba(255,255,255,.15);padding:.2em .7em;border-radius:6px;}
.aq-latest__track{display:flex;gap:2rem;white-space:nowrap;overflow:hidden;flex:1;}
.aq-latest__track a{color:#fff;font-weight:500;opacity:.92;}
.aq-latest__track a:hover{opacity:1;text-decoration:underline;}

/* ==========================================================================
   7. Hero
   ========================================================================== */
.aq-hero{padding:clamp(2.5rem,6vw,5rem) 0;}
.aq-hero__grid{display:grid;grid-template-columns:1.05fr .95fr;gap:3rem;align-items:center;}
.aq-hero__title{margin-bottom:1rem;}
.aq-hero__text{color:var(--aq-muted);font-size:1.1rem;max-width:38ch;margin-bottom:1.8rem;}
.aq-hero__cta{display:flex;gap:1.2rem;align-items:center;flex-wrap:wrap;}
.aq-hero__media{position:relative;}
.aq-hero__media img{border-radius:var(--aq-radius-lg);box-shadow:var(--aq-shadow);margin-inline:auto;}
.aq-hero__book{background:var(--aq-cream-deep);border-radius:var(--aq-radius-lg);padding:2.5rem;text-align:center;box-shadow:var(--aq-shadow-sm);}
.aq-hero__book h3{color:var(--aq-teal);font-size:2rem;text-transform:uppercase;letter-spacing:.02em;}

/* ==========================================================================
   8. Publication cards
   ========================================================================== */
.aq-books__head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:2.5rem;flex-wrap:wrap;}
.aq-books__grid{display:grid;grid-template-columns:repeat(4,1fr);gap:1.8rem;}
.aq-card{background:transparent;display:flex;flex-direction:column;}
.aq-card__media{border-radius:var(--aq-radius);overflow:hidden;aspect-ratio:3/4;background:var(--aq-cream-deep);box-shadow:var(--aq-shadow-sm);margin-bottom:1rem;}
.aq-card__media img{width:100%;height:100%;object-fit:cover;transition:transform .4s ease;}
.aq-card:hover .aq-card__media img{transform:scale(1.05);}
.aq-card__title{font-family:var(--aq-font-head);font-size:1.15rem;margin:0 0 .1rem;}
.aq-card__title a{color:var(--aq-teal);}
.aq-card__author{color:var(--aq-muted);font-size:.92rem;margin-bottom:.6rem;}
.aq-card__price{color:var(--aq-terracotta);font-weight:700;font-family:var(--aq-font-head);font-size:1.25rem;display:flex;align-items:baseline;gap:.5rem;margin-bottom:1rem;}
.aq-card__price del{color:var(--aq-muted);font-size:.9rem;font-weight:500;}

/* ==========================================================================
   9. Features
   ========================================================================== */
.aq-features__title{text-align:center;max-width:20ch;margin-inline:auto;margin-bottom:3rem;}
.aq-features__grid{display:grid;grid-template-columns:1fr 1.1fr 1fr;gap:2.5rem;align-items:center;}
.aq-feature{margin-bottom:2rem;}
.aq-feature__icon{width:46px;height:46px;color:var(--aq-teal);margin-bottom:.9rem;}
.aq-feature h3{color:var(--aq-terracotta);font-size:1.2rem;margin-bottom:.4rem;}
.aq-feature p{color:var(--aq-muted);font-size:.96rem;}
.aq-features__media img{border-radius:var(--aq-radius-lg);box-shadow:var(--aq-shadow);}

/* ==========================================================================
   10. Content / articles
   ========================================================================== */
.aq-content{max-width:760px;margin-inline:auto;}
.aq-content img{border-radius:var(--aq-radius);margin:1.5em 0;}
.aq-page-header{text-align:center;padding:clamp(2.5rem,6vw,4rem) 0 1rem;}
.aq-page-header p{color:var(--aq-muted);max-width:60ch;margin-inline:auto;}
.aq-posts{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:2.2rem;}
.aq-post{background:#fff;border-radius:var(--aq-radius-lg);overflow:hidden;box-shadow:var(--aq-shadow-sm);display:flex;flex-direction:column;transition:transform var(--aq-transition),box-shadow var(--aq-transition);}
.aq-post:hover{transform:translateY(-4px);box-shadow:var(--aq-shadow);}
.aq-post__media{aspect-ratio:16/10;overflow:hidden;background:var(--aq-cream-deep);}
.aq-post__media img{width:100%;height:100%;object-fit:cover;}
.aq-post__body{padding:1.4rem 1.5rem 1.7rem;flex:1;display:flex;flex-direction:column;}
.aq-post__meta{color:var(--aq-muted);font-size:.83rem;margin-bottom:.5rem;display:flex;gap:.8rem;flex-wrap:wrap;}
.aq-post__title{font-size:1.25rem;margin-bottom:.5rem;}
.aq-post__title a{color:var(--aq-teal);}
.aq-post__excerpt{color:var(--aq-muted);font-size:.95rem;flex:1;}
.aq-post__more{margin-top:1rem;font-weight:600;color:var(--aq-terracotta);}
.aq-tax{display:inline-block;background:var(--aq-cream-deep);color:var(--aq-teal);font-size:.78rem;padding:.2em .7em;border-radius:20px;margin:0 .3em .3em 0;}

/* single */
.aq-single__header{text-align:center;max-width:760px;margin:0 auto 2rem;}
.aq-single__meta{color:var(--aq-muted);font-size:.9rem;margin-top:1rem;}
.aq-single__thumb{border-radius:var(--aq-radius-lg);overflow:hidden;margin-bottom:2.5rem;box-shadow:var(--aq-shadow-sm);}

/* Article audio ("Listen to this article") */
.aq-audio{max-width:760px;margin:0 auto 2.2rem;background:var(--aq-cream-deep);border:1px solid var(--aq-line);
    border-radius:var(--aq-radius-lg);padding:1.1rem 1.3rem;box-shadow:var(--aq-shadow-sm);}
.aq-audio__label{display:flex;align-items:center;gap:.55rem;color:var(--aq-teal-dark);
    font-family:var(--aq-font-head);font-weight:600;margin-bottom:.7rem;}
.aq-audio audio,.aq-audio .mejs-container,.aq-audio .wp-audio-shortcode{width:100%!important;}
.aq-audio-badge{display:inline-flex;align-items:center;gap:.3rem;margin-top:.5rem;font-size:.8rem;font-weight:600;
    color:var(--aq-teal-dark);background:rgba(18,124,123,.1);padding:.2em .6em;border-radius:999px;}
.aq-audio-badge svg{flex:none;}

/* ==========================================================================
   11. Forms (contact, account, comments)
   ========================================================================== */
.aq-form{max-width:620px;margin-inline:auto;background:#fff;padding:2.4rem;border-radius:var(--aq-radius-lg);box-shadow:var(--aq-shadow-sm);}
.aq-form p{margin-bottom:1.2rem;}
.aq-field{margin-bottom:1.2rem;}
.aq-field label{display:block;font-weight:600;font-family:var(--aq-font-head);margin-bottom:.4rem;font-size:.95rem;}
.aq-input,input[type="text"],input[type="email"],input[type="url"],input[type="password"],input[type="search"],input[type="tel"],textarea,select{
    width:100%;padding:.75em .9em;border:1px solid var(--aq-line);border-radius:var(--aq-radius);
    background:var(--aq-cream);font-family:var(--aq-font-body);font-size:1rem;color:var(--aq-ink);transition:border var(--aq-transition),box-shadow var(--aq-transition);
}
input:focus,textarea:focus,select:focus{border-color:var(--aq-teal);box-shadow:0 0 0 3px rgba(18,124,123,.15);outline:none;}
textarea{min-height:150px;resize:vertical;}
.aq-honeypot{position:absolute!important;left:-9999px!important;}
.aq-notice{padding:.9em 1.2em;border-radius:var(--aq-radius);margin-bottom:1.4rem;font-weight:500;}
.aq-notice--ok{background:rgba(46,125,91,.12);color:var(--aq-success);border:1px solid rgba(46,125,91,.3);}
.aq-notice--err{background:rgba(178,58,72,.1);color:var(--aq-danger);border:1px solid rgba(178,58,72,.3);}
.aq-account-tabs{display:flex;gap:.5rem;justify-content:center;margin-bottom:1.6rem;}
.aq-account-tabs a{padding:.5em 1.2em;border-radius:var(--aq-radius);font-weight:600;font-family:var(--aq-font-head);background:var(--aq-cream-deep);color:var(--aq-ink);}
.aq-account-tabs a.is-active{background:var(--aq-terracotta);color:#fff;}

/* ==========================================================================
   12. Comments
   ========================================================================== */
.aq-comments{max-width:760px;margin:3rem auto 0;}
.aq-comments ol{list-style:none;padding:0;}
.aq-comments .comment-body{background:#fff;border-radius:var(--aq-radius);padding:1.2rem 1.4rem;margin-bottom:1rem;box-shadow:var(--aq-shadow-sm);}
.aq-comments .comment-author{font-weight:600;font-family:var(--aq-font-head);}
.aq-comments .comment-meta{font-size:.82rem;color:var(--aq-muted);margin-bottom:.6rem;}

/* ==========================================================================
   13. Pagination
   ========================================================================== */
.aq-pagination{display:flex;gap:.5rem;justify-content:center;margin-top:3rem;flex-wrap:wrap;}
.aq-pagination .page-numbers{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:44px;padding:0 .6em;border-radius:var(--aq-radius);background:#fff;color:var(--aq-ink);font-weight:600;box-shadow:var(--aq-shadow-sm);}
.aq-pagination .page-numbers.current,.aq-pagination .page-numbers:hover{background:var(--aq-terracotta);color:#fff;}

/* ==========================================================================
   14. Footer
   ========================================================================== */
.aq-footer{background:var(--aq-teal-dark);color:#fff;padding:clamp(3rem,6vw,4.5rem) 0 1.5rem;}
.aq-footer a{color:#fff;opacity:.85;}
.aq-footer a:hover{opacity:1;color:#fff;}
.aq-footer__grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:2.5rem;margin-bottom:2.5rem;}
.aq-footer h4{color:#fff;font-size:1rem;margin-bottom:1rem;font-family:var(--aq-font-head);}
.aq-footer ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.5rem;}
.aq-footer__brand{font-size:1.5rem;font-weight:700;font-family:var(--aq-font-head);margin-bottom:.4rem;color:#fff;}
.aq-footer__tagline{margin:0;opacity:.8;max-width:32ch;font-size:.92rem;}
.aq-footer__bar{display:flex;align-items:center;justify-content:space-between;gap:2rem;flex-wrap:wrap;
    padding-bottom:1.8rem;margin-bottom:1.5rem;border-bottom:1px solid rgba(255,255,255,.15);}
.aq-footer__nav .aq-footer__menu{flex-direction:row;flex-wrap:wrap;gap:.4rem 1.4rem;justify-content:center;}
.aq-footer__nav .aq-footer__menu a{font-family:var(--aq-font-head);font-weight:500;}
.aq-footer__social{display:flex;align-items:center;gap:.7rem;}
.aq-social-link{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;
    background:rgba(255,255,255,.1);color:#fff;opacity:1;transition:background var(--aq-transition),transform var(--aq-transition);}
.aq-social-link:hover{background:var(--aq-terracotta);color:#fff;transform:translateY(-2px);}
.aq-social-icon{display:block;}
.aq-footer__bottom{padding-top:.5rem;text-align:center;font-size:.88rem;opacity:.8;}
.aq-footer .widget{color:#fff;}

/* ==========================================================================
   15. Widgets / sidebar
   ========================================================================== */
.aq-sidebar .widget{background:#fff;border-radius:var(--aq-radius-lg);padding:1.5rem;margin-bottom:1.8rem;box-shadow:var(--aq-shadow-sm);}
.aq-sidebar .widget-title{color:var(--aq-terracotta);font-size:1.15rem;margin-bottom:1rem;}
.aq-with-sidebar{display:grid;grid-template-columns:1fr 320px;gap:3rem;align-items:start;}

/* ==========================================================================
   16. Responsive
   ========================================================================== */
@media (max-width:980px){
    .aq-hero__grid{grid-template-columns:1fr;}
    .aq-hero__media{order:-1;}
    .aq-books__grid{grid-template-columns:repeat(2,1fr);}
    .aq-features__grid{grid-template-columns:1fr;}
    .aq-features__media{order:-1;}
    .aq-footer__grid{grid-template-columns:1fr 1fr;}
    .aq-with-sidebar{grid-template-columns:1fr;}
}
@media (max-width:760px){
    .aq-nav-toggle{display:block;}
    .aq-nav{position:fixed;inset:0 0 0 auto;width:min(80%,320px);background:#fff;box-shadow:var(--aq-shadow);
        transform:translateX(100%);transition:transform var(--aq-transition);padding:5rem 1.5rem;z-index:950;}
    body.rtl .aq-nav{inset:0 auto 0 0;transform:translateX(-100%);}
    .aq-nav.is-open{transform:translateX(0);}
    .aq-nav ul{flex-direction:column;align-items:flex-start;gap:.4rem;}
    .aq-nav .sub-menu{position:static;box-shadow:none;padding-inline-start:1rem;display:flex;}
    .aq-books__grid{grid-template-columns:1fr 1fr;}
    .aq-footer__bar{flex-direction:column;text-align:center;align-items:center;}
    .aq-footer__tagline{margin-inline:auto;}
    .aq-latest__label{display:none;}
}
@media (max-width:460px){
    .aq-books__grid{grid-template-columns:1fr;}
}

/* Breadcrumbs */
.aq-breadcrumbs{padding-block:0.85rem;border-bottom:1px solid var(--aq-line);background:var(--aq-cream-deep);font-size:0.85rem;}
.aq-breadcrumbs ol{display:flex;flex-wrap:wrap;align-items:center;gap:0.45rem;margin:0;padding:0;list-style:none;}
.aq-breadcrumbs li{display:flex;align-items:center;gap:0.45rem;color:var(--aq-muted);}
.aq-breadcrumbs li:not(:first-child)::before{content:"/";color:var(--aq-line);}
.aq-breadcrumbs a{color:var(--aq-muted);}
.aq-breadcrumbs a:hover{color:var(--aq-teal);}
.aq-breadcrumbs [aria-current="page"]{color:var(--aq-ink);font-weight:500;}

/* Marquee animation for the latest-publications ribbon (added by theme.js) */
@keyframes aq-marquee{
    from{transform:translateX(0);}
    to{transform:translateX(-50%);}
}
body.rtl @keyframes aq-marquee{
    from{transform:translateX(0);}
    to{transform:translateX(50%);}
}
