/* =========================================================
   قافية — ملف التصميم الرئيسي
   النسخة النهائية المتجاوبة لجميع الأجهزة
========================================================= */


/* =========================================================
   الألوان الأساسية
========================================================= */

:root {
    --color-primary: #3E2723;
    --color-background: #3E2723;
    --color-light: #f5f5f5;
    --color-accent: #FFE8D6;
    --color-accent-dark: #CB997E;
    --color-secondary: #B5838D;
    --color-gray: #6D6875;
    --color-card: #35221F;
    --color-border: rgba(255, 232, 214, 0.18);

    --color-danger: #b3261e;
    --color-danger-light: #ff8d85;

    --shadow-small:
        0 4px 18px rgba(0, 0, 0, 0.10);

    --shadow-medium:
        0 12px 35px rgba(0, 0, 0, 0.16);

    --shadow-large:
        0 20px 60px rgba(0, 0, 0, 0.25);

    --radius-small: 10px;
    --radius-medium: 15px;
    --radius-large: 20px;

    --header-height: 82px;
    --content-width: 1180px;
}


/* =========================================================
   الخط
========================================================= */

@font-face {
    font-family: 'Saudi';
    src: url('Saudi-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* =========================================================
   الإعدادات العامة
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;

    scroll-behavior: smooth;

    overflow-x: hidden;

    -webkit-text-size-adjust: 100%;
}

body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    margin: 0;
    padding: 0;

    overflow-x: hidden;

    direction: rtl;

    font-family: 'Saudi', Arial, sans-serif;

    background-color: var(--color-background);
    color: var(--color-light);

    line-height: 1.7;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea {
    font-family: 'Saudi', Arial, sans-serif;
}

a {
    color: inherit;
}

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

button {
    border: 0;
}

img,
video,
iframe {
    max-width: 100%;
}

img,
video {
    height: auto;
}

svg {
    display: block;
}

::selection {
    background-color: var(--color-accent);
    color: var(--color-primary);
}

:focus-visible {
    outline: 3px solid rgba(203, 153, 126, 0.65);
    outline-offset: 3px;
}


/* =========================================================
   إخفاء بصري لعناصر الوصول
========================================================= */

.sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}


/* =========================================================
   رأس الموقع
========================================================= */

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

    width: 100%;
    min-height: var(--header-height);

    padding-top: env(safe-area-inset-top);

    background-color: var(--color-light);
    color: var(--color-primary);

    z-index: 1000;

    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.12);
}

.header-container {
    position: relative;

    width: min(100%, var(--content-width));
    min-height: var(--header-height);

    margin: 0 auto;

    padding: 12px 24px;

    display: flex;
    align-items: center;

    gap: 16px;
}


/* =========================================================
   زر القائمة
========================================================= */

.menu-button {
    width: 48px;
    height: 48px;

    min-width: 48px;
    flex: 0 0 48px;

    padding: 0;

    border-radius: 12px;

    background-color: transparent;
    color: var(--color-primary);

    cursor: pointer;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;

    visibility: visible;
    opacity: 1;

    transition:
        background-color 0.25s ease,
        transform 0.25s ease;
}

.menu-button span {
    width: 22px;
    height: 2px;

    flex: 0 0 2px;

    border-radius: 10px;

    background-color: currentColor;

    display: block;

    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

.menu-button:hover {
    background-color: var(--color-accent);

    transform: scale(1.05);
}

.menu-button:active {
    transform: scale(0.96);
}


/* =========================================================
   شعار الموقع
========================================================= */

.site-logo {
    min-width: 0;
    flex: 1 1 auto;

    color: var(--color-primary);

    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700;

    line-height: 1;

    text-decoration: none;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.site-logo:hover {
    opacity: 0.75;

    transform: translateY(-1px);
}


/* =========================================================
   أدوات المستخدم
========================================================= */

.header-actions {
    margin-right: auto;

    display: flex;
    align-items: center;

    gap: 10px;

    flex: 0 0 auto;
}


/* =========================================================
   زر الإشعارات
========================================================= */

.notification-button {
    position: relative;

    width: 48px;
    height: 48px;

    min-width: 48px;
    flex: 0 0 48px;

    padding: 0;

    border-radius: 12px;

    background-color: transparent;
    color: var(--color-primary);

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition:
        background-color 0.25s ease,
        transform 0.25s ease;
}

.notification-button:hover {
    background-color: var(--color-accent);

    transform: scale(1.05);
}

.notification-button:active {
    transform: scale(0.96);
}

.notification-icon {
    width: 22px;
    height: 22px;

    display: block;
}

.notification-count {
    position: absolute;

    top: 3px;
    right: 3px;

    min-width: 18px;
    height: 18px;

    padding: 0 4px;

    border-radius: 20px;

    background-color: var(--color-danger);
    color: #ffffff;

    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;

    display: none;
    align-items: center;
    justify-content: center;
}


/* =========================================================
   زر تسجيل الدخول
========================================================= */

.login-button {
    min-width: 92px;
    min-height: 44px;

    padding: 8px 18px;

    border: 1px solid var(--color-primary);
    border-radius: 10px;

    background-color: var(--color-primary);
    color: var(--color-light);

    font-size: 15px;
    line-height: 1;

    white-space: nowrap;

    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        transform 0.2s ease;
}

.login-button:hover {
    background-color: transparent;
    color: var(--color-primary);

    transform: translateY(-1px);
}

.login-button:active {
    transform: scale(0.97);
}


/* =========================================================
   منطقة الحساب القديمة
========================================================= */

.account-area {
    position: relative;

    display: flex;
    align-items: center;

    flex: 0 0 auto;
}

.account-avatar-button {
    width: 44px;
    height: 44px;

    min-width: 44px;

    padding: 0;

    border: 1px solid rgba(62, 39, 35, 0.15);
    border-radius: 50%;

    background-color: var(--color-primary);
    color: var(--color-light);

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.account-avatar-button:hover {
    transform: scale(1.04);

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.15);
}

.account-avatar-image {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}

.account-avatar-default {
    width: 23px;
    height: 23px;

    display: block;
}


/* =========================================================
   قائمة الحساب القديمة
========================================================= */

.account-dropdown {
    position: absolute;

    top: calc(100% + 10px);
    left: 0;

    width: 190px;

    padding: 8px;

    border: 1px solid rgba(62, 39, 35, 0.10);
    border-radius: 14px;

    background-color: var(--color-light);
    color: var(--color-primary);

    box-shadow: var(--shadow-medium);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-6px);

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;

    z-index: 2500;
}

.account-dropdown.open {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}

.account-dropdown a,
.account-dropdown button {
    width: 100%;
    min-height: 44px;

    padding: 9px 12px;

    border: none;
    border-radius: 9px;

    background: transparent;
    color: var(--color-primary);

    text-decoration: none;

    display: flex;
    align-items: center;

    font-family: inherit;
    font-size: 14px;

    cursor: pointer;

    text-align: right;

    transition:
        background-color 0.2s ease;
}

.account-dropdown a:hover,
.account-dropdown button:hover {
    background-color: var(--color-accent);
}


/* =========================================================
   منطقة الحساب الحالية
========================================================= */

.qafiyah-account-area {
    position: relative;

    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 48px;
}

.qafiyah-header-avatar {
    width: 44px;
    height: 44px;

    padding: 0;

    border: 1px solid rgba(62, 39, 35, 0.18);
    border-radius: 50%;

    background-color: var(--color-accent);
    color: var(--color-primary);

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.qafiyah-header-avatar:hover {
    transform: scale(1.05);

    box-shadow:
        0 5px 18px rgba(0, 0, 0, 0.15);
}

.qafiyah-header-avatar svg {
    width: 22px;
    height: 22px;
}

.qafiyah-header-avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}


/* =========================================================
   قائمة الحساب الحالية
========================================================= */

.qafiyah-account-dropdown {
    position: fixed;

    min-width: 190px;

    padding: 7px;

    border: 1px solid rgba(62, 39, 35, 0.12);
    border-radius: 13px;

    background-color: var(--color-light);
    color: var(--color-primary);

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.18);

    z-index: 5000;

    opacity: 0;
    visibility: hidden;

    transform: translateY(-6px);

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
}

.qafiyah-account-dropdown.active {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);

    pointer-events: auto;
}

.qafiyah-account-dropdown button {
    width: 100%;

    min-height: 45px;

    padding: 9px 13px;

    border: none;
    border-radius: 9px;

    background: transparent;
    color: var(--color-primary);

    font-family: inherit;
    font-size: 14px;

    text-align: right;

    cursor: pointer;

    transition:
        background-color 0.2s ease;
}

.qafiyah-account-dropdown button:hover {
    background-color: var(--color-accent);
}


/* =========================================================
   القائمة الجانبية
========================================================= */

.side-menu {
    position: fixed;

    top: 0;
    right: 0;

    width: min(360px, 88vw);
    height: 100vh;
    height: 100dvh;

    padding-top: env(safe-area-inset-top);
    padding-bottom: max(15px, env(safe-area-inset-bottom));

    background-color: var(--color-light);
    color: var(--color-primary);

    z-index: 2000;

    transform: translateX(105%);

    transition:
        transform 0.3s ease;

    box-shadow:
        -10px 0 35px rgba(0, 0, 0, 0.20);

    overflow-y: auto;
    overflow-x: hidden;

    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;
}

.side-menu.open {
    transform: translateX(0);
}


/* =========================================================
   خلفية القائمة
========================================================= */

.menu-overlay {
    position: fixed;

    inset: 0;

    background-color: rgba(0, 0, 0, 0.50);

    z-index: 1500;

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* =========================================================
   رأس القائمة
========================================================= */

.side-menu-header {
    min-height: 82px;

    padding: 15px 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #ddd;
}

.side-menu-header h2 {
    margin: 0;

    color: var(--color-primary);

    font-size: 1.7rem;
}

.close-menu-button {
    width: 44px;
    height: 44px;

    min-width: 44px;

    padding: 0;

    border-radius: 10px;

    background-color: transparent;
    color: var(--color-primary);

    font-size: 32px;
    line-height: 1;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition:
        background-color 0.2s ease;
}

.close-menu-button:hover {
    background-color: var(--color-accent);
}


/* =========================================================
   قسم المستخدم في القائمة
========================================================= */

.user-section {
    margin: 20px;

    padding: 16px;

    border-radius: 14px;

    background-color: var(--color-accent);

    display: flex;
    align-items: center;

    gap: 12px;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.user-section:hover {
    transform: translateY(-1px);

    box-shadow:
        0 6px 18px rgba(62, 39, 35, 0.08);
}

.user-avatar {
    width: 50px;
    height: 50px;

    min-width: 50px;

    border-radius: 50%;

    background-color: var(--color-primary);
    color: var(--color-light);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;

    flex-shrink: 0;

    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    border-radius: 50%;

    display: block;
}

.user-avatar svg {
    width: 24px;
    height: 24px;
}

.user-info {
    min-width: 0;

    display: flex;
    flex-direction: column;

    flex: 1;
}

.user-info strong {
    font-size: 15px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info span {
    color: var(--color-gray);

    font-size: 12px;

    line-height: 1.5;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   روابط القائمة
========================================================= */

.side-navigation {
    padding: 5px 15px 25px;
}

.side-navigation a {
    min-height: 52px;

    margin-bottom: 5px;

    padding: 10px 14px;

    border-radius: 10px;

    color: var(--color-primary);

    text-decoration: none;

    display: flex;
    align-items: center;

    gap: 14px;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        color 0.2s ease;
}

.side-navigation a span:first-child {
    width: 25px;

    text-align: center;

    font-size: 19px;

    flex-shrink: 0;
}

.side-navigation a:hover {
    background-color: var(--color-accent);

    transform: translateX(-3px);
}

.side-navigation a.active {
    background-color: var(--color-accent);

    font-weight: 700;
}


/* =========================================================
   تذييل القائمة الجانبية
========================================================= */

.side-menu-footer {
    margin-top: auto;

    padding: 10px 20px 20px;

    text-align: center;
}

.side-menu-footer p {
    margin: 12px 0 0;

    color: var(--color-gray);

    font-size: 12px;
}

.side-menu-socials {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 8px;
}

.side-menu-socials a {
    width: 38px;
    height: 38px;

    border-radius: 10px;

    color: var(--color-primary);

    display: flex;
    align-items: center;
    justify-content: center;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.side-menu-socials a:hover {
    background-color: var(--color-accent);

    transform: translateY(-2px);
}

.side-menu-socials svg {
    width: 19px;
    height: 19px;

    fill: currentColor;
}


/* =========================================================
   نافذة الإشعارات
========================================================= */

.notification-panel {
    position: fixed;

    top: calc(var(--header-height) + 10px);
    left: 20px;

    width: min(360px, calc(100vw - 40px));
    max-height: calc(100dvh - var(--header-height) - 30px);

    overflow-y: auto;
    overflow-x: hidden;

    background-color: var(--color-light);
    color: var(--color-primary);

    border-radius: 15px;

    z-index: 1400;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.25);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-10px);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;
}

.notification-panel.open {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}

.notification-header {
    padding: 15px 18px;

    border-bottom: 1px solid #ddd;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
}

.notification-header h3 {
    margin: 0;
}

.notification-header button {
    width: 35px;
    height: 35px;

    min-width: 35px;

    padding: 0;

    border-radius: 8px;

    background: transparent;
    color: var(--color-primary);

    font-size: 25px;
    line-height: 1;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-header button:hover {
    background-color: var(--color-accent);
}

.notification-content {
    padding: 20px;

    color: var(--color-gray);
}

.notification-content p {
    margin: 0;
}


/* =========================================================
   الأبطال — الصفحة الرئيسية
========================================================= */

.hero-section {
    min-height: 520px;

    padding: 80px 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;

    background:
        radial-gradient(
            circle at center,
            rgba(203, 153, 126, 0.16),
            transparent 55%
        ),
        var(--color-background);
}

.hero-content {
    width: 100%;
    max-width: 850px;

    margin: 0 auto;
}

.hero-content h1 {
    margin: 0 0 15px;

    color: var(--color-light);

    font-size: clamp(3rem, 8vw, 5.5rem);

    line-height: 1.1;
}

.hero-content p {
    margin: 0 auto 30px;

    max-width: 650px;

    color: var(--color-accent);

    font-size: clamp(1rem, 2.5vw, 1.35rem);
}


/* =========================================================
   أزرار الصفحة الرئيسية
========================================================= */

.hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;

    flex-wrap: wrap;

    gap: 12px;
}

.primary-button,
.secondary-button {
    min-width: 160px;
    min-height: 46px;

    padding: 12px 20px;

    border-radius: 10px;

    text-decoration: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition:
        transform 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.primary-button {
    background-color: var(--color-accent);
    color: var(--color-primary);
}

.secondary-button {
    border: 1px solid var(--color-accent);

    background-color: transparent;
    color: var(--color-accent);
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-2px);
}

.primary-button:hover {
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.15);
}

.secondary-button:hover {
    background-color: var(--color-accent);
    color: var(--color-primary);
}


/* =========================================================
   أقسام الموقع
========================================================= */

.site-sections {
    padding: 70px 20px;

    background-color: var(--color-background);
}

.section-title {
    margin-bottom: 40px;

    text-align: center;
}

.section-title h2 {
    margin: 0 0 10px;

    font-size: 2rem;
}

.section-title p {
    margin: 0;

    color: var(--color-accent);
}


/* =========================================================
   بطاقات الأقسام
========================================================= */

.section-cards {
    width: 100%;
    max-width: 1100px;

    margin: auto;

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 20px;
}

.section-card {
    min-width: 0;

    padding: 30px 24px;

    border: 1px solid var(--color-border);
    border-radius: 16px;

    background-color: var(--color-card);

    color: var(--color-light);

    text-decoration: none;

    text-align: center;

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.section-card:hover {
    transform: translateY(-5px);

    border-color: var(--color-accent-dark);

    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.15);
}

.card-icon {
    display: block;

    margin-bottom: 15px;

    font-size: 35px;
}

.section-card h3 {
    margin: 0 0 8px;

    color: var(--color-light);

    font-size: 1.4rem;
}

.section-card p {
    margin: 0;

    color: #d8d0ce;

    font-size: 0.95rem;
}


/* =========================================================
   الأبطال الداخلية
========================================================= */

.page-hero {
    position: relative;

    min-height: 360px;

    padding: 80px 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(203, 153, 126, 0.18),
            transparent 48%
        ),
        linear-gradient(
            180deg,
            #3E2723 0%,
            #35221F 100%
        );
}

.page-hero::before {
    content: "";

    position: absolute;

    width: 320px;
    height: 320px;

    top: -180px;
    left: -100px;

    border-radius: 50%;

    border: 1px solid rgba(255, 232, 214, 0.08);

    pointer-events: none;
}

.page-hero::after {
    content: "";

    position: absolute;

    width: 420px;
    height: 420px;

    right: -200px;
    bottom: -280px;

    border-radius: 50%;

    border: 1px solid rgba(255, 232, 214, 0.07);

    pointer-events: none;
}

.page-hero .hero-content {
    position: relative;

    z-index: 1;

    max-width: 900px;
}

.section-label {
    display: inline-block;

    margin-bottom: 12px;

    color: var(--color-accent-dark);

    font-size: 0.90rem;

    letter-spacing: 0.02em;
}

.page-hero h1 {
    margin: 0 0 15px;

    color: var(--color-light);

    font-size: clamp(2.5rem, 7vw, 4.5rem);

    line-height: 1.15;
}

.page-hero p {
    max-width: 700px;

    margin: 0 auto;

    color: var(--color-accent);

    font-size: clamp(1rem, 2.2vw, 1.2rem);
}


/* =========================================================
   شريط المقالات والشعراء
========================================================= */

.articles-toolbar {
    width: min(1180px, calc(100% - 40px));

    margin: 0 auto;

    padding: 30px 0;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(190px, 220px);

    gap: 14px;

    align-items: center;
}

.poets-toolbar {
    grid-template-columns:
        minmax(0, 1fr)
        minmax(170px, 210px)
        minmax(170px, 210px);
}

.articles-search {
    width: 100%;
}

.search-input-wrapper {
    position: relative;

    width: 100%;
}

.search-icon {
    position: absolute;

    top: 50%;
    right: 17px;

    width: 21px;
    height: 21px;

    color: var(--color-gray);

    transform: translateY(-50%);

    pointer-events: none;
}

.articles-search input {
    width: 100%;

    min-height: 54px;

    padding: 11px 50px 11px 17px;

    border: 1px solid rgba(255, 232, 214, 0.22);
    border-radius: 13px;

    outline: none;

    background-color: var(--color-card);
    color: var(--color-light);

    font-size: 15px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.articles-search input::placeholder {
    color: #bdb2af;
}

.articles-search input:focus {
    border-color: var(--color-accent-dark);

    background-color: #3b2521;

    box-shadow:
        0 0 0 3px rgba(203, 153, 126, 0.12);
}

.articles-search input::-webkit-search-cancel-button {
    filter: grayscale(1);
}

.articles-filter {
    width: 100%;
}

.articles-filter select {
    width: 100%;

    min-height: 54px;

    padding: 11px 15px;

    border: 1px solid rgba(255, 232, 214, 0.22);
    border-radius: 13px;

    outline: none;

    background-color: var(--color-card);
    color: var(--color-light);

    font-size: 14px;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.articles-filter select:focus {
    border-color: var(--color-accent-dark);

    box-shadow:
        0 0 0 3px rgba(203, 153, 126, 0.12);
}


/* =========================================================
   قائمة المقالات
========================================================= */

.articles-list,
.poets-list {
    width: min(1180px, calc(100% - 40px));

    margin: 0 auto;

    padding: 10px 0 80px;
}

.articles-container {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 22px;
}


/* =========================================================
   بطاقات المقالات الديناميكية
========================================================= */

.article-card {
    position: relative;

    min-width: 0;

    border: 1px solid var(--color-border);
    border-radius: 18px;

    background-color: var(--color-card);

    overflow: hidden;

    text-decoration: none;

    display: flex;
    flex-direction: column;

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.article-card:hover {
    transform: translateY(-5px);

    border-color: var(--color-accent-dark);

    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.17);
}

.article-card-image {
    width: 100%;
    height: 210px;

    background:
        linear-gradient(
            135deg,
            rgba(203, 153, 126, 0.20),
            rgba(181, 131, 141, 0.12)
        );

    overflow: hidden;
}

.article-card-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    transition:
        transform 0.35s ease;
}

.article-card:hover .article-card-image img {
    transform: scale(1.035);
}

.article-card-body {
    padding: 22px;

    display: flex;
    flex-direction: column;

    flex: 1;
}

.article-card-category {
    margin-bottom: 8px;

    color: var(--color-accent-dark);

    font-size: 12px;
}

.article-card h2,
.article-card h3 {
    margin: 0 0 10px;

    color: var(--color-light);

    font-size: 1.25rem;

    line-height: 1.5;
}

.article-card p {
    margin: 0;

    color: #d8d0ce;

    font-size: 0.92rem;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;

    overflow: hidden;
}

.article-card-meta {
    margin-top: auto;
    padding-top: 18px;

    color: #a99e9a;

    font-size: 12px;
}


/* =========================================================
   حالات المقالات
========================================================= */

.articles-empty,
.articles-loading,
.poets-empty,
.poets-loading {
    width: 100%;

    padding: 70px 20px;

    border: 1px solid var(--color-border);
    border-radius: 18px;

    background-color: var(--color-card);

    text-align: center;
}

.articles-empty[hidden],
.articles-loading[hidden],
.poets-empty[hidden],
.poets-loading[hidden] {
    display: none;
}

.articles-empty-icon,
.poets-empty-icon {
    width: 68px;
    height: 68px;

    margin: 0 auto 18px;

    border-radius: 18px;

    background-color: rgba(255, 232, 214, 0.08);
    color: var(--color-accent-dark);

    display: flex;
    align-items: center;
    justify-content: center;
}

.articles-empty-icon svg,
.poets-empty-icon svg {
    width: 32px;
    height: 32px;
}

.articles-empty h2,
.poets-empty h2 {
    margin: 0 0 8px;

    color: var(--color-light);

    font-size: 1.35rem;
}

.articles-empty p,
.poets-empty p {
    max-width: 500px;

    margin: 0 auto;

    color: #bdb2af;

    font-size: 0.92rem;
}

.articles-loading,
.poets-loading {
    color: var(--color-accent);

    font-size: 0.95rem;
}


/* =========================================================
   الشعراء
========================================================= */

.poets-container {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 20px;
}


/* =========================================================
   بطاقة الشاعر
========================================================= */

.poet-card {
    position: relative;

    min-width: 0;

    padding: 24px 20px;

    border: 1px solid var(--color-border);
    border-radius: 18px;

    background-color: var(--color-card);

    color: var(--color-light);

    text-decoration: none;

    text-align: center;

    overflow: hidden;

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.poet-card::before {
    content: "";

    position: absolute;

    width: 150px;
    height: 150px;

    top: -85px;
    right: -65px;

    border-radius: 50%;

    border: 1px solid rgba(255, 232, 214, 0.08);

    pointer-events: none;
}

.poet-card:hover {
    transform: translateY(-5px);

    border-color: var(--color-accent-dark);

    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.17);
}

.poet-card-image {
    width: 105px;
    height: 105px;

    margin: 0 auto 17px;

    border: 2px solid var(--color-accent-dark);
    border-radius: 50%;

    background-color: var(--color-primary);
    color: var(--color-accent);

    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;
}

.poet-card-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}

.poet-card-image svg {
    width: 45px;
    height: 45px;
}

.poet-card h2,
.poet-card h3 {
    margin: 0 0 6px;

    color: var(--color-light);

    font-size: 1.15rem;
}

.poet-card-era {
    color: var(--color-accent-dark);

    font-size: 12px;
}

.poet-card-category {
    margin-top: 4px;

    color: #bdb2af;

    font-size: 12px;
}

.poet-card-description {
    margin: 12px 0 0;

    color: #d8d0ce;

    font-size: 0.86rem;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;

    overflow: hidden;
}


/* =========================================================
   صفحات المحتوى العامة
========================================================= */

.content-section {
    width: min(1100px, calc(100% - 40px));

    margin: 0 auto;

    padding: 55px 0;
}

.content-card {
    min-width: 0;

    padding: 35px;

    border: 1px solid var(--color-border);
    border-radius: 20px;

    background-color: var(--color-card);

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.12);
}

.content-card h2 {
    margin: 0 0 15px;

    color: var(--color-light);

    font-size: 1.8rem;
}

.content-card p {
    margin: 0;

    color: #d8d0ce;

    font-size: 1rem;
}


/* =========================================================
   عن قافية — شبكة الرؤية والرسالة
========================================================= */

.about-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;
}

.about-feature-card {
    min-height: 280px;

    display: flex;
    flex-direction: column;
}

.about-feature-icon {
    width: 62px;
    height: 62px;

    margin-bottom: 20px;

    border: 1px solid rgba(255, 232, 214, 0.16);
    border-radius: 17px;

    background-color: rgba(255, 232, 214, 0.07);
    color: var(--color-accent-dark);

    display: flex;
    align-items: center;
    justify-content: center;
}

.about-feature-icon svg {
    width: 30px;
    height: 30px;
}

.about-feature-card h2 {
    margin: 0 0 10px;

    font-size: 1.5rem;
}

.about-feature-card p {
    margin-top: auto;
}


/* =========================================================
   عن قافية — الخدمات
========================================================= */

.about-section-heading {
    margin-bottom: 28px;
}

.about-section-heading .section-label {
    margin-bottom: 5px;
}

.about-section-heading h2 {
    margin: 0 0 8px;
}

.about-section-heading p {
    margin: 0;

    color: #bdb2af;
}

.about-services {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 15px;
}

.about-service {
    min-height: 155px;

    padding: 20px;

    border: 1px solid rgba(255, 232, 214, 0.13);
    border-radius: 15px;

    background-color: rgba(255, 232, 214, 0.035);

    color: inherit;

    text-decoration: none;

    display: flex;
    flex-direction: column;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.about-service:hover {
    transform: translateY(-4px);

    border-color: var(--color-accent-dark);

    background-color: rgba(255, 232, 214, 0.07);
}

.about-service-icon {
    width: 48px;
    height: 48px;

    margin-bottom: 14px;

    border-radius: 13px;

    background-color: rgba(255, 232, 214, 0.08);
    color: var(--color-accent-dark);

    display: flex;
    align-items: center;
    justify-content: center;
}

.about-service-icon svg {
    width: 24px;
    height: 24px;
}

.about-service h3 {
    margin: 0 0 5px;

    color: var(--color-light);

    font-size: 1.05rem;
}

.about-service p {
    margin: 0;

    color: #bdb2af;

    font-size: 0.84rem;
}


/* =========================================================
   عن قافية — بطاقة الحفظ والتوثيق
========================================================= */

.about-mission-card {
    min-height: 240px;

    display: grid;

    grid-template-columns: 110px minmax(0, 1fr);

    gap: 25px;

    align-items: center;
}

.about-mission-icon {
    width: 100px;
    height: 100px;

    border: 1px solid rgba(255, 232, 214, 0.15);
    border-radius: 25px;

    background:
        radial-gradient(
            circle,
            rgba(203, 153, 126, 0.15),
            rgba(255, 232, 214, 0.025)
        );

    color: var(--color-accent-dark);

    display: flex;
    align-items: center;
    justify-content: center;
}

.about-mission-icon svg {
    width: 48px;
    height: 48px;
}

.about-mission-card h2 {
    margin-bottom: 10px;
}


/* =========================================================
   عن قافية — النهاية
========================================================= */

.about-final {
    width: 100%;

    padding: 80px 20px 100px;

    text-align: center;

    background:
        radial-gradient(
            circle at center,
            rgba(203, 153, 126, 0.15),
            transparent 52%
        ),
        var(--color-background);
}

.about-final-content {
    max-width: 700px;

    margin: 0 auto;
}

.about-final-mark {
    width: 82px;
    height: 82px;

    margin: 0 auto 22px;

    border: 1px solid rgba(255, 232, 214, 0.22);
    border-radius: 24px;

    background-color: var(--color-card);
    color: var(--color-accent);

    font-size: 1.6rem;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.15);
}

.about-final h2 {
    margin: 0 0 10px;

    color: var(--color-light);

    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.about-final p {
    margin: 0 auto 25px;

    max-width: 560px;

    color: var(--color-accent);

    font-size: 1rem;
}


/* =========================================================
   نافذة تسجيل الدخول
========================================================= */

.login-modal {
    position: fixed;

    inset: 0;

    padding:
        max(20px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(20px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));

    background-color: rgba(0, 0, 0, 0.65);

    z-index: 3000;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;

    overflow-y: auto;
}

.login-modal.open {
    opacity: 1;
    visibility: visible;
}

.login-box {
    position: relative;

    width: min(450px, 100%);

    max-height: calc(100dvh - 40px);

    padding: 35px 28px;

    border-radius: 18px;

    background-color: var(--color-light);
    color: var(--color-primary);

    box-shadow: var(--shadow-large);

    overflow-y: auto;
    overflow-x: hidden;

    -webkit-overflow-scrolling: touch;
}

.login-box h2 {
    margin: 0 0 8px;

    font-size: 1.8rem;
}

.login-box > p {
    margin-top: 0;

    color: var(--color-gray);
}

.close-login-button {
    position: absolute;

    top: 12px;
    left: 12px;

    width: 40px;
    height: 40px;

    min-width: 40px;

    padding: 0;

    border-radius: 8px;

    background: transparent;
    color: var(--color-primary);

    font-size: 27px;
    line-height: 1;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

.close-login-button:hover {
    background-color: var(--color-accent);
}


/* =========================================================
   طرق تسجيل الدخول
========================================================= */

.login-method,
.login-submit {
    width: 100%;

    min-height: 48px;

    margin-top: 12px;

    padding: 10px 15px;

    border-radius: 10px;

    font-family: inherit;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}

.login-method {
    border: 1px solid var(--color-primary);

    background-color: var(--color-primary);
    color: var(--color-light);

    font-size: 15px;
}

.login-method:hover {
    opacity: 0.9;

    transform: translateY(-1px);
}

.login-divider {
    margin: 20px 0;

    display: flex;
    align-items: center;

    gap: 10px;

    color: var(--color-gray);
}

.login-divider::before,
.login-divider::after {
    content: "";

    height: 1px;

    flex: 1;

    background-color: #ddd;
}

.login-divider span {
    font-size: 13px;
}

.login-box label {
    display: block;

    margin-bottom: 7px;

    color: var(--color-primary);

    font-size: 14px;
}

.login-box input,
.login-box select {
    width: 100%;

    min-height: 48px;

    margin-bottom: 12px;

    padding: 10px 14px;

    border: 1px solid #ccc;
    border-radius: 10px;

    background-color: #ffffff;
    color: var(--color-primary);

    font-family: inherit;
    font-size: 15px;

    outline: none;

    text-align: right;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.login-box input:focus,
.login-box select:focus {
    border-color: var(--color-primary);

    box-shadow:
        0 0 0 3px rgba(62, 39, 35, 0.08);
}

.login-submit {
    border: 1px solid var(--color-primary);

    background-color: var(--color-primary);
    color: var(--color-light);
}

.login-submit:hover {
    transform: translateY(-1px);

    background-color: #4a2d28;
}

.login-submit:disabled {
    opacity: 0.6;

    cursor: wait;

    transform: none;
}

.login-register {
    width: 100%;

    margin-top: 16px;

    padding: 5px;

    border: none;

    background: transparent;
    color: var(--color-gray);

    font-family: inherit;
    font-size: 13px;

    text-align: center;

    cursor: pointer;

    transition:
        color 0.2s ease;
}

.login-register:hover {
    color: var(--color-primary);

    text-decoration: underline;
}

.login-note {
    margin-top: 15px !important;

    color: var(--color-gray);

    font-size: 12px;

    text-align: center;
}


/* =========================================================
   تاريخ الميلاد
========================================================= */

.birth-date-fields {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 8px;
}

.birth-date-fields select {
    margin-bottom: 0 !important;
}


/* =========================================================
   نموذج تسجيل الدخول القديم في الملف
========================================================= */

.profile-login-form {
    width: 100%;

    margin: 0;
    padding: 0;

    border: none;

    background: transparent;
    color: var(--color-primary);
}

.profile-login-form h2 {
    margin: 0 0 20px;

    color: var(--color-primary);

    font-size: 1.8rem;

    text-align: right;
}

.profile-login-form input,
.profile-login-form select {
    width: 100%;

    min-height: 48px;

    margin-top: 12px;

    padding: 10px 14px;

    border: 1px solid #ccc;
    border-radius: 10px;

    background-color: white;
    color: var(--color-primary);

    font-family: inherit;
    font-size: 15px;

    outline: none;

    text-align: right;
}

.profile-login-form input:focus,
.profile-login-form select:focus {
    border-color: var(--color-primary);
}

.profile-login-form .birth-date-fields {
    width: 100%;

    margin-top: 12px;

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 10px;
}

.profile-login-form .birth-date-fields select {
    margin-top: 0;
}

.profile-login-form .login-submit {
    width: 100%;

    min-height: 48px;

    margin-top: 12px;
}


/* =========================================================
   صفحة الملف الشخصي
========================================================= */

.profile-page {
    width: 100%;

    min-height: calc(100vh - var(--header-height));

    padding:
        60px 20px
        max(80px, env(safe-area-inset-bottom));

    background-color: var(--color-background);
}

.profile-container {
    width: 100%;
    max-width: 950px;

    margin: 0 auto;
}

.profile-heading {
    margin-bottom: 30px;

    text-align: right;
}

.profile-heading h1 {
    margin: 0 0 8px;

    color: var(--color-light);

    font-size: clamp(2rem, 5vw, 3rem);
}

.profile-heading p {
    margin: 0;

    color: var(--color-accent);

    font-size: 1rem;
}

.profile-title {
    margin: 0 0 30px;

    color: var(--color-light);

    text-align: center;

    font-size: 2rem;
}


/* =========================================================
   بطاقة الملف
========================================================= */

.profile-card {
    width: 100%;

    padding: 35px;

    border: 1px solid var(--color-border);
    border-radius: 20px;

    background-color: var(--color-card);

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.18);
}


/* =========================================================
   صورة الملف الشخصي القديمة
========================================================= */

.profile-avatar-section {
    margin-bottom: 35px;

    display: flex;
    flex-direction: column;

    align-items: center;
}

.profile-avatar {
    width: 130px;
    height: 130px;

    margin-bottom: 18px;

    border-radius: 50%;

    background-color: var(--color-primary);
    color: var(--color-light);

    border: 3px solid var(--color-accent-dark);

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.2);
}

.profile-avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}

.profile-avatar-default {
    width: 58px;
    height: 58px;
}

.profile-avatar-actions {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 8px;
}

.profile-avatar-actions button {
    min-height: 42px;

    padding: 8px 16px;

    border: 1px solid var(--color-accent);
    border-radius: 9px;

    background-color: transparent;
    color: var(--color-accent);

    font-family: inherit;
    font-size: 13px;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.profile-avatar-actions button:hover {
    background-color: var(--color-accent);
    color: var(--color-primary);
}

.profile-avatar-actions input[type="file"] {
    display: none;
}


/* =========================================================
   الصورة الشخصية الحالية
========================================================= */

.profile-photo-section {
    width: 100%;

    margin-bottom: 35px;
    padding-bottom: 30px;

    border-bottom: 1px solid var(--color-border);

    display: flex;
    flex-direction: column;

    align-items: center;

    text-align: center;
}

.profile-photo {
    width: 125px;
    height: 125px;

    margin-bottom: 18px;

    border: 2px solid var(--color-accent-dark);
    border-radius: 50%;

    background-color: var(--color-primary);
    color: var(--color-light);

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}

.profile-photo svg {
    width: 55px;
    height: 55px;
}

.profile-photo img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}

.profile-photo-actions {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 10px;

    margin-bottom: 10px;
}

.profile-upload-button,
.profile-delete-button {
    min-height: 44px;

    padding: 9px 17px;

    border-radius: 10px;

    font-family: inherit;
    font-size: 14px;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.profile-upload-button {
    border: 1px solid var(--color-primary);

    background-color: var(--color-primary);
    color: var(--color-light);
}

.profile-delete-button {
    border: 1px solid rgba(179, 38, 30, 0.65);

    background-color: transparent;
    color: var(--color-danger);
}

.profile-upload-button:hover,
.profile-delete-button:hover {
    transform: translateY(-1px);
}

.profile-upload-button:hover {
    background-color: var(--color-accent-dark);
}

.profile-delete-button:hover {
    background-color: rgba(179, 38, 30, 0.08);
}

.profile-photo-section small {
    color: #d8d0ce;

    font-size: 12px;
}


/* =========================================================
   نموذج الملف الشخصي
========================================================= */

.profile-form {
    width: 100%;
}

.profile-fields {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;
}

.profile-field {
    width: 100%;

    min-width: 0;

    text-align: right;

    display: flex;
    flex-direction: column;
}

.profile-field.full-width {
    grid-column: 1 / -1;
}

.profile-field label {
    display: block;

    margin-bottom: 8px;

    color: var(--color-light);

    font-size: 14px;
}

.profile-field input,
.profile-field select {
    width: 100%;

    min-height: 50px;

    padding: 10px 14px;

    border: 1px solid rgba(255, 232, 214, 0.22);
    border-radius: 10px;

    background-color: var(--color-light);
    color: var(--color-primary);

    font-family: inherit;
    font-size: 15px;

    text-align: right;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.profile-field input:focus,
.profile-field select:focus {
    border-color: var(--color-accent-dark);

    box-shadow:
        0 0 0 3px rgba(203, 153, 126, 0.12);
}

.profile-field input[readonly] {
    background-color: #e9e6e5;

    opacity: 0.75;

    cursor: not-allowed;
}


/* =========================================================
   أزرار الملف الشخصي
========================================================= */

.profile-actions {
    grid-column: 1 / -1;

    margin-top: 10px;

    display: flex;

    justify-content: flex-start;

    gap: 10px;
}

.profile-save-area {
    margin-top: 30px;

    display: flex;
    align-items: center;
    justify-content: flex-start;

    flex-wrap: wrap;

    gap: 10px;
}

.profile-save-button,
.profile-logout-button {
    min-height: 48px;

    padding: 10px 22px;

    border-radius: 10px;

    font-family: inherit;
    font-size: 15px;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background-color 0.2s ease,
        opacity 0.2s ease;
}

.profile-save-button {
    border: 1px solid var(--color-primary);

    background-color: var(--color-accent);
    color: var(--color-primary);
}

.profile-logout-button {
    border: 1px solid rgba(179, 38, 30, 0.65);

    background-color: transparent;
    color: var(--color-danger);
}

.profile-save-button:hover,
.profile-logout-button:hover {
    transform: translateY(-1px);
}

.profile-save-button:hover {
    background-color: #f5d8c2;
}

.profile-logout-button:hover {
    background-color: rgba(179, 38, 30, 0.08);
}

.profile-save-button:disabled {
    opacity: 0.6;

    cursor: wait;

    transform: none;
}


/* =========================================================
   رسائل الملف الشخصي
========================================================= */

.profile-message {
    grid-column: 1 / -1;

    min-height: 25px;

    margin: 15px 0 0;

    color: var(--color-accent);

    font-size: 14px;

    text-align: right;
}

.profile-message.error {
    color: var(--color-danger-light);
}


/* =========================================================
   التذييل الرئيسي
========================================================= */

.site-footer {
    margin-top: 0;

    background-color: var(--color-light);
    color: var(--color-primary);

    text-align: center;

    font-size: 0.9rem;
}

.footer-container {
    width: min(1180px, calc(100% - 40px));

    margin: 0 auto;

    padding: 55px 0 45px;

    display: grid;

    grid-template-columns:
        1.4fr
        0.8fr
        0.8fr
        1fr;

    gap: 40px;

    text-align: right;
}

.footer-brand,
.footer-links,
.footer-contact {
    min-width: 0;
}

.footer-logo {
    display: inline-block;

    margin-bottom: 12px;

    color: var(--color-primary);

    font-size: 2rem;
    font-weight: 700;

    line-height: 1;

    text-decoration: none;
}

.footer-brand p {
    max-width: 360px;

    margin: 0;

    color: var(--color-gray);

    font-size: 0.9rem;
}

.footer-links h3,
.footer-contact h3 {
    margin: 0 0 14px;

    color: var(--color-primary);

    font-size: 1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
}

.footer-links a,
.footer-email {
    width: fit-content;

    margin-bottom: 8px;

    color: var(--color-gray);

    text-decoration: none;

    transition:
        color 0.2s ease;
}

.footer-links a:hover,
.footer-email:hover {
    color: var(--color-primary);
}

.footer-socials {
    margin-top: 15px;

    display: flex;
    align-items: center;

    gap: 7px;
}

.footer-socials a {
    width: 37px;
    height: 37px;

    border-radius: 9px;

    color: var(--color-primary);

    display: flex;
    align-items: center;
    justify-content: center;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.footer-socials a:hover {
    background-color: var(--color-accent);

    transform: translateY(-2px);
}

.footer-socials svg {
    width: 18px;
    height: 18px;

    fill: currentColor;
}

.footer-bottom {
    width: min(1180px, calc(100% - 40px));

    margin: 0 auto;

    padding: 18px 0 22px;

    border-top: 1px solid rgba(62, 39, 35, 0.12);

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    color: var(--color-gray);

    font-size: 12px;

    text-align: right;
}

.footer-bottom p {
    margin: 0;
}

.footer-bottom span {
    display: block;
}


/* =========================================================
   تحسينات عامة للأزرار والحقول
========================================================= */

button:disabled {
    cursor: not-allowed;
}

input::placeholder,
textarea::placeholder {
    opacity: 1;
}

textarea {
    resize: vertical;
}

select {
    max-width: 100%;
}


/* =========================================================
   1024px
========================================================= */

@media (max-width: 1024px) {

    .poets-container {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .footer-container {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   900px
========================================================= */

@media (max-width: 900px) {

    :root {
        --header-height: 74px;
    }

    .header-container {
        min-height: var(--header-height);
        padding: 10px 18px;
    }

    .articles-container {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .poets-container {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .about-services {
        grid-template-columns:
            1fr;
    }

    .about-mission-card {
        grid-template-columns:
            85px minmax(0, 1fr);
    }

    .about-mission-icon {
        width: 80px;
        height: 80px;
    }

    .about-mission-icon svg {
        width: 40px;
        height: 40px;
    }

    .footer-container {
        gap: 28px;
    }
}


/* =========================================================
   768px
========================================================= */

@media (max-width: 768px) {

    :root {
        --header-height: 70px;
    }

    .header-container {
        min-height: var(--header-height);

        padding:
            10px
            max(14px, env(safe-area-inset-right))
            10px
            max(14px, env(safe-area-inset-left));

        gap: 8px;
    }

    .menu-button,
    .notification-button {
        width: 43px;
        height: 43px;

        min-width: 43px;
        flex-basis: 43px;
    }

    .site-logo {
        font-size: 2rem;
    }

    .header-actions {
        gap: 5px;
    }

    .login-button {
        min-width: 82px;
        min-height: 42px;

        padding: 7px 11px;

        font-size: 13px;
    }

    .account-avatar-button {
        width: 41px;
        height: 41px;
    }

    .qafiyah-account-area {
        width: 43px;
        height: 43px;

        flex-basis: 43px;
    }

    .qafiyah-header-avatar {
        width: 40px;
        height: 40px;
    }

    .hero-section {
        min-height: 450px;

        padding: 60px 18px;
    }

    .page-hero {
        min-height: 320px;

        padding: 65px 18px;
    }

    .section-cards {
        grid-template-columns: 1fr;

        max-width: 500px;
    }

    .side-menu {
        width: min(340px, 90vw);
    }

    .notification-panel {
        top: calc(var(--header-height) + 10px);
    }

    .articles-toolbar,
    .poets-toolbar {
        width: min(calc(100% - 30px), 700px);

        grid-template-columns: 1fr;

        padding: 25px 0;
    }

    .articles-list,
    .poets-list {
        width: min(calc(100% - 30px), 700px);

        padding-bottom: 60px;
    }

    .articles-container {
        grid-template-columns: 1fr;
    }

    .poets-container {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 14px;
    }

    .article-card-image {
        height: 220px;
    }

    .content-section {
        width: min(calc(100% - 30px), 700px);

        padding: 40px 0;
    }

    .content-card {
        padding: 25px 20px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-mission-card {
        grid-template-columns: 1fr;

        text-align: center;
    }

    .about-mission-icon {
        margin: 0 auto;
    }

    .about-mission-card .section-label {
        margin-top: 5px;
    }

    .about-mission-card h2 {
        font-size: 1.45rem;
    }

    .profile-page {
        min-height: calc(100vh - var(--header-height));

        padding:
            40px 15px
            max(60px, env(safe-area-inset-bottom));
    }

    .profile-card {
        padding: 25px 18px;
    }

    .profile-fields {
        grid-template-columns: 1fr;
    }

    .profile-field.full-width {
        grid-column: auto;
    }

    .profile-actions {
        grid-column: auto;
    }

    .profile-message {
        grid-column: auto;
    }

    .profile-save-area {
        justify-content: stretch;
    }

    .profile-save-button,
    .profile-logout-button {
        flex: 1;
    }

    .footer-container {
        width: min(calc(100% - 30px), 700px);

        grid-template-columns: 1fr 1fr;

        gap: 30px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-bottom {
        width: min(calc(100% - 30px), 700px);

        flex-direction: column;
        align-items: flex-start;
    }
}


/* =========================================================
   520px
========================================================= */

@media (max-width: 520px) {

    :root {
        --header-height: 64px;
    }

    .site-logo {
        font-size: 1.8rem;
    }

    .header-container {
        min-height: var(--header-height);

        padding:
            8px
            max(8px, env(safe-area-inset-right))
            8px
            max(8px, env(safe-area-inset-left));

        gap: 5px;
    }

    .menu-button,
    .notification-button {
        width: 41px;
        height: 41px;

        min-width: 41px;
        flex-basis: 41px;
    }

    .menu-button span {
        width: 20px;
    }

    .notification-icon {
        width: 21px;
        height: 21px;
    }

    .login-button {
        min-width: 76px;
        min-height: 38px;

        padding: 7px 9px;

        font-size: 12px;
    }

    .header-actions {
        gap: 4px;
    }

    .page-hero {
        min-height: 290px;

        padding: 55px 15px;
    }

    .page-hero h1 {
        font-size: 2.5rem;
    }

    .page-hero p {
        font-size: 0.92rem;
    }

    .articles-search input,
    .articles-filter select {
        min-height: 50px;
    }

    .articles-container {
        gap: 15px;
    }

    .poets-container {
        grid-template-columns: 1fr;

        gap: 15px;
    }

    .poet-card {
        padding: 25px 20px;
    }

    .article-card-image {
        height: 200px;
    }

    .articles-empty,
    .articles-loading,
    .poets-empty,
    .poets-loading {
        padding: 55px 15px;
    }

    .about-final {
        padding: 65px 18px 80px;
    }

    .about-final-mark {
        width: 72px;
        height: 72px;

        font-size: 1.4rem;
    }

    .content-card {
        padding: 22px 17px;
    }

    .about-feature-card {
        min-height: 0;
    }

    .about-services {
        gap: 10px;
    }

    .about-service {
        min-height: 135px;

        padding: 17px;
    }

    .login-modal {
        padding: 12px;
    }

    .login-box {
        width: 100%;

        max-height: calc(100dvh - 24px);

        padding: 30px 20px;
    }

    .profile-card {
        padding: 22px 15px;
    }

    .profile-photo {
        width: 110px;
        height: 110px;
    }

    .profile-avatar {
        width: 115px;
        height: 115px;
    }

    .profile-avatar-actions {
        flex-direction: column;

        width: 100%;
    }

    .profile-avatar-actions button {
        width: 100%;
    }

    .profile-photo-actions {
        flex-direction: column;

        width: 100%;
    }

    .profile-upload-button,
    .profile-delete-button {
        width: 100%;
    }

    .profile-actions {
        flex-direction: column;
    }

    .profile-save-area {
        flex-direction: column;
    }

    .profile-save-button,
    .profile-logout-button {
        width: 100%;
    }

    .birth-date-fields {
        grid-template-columns: 1fr;
    }

    .profile-login-form .birth-date-fields {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: 1fr;

        text-align: center;
    }

    .footer-brand {
        grid-column: auto;
    }

    .footer-brand p {
        max-width: 100%;
    }

    .footer-links a,
    .footer-email {
        width: auto;
    }

    .footer-socials {
        justify-content: center;
    }

    .footer-bottom {
        align-items: center;

        text-align: center;
    }
}


/* =========================================================
   430px — أصغر الهواتف
========================================================= */

@media (max-width: 430px) {

    .header-container {
        gap: 3px;
    }

    .menu-button,
    .notification-button {
        width: 38px;
        height: 38px;

        min-width: 38px;
        flex-basis: 38px;

        border-radius: 10px;
    }

    .menu-button {
        gap: 4px;
    }

    .menu-button span {
        width: 19px;
        height: 2px;
    }

    .notification-icon {
        width: 20px;
        height: 20px;
    }

    .site-logo {
        font-size: 1.65rem;
    }

    /*
       مهم:
       زر تسجيل الدخول يبقى ظاهرًا على الجوال
       ولا يتم إخفاؤه.
    */

    .login-button {
        display: inline-flex;

        min-width: 70px;
        min-height: 36px;

        padding: 6px 8px;

        font-size: 11px;
    }

    .header-actions {
        gap: 3px;
    }

    .hero-content h1 {
        font-size: clamp(2.4rem, 12vw, 3.3rem);
    }

    .hero-actions {
        flex-direction: column;
    }

    .primary-button,
    .secondary-button {
        width: min(280px, 100%);
    }

    .account-dropdown {
        left: -8px;

        width: 175px;
    }

    .qafiyah-account-dropdown {
        min-width: 175px;
    }

    .notification-panel {
        top: calc(var(--header-height) + 8px);

        left: 10px;

        width: calc(100vw - 20px);
    }

    .side-menu {
        width: min(320px, 92vw);
    }

    .side-menu-header {
        padding-left: 14px;
        padding-right: 14px;
    }

    .user-section {
        margin: 15px;
    }

    .poet-card-image {
        width: 95px;
        height: 95px;
    }

    .about-mission-card {
        padding: 25px 18px;
    }
}


/* =========================================================
   الهواتف بوضع أفقي
========================================================= */

@media (max-height: 520px) and (orientation: landscape) {

    .hero-section {
        min-height: auto;

        padding-top: 45px;
        padding-bottom: 45px;
    }

    .page-hero {
        min-height: auto;

        padding-top: 45px;
        padding-bottom: 45px;
    }

    .login-modal {
        align-items: flex-start;
    }

    .login-box {
        margin: 10px 0;

        max-height: calc(100dvh - 20px);
    }

    .side-menu {
        overflow-y: auto;
    }
}


/* =========================================================
   أجهزة اللمس
========================================================= */

@media (hover: none) {

    .menu-button:hover,
    .notification-button:hover,
    .login-button:hover,
    .section-card:hover,
    .article-card:hover,
    .poet-card:hover,
    .about-service:hover,
    .primary-button:hover,
    .secondary-button:hover {
        transform: none;
    }

    .article-card:hover .article-card-image img {
        transform: none;
    }
}


/* =========================================================
   iOS / Safari
========================================================= */

@supports (-webkit-touch-callout: none) {

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .site-header {
        padding-top: env(safe-area-inset-top);
    }

    .side-menu {
        padding-bottom:
            max(15px, env(safe-area-inset-bottom));
    }

    .login-modal {
        padding-bottom:
            max(12px, env(safe-area-inset-bottom));
    }
}


/* =========================================================
   منع الخروج الأفقي
========================================================= */

.site-header,
.hero-section,
.site-sections,
.page-hero,
.articles-toolbar,
.articles-list,
.poets-list,
.content-section,
.profile-page,
.about-final,
.site-footer {
    max-width: 100%;
}


/* =========================================================
   تقليل الحركة لمن يفضل ذلك
========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.about-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(203, 153, 126, 0.12);
    color: var(--color-accent-dark);
    flex-shrink: 0;
}

.about-icon svg {
    width: 32px;
    height: 32px;
    display: block;
}