/* ============================================================
   Base CSS — AvalServer
   ============================================================ */

/* ==================== Reset ==================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-fa);
    background-color: var(--color-white);
    color: var(--color-text);
    direction: rtl;
    text-align: right;
    line-height: 1.8;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ==================== Typography ==================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-primary-navy);
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    color: var(--color-text);
    margin-bottom: 1rem;
    line-height: 1.9;
}

p:last-child {
    margin-bottom: 0;
}

small {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

strong, b {
    font-weight: 700;
    color: var(--color-primary-navy);
}

/* ==================== Links ==================== */
a {
    color: var(--color-royal-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-electric-blue);
}

/* ==================== Lists ==================== */
ul, ol {
    margin-bottom: 1rem;
    padding-right: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

ul li::marker {
    color: var(--color-champagne-gold);
}

/* ==================== Images ==================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==================== Container ==================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-wide {
    max-width: 1440px;
}

.container-narrow {
    max-width: 800px;
}

/* ==================== Sections ==================== */
.section {
    padding: 4rem 0;
}

.section-sm {
    padding: 2.5rem 0;
}

.section-lg {
    padding: 6rem 0;
}

.section-off-white {
    background-color: var(--color-off-white);
}

.section-sky-blue {
    background-color: var(--color-sky-blue);
}

.section-navy {
    background: var(--gradient-navy);
    color: var(--color-white);
}

.section-navy h1,
.section-navy h2,
.section-navy h3,
.section-navy h4 {
    color: var(--color-white);
}

.section-navy p {
    color: var(--color-sky-blue);
}

/* ==================== Section Titles ==================== */
.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primary-navy);
    margin-bottom: 1rem;
    position: relative;
}

.section-title.center {
    text-align: center;
}

.section-title.center::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--gradient-gold);
    margin: 1rem auto 0;
    border-radius: 2px;
}

.section-description {
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.9;
    margin-bottom: 2.5rem;
}

/* ==================== Eyebrow ==================== */
.eyebrow {
    display: inline-block;
    color: var(--color-champagne-gold);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-md);
    font-family: var(--font-fa);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    text-decoration: none;
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2.25rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

/* Primary (Blue) */
.btn-primary {
    background: var(--gradient-blue);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--color-electric-blue);
    color: var(--color-white);
    box-shadow: var(--shadow-glow-blue);
    transform: translateY(-2px);
}

/* Gold */
.btn-gold {
    background: var(--gradient-gold);
    color: var(--color-primary-navy);
    box-shadow: var(--shadow-md);
}

.btn-gold:hover {
    color: var(--color-primary-navy);
    box-shadow: var(--shadow-glow-gold);
    transform: translateY(-2px);
}

/* Outline */
.btn-outline {
    background: transparent;
    color: var(--color-royal-blue);
    border-color: var(--color-royal-blue);
}

.btn-outline:hover {
    background: var(--color-royal-blue);
    color: var(--color-white);
    transform: translateY(-2px);
}

/* Outline Gold */
.btn-outline-gold {
    background: transparent;
    color: var(--color-champagne-gold);
    border-color: var(--color-champagne-gold);
}

.btn-outline-gold:hover {
    background: var(--color-champagne-gold);
    color: var(--color-white);
}

/* Navy */
.btn-navy {
    background: var(--color-primary-navy);
    color: var(--color-white);
}

.btn-navy:hover {
    background: var(--color-deep-navy);
    color: var(--color-white);
}

/* ==================== Card ==================== */
.card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--color-electric-blue);
}

.card-header {
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary-navy);
    margin-bottom: 0.5rem;
}

.card-body {
    color: var(--color-text);
}

/* ==================== Grid ==================== */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ==================== Utilities ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--color-primary-navy); }
.text-secondary { color: var(--color-text-secondary); }
.text-gold { color: var(--color-champagne-gold); }
.text-blue { color: var(--color-royal-blue); }
.text-white { color: var(--color-white); }

.bg-white { background-color: var(--color-white); }
.bg-off-white { background-color: var(--color-off-white); }
.bg-sky-blue { background-color: var(--color-sky-blue); }
.bg-navy { background-color: var(--color-primary-navy); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.hidden { display: none; }

/* ==================== Rich Text (Wagtail) ==================== */
.rich-text h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.rich-text h3 {
    font-size: 1.35rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.rich-text p {
    margin-bottom: 1.25rem;
}

.rich-text ul,
.rich-text ol {
    margin-bottom: 1.25rem;
    padding-right: 1.5rem;
}

.rich-text blockquote {
    border-right: 4px solid var(--color-champagne-gold);
    padding: 0.5rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--color-gold-light);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-style: italic;
}

.rich-text a {
    color: var(--color-royal-blue);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.rich-text a:hover {
    border-bottom-color: var(--color-royal-blue);
}

.rich-text img {
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-off-white);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-secondary);
}

/* ==================== Selection ==================== */
::selection {
    background: var(--color-champagne-gold);
    color: var(--color-white);
}

/* ==================== Focus ==================== */
:focus-visible {
    outline: 2px solid var(--color-electric-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ==================== Responsive ==================== */
@media (max-width: 992px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.35rem; }

    .section { padding: 3rem 0; }
    .section-lg { padding: 4rem 0; }

    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    body { font-size: 15px; }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .container { padding: 0 1rem; }

    .section { padding: 2.5rem 0; }
    .section-lg { padding: 3rem 0; }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .btn-lg {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }

    .card {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.35rem; }

    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
}