/* =========================================================
  NovelAuthors — Shared Site UI Theme  (site-theme.css)
  ------------------------------------------------------------
  STATUS : STAGED — not linked to any page yet.
  SOURCE : includes/header.php  (inline <style>, shared UI)
           includes/footer.php  (inline <style>, shared UI)
  SCOPE  : shared layout only — tokens, base, header, nav,
           header search, notifications, user menu, mobile,
           buttons, footer, dark theme, media queries.
  EXCLUDED: page-specific CSS, auth UI CSS, style-v7.css.
  VALUES : copied verbatim — no colour, size, breakpoint,
           shadow, radius or animation was altered.
  NOTE   : selectors and their original order are preserved,
           so cascade behaviour matches the current inline CSS.
  ========================================================= */
/* =========================================================
  01. DESIGN TOKENS / GLOBAL VARIABLES
  Light-theme root variables (verbatim from includes/header.php).
  ========================================================= */

:root {
    --nav: #e8dfcf;
    --nav2: #f3eee5;
    --nav3: #ddd1bc;
    --gold: #b48232;
    --gold2: #c99a4a;
    --gold3: #e0bb77;
    --ink: #27231d;
    --muted: #777067;
    --line: #ddd4c4;
    --bg: #ffffff;
    --soft: #f7f3eb;
    --danger: #c84b47;
    --shadow: 0 8px 28px rgba( 73, 57, 33, .10 );
    --shadow-lg: 0 18px 50px rgba( 53, 42, 28, .20 );
}

/* =========================================================
  02. BASE / RESET
  Element defaults shared by every page.
  ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

button, input, select, textarea {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

/* =========================================================
  03. TYPOGRAPHY
  Shared body + link typography.
  ========================================================= */

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Cairo, Tahoma, Arial, sans-serif;
    line-height: 1.7;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================================
  04. SHARED CONTAINERS
  .container — the single shared width.
  ========================================================= */

.container {
    width: min( 1490px, calc(100% - 44px) );
    margin-inline: auto;
}

/* =========================================================
  05. HEADER
  site-header shell, decorative layers, top-nav grid, logo.
  ========================================================= */

.site-header {
    position: relative;
    z-index: 1000;
    color: var(--ink);
    background: linear-gradient( 135deg, #f8f5ed 0%, #eee7d9 24%, #e3d8c5 50%, #f4efe5 76%, #ddd0b9 100% );
    border-bottom: 1px solid rgba( 121, 94, 51, .22 );
    box-shadow: 0 7px 26px rgba( 77, 60, 34, .16 );
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient( circle at 16% 18%, rgba( 255, 255, 255, .72 ) 0%, rgba( 255, 255, 255, 0 ) 34% ), radial-gradient( circle at 84% 72%, rgba( 190, 159, 107, .11 ) 0%, rgba( 190, 159, 107, 0 ) 38% );
    pointer-events: none;
}

.site-header::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: linear-gradient( 90deg, transparent 0%, rgba( 160, 118, 51, .20 ) 18%, rgba( 181, 133, 53, .88 ) 50%, rgba( 160, 118, 51, .20 ) 82%, transparent 100% );
    pointer-events: none;
}

/* ---------------------------------------------------------------------------
   Header layout — Logical columns
   ---------------------------------------------------------------------------
   الترتيب من اليمين إلى اليسار:
   اللوجو → القائمة الرئيسية → البحث → الأدوات
   --------------------------------------------------------------------------- */

.top-nav {
    position: relative;
    z-index: 1;
    min-height: 84px;
    display: grid;
    grid-template-columns: auto minmax( 0, 1fr ) minmax( 260px, 340px ) auto;
    align-items: center;
    gap: 12px;
    direction: rtl;
}

/* ---------------------------------------------------------------------------
   Logo V6
   --------------------------------------------------------------------------- */

.logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 210px;
    height: 84px;
    /* * إصلاح حجم اللوجو داخل منطقة الهيدر. * لم يعد يتجاوز الحاوية أو يخرج منها. */
    overflow: hidden;
    transition: filter .18s ease;
}

.logo:hover {
    filter: brightness( 1.04 );
}

.logo img {
    display: block;
    width: 210px;
    height: 84px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform: none;
    transform-origin: center;
    filter: none;
    position: relative;
    z-index: 2;
}

/* =========================================================
  06. DESKTOP NAVIGATION
  .main-nav links, hover and active states.
  ========================================================= */
    .main-nav {
    display: flex;
    direction: rtl;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.main-nav a {
    position: relative;
    height: 84px;
    min-width: 88px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba( 39, 35, 29, .82 );
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    transition: color .18s ease, background .18s ease;
}

.main-nav a::before {
    content: "";
    position: absolute;
    right: 8px;
    left: 8px;
    bottom: 12px;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient( 90deg, transparent, var(--gold2), transparent );
    transform: scaleX( 0 );
    transform-origin: center;
    transition: transform .2s ease;
}

.main-nav a:hover {
    color: #6f4c18;
    background: linear-gradient( 135deg, rgba( 248, 245, 237, .78 ), rgba( 227, 216, 197, .78 ) );
}

.main-nav a:hover::before, .main-nav a.active::before {
    transform: scaleX( 1 );
}

.main-nav a.active {
    color: #8b611f;
    background: linear-gradient( 135deg, rgba( 248, 245, 237, .58 ), rgba( 227, 216, 197, .48 ) );
}

/* =========================================================
  07. HEADER TOOLS (search + actions)
  Header search field/submit and the .nav-tools cluster.
  ========================================================= */

.header-search {
    width: 100%;
}

.header-search-form {
    position: relative;
    height: 46px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    border: 1px solid rgba( 119, 92, 52, .18 );
    background: linear-gradient( 180deg, rgba( 255, 255, 255, .58 ), rgba( 255, 255, 255, .34 ) );
    border-radius: 11px;
    box-shadow: inset 0 1px 0 rgba( 255, 255, 255, .72 ), 0 3px 10px rgba( 74, 56, 29, .06 );
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.header-search-form:focus-within {
    border-color: rgba( 161, 116, 44, .46 );
    background: rgba( 255, 255, 255, .72 );
    box-shadow: 0 0 0 3px rgba( 179, 133, 55, .10 ), 0 5px 14px rgba( 74, 56, 29, .08 );
}

.header-search-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    color: #9b6e27;
}

.header-search-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #332d24;
    padding: 0 10px;
    text-align: right;
    font-size: 14px;
}

.header-search input::placeholder {
    color: #83796b;
}

.header-search-submit {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: rgba( 171, 128, 53, .11 );
    color: #966a24;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}

.header-search-submit:hover {
    background: rgba( 171, 128, 53, .19 );
    transform: scale( 1.03 );
}

.header-search-submit svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-tools {
    display: flex;
    direction: ltr;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    white-space: nowrap;
}

/* =========================================================
  08. NOTIFICATIONS DROPDOWN
  Badge, dropdown, items, empty state, footer actions.
  ========================================================= */

.notification-wrap {
    position: relative;
    direction: rtl;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #e7dece;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}

.notification-dropdown {
    position: absolute;
    top: 49px;
    left: 0;
    width: 375px;
    background: var(--bg);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY( -8px );
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
    z-index: 3000;
}

.notification-wrap.open .notification-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY( 0 );
}

.notification-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient( 180deg, rgba( 201, 149, 63, .045 ), transparent );
}

.notification-dropdown-head strong {
    display: block;
    font-size: 14px;
}

.notification-dropdown-head small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.notification-mark-button {
    border: 0;
    background: transparent;
    color: #94681f;
    padding: 5px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.notification-items {
    max-height: 390px;
    overflow-y: auto;
}

.notification-empty {
    padding: 42px 15px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.notification-empty-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 9px;
    display: grid;
    place-items: center;
    border: 1px solid rgba( 201, 149, 63, .16 );
    border-radius: 13px;
    background: rgba( 201, 149, 63, .07 );
    color: #a6742a;
}

.notification-empty-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notification-item {
    display: grid;
    grid-template-columns: 36px minmax( 0, 1fr );
    gap: 10px;
    padding: 11px 13px;
    border-bottom: 1px solid var(--line);
    background: transparent;
    transition: background .18s ease;
    cursor: pointer;
}

.notification-item:hover {
    background: rgba( 201, 149, 63, .04 );
}

.notification-item.unread {
    background: rgba( 201, 149, 63, .055 );
}

.notification-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba( 201, 149, 63, .11 );
    border-radius: 10px;
    background: rgba( 201, 149, 63, .07 );
    color: #a6742a;
}

.notification-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notification-content {
    min-width: 0;
}

.notification-title-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.notification-title-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.notification-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: var(--gold);
}

.notification-message {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    display: block;
    margin-top: 3px;
    color: #89939a;
    font-size: 10px;
}

.notification-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 9px;
    background: var(--soft);
    border-top: 1px solid var(--line);
}

.notification-footer a, .notification-footer button {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--ink);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.notification-footer a:hover, .notification-footer button:hover {
    border-color: var(--gold);
    color: #94681f;
}

/* =========================================================
  09. USER MENU
  Avatar button and the account dropdown.
  ========================================================= */

.header-user-wrap {
    position: relative;
    direction: rtl;
}

.header-user-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba( 143, 100, 33, .28 );
    border-radius: 11px;
    background: linear-gradient( 145deg, #dcb76f, #8c642d );
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    overflow: hidden;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.header-user-btn:hover {
    transform: translateY( -1px );
    border-color: rgba( 176, 128, 45, .70 );
    box-shadow: 0 0 0 3px rgba( 201, 149, 63, .10 ), 0 6px 14px rgba( 83, 59, 27, .15 );
}

.header-user-avatar {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.header-user-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

.header-user-menu {
    position: absolute;
    top: 49px;
    left: 0;
    width: 245px;
    padding: 8px;
    background: var(--bg);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY( -8px );
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
    z-index: 3000;
}

.header-user-wrap.open .header-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY( 0 );
}

.header-user-info {
    padding: 9px 10px 11px;
    margin-bottom: 5px;
    border-bottom: 1px solid var(--line);
}

.header-user-info strong {
    display: block;
    font-size: 13px;
}

.header-user-info span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.header-user-menu a {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 39px;
    padding: 0 10px;
    border-radius: 8px;
    color: #171717;
    background: transparent;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 800;
    transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

/* ---------------------------------------------------------------------------
   User menu hover — same paper gradient as header
   --------------------------------------------------------------------------- */

.header-user-menu a:hover, .header-user-menu a.profile-link:hover, .header-user-menu a.account-link:hover, .header-user-menu a.library-link:hover {
    background: linear-gradient( 135deg, #f8f5ed 0%, #eee7d9 24%, #e3d8c5 50%, #f4efe5 76%, #ddd0b9 100% );
    color: #27231d;
    border-color: rgba( 121, 94, 51, .22 );
    box-shadow: 0 5px 14px rgba( 77, 60, 34, .10 );
}

.header-user-menu a.profile-link, .header-user-menu a.account-link, .header-user-menu a.library-link {
    color: #171717;
    background: transparent;
    border: 1px solid transparent;
    margin-bottom: 0;
}

.header-menu-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    display: grid;
    place-items: center;
    color: currentColor;
}

.header-menu-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =========================================================
  10. SHARED BUTTONS (header level)
  .nav-login, .nav-join, .circle-btn.
  ========================================================= */

.nav-login, .nav-join {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 800;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.nav-login {
    border: 1px solid rgba( 104, 80, 44, .19 );
    color: #463b2c;
    background: rgba( 255, 255, 255, .34 );
}

.nav-login:hover {
    transform: translateY( -1px );
    border-color: rgba( 166, 121, 43, .34 );
    background: linear-gradient( 135deg, rgba( 248, 245, 237, .78 ), rgba( 227, 216, 197, .78 ) );
}

.nav-join {
    border: 1px solid #a97b2c;
    color: #fff;
    background: linear-gradient( 180deg, #d0a051, #af7930 );
    box-shadow: 0 5px 16px rgba( 154, 108, 42, .18 );
}

.nav-join:hover {
    transform: translateY( -1px );
    filter: brightness( .98 );
    box-shadow: 0 7px 19px rgba( 154, 108, 42, .24 );
}

.circle-btn {
    position: relative;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid rgba( 102, 77, 41, .15 );
    border-radius: 10px;
    background: rgba( 255, 255, 255, .35 );
    color: #584a37;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

.circle-btn:hover {
    transform: translateY( -1px );
    border-color: rgba( 175, 128, 45, .36 );
    background: linear-gradient( 135deg, rgba( 248, 245, 237, .82 ), rgba( 227, 216, 197, .82 ) );
    color: #956923;
}

.circle-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =========================================================
  11. MOBILE NAVIGATION
  .mobile-nav-wrap / toggle / dropdown.
  ========================================================= */

/* ---------------------------------------------------------------------------
   Mobile main navigation
   ---------------------------------------------------------------------------
   Desktop navigation remains unchanged. On phones only, the main
   navigation links are presented in a compact dropdown immediately
   to the left of the notifications button.
   --------------------------------------------------------------------------- */
.mobile-nav-wrap {
    display: none;
    position: relative;
    flex: 0 0 auto;
}

.mobile-nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid rgba( 102, 77, 41, .15 );
    border-radius: 10px;
    background: rgba( 255, 255, 255, .35 );
    color: #584a37;
    place-items: center;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.mobile-nav-toggle:hover {
    background: rgba( 255, 255, 255, .72 );
    border-color: rgba( 121, 94, 51, .30 );
}

.mobile-nav-toggle:active {
    transform: scale( .96 );
}

.mobile-nav-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mobile-nav-dropdown {
    position: absolute;
    top: calc( 100% + 10px );
    left: 0;
    width: 232px;
    padding: 8px;
    border: 1px solid rgba( 121, 94, 51, .18 );
    border-radius: 14px;
    background: rgba( 255, 253, 248, .98 );
    box-shadow: 0 16px 38px rgba( 53, 41, 25, .16 ), inset 0 1px 0 rgba( 255, 255, 255, .92 );
    backdrop-filter: blur( 12px );
    -webkit-backdrop-filter: blur( 12px );
    opacity: 0;
    visibility: hidden;
    transform: translateY( -7px );
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    z-index: 1200;
}

.mobile-nav-wrap.open .mobile-nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY( 0 );
}

.mobile-nav-dropdown::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 15px;
    width: 11px;
    height: 11px;
    border-top: 1px solid rgba( 121, 94, 51, .18 );
    border-left: 1px solid rgba( 121, 94, 51, .18 );
    background: #fffdf8;
    transform: rotate( 45deg );
}

.mobile-nav-dropdown a {
    min-height: 43px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #302a22;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    direction: rtl;
    transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}

.mobile-nav-dropdown a + a {
    margin-top: 3px;
}

.mobile-nav-dropdown a:hover, .mobile-nav-dropdown a.active {
    color: #6f4c18;
    background: linear-gradient( 135deg, rgba( 248, 245, 237, .94 ), rgba( 227, 216, 197, .88 ) );
    border-color: rgba( 121, 94, 51, .14 );
}

.mobile-nav-dropdown a:active {
    transform: translateY( 1px );
}

.mobile-nav-dropdown .mobile-nav-item-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    display: grid;
    place-items: center;
    color: #92703a;
}

.mobile-nav-dropdown .mobile-nav-item-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =========================================================
  12. MOBILE SEARCH
  .mobile-search-toggle / panel.
  ========================================================= */

.mobile-search-toggle {
    display: none;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid rgba( 102, 77, 41, .15 );
    border-radius: 10px;
    background: rgba( 255, 255, 255, .35 );
    color: #584a37;
    place-items: center;
    cursor: pointer;
}

.mobile-search-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mobile-search-panel {
    display: none;
    padding: 0 0 11px;
}

.mobile-search-panel.open {
    display: block;
}

/* =========================================================
  13. FOOTER
  site-footer, brand, social, links, newsletter, bottom bar.
  ========================================================= */

/* ========================================================= نوڨيل أوثرز FOOTER ========================================================= */
.site-footer {
    background: linear-gradient( 135deg, #f8f5ed 0%, #eee7d9 24%, #e3d8c5 50%, #f4efe5 76%, #ddd0b9 100% );
    color: #27231d;
    padding: 36px 0 18px;
    border-top: 1px solid rgba(121, 94, 51, 0.22);
    box-shadow: 0 -7px 26px rgba(77, 60, 34, 0.10);
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient( circle at 16% 18%, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 34% ), radial-gradient( circle at 84% 72%, rgba(190, 159, 107, 0.11) 0%, rgba(190, 159, 107, 0) 38% );
    pointer-events: none;
}

.site-footer::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient( 90deg, transparent 0%, rgba(160, 118, 51, 0.20) 18%, rgba(181, 133, 53, 0.88) 50%, rgba(160, 118, 51, 0.20) 82%, transparent 100% );
    pointer-events: none;
}

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

.footer-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(150px, 0.85fr) minmax(0, 1.30fr);
    column-gap: 46px;
    row-gap: 30px;
    direction: rtl;
    align-items: start;
}

/* ========================================================= BRAND ========================================================= */

.footer-brand {
    direction: rtl;
    min-width: 0;
}

.footer-brand-main {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.footer-logo-link {
    width: 150px;
    height: 90px;
    flex: 0 0 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.footer-logo-link img {
    width: 180px;
    height: 120px;
    object-fit: contain;
    object-position: center;
    display: block;
    filter: none;
}

.footer-brand-copy {
    min-width: 0;
}

.footer-brand-copy h3 {
    margin: 0 0 8px;
    color: #8d6425;
    font-size: 14px;
    font-weight: 800;
}

.footer-brand-copy p {
    margin: 0;
    max-width: 290px;
    color: #665f55;
    font-size: 13px;
    line-height: 1.85;
    text-align: justify;
    text-justify: inter-word;
    text-align-last: right;
}

/* ========================================================= SOCIAL ========================================================= */

.footer-social-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.footer-social-links a {
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid rgba(121, 94, 51, 0.22);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.34);
    color: #574d3f;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.footer-social-links a:hover {
    background: linear-gradient( 135deg, #f8f5ed 0%, #eee7d9 24%, #e3d8c5 50%, #f4efe5 76%, #ddd0b9 100% );
    border-color: rgba(121, 94, 51, 0.36);
    color: #27231d;
    transform: translateY(-1px);
}

.footer-social-icon {
    width: 15px;
    height: 15px;
    display: grid;
    place-items: center;
    flex: 0 0 15px;
}

.footer-social-icon svg {
    width: 15px;
    height: 15px;
    display: block;
}

/* ========================================================= LINKS COLUMN ========================================================= */

.footer-links {
    min-width: 0;
/* * ترحيل عمود الدعم والمساعدة إلى اليسار */
    transform: translateX(-28px);
}

.footer-links-group {
    min-width: 0;
}

.site-footer h4 {
    margin: 4px 0 14px;
    color: #8d6425;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
    text-align: right;
}

.footer-links a {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 8px 0;
    color: #665f55;
    font-size: 13px;
    text-align: right;
    text-decoration: none;
    line-height: 1.6;
    transition: color 0.2s ease, transform 0.2s ease;
}

.footer-links a:hover {
    color: #6f4c18;
    transform: translateX(-2px);
}

/* ========================================================= NEWSLETTER ========================================================= */
    .newsletter {
    min-width: 0;
}

.newsletter p {
    margin: 0 0 12px;
    color: #665f55;
    font-size: 13px;
    line-height: 1.8;
    text-align: justify;
    text-justify: inter-word;
    text-align-last: right;
}

.newsletter form {
    display: flex;
    gap: 6px;
    direction: rtl;
}

.newsletter input {
    min-width: 0;
    flex: 1;
    height: 34px;
    background: rgba(255, 255, 255, 0.50);
    border: 1px solid rgba(119, 92, 52, 0.22);
    border-radius: 5px;
    color: #332d24;
    outline: 0;
    padding: 0 8px;
    font-size: 12px;
    text-align: right;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.newsletter input::placeholder {
    color: #83796b;
    text-align: right;
}

.newsletter input:focus {
    border-color: rgba(161, 116, 44, 0.46);
    background: rgba(255, 255, 255, 0.70);
    box-shadow: 0 0 0 2px rgba(179, 133, 55, 0.08);
}

.newsletter button {
    flex: 0 0 auto;
    min-width: 65px;
    height: 34px;
    background: linear-gradient( 180deg, #d0a051, #af7930 );
    border: 1px solid #a97b2c;
    border-radius: 5px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.newsletter button:hover {
    transform: translateY(-1px);
    filter: brightness(0.98);
    box-shadow: 0 5px 14px rgba(154, 108, 42, 0.20);
}

.footer-newsletter-message {
    margin: 0 0 10px;
    padding: 6px 7px;
    border-radius: 5px;
    font-size: 11px;
    line-height: 1.6;
    text-align: justify;
    text-justify: inter-word;
    text-align-last: right;
}

.footer-newsletter-message.success {
    color: #45694e;
    background: rgba(84, 140, 96, 0.10);
    border: 1px solid rgba(84, 140, 96, 0.18);
}

.footer-newsletter-message.error {
    color: #8d4646;
    background: rgba(166, 57, 57, 0.08);
    border: 1px solid rgba(166, 57, 57, 0.16);
}

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

.footer-bottom {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(121, 94, 51, 0.16);
    margin-top: 30px;
    padding-top: 12px;
    text-align: center;
    color: #81776a;
    font-size: 11px;
}

/* =========================================================
  14. DARK THEME
  ========================================================= */

/* --- 14.1  Root dark palette (from includes/header.php) --- */

[data-theme="dark"] {
    --bg: #0b1116;
    --soft: #11181f;
    --ink: #f4f5f6;
    --muted: #aab1b7;
    --line: #28323a;
    --shadow: 0 8px 28px rgba( 0, 0, 0, .28 );
    --shadow-lg: 0 18px 50px rgba( 0, 0, 0, .38 );
}

/* --- 14.2  Footer dark theme (from includes/footer.php) --- */

/* ========================================================= DARK MODE ========================================================= */
[data-theme="dark"] .site-footer {
    background: linear-gradient( 135deg, #05080b 0%, #0b1116 40%, #11181f 68%, #0b1116 100% );
    color: #b8c0c6;
    border-top-color: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .site-footer::before {
    background: radial-gradient( circle at 16% 18%, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0) 34% ), radial-gradient( circle at 84% 72%, rgba(201, 149, 63, 0.06) 0%, rgba(201, 149, 63, 0) 38% );
}

[data-theme="dark"] .footer-brand-copy h3, [data-theme="dark"] .site-footer h4 {
    color: #dba756;
}

[data-theme="dark"] .footer-brand-copy p, [data-theme="dark"] .footer-links a, [data-theme="dark"] .newsletter p {
    color: #9da7ad;
}

[data-theme="dark"] .footer-social-links a {
    border-color: #2e3a43;
    background: rgba(13, 21, 27, 0.58);
    color: #c4ccd1;
}

[data-theme="dark"] .footer-social-links a:hover {
    background: linear-gradient( 135deg, #06090c, #11181e );
    border-color: rgba(227, 184, 106, 0.25);
    color: #fff;
}

[data-theme="dark"] .newsletter input {
    background: #111820;
    border-color: #2b3943;
    color: #fff;
}

[data-theme="dark"] .newsletter input::placeholder {
    color: #77838b;
}

[data-theme="dark"] .footer-bottom {
    border-top-color: #ffffff12;
    color: #68737b;
}

/* --- 14.3  Header dark theme (shell, nav, tools, dropdowns) --- */

[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] .site-header {
    background: linear-gradient( 135deg, #05080b 0%, #0b1116 40%, #11181f 68%, #0b1116 100% );
    border-bottom-color: rgba( 255, 255, 255, .07 );
    box-shadow: 0 7px 26px rgba( 0, 0, 0, .38 );
}

[data-theme="dark"] .site-header::before {
    background: radial-gradient( circle at 16% 18%, rgba( 255, 255, 255, .04 ) 0%, rgba( 255, 255, 255, 0 ) 34% ), radial-gradient( circle at 84% 72%, rgba( 201, 149, 63, .07 ) 0%, rgba( 201, 149, 63, 0 ) 38% );
}

[data-theme="dark"] .site-header::after {
    background: linear-gradient( 90deg, transparent 0%, rgba( 201, 149, 63, .22 ) 18%, rgba( 219, 167, 86, .55 ) 50%, rgba( 201, 149, 63, .22 ) 82%, transparent 100% );
}

/* اللوجو الأصلي داكن اللون، لذلك يُعكس داخل الوضع الليلي فقط. */
[data-theme="dark"] .logo img {
    filter: invert( 1 ) hue-rotate( 180deg ) brightness( 1.05 );
}

[data-theme="dark"] .main-nav a {
    color: rgba( 244, 245, 246, .80 );
}

[data-theme="dark"] .main-nav a:hover {
    color: #e0bb77;
    background: linear-gradient( 135deg, rgba( 255, 255, 255, .07 ), rgba( 255, 255, 255, .035 ) );
}

[data-theme="dark"] .main-nav a.active {
    color: #dba756;
    background: linear-gradient( 135deg, rgba( 219, 167, 86, .12 ), rgba( 219, 167, 86, .05 ) );
}

[data-theme="dark"] .header-search-form {
    border-color: #2b3943;
    background: linear-gradient( 180deg, rgba( 17, 24, 31, .82 ), rgba( 11, 17, 22, .68 ) );
    box-shadow: inset 0 1px 0 rgba( 255, 255, 255, .04 ), 0 3px 10px rgba( 0, 0, 0, .22 );
}

[data-theme="dark"] .header-search-form:focus-within {
    border-color: rgba( 227, 184, 106, .45 );
    background: rgba( 17, 24, 31, .92 );
    box-shadow: 0 0 0 3px rgba( 227, 184, 106, .10 ), 0 5px 14px rgba( 0, 0, 0, .28 );
}

[data-theme="dark"] .header-search-icon {
    color: #c9a15c;
}

[data-theme="dark"] .header-search input {
    color: #eef1f3;
}

[data-theme="dark"] .header-search input::placeholder {
    color: #77838b;
}

[data-theme="dark"] .header-search-submit {
    background: rgba( 227, 184, 106, .14 );
    color: #e0bb77;
}

[data-theme="dark"] .header-search-submit:hover {
    background: rgba( 227, 184, 106, .24 );
}

[data-theme="dark"] .circle-btn, [data-theme="dark"] .mobile-nav-toggle, [data-theme="dark"] .mobile-search-toggle {
    border-color: #2e3a43;
    background: rgba( 255, 255, 255, .06 );
    color: #e6e8ea;
}

[data-theme="dark"] .circle-btn:hover, [data-theme="dark"] .mobile-nav-toggle:hover {
    border-color: rgba( 227, 184, 106, .36 );
    background: linear-gradient( 135deg, rgba( 255, 255, 255, .10 ), rgba( 255, 255, 255, .05 ) );
    color: #e0bb77;
}

[data-theme="dark"] .nav-login {
    border-color: #33414b;
    background: rgba( 255, 255, 255, .06 );
    color: #e6e8ea;
}

[data-theme="dark"] .nav-login:hover {
    border-color: rgba( 227, 184, 106, .36 );
    background: linear-gradient( 135deg, rgba( 255, 255, 255, .10 ), rgba( 255, 255, 255, .05 ) );
}

[data-theme="dark"] .notification-badge {
    border-color: #0b1116;
}

[data-theme="dark"] .notification-mark-button {
    color: #dba756;
}

[data-theme="dark"] .notification-icon, [data-theme="dark"] .notification-empty-icon {
    border-color: rgba( 219, 167, 86, .16 );
    background: rgba( 219, 167, 86, .09 );
    color: #d3a253;
}

[data-theme="dark"] .header-user-menu a, [data-theme="dark"] .header-user-menu a.profile-link, [data-theme="dark"] .header-user-menu a.account-link, [data-theme="dark"] .header-user-menu a.library-link {
    color: #e6e8ea;
}

[data-theme="dark"] .header-user-menu a:hover, [data-theme="dark"] .header-user-menu a.profile-link:hover, [data-theme="dark"] .header-user-menu a.account-link:hover, [data-theme="dark"] .header-user-menu a.library-link:hover {
    background: linear-gradient( 135deg, rgba( 255, 255, 255, .08 ), rgba( 255, 255, 255, .04 ) );
    color: #e0bb77;
    border-color: rgba( 227, 184, 106, .22 );
    box-shadow: 0 5px 14px rgba( 0, 0, 0, .26 );
}

[data-theme="dark"] .mobile-nav-dropdown {
    border-color: #2b3943;
    background: rgba( 11, 17, 22, .98 );
    box-shadow: 0 16px 38px rgba( 0, 0, 0, .50 ), inset 0 1px 0 rgba( 255, 255, 255, .05 );
}

[data-theme="dark"] .mobile-nav-dropdown::before {
    border-top-color: #2b3943;
    border-left-color: #2b3943;
    background: #0b1116;
}

[data-theme="dark"] .mobile-nav-dropdown a {
    color: #e6e8ea;
}

[data-theme="dark"] .mobile-nav-dropdown a:hover, [data-theme="dark"] .mobile-nav-dropdown a.active {
    color: #e0bb77;
    background: linear-gradient( 135deg, rgba( 255, 255, 255, .08 ), rgba( 255, 255, 255, .04 ) );
    border-color: rgba( 227, 184, 106, .18 );
}

[data-theme="dark"] .mobile-nav-dropdown .mobile-nav-item-icon {
    color: #c9a15c;
}

/* --- 14.4  Theme toggle button (moon = light, sun = dark) --- */

#themeToggle .theme-icon {
    display: grid;
    place-items: center;
}

#themeToggle .theme-icon-sun {
    display: none;
}

[data-theme="dark"] #themeToggle .theme-icon-sun {
    display: grid;
}

[data-theme="dark"] #themeToggle .theme-icon-moon {
    display: none;
}

/* =========================================================
  15. RESPONSIVE / MEDIA QUERIES
  ========================================================= */

/* --- 15.1  Header media queries (from includes/header.php) --- */

/* NOTE: header breakpoints are 1250 / 1050 / 760 / 520 / 390,
  footer breakpoints are 1100 / 760 / 480. The two sets are
  not aligned — documented, deliberately NOT changed. */

@media(max-width:1250px) {
    .top-nav {
        grid-template-columns: auto minmax( 0, 1fr ) minmax( 220px, 280px ) auto;
        gap: 10px;
    }

    .logo {
        width: 185px;
    }

    .logo img {
        width: 185px;
        height: 84px;
        transform: none;
    }

    .main-nav {
        gap: 4px;
    }

    .main-nav a {
        min-width: 80px;
        padding: 0 10px;
        font-size: 13px;
    }
}

@media(max-width:1050px) {
    .top-nav {
        grid-template-columns: auto minmax( 0, 1fr ) auto;
        gap: 10px;
    }

    .logo {
        width: 170px;
    }

    .logo img {
        width: 170px;
        height: 84px;
        transform: none;
    }

    .main-nav {
        display: none;
    }

    .header-search {
        grid-column: 2;
    }

    .nav-tools {
        grid-column: 3;
    }
}

@media(max-width:760px) {
    .mobile-nav-wrap {
        display: block;
    }

    .mobile-nav-toggle {
        display: grid;
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .mobile-nav-toggle svg {
        width: 17px;
        height: 17px;
    }

    .container {
        width: calc( 100% - 20px );
    }

    .site-header {
        position: sticky;
        top: 0;
    }

    .top-nav {
        min-height: 68px;
        height: 68px;
        display: flex;
        direction: rtl;
        justify-content: space-between;
        gap: 0;
    }

    .logo {
        width: 135px;
        height: 68px;
        flex: 0 0 135px;
        justify-content: center;
    }

    .logo img {
        width: 155px;
        height: 80px;
        transform: translateY( -3px ) scale( 1.14 );
        transform-origin: center;
        filter: none;
    }

    .header-search {
        display: none;
    }

    .mobile-search-toggle {
        display: grid;
    }

    .nav-tools {
        width: auto;
        flex: 0 0 auto;
        gap: 6px;
    }

    .nav-login, .nav-join {
        min-height: 38px;
        padding: 0 11px;
        font-size: 11px;
    }

    .circle-btn {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .header-user-btn {
        width: 38px;
        height: 38px;
    }

    .notification-dropdown {
        position: fixed;
        top: 68px;
        right: 8px;
        left: 8px;
        width: auto;
        transform: translateY( -8px );
    }

    .header-user-menu {
        position: fixed;
        top: 68px;
        right: 8px;
        left: 8px;
        width: auto;
    }

    .mobile-search-panel {
        padding: 0 0 10px;
    }

    .mobile-search-form {
        width: 100%;
        height: 42px;
    }
}

@media(max-width:520px) {
    .logo {
        width: 118px;
        flex-basis: 118px;
    }

    .logo img {
        width: 140px;
        height: 72px;
        transform: translateY( -3px ) scale( 1.10 );
    }

    .nav-login {
        display: none;
    }

    .nav-join {
        padding: 0 10px;
    }

    .circle-btn {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .header-user-btn {
        width: 36px;
        height: 36px;
    }
}

@media(max-width:390px) {
    .container {
        width: calc( 100% - 20px );
    }

    .logo {
        width: 108px;
        flex-basis: 108px;
    }

    .logo img {
        width: 130px;
        height: 68px;
        transform: translateY( -3px ) scale( 1.07 );
    }

    .nav-join {
        display: none;
    }

    .mobile-search-toggle, .circle-btn {
        width: 33px;
        height: 33px;
        flex-basis: 33px;
    }

    .header-user-btn {
        width: 34px;
        height: 34px;
    }
}

/* --- 15.2  Footer media queries (from includes/footer.php) --- */

/* ========================================================= TABLET ========================================================= */
@media (max-width: 1100px) {
    .footer-grid { grid-template-columns: minmax(0, 1.45fr) minmax(140px, 0.85fr) minmax(0, 1.25fr);
    column-gap: 30px;
    row-gap: 28px;
    } .footer-links { transform: translateX(-18px);
    };
}

/* ========================================================= MOBILE ========================================================= */

@media (max-width: 760px) {
    .site-footer { padding: 28px 0 14px;
    } .footer-grid { grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    row-gap: 18px;
    } .footer-brand { grid-column: 1 / -1;
    } .footer-links { grid-column: 1 / -1;
    transform: none;
    } .footer-brand-main { gap: 14px;
    } .footer-logo-link { width: 112px;
    height: 62px;
    flex: 0 0 112px;
    } .footer-logo-link img { width: 124px;
    height: 66px;
    } .footer-brand-copy h3 { font-size: 13px;
    } .footer-brand-copy p { max-width: none;
    font-size: 11px;
    line-height: 1.75;
    } .footer-social-links { margin-top: 14px;
    } .footer-social-links a { min-height: 29px;
    padding: 0 8px;
    font-size: 9px;
    } .footer-links a { margin: 6px 0;
    font-size: 11px;
    } .site-footer h4 { margin: 2px 0 10px;
    font-size: 12px;
    } .newsletter { grid-column: 1 / -1;
    } .newsletter p { font-size: 11px;
    line-height: 1.7;
    margin-bottom: 10px;
    } .newsletter input { height: 32px;
    font-size: 11px;
    } .newsletter button { height: 32px;
    min-width: 62px;
    font-size: 11px;
    } .footer-newsletter-message { font-size: 10px;
    } .footer-bottom { margin-top: 24px;
    padding-top: 10px;
    font-size: 10px;
    };
}

/* ========================================================= SMALL MOBILE ========================================================= */

@media (max-width: 480px) {
    .site-footer { padding: 24px 0 12px;
    } .footer-grid { grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 14px;
    } .footer-brand { grid-column: auto;
    } .footer-links { grid-column: auto;
    transform: none;
    } .footer-brand-main { align-items: center;
    gap: 10px;
    } .footer-logo-link { width: 98px;
    height: 54px;
    flex: 0 0 98px;
    } .footer-logo-link img { width: 108px;
    height: 58px;
    } .footer-brand-copy h3 { margin-bottom: 4px;
    font-size: 12px;
    } .footer-brand-copy p { font-size: 10px;
    line-height: 1.65;
    } .footer-social-links { gap: 6px;
    margin-top: 12px;
    } .footer-social-links a { min-height: 27px;
    padding: 0 7px;
    font-size: 8.5px;
    } .footer-social-icon, .footer-social-icon svg { width: 13px;
    height: 13px;
    } .site-footer h4 { font-size: 11px;
    margin: 2px 0 8px;
    } .footer-links a { margin: 5px 0;
    font-size: 10px;
    line-height: 1.5;
    } .newsletter p { font-size: 10px;
    line-height: 1.6;
    margin-bottom: 8px;
    } .newsletter input { height: 31px;
    font-size: 10px;
    } .newsletter button { height: 31px;
    min-width: 58px;
    font-size: 10px;
    } .footer-bottom { margin-top: 20px;
    padding-top: 8px;
    font-size: 9px;
    };
}
