/*
Theme Name: UAE Expatriates Child
Template: generatepress
Author: UAE Expatriates
Description: Child theme for UAE Expatriates — brand design system (red/green/ink on white), typography, and article styling. Inspired by, but distinct from, the KSA Expats build.
Version: 1.0.0
*/

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
    /* Brand (from the UE logo) */
    --uae-red:      #D8412F;
    --uae-red-700:  #B5311F;
    --uae-green:    #2E7D5B;
    --uae-green-700:#226046;
    --uae-ink:      #1E2A28;  /* headings / dark UI */
    --uae-ink-2:    #3A4744;  /* muted text */
    --uae-ink-3:    #6A7672;  /* captions */

    /* Surfaces */
    --uae-bg:    #FFFFFF;
    --uae-paper: #FAFAF8;     /* cards / article tables */
    --uae-line:  #E7E9E8;     /* borders / dividers */
    --uae-sand:  #EAD9B8;     /* warm tertiary, used sparingly */

    /* Semantic */
    --uae-up:    #1E8E4E;     /* gains / positive */
    --uae-down:  #D8412F;     /* loss / negative */

    /* Radius / shadow / spacing */
    --uae-r-sm: 8px;
    --uae-r-md: 12px;
    --uae-r-lg: 18px;
    --uae-shadow-1: 0 1px 2px rgba(30,42,40,.06), 0 4px 14px rgba(30,42,40,.06);
    --uae-shadow-2: 0 12px 36px rgba(30,42,40,.14);

    /* Type */
    --uae-font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --uae-font-head: "Plus Jakarta Sans", var(--uae-font-ui);
    --uae-maxw: 1180px;
}

/* ============================================================
   2. BASE TYPOGRAPHY
   ============================================================ */
body {
    font-family: var(--uae-font-ui);
    color: var(--uae-ink-2);
    background: var(--uae-bg);
}
h1, h2, h3, h4, h5, h6,
.entry-title {
    font-family: var(--uae-font-head);
    color: var(--uae-ink);
    letter-spacing: -.015em;
}
.single-post .entry-content {
    color: var(--uae-ink-2);
    font-size: 18px;
    line-height: 1.78;
    max-width: 780px;
}
.single-post .entry-content a {
    color: var(--uae-red-700);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}
.single-post .entry-content a:hover { color: var(--uae-red); }

.single-post .site-content {
    padding-top: 48px;
    padding-bottom: 56px;
}
.single-post .inside-article {
    background: transparent;
    padding-top: 0;
}
.single-post .entry-header {
    margin-bottom: 20px;
}
.single-post .entry-title {
    max-width: 900px;
    margin-bottom: 10px;
    font-size: clamp(40px, 4.3vw, 60px);
    line-height: 1.08;
    letter-spacing: -.045em;
}
.single-post .entry-meta {
    color: var(--uae-ink-3);
    font-size: 16px;
    line-height: 1.5;
}
.single-post .entry-meta a {
    color: var(--uae-red);
    text-decoration: none;
}
.single-post .post-image,
.single-post .featured-image,
.single-post .entry-content > .wp-block-image:first-child {
    margin-bottom: 34px;
}
.single-post .post-image img,
.single-post .featured-image img,
.single-post .entry-content img {
    border-radius: var(--uae-r-md);
}

/* ============================================================
   3. ARTICLE ELEMENTS  (UAE-styled, distinct from KSA)
   ============================================================ */
.single-post .entry-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    background: var(--uae-bg);
    color: var(--uae-ink-2);
    margin: 24px 0 34px;
    font-size: 16px;
    line-height: 1.55;
    border: 1px solid var(--uae-line);
    border-radius: var(--uae-r-md);
    overflow: hidden;
}
.single-post .entry-content thead th {
    background: var(--uae-ink);
    color: #fff;
    font-family: var(--uae-font-head);
    font-weight: 700;
    text-align: left;
    padding: 13px 16px;
    border: 0;
}
.single-post .entry-content tbody td {
    padding: 12px 16px;
    border-top: 1px solid var(--uae-line);
}
.single-post .entry-content tbody tr:nth-child(even) td { background: var(--uae-paper); }

.single-post .entry-content blockquote {
    border-left: 4px solid var(--uae-red);
    background: var(--uae-paper);
    margin: 26px 0;
    padding: 14px 20px;
    border-radius: 0 var(--uae-r-sm) var(--uae-r-sm) 0;
    color: var(--uae-ink);
    font-style: normal;
}
.single-post .entry-content p {
    margin-bottom: 1.35em;
}
.single-post .entry-content :is(h2, h3) {
    line-height: 1.22;
    letter-spacing: -.035em;
}
.single-post .entry-content h2 {
    margin: 1.9em 0 .55em;
    padding-bottom: 0;
    border-bottom: 0;
    font-size: 31px;
}
.single-post .entry-content h3 {
    margin: 1.7em 0 .5em;
    font-size: 24px;
}
.single-post .entry-content :is(ul, ol) {
    margin: 0 0 1.45em 1.2em;
}
.single-post .entry-content li {
    margin-bottom: .35em;
}
.single-post .entry-content > p:empty {
    display: none;
}
.single-post .entry-content hr {
    height: 1px;
    margin: 34px 0;
    border: 0;
    background: var(--uae-line);
}

/* Pull-accent for the first letter / lead handled in templates if needed */

/* ============================================================
   4. SHARED UI PRIMITIVES  (reusable across plugins)
   ============================================================ */
.uae-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--uae-font-head);
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    padding: 11px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.uae-btn--primary { background: var(--uae-red); color: #fff; }
.uae-btn--primary:hover { background: var(--uae-red-700); color: #fff; }
.uae-btn--ghost { background: #fff; color: var(--uae-ink); border-color: var(--uae-line); }
.uae-btn--ghost:hover { border-color: var(--uae-ink); }

.uae-card {
    background: var(--uae-bg);
    border: 1px solid var(--uae-line);
    border-radius: var(--uae-r-lg);
    box-shadow: var(--uae-shadow-1);
}

.uae-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--uae-ink);
    background: var(--uae-paper);
    border: 1px solid var(--uae-line);
    border-radius: 999px;
    padding: 6px 12px;
}

/* RTL niceties for Arabic strings */
[dir="rtl"] .single-post .entry-content thead th { text-align: right; }
[dir="rtl"] .single-post .entry-content blockquote {
    border-left: 0;
    border-right: 4px solid var(--uae-red);
    border-radius: var(--uae-r-sm) 0 0 var(--uae-r-sm);
}

@media (max-width: 768px) {
    .single-post .site-content {
        padding: 28px 18px 42px;
    }
    .single-post .inside-article {
        padding: 0;
    }
    .single-post .entry-header {
        margin-bottom: 16px;
    }
    .single-post .entry-title {
        margin-bottom: 8px;
        font-size: clamp(34px, 9vw, 46px);
        line-height: 1.08;
        letter-spacing: -.045em;
    }
    .single-post .entry-meta {
        font-size: 15px;
    }
    .single-post .post-image,
    .single-post .featured-image,
    .single-post .entry-content > .wp-block-image:first-child {
        margin-bottom: 26px;
    }
    .single-post .entry-content {
        font-size: 17px;
        line-height: 1.72;
    }
    .single-post .entry-content h2 {
        margin: 1.75em 0 .5em;
        font-size: 27px;
    }
    .single-post .entry-content h3 {
        margin: 1.55em 0 .45em;
        font-size: 22px;
    }
    .single-post .entry-content :is(ul, ol) {
        margin-left: 1.05em;
        padding-left: .7em;
    }
}

/* ============================================================
   6. AUTHOR ARCHIVES
   ============================================================ */
.author .site-content {
    padding-top: 44px;
    padding-bottom: 54px;
}
.uae-author-page {
    font-family: var(--uae-font-ui);
}
.uae-author-results {
    max-width: 820px;
}
.uae-author-profile {
    display: flex;
    gap: 18px;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--uae-line);
}
.uae-author-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
}
.uae-author-profile h1 {
    margin: 5px 0 7px;
    color: var(--uae-ink);
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1.1;
    letter-spacing: -.045em;
}
.uae-author-profile p {
    max-width: 680px;
    margin: 0;
    color: var(--uae-ink-2);
    font-size: 15.5px;
    line-height: 1.55;
}
.uae-author-list-hd {
    padding: 24px 0 0;
}
.uae-author-list-hd h2 {
    margin: 0 0 5px;
    color: var(--uae-ink);
    font-size: 24px;
    letter-spacing: -.025em;
}
.uae-author-list-hd p {
    margin: 0;
    color: var(--uae-ink-3);
    font-size: 13px;
}
.uae-author-list-hd strong {
    color: var(--uae-ink);
}

@media (max-width: 768px) {
    .author .site-content {
        padding: 28px 18px 42px;
    }
    .uae-author-profile {
        align-items: flex-start;
        gap: 13px;
    }
    .uae-author-avatar {
        width: 64px;
        height: 64px;
    }
    .uae-author-profile h1 {
        font-size: 29px;
    }
    .uae-author-profile p {
        font-size: 14px;
    }
    .uae-author-list-hd h2 {
        font-size: 21px;
    }
}

/* Keep article section headings clean even if older theme CSS remains cached. */
body.single-post .entry-content h2 {
    border: 0 !important;
    border-bottom: 0 !important;
    border-block-end: 0 !important;
    box-shadow: none !important;
    padding-bottom: 0 !important;
    background-image: none !important;
}
body.single-post .entry-content h2::before,
body.single-post .entry-content h2::after {
    display: none !important;
    content: none !important;
}
body.single-post .entry-content h2 + hr {
    display: none !important;
}

/* ============================================================
   5. SEARCH RESULTS
   ============================================================ */
.search .site-content {
    padding-top: 44px;
    padding-bottom: 54px;
}
.uae-search-page {
    font-family: var(--uae-font-ui);
}
.uae-search-results {
    max-width: 820px;
}
.uae-search-results-hd {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--uae-line);
}
.uae-search-eyebrow,
.uae-search-tags span {
    color: var(--uae-red);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.uae-search-results-hd h1 {
    margin: 6px 0 10px;
    color: var(--uae-ink);
    font-size: clamp(34px, 4vw, 48px);
    line-height: 1.12;
    letter-spacing: -.045em;
}
.uae-search-results-hd p {
    margin: 0;
    color: var(--uae-ink-3);
    font-size: 14px;
}
.uae-search-results-hd strong {
    color: var(--uae-ink);
}
.uae-search-result {
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 24px 0;
    border-bottom: 1px solid var(--uae-line);
}
.uae-search-result-body {
    min-width: 0;
}
.uae-search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 7px;
}
.uae-search-tags span {
    padding: 4px 7px;
    border-radius: 4px;
    background: #fdf0ee;
}
.uae-search-result h2 {
    margin: 0 0 7px;
    font-size: 21px;
    line-height: 1.32;
    letter-spacing: -.025em;
}
.uae-search-result h2 a {
    color: var(--uae-ink);
    text-decoration: none;
}
.uae-search-result h2 a:hover {
    color: var(--uae-red);
}
.uae-search-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--uae-green);
    font-size: 12.5px;
    line-height: 1.45;
}
.uae-search-dot {
    color: var(--uae-line);
}
.uae-search-author {
    color: var(--uae-ink-3);
}
.uae-search-result p {
    margin: 10px 0 0;
    color: var(--uae-ink-2);
    font-size: 14.5px;
    line-height: 1.58;
}
.uae-search-thumb {
    flex: 0 0 128px;
}
.uae-search-thumb img {
    width: 128px;
    height: 96px;
    border: 1px solid var(--uae-line);
    border-radius: var(--uae-r-sm);
    object-fit: cover;
}
.uae-search-pagination {
    margin-top: 26px;
}
.uae-search-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.uae-search-pagination a,
.uae-search-pagination span {
    display: inline-flex;
    min-width: 36px;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border: 1px solid var(--uae-line);
    border-radius: 8px;
    color: var(--uae-ink);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.uae-search-pagination a:hover,
.uae-search-pagination .current {
    border-color: var(--uae-ink);
    background: var(--uae-ink);
    color: #fff;
}
.uae-search-empty {
    padding: 26px 0;
}
.uae-search-empty h2 {
    margin: 0 0 7px;
    font-size: 24px;
}
.uae-search-empty p {
    margin: 0 0 15px;
}

@media (max-width: 768px) {
    .search .site-content {
        padding: 28px 18px 42px;
    }
    .uae-search-results-hd h1 {
        font-size: 33px;
    }
    .uae-search-result {
        gap: 13px;
        padding: 20px 0;
    }
    .uae-search-result h2 {
        font-size: 19px;
    }
    .uae-search-meta span:first-child {
        display: none;
    }
    .uae-search-thumb {
        flex-basis: 92px;
    }
    .uae-search-thumb img {
        width: 92px;
        height: 76px;
    }
}
