/* =========================================
   WEBFA24 - RULES PAGE STYLES
   Brand Colors: Webfa Blue & Dark Navy
========================================= */

/* Smooth Scrolling for Anchor Links */
html {
    scroll-behavior: smooth;
}

:root {
    --webfa-navy: #0d3c6c;
    --webfa-navy-dark: #092646;
    --webfa-blue: #1e73be;
    --webfa-blue-light: #eaf2fa;
    --webfa-gray-bg: #f5f7fa;
    --webfa-border: #e2e8f0;
    --webfa-text-main: #1e293b;
    --webfa-text-muted: #64748b;
}

.webfa-rules-page {
    direction: rtl;
    background: var(--webfa-gray-bg);
    color: var(--webfa-text-main);
    font-family: inherit;
    line-height: 2;
}

.webfa-rules-page *,
.webfa-rules-page *::before,
.webfa-rules-page *::after {
    box-sizing: border-box;
}

/* Container */
.webfa-rules-container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

/* =========================================
   HERO SECTION
========================================= */
.webfa-rules-hero {
    background: linear-gradient(135deg, var(--webfa-navy-dark) 0%, var(--webfa-navy) 100%);
    color: #fff;
    padding: 65px 0 70px;
    position: relative;
    overflow: hidden;
}

.webfa-rules-hero::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    border: 70px solid rgba(30, 115, 190, 0.15);
    border-radius: 50%;
    left: -120px;
    top: -130px;
}

.webfa-rules-hero::before {
    content: "";
    position: absolute;
    width: 5px;
    height: 180px;
    background: var(--webfa-blue);
    right: 0;
    top: 0;
}

.webfa-rules-badge {
    display: inline-block;
    background: var(--webfa-blue);
    color: #fff;
    padding: 4px 15px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 12px;
}

.webfa-rules-hero h1 {
    margin: 0 0 10px;
    color: #fff;
    font-size: 34px;
    font-weight: 800;
}

.webfa-rules-hero p {
    max-width: 700px;
    margin: 0;
    color: #e2e8f0;
    font-size: 15px;
}

/* =========================================
   MAIN LAYOUT
========================================= */
.webfa-rules-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
    padding-top: 40px;
    padding-bottom: 70px;
}

/* =========================================
   SIDEBAR MENU (STICKY ON SCROLL)
========================================= */
.webfa-rules-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 30px; /* فاصله از بالای مرورگر هنگام اسکرول */
    z-index: 99;
    align-self: start;
}

/* تنظیم فاصله سایدبار در صورت لاگین بودن ادمین وردپرس */
body.logged-in .webfa-rules-sidebar {
    top: 62px;
}

.webfa-rules-menu {
    background: #fff;
    border: 1px solid var(--webfa-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(13, 60, 108, 0.06);
    max-height: calc(100vh - 80px); /* اسکرول داخلی در صورت طولانی بودن منو */
    overflow-y: auto;
}

.webfa-rules-menu-title {
    background: var(--webfa-navy);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 17px 20px;
    border-right: 4px solid var(--webfa-blue);
    position: sticky;
    top: 0;
    z-index: 2;
}

.webfa-rules-menu a {
    display: block;
    color: var(--webfa-text-main);
    text-decoration: none;
    font-size: 13px;
    padding: 11px 18px;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.webfa-rules-menu a:last-child {
    border-bottom: 0;
}

.webfa-rules-menu a:hover {
    color: var(--webfa-blue);
    background: var(--webfa-blue-light);
    padding-right: 23px;
}

/* =========================================
   CONTENT AREA
========================================= */
.webfa-rules-content {
    min-width: 0;
}

/* Intro Box */
.webfa-rules-intro {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--webfa-border);
    padding: 20px 22px;
    margin-bottom: 22px;
    border-right: 4px solid var(--webfa-blue);
}

.webfa-rules-intro-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    background: var(--webfa-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.webfa-rules-intro strong {
    display: block;
    color: var(--webfa-navy);
    font-size: 15px;
    margin-bottom: 3px;
}

.webfa-rules-intro p {
    margin: 0;
    color: var(--webfa-text-muted);
    font-size: 13px;
}

/* Rule Sections */
.webfa-rule-section {
    display: grid;
    grid-template-columns: 65px 1fr;
    gap: 18px;
    background: #fff;
    border: 1px solid var(--webfa-border);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 20px;
    scroll-margin-top: 30px;
    transition: box-shadow 0.2s ease;
}

.webfa-rule-section:hover {
    box-shadow: 0 7px 30px rgba(13, 60, 108, 0.08);
}

.webfa-rule-number {
    width: 54px;
    height: 54px;
    background: var(--webfa-navy);
    color: #fff;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 15px;
    font-weight: 800;
    position: relative;
}

.webfa-rule-number::after {
    content: "";
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 16px;
    height: 16px;
    background: var(--webfa-blue);
    border-radius: 50%;
}

.webfa-rule-body h2 {
    margin: 0 0 13px;
    color: var(--webfa-navy);
    font-size: 20px;
    font-weight: 800;
    position: relative;
    padding-bottom: 9px;
}

.webfa-rule-body h2::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 38px;
    height: 3px;
    background: var(--webfa-blue);
    border-radius: 10px;
}

.webfa-rule-body p {
    margin: 0 0 12px;
    color: #334155;
    font-size: 14px;
}

.webfa-rule-body p:last-child {
    margin-bottom: 0;
}

/* Warning Box */
.webfa-warning {
    background: #f0f7ff;
    border: 1px solid #cce3f7;
    border-right: 4px solid var(--webfa-blue);
    border-radius: 8px;
    padding: 16px 18px;
    margin: 18px 0;
}

.webfa-warning strong {
    color: var(--webfa-navy);
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.webfa-warning p {
    margin: 0;
    color: #1e293b;
}

/* Info Cards */
.webfa-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.webfa-info-card {
    border: 1px solid var(--webfa-border);
    border-radius: 10px;
    padding: 20px;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
}

.webfa-info-card::before {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--webfa-blue);
}

.webfa-info-card span {
    display: inline-block;
    color: var(--webfa-blue);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
}

.webfa-info-card h3 {
    margin: 0 0 5px;
    font-size: 16px;
    color: var(--webfa-navy);
}

.webfa-info-card p {
    margin: 0;
    font-size: 13px;
    color: var(--webfa-text-muted);
}

/* Contact Footer Note */
.webfa-rules-footer-note {
    background: var(--webfa-navy-dark);
    color: #fff;
    border-radius: 10px;
    padding: 22px;
    margin-top: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.webfa-rules-footer-note span {
    color: #94a3b8;
    font-size: 13px;
}

.webfa-rules-footer-note strong {
    color: #fff;
    font-size: 15px;
}

/* =========================================
   RESPONSIVE DESIGN
========================================= */
@media (max-width: 900px) {
    .webfa-rules-layout {
        grid-template-columns: 1fr;
    }
    .webfa-rules-sidebar {
        position: relative;
        top: auto !important;
    }
    .webfa-rules-menu {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        max-height: none;
    }
    .webfa-rules-menu-title {
        grid-column: 1 / -1;
        position: static;
    }
    .webfa-rules-menu a {
        border-left: 1px solid #eee;
    }
}

@media (max-width: 650px) {
    .webfa-rules-container {
        width: min(100% - 24px, 1180px);
    }
    .webfa-rules-hero h1 {
        font-size: 25px;
    }
    .webfa-rule-section {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 20px;
    }
    .webfa-info-grid {
        grid-template-columns: 1fr;
    }
    .webfa-rules-footer-note {
        flex-direction: column;
        align-items: flex-start;
    }
}