/**
 * Amanah — Product Description Typography System
 * am-product-description.css
 *
 * HOW TO USE:
 *   1. Enqueue in functions.php:
 *        wp_enqueue_style( 'am-product-desc',
 *            get_stylesheet_directory_uri() . '/assets/css/am-product-description.css',
 *            [], '1.0.0' );
 *
 *   2. Wrap the_content() in single-product.php:
 *        <div class="am-sp-sec-text am-desc"><?php the_content(); ?></div>
 *
 * CONTENT CONVENTIONS:
 *   H2           = section heading
 *   H3           = sub-heading
 *   UL > LI      = gold-dash bullet. Start LI with <strong>Bold lead —</strong> then text.
 *   BLOCKQUOTE   = Hadith / Qur'anic quote
 *   P.am-arabic  = Arabic RTL text
 *   P.am-highlight = spec summary box
 *   HR           = gold gradient section divider
 *
 * @package Amanah
 * @version 1.1.0
 */

/* ══════════════════════════════════════════════════════════
   VARIABLES
══════════════════════════════════════════════════════════ */
.am-desc {
    --ad-gold:        #C9A84C;
    --ad-gold-light:  #E2C272;
    --ad-gold-pale:   #F5E9C8;
    --ad-gold-border: rgba(201,168,76,0.18);
    --ad-black:       #0A0A0A;
    --ad-dark:        #1A1A1A;
    --ad-grey:        #6B6B6B;
    --ad-light-grey:  #B0B0B0;
    --ad-off-white:   #F8F5EF;
    --ad-border:      #E8E2D6;
    --ad-white:       #FFFFFF;
    --ad-font-display: 'Cormorant Garamond', 'Georgia', serif;
    --ad-font-body:    'AkkuratPro', 'Helvetica Neue', sans-serif;
    --ad-font-arabic:  'Noto Naskh Arabic', 'Traditional Arabic', serif;
    --ad-ease:         0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════════════════════════════════════
   BASE RESET inside .am-desc
══════════════════════════════════════════════════════════ */
.am-desc,
.am-desc * {
    box-sizing: border-box;
}

.am-desc {
    font-family: var(--ad-font-body);
    font-size: 13px;
    line-height: 1.8;
    color: var(--ad-grey);
    -webkit-font-smoothing: antialiased;
    max-width: 100%;
    width: 100%;
}

/* ══════════════════════════════════════════════════════════
   PARAGRAPHS
══════════════════════════════════════════════════════════ */
.am-desc p {
    font-size: 13px;
    line-height: 1.85;
    color: var(--ad-grey);
    margin: 0 0 16px;
    font-weight: 400;
}

.am-desc p:last-child {
    margin-bottom: 0;
}

.am-desc h2 + p,
.am-desc h3 + p {
    font-size: 13.5px;
    color: #555;
}

/* ══════════════════════════════════════════════════════════
   HEADINGS
══════════════════════════════════════════════════════════ */
.am-desc h2 {
    font-family: var(--ad-font-display);
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 400;
    color: var(--ad-black);
    line-height: 1.2;
    letter-spacing: 0.02em;
    margin: 36px 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ad-border);
    position: relative;
}

.am-desc h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--ad-gold);
}

.am-desc h3 {
    font-family: var(--ad-font-body);
    font-size: 11px;
    font-weight: 700;
    color: var(--ad-black);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 28px 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.am-desc h3::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 1.5px;
    background: var(--ad-gold);
    flex-shrink: 0;
}

.am-desc h4 {
    font-family: var(--ad-font-body);
    font-size: 12px;
    font-weight: 700;
    color: var(--ad-black);
    letter-spacing: 0.08em;
    margin: 20px 0 8px;
}

.am-desc > h2:first-child,
.am-desc > h3:first-child {
    margin-top: 0;
}

/* ══════════════════════════════════════════════════════════
   UNORDERED LISTS — Gold dash bullets
   KEY FIX: display:block + padding-left + position:absolute ::before
   This is the only approach that keeps <strong> inline with
   the following text on ALL screen widths without word-stacking.
══════════════════════════════════════════════════════════ */
.am-desc ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 20px !important;
}

.am-desc ul li {
    display: block !important;
    position: relative !important;
    padding: 10px 0 10px 26px !important;
    border-bottom: 1px solid rgba(232,226,214,0.6) !important;
    font-size: 13px !important;
    color: var(--ad-grey) !important;
    line-height: 1.75 !important;
    /* Kill any Savoy flex/grid that may leak in */
    flex-direction: unset !important;
    align-items: unset !important;
    gap: unset !important;
}

.am-desc ul li:last-child {
    border-bottom: none !important;
}

/* Gold dash — absolutely in left gutter, never participates in text layout */
.am-desc ul li::before {
    content: '—' !important;
    position: absolute !important;
    left: 0 !important;
    top: 10px !important;
    color: var(--ad-gold) !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    line-height: 1.75 !important;
    letter-spacing: -0.04em !important;
    display: block !important;
    /* Override any grid-column from Savoy */
    grid-column: unset !important;
}

/* Bold lead-in: purely inline, wraps naturally with following text */
.am-desc ul li strong,
.am-desc ul li b {
    color: var(--ad-black) !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    display: inline !important;
}

/* ── Kill Savoy / WooCommerce global list overrides that leak into .am-desc ── */
.am-desc ul li,
.am-desc ul:not([class]) li {
    list-style: none !important;
    list-style-position: outside !important;
}

/* Savoy injects this globally — override inside .am-desc */
ol:not([class]) li,
ul:not([class]) li {
    /* Savoy sets list-style-position:inside — reset for our lists */
}
.am-desc ul li {
    list-style-position: outside !important;
}

/* ══════════════════════════════════════════════════════════
   CHECK LIST — UL.am-check or .amanah-custom-check-list
══════════════════════════════════════════════════════════ */
.am-desc ul.am-check li::before,
.am-desc .amanah-custom-check-list li::before {
    content: '' !important;
    width: 16px !important;
    height: 16px !important;
    top: 12px !important;
    background-color: var(--ad-black) !important;
    border-radius: 50% !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23C9A84C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 10px !important;
    letter-spacing: 0 !important;
}

/* ══════════════════════════════════════════════════════════
   ORDERED LISTS
══════════════════════════════════════════════════════════ */
.am-desc ol {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    counter-reset: am-counter;
}

.am-desc ol li {
    counter-increment: am-counter;
    display: block;
    position: relative;
    padding: 10px 0 10px 36px;
    border-bottom: 1px solid rgba(232,226,214,0.5);
    font-size: 13px;
    color: var(--ad-grey);
    line-height: 1.75;
}

.am-desc ol li:last-child {
    border-bottom: none;
}

.am-desc ol li::before {
    content: counter(am-counter, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 10px;
    font-family: var(--ad-font-display);
    font-size: 18px;
    font-weight: 300;
    color: var(--ad-gold);
    line-height: 1;
}

/* ══════════════════════════════════════════════════════════
   BLOCKQUOTE — Hadith, Qur'anic verses
══════════════════════════════════════════════════════════ */
.am-desc blockquote {
    margin: 28px 0;
    padding: 0;
    border: none;
    background: none;
}

.am-desc blockquote p {
    font-family: var(--ad-font-display);
    font-style: italic;
    font-size: clamp(15px, 1.6vw, 18px);
    color: var(--ad-black);
    line-height: 1.65;
    margin: 0 0 8px;
    padding: 20px 24px 18px 24px;
    border-left: 3px solid var(--ad-gold);
    border-radius: 0;
    background: var(--ad-off-white);
    position: relative;
}

.am-desc blockquote p::before {
    content: '\201C';
    font-family: var(--ad-font-display);
    font-size: 52px;
    color: var(--ad-gold);
    opacity: 0.2;
    position: absolute;
    top: -6px;
    left: 14px;
    line-height: 1;
    pointer-events: none;
}

.am-desc blockquote cite,
.am-desc blockquote footer {
    display: block;
    font-style: normal;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ad-gold);
    font-weight: 700;
    padding: 0 0 0 24px;
    margin: 0;
}

/* ══════════════════════════════════════════════════════════
   ARABIC TEXT
══════════════════════════════════════════════════════════ */
.am-desc .am-arabic,
.am-desc [lang="ar"] {
    font-family: var(--ad-font-arabic);
    font-size: clamp(20px, 2.5vw, 26px);
    direction: rtl;
    text-align: right;
    color: var(--ad-black);
    line-height: 2.2;
    margin: 16px 0 4px;
    display: block;
}

.am-desc .am-verse-ref {
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ad-gold);
    font-weight: 700;
    text-align: right;
    margin: 0 0 6px;
    display: block;
}

.am-desc .am-verse-trans {
    font-family: var(--ad-font-display);
    font-style: italic;
    font-size: 14px;
    color: var(--ad-grey);
    margin: 0 0 20px;
    text-align: center;
    display: block;
}

/* ══════════════════════════════════════════════════════════
   HIGHLIGHT BOX — P.am-highlight
══════════════════════════════════════════════════════════ */
.am-desc .am-highlight {
    background: var(--ad-off-white);
    border: 1px solid var(--ad-border);
    border-left: 3px solid var(--ad-gold);
    border-radius: 0 3px 3px 0;
    padding: 14px 18px;
    font-size: 12.5px;
    color: var(--ad-dark);
    line-height: 1.7;
    margin: 0 0 20px;
    display: block;
}

.am-desc .am-highlight strong {
    color: var(--ad-black);
    font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   HR — Gold gradient divider
══════════════════════════════════════════════════════════ */
.am-desc hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, var(--ad-gold), rgba(201,168,76,0.1));
    margin: 32px 0;
}

/* ══════════════════════════════════════════════════════════
   LINKS
══════════════════════════════════════════════════════════ */
.am-desc a {
    color: var(--ad-gold);
    text-decoration: none;
    border-bottom: 1px solid rgba(201,168,76,0.3);
    transition: border-color var(--ad-ease), color var(--ad-ease);
}

.am-desc a:hover {
    color: var(--ad-black);
    border-bottom-color: var(--ad-black);
}

/* ══════════════════════════════════════════════════════════
   STRONG / EM
══════════════════════════════════════════════════════════ */
.am-desc strong,
.am-desc b {
    color: var(--ad-black);
    font-weight: 700;
}

.am-desc em,
.am-desc i {
    font-style: italic;
}

/* ══════════════════════════════════════════════════════════
   IMAGES
══════════════════════════════════════════════════════════ */
.am-desc img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    display: block;
    margin: 16px 0;
}

/* ══════════════════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════════════════ */
.am-desc table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 12px;
}

.am-desc table th {
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ad-grey);
    font-weight: 700;
    padding: 10px 14px;
    background: var(--ad-off-white);
    border-bottom: 1px solid var(--ad-border);
    text-align: left;
}

.am-desc table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--ad-border);
    color: var(--ad-dark);
    font-weight: 500;
}

.am-desc table tr:last-child td {
    border-bottom: none;
}

/* ══════════════════════════════════════════════════════════
   SPACING — first/last child normalisation
══════════════════════════════════════════════════════════ */
.am-desc > *:first-child {
    margin-top: 0 !important;
}

.am-desc > *:last-child {
    margin-bottom: 0 !important;
}

/* ══════════════════════════════════════════════════════════
   MOBILE
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    .am-desc {
        font-size: 13px;
    }

    .am-desc h2 {
        font-size: 20px;
        margin: 24px 0 10px;
    }

    .am-desc h3 {
        font-size: 10px;
        margin: 20px 0 8px;
    }

    .am-desc ul li {
        font-size: 13px !important;
        padding: 10px 0 10px 26px !important;
        line-height: 1.75 !important;
    }

    .am-desc ul li::before {
        font-size: 13px !important;
        top: 10px !important;
    }

    .am-desc blockquote p {
        padding: 16px 18px 14px;
        font-size: 15px;
    }

    .am-desc blockquote cite,
    .am-desc blockquote footer {
        padding-left: 18px;
    }

    .am-desc .am-arabic {
        font-size: 22px;
    }
}

/* ══════════════════════════════════════════════════════════
   DARK VARIANT — .am-desc-dark (for use on black backgrounds)
══════════════════════════════════════════════════════════ */
.am-desc-dark {
    --ad-grey:       rgba(255,255,255,0.55);
    --ad-black:      #FFFFFF;
    --ad-dark:       rgba(255,255,255,0.8);
    --ad-off-white:  rgba(255,255,255,0.04);
    --ad-border:     rgba(201,168,76,0.15);
}

.am-desc-dark p,
.am-desc-dark li {
    color: rgba(255,255,255,0.55);
}

.am-desc-dark h2,
.am-desc-dark h3,
.am-desc-dark h4,
.am-desc-dark strong {
    color: #FFFFFF;
}

.am-desc-dark ul li::before {
    color: var(--ad-gold);
}

.am-desc-dark blockquote p {
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.85);
}

/* ══════════════════════════════════════════════════════════
   FACTS GRID — always 3 columns
   Override single-product.php @media (max-width:480px) rule
   that collapses it to repeat(2,1fr)
══════════════════════════════════════════════════════════ */
.am-sp-v2 .am-sp-facts {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 18px !important;
}

@media (max-width: 480px) {
    .am-sp-v2 .am-sp-facts {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }

    .am-sp-v2 .am-sp-fact {
        padding: 10px 6px !important;
    }

    .am-sp-v2 .am-sp-fact-val {
        font-size: 15px !important;
    }

    .am-sp-v2 .am-sp-fact-lbl {
        font-size: 8px !important;
        letter-spacing: 0.06em !important;
    }
}