/**
 * نظام إدارة المحتوى - المركز الجغرافي الملكي الأردني
 * "Sovereign Minimal" Theme: Official, Authoritative, Clean
 */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@200;300;400;500;700;800;900&display=swap');

:root {
    /* Color Palette */
    --primary-blue: #0A2B4E;
    /* Deep Government Blue */
    --secondary-gold: #C5A059;
    /* Wheat Gold Accent */
    --palm-green: #2B5B4C;
    /* Palm Green alternative */

    --bg-cold-gray: #F4F7FC;
    /* Main Background */
    --card-white: #FFFFFF;
    /* Card Background */

    --text-primary: #2C3E50;
    /* Charcoal Text */
    --text-secondary: #6B7A8F;
    /* Medium Gray for meta data */
    --text-muted: #94A3B8;

    --border-color: #E2E8F0;

    /* Effects & Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-cold-gray);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    direction: rtl;
    /* Default for Arabic */
}

[dir="ltr"] body {
    direction: ltr;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Tajawal', sans-serif;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

button,
input,
select,
textarea {
    font-family: 'Tajawal', sans-serif;
}

a {
    transition: var(--transition);
    text-decoration: none;
}

/* Header System (Minimal Solid) */
.main-header {
    position: fixed;
    top: 40px;
    left: 0;
    width: 100%;
    background-color: var(--card-white);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    padding: 15px 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
}

.logo-wrap img {
    height: 90px;
    /* Increased logo size for better visibility */
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-inline-start: 1px solid var(--border-color);
    padding-inline-start: 15px;
}

.logo-text h1 {
    font-size: 16px;
    line-height: 1.3;
    margin: 0;
    color: var(--primary-blue);
    white-space: nowrap;
    font-weight: 800;
}

.logo-text span {
    font-size: 10px;
    color: var(--secondary-gold);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 3px;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    justify-content: flex-end;
}

/* Navigation */
.desktop-nav {
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    gap: 8px;
    /* Reduced gap to fit all items */
    list-style: none;
    justify-content: center;
}

.menu-item-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-wrap: nowrap;
}

.nav-menu .menu-item-wrapper a {
    color: var(--primary-blue);
    padding: 8px 10px;
    /* Reduced padding */
    font-weight: 700;
    font-size: 14px;
    /* Reduced font size to save space */
    border-radius: var(--radius-sm);
    white-space: nowrap !important;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu li .menu-item-wrapper a:hover,
.nav-menu li .menu-item-wrapper:hover a {
    color: var(--primary-blue);
    background-color: rgba(197, 160, 89, 0.08);
}

.nav-menu li .menu-item-wrapper a:hover i {
    color: var(--secondary-gold) !important;
}

.dropdown li.has-dropdown>.menu-item-wrapper>a i.fa-chevron-left,
.dropdown li.has-dropdown>.menu-item-wrapper>a i.fa-chevron-right {
    transition: transform 0.3s ease;
}

.dropdown li.has-dropdown:hover>.menu-item-wrapper>a i.fa-chevron-left {
    transform: translateX(-5px);
}

.dropdown li.has-dropdown:hover>.menu-item-wrapper>a i.fa-chevron-right {
    transform: translateX(5px);
}

.nav-menu li.has-dropdown:hover>.menu-item-wrapper a,
.nav-menu li.active>.menu-item-wrapper a {
    color: var(--primary-blue);
}

/* Dropdowns (Minimal White) */
.nav-menu>li {
    position: relative;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    width: max-content !important;
    background: #ffffff !important;
    border: 1px solid rgba(10, 43, 78, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    padding: 12px 0;
    display: none !important;
    /* Absolute hide */
    visibility: hidden;
    opacity: 0;
    z-index: 1000;
}

/* Ensure nested dropdowns are also hidden */
.dropdown .dropdown {
    display: none !important;
    visibility: hidden;
    opacity: 0;
}

/* Vertical Ancestry Line (Sovereign Style) */
.dropdown::before {
    content: '';
    position: absolute;
    top: 15px;
    bottom: 15px;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--secondary-gold), transparent);
    opacity: 0.3;
    left: 14px;
}

html[dir="rtl"] .dropdown::before {
    left: auto;
    right: 14px;
}

.nav-menu>li:hover>.dropdown {
    display: block !important;
    visibility: visible;
    opacity: 1;
}

.dropdown li {
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.dropdown li:last-child {
    border-bottom: none;
}

.nav-menu .dropdown li .menu-item-wrapper a {
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #0A2B4E !important;
    /* Deep Royal Blue */
    white-space: nowrap !important;
    /* Force single line */
    transition: all 0.2s ease;
    border-radius: 0;
}

.nav-menu .dropdown li:hover>.menu-item-wrapper>a,
.nav-menu .dropdown li .menu-item-wrapper a:hover {
    background: rgba(197, 160, 89, 0.1);
    color: #C5A059 !important;
    /* Official Gold */
    padding-inline-start: 32px;
}

.nav-menu li:hover>.dropdown,
.dropdown li:hover>.dropdown {
    display: block !important;
    visibility: visible;
    opacity: 1;
}

/* Nested Dropdowns (Premium Fly-out) */
.dropdown .dropdown {
    top: -12px !important;
    /* Align with parent padding */
    left: 100% !important;
    right: auto !important;
    margin-top: 0;
}

html[dir="rtl"] .dropdown .dropdown {
    left: auto !important;
    right: 100% !important;
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--secondary-gold);
    border-radius: 2px;
}

/* Cards (Standard Minimal) */
.card {
    background: var(--card-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 30px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-gold);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-blue);
    color: #fff;
    padding: 12px 25px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #0d3b6b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background-color: var(--secondary-gold);
    color: #fff;
    padding: 12px 25px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    display: inline-block;
    border: none;
}

/* Common Card Style */
.card {
    background: var(--card-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--secondary-gold);
}

/* Footer (Deep Authority) */
.main-footer {
    background-color: var(--primary-blue);
    color: #fff;
    padding: 80px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-title {
    color: var(--secondary-gold);
    font-size: 18px;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links li a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.footer-links li a:hover {
    color: #fff;
    padding-inline-start: 10px;
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* Animations */
[data-animate] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-animate].active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 24px;
    cursor: pointer;
}

/* Slider Navigation */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.slider-arrow:hover {
    background: var(--secondary-gold);
    border-color: var(--secondary-gold);
    transform: translateY(-50%) scale(1.1);
}

.slider-arrow.prev {
    left: 40px;
}

.slider-arrow.next {
    right: 40px;
}

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--secondary-gold);
    transform: scale(1.5);
    box-shadow: 0 0 10px var(--secondary-gold);
}

/* Slide Elements */
.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 1;
    transition: opacity 1.2s ease;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(10, 43, 78, 0.8), rgba(10, 43, 78, 0.35));
    z-index: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}

.slide-title {
    font-size: 56px !important;
    font-weight: 900 !important;
    color: #fff !important;
    margin-bottom: 25px;
    max-width: 850px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.8s 0.3s ease-out;
}

.slide-subtitle {
    font-size: 22px;
    color: rgba(255, 255, 255, 0.95) !important;
    max-width: 700px;
    margin-bottom: 40px;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.8s 0.5s ease-out;
}

.slide-actions {
    display: flex;
    gap: 15px;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.8s 0.7s ease-out;
}

.slide-actions .btn-accent {
    padding: 16px 45px;
    font-size: 17px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Active slide shows all text */
.slide.active .slide-title,
.slide.active .slide-subtitle,
.slide.active .slide-actions {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 992px) {
    .slide-title {
        font-size: 36px !important;
    }

    .slide-subtitle {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .header-container {
        justify-content: space-between;
        gap: 0;
    }

    .nav-menu {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .section-title h2 {
        font-size: 28px;
    }

    .slider-arrow {
        width: 40px;
        height: 40px;
    }

    .slider-arrow.prev {
        left: 15px;
    }

    .slider-arrow.next {
        right: 15px;
    }

    .slide-title {
        font-size: 28px !important;
    }

    .slide-subtitle {
        font-size: 16px;
    }

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

/* Welcome Section */
.welcome-section {
    padding: 100px 0;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    align-items: center;
}

.welcome-image-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: visible;
    box-shadow: var(--shadow-lg);
}

.welcome-image-wrapper>img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
    border-radius: 20px;
}

.delete-block-btn, .move-block-btn {
    position: absolute;
    top: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.2s;
    font-size: 12px;
}
.delete-block-btn { right: -10px; background: #ef4444; color: #fff; }
.delete-block-btn:hover { background: #dc2626; transform: scale(1.1); }

.move-up-btn { right: 25px; background: var(--primary-blue); color: #fff; }
.move-down-btn { right: 60px; background: var(--primary-blue); color: #fff; }
.move-block-btn:hover { background: #1e40af; transform: scale(1.1); }

.welcome-badge {
    position: absolute;
    bottom: -25px;
    right: -25px;
    width: 120px;
    height: 120px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border: 6px solid #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.welcome-badge img {
    width: 90px;
    height: auto;

}

.welcome-content h2 {
    font-size: 38px;
    color: var(--primary-blue);
    margin-bottom: 25px;
    position: relative;
}

.welcome-content h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 80px;
    height: 4px;
    background: var(--secondary-gold);
}

.welcome-text {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 35px;
}

.director-info {
    border-right: 4px solid var(--secondary-gold);
    padding-right: 20px;
}

.director-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-blue);
    display: block;
}

.director-title {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Announcements List */
.announcements-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.announcement-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.announcement-item:last-child {
    border-bottom: none;
}

.announcement-item:hover {
    transform: translateX(-5px);
}

.announcement-date {
    flex-shrink: 0;
    width: 65px;
    height: 65px;
    background: var(--bg-cold-gray);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
}

.announcement-date span:first-child {
    font-size: 20px;
    font-weight: 800;
}

.announcement-date span:last-child {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
}

.announcement-content h4 {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 5px;
}

.announcement-content h4 a {
    color: var(--text-main);
    text-decoration: none;
}

.announcement-content h4 a:hover {
    color: var(--primary-blue);
}

/* Multimedia Section */
.multimedia-section {
    padding: 120px 0;
    background: #06192d;
    /* Deep Midnight Blue - different from footer */
    color: #fff;
    position: relative;
    box-shadow: inset 0 20px 40px rgba(0, 0, 0, 0.2);
}

.multimedia-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
}

.video-box {
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 9;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.video-box iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.gallery-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.album-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 200px;
    cursor: pointer;
}

.album-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.album-card:hover img {
    transform: scale(1.1);
}

/* Organizational Structure Chart */
.org-chart-wrap {
    padding: 40px 0;
}

.org-header {
    text-align: center;
    margin-bottom: 50px;
}

.org-leadership-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 60px;
}

.org-node {
    padding: 15px 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-weight: 700;
    transition: var(--transition);
    text-align: center;
    position: relative;
    max-width: 250px;
}

.org-node:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.node-primary {
    background: var(--primary-blue);
    color: #fff;
}

.node-accent {
    background: var(--secondary-gold);
    color: #fff;
    font-size: 0.9em;
}

.node-secondary {
    background: #fff;
    color: var(--primary-blue);
    border: 1px solid var(--border-color);
    font-size: 0.85em;
}

.node-unit {
    background: #cbd5e1;
    /* Gray-300 */
    color: #1e293b;
    /* Gray-800 */
    font-size: 0.8em;
}

.org-side-units {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 900px;
    margin: 20px auto;
}

.org-directorates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.directorate-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.directorate-header {
    background: #eadbc8;
    /* Soft Brown */
    color: #4a3a2a;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
    border-right: 4px solid var(--secondary-gold);
}

.section-node {
    background: #f1f5f9;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
    color: var(--text-primary);
    border-right: 3px solid #cbd5e1;
    transition: var(--transition);
}

.section-node:hover {
    background: #e2e8f0;
    padding-inline-start: 20px;
}

.org-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 50px;
    padding: 20px;
    background: #fff;
    border-radius: var(--radius-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85em;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

@media (max-width: 992px) {
    .org-directorates-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .welcome-grid,
    .multimedia-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .org-directorates-grid {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------------------------- */
/* Content Rendering Support (Summernote Aligment & Media)                    */
/* -------------------------------------------------------------------------- */

article img,
.page-content img,
.post-content img,
.service-content img {
    max-width: 100%;
    height: auto !important;
    border-radius: var(--radius-md);
    margin: 15px 0;
}

/* Image Alignment Support */
.note-float-left,
.float-start {
    float: right;
    /* Correct for RTL: 'Start' is Right */
    margin-left: 20px;
    margin-bottom: 15px;
}

.note-float-right,
.float-end {
    float: left;
    /* Correct for RTL: 'End' is Left */
    margin-right: 20px;
    margin-bottom: 15px;
}

[dir="ltr"] .note-float-left,
[dir="ltr"] .float-start {
    float: left;
    margin-right: 20px;
}

[dir="ltr"] .note-float-right,
[dir="ltr"] .float-end {
    float: right;
    margin-left: 20px;
}

.note-align-center,
.align-center {
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Clearfix for floating images */
article::after,
.page-content::after,
.post-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Styled File Download Links from Editor */
.editor-file-link {
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.editor-file-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: #e2e8f0 !important;
    color: var(--primary-blue) !important;
}

/* Urgent Ticker Section */
.urgent-ticker-section {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    height: 45px;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: fixed;
    top: 160px;
    /* Adjusted for 40px accessibility bar + 120px header */
    /* Adjust this based on header height (90px logo + 30px padding) */
    left: 0;
    width: 100%;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* Adjust the main content spacer to account for the ticker */
.header-spacer {
    height: 205px;
    /* 40px bar + 120px header + 45px ticker */
}

.ticker-container {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 !important;
}

.ticker-label {
    background: #dc2626;
    /* Urgent Red by default */
    color: #fff;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-weight: 800;
    font-size: 14px;
    z-index: 2;
    position: relative;
    white-space: nowrap;
    box-shadow: 10px 0 20px rgba(0, 0, 0, 0.1);
}

html[dir="rtl"] .ticker-label {
    box-shadow: -10px 0 20px rgba(0, 0, 0, 0.1);
}

.ticker-label i {
    margin-inline-end: 10px;
    animation: pulse 2s infinite;
}

.ticker-content {
    flex: 1;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.ticker-track {
    display: flex;
    white-space: nowrap;
    will-change: transform;
    animation: ticker-scroll 30s linear infinite;
}

.ticker-track:hover {
    animation-play-state: paused;
}

.ticker-item {
    padding: 0 40px;
    font-weight: 600;
    font-size: 15px;
    color: var(--primary-blue);
    position: relative;
}

.ticker-item::after {
    content: '•';
    position: absolute;
    inset-inline-end: 0;
    color: var(--secondary-gold);
    font-size: 20px;
}

.ticker-item a {
    color: inherit;
    text-decoration: none;
}

.ticker-item a:hover {
    color: var(--secondary-gold);
}

/* Ticker Item Types */
.ticker-item.type-urgent {
    color: #dc2626;
}

.ticker-item.type-info {
    color: #2563eb;
}

.ticker-item.type-success {
    color: #16a34a;
}

/* Animations */
@keyframes ticker-scroll-ltr {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

@keyframes ticker-scroll-rtl {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(100%);
    }
}

.ticker-track {
    animation: ticker-scroll-ltr 30s linear infinite;
}

[dir="rtl"] .ticker-track {
    animation: ticker-scroll-rtl 30s linear infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .ticker-label span {
        display: none;
    }

    .ticker-label {
        padding: 0 15px;
    }

    .ticker-item {
        font-size: 13px;
        padding: 0 20px;
    }
}


/* Force Tajawal on CMS Content blocks to override editor inline styles */
.page-content,
.post-content,
.service-content,
.course-content,
.page-content *,
.post-content *,
.service-content *,
.course-content * {
    font-family: 'Tajawal', sans-serif !important;
}

/* --- Content Templates & Components --- */
.content-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 30px;
}
.grid-2col { grid-template-columns: 1fr 1fr; }
.grid-sidebar-right { grid-template-columns: 1fr 300px; }
.grid-sidebar-left { grid-template-columns: 300px 1fr; }

@media (max-width: 992px) {
    .grid-sidebar-right, .grid-sidebar-left, .grid-2col { grid-template-columns: 1fr !important; }
}

.content-sidebar {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 25px;
    height: fit-content;
}

.content-sidebar h4 {
    color: var(--primary-blue);
    border-bottom: 2px solid var(--secondary-gold);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.sidebar-links {
    list-style: none;
    padding: 0;
}

.sidebar-links li {
    padding: 0;
    border-bottom: none;
    margin-bottom: 10px;
}

.sidebar-links li a {
    display: block;
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    color: var(--primary-blue);
    font-size: 15px;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.sidebar-links li a:hover {
    background: var(--primary-blue);
    color: #fff !important;
    border-color: var(--primary-blue);
    transform: translateX(-8px);
    box-shadow: var(--shadow-md);
}

html[dir="ltr"] .sidebar-links li a:hover {
    transform: translateX(8px);
}

.sidebar-links li a i {
    margin-inline-end: 10px;
    color: var(--secondary-gold);
}

.sidebar-links li a:hover i {
    color: #fff;
}

.content-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
}

.content-notice {
    background: rgba(197, 160, 89, 0.05);
    border-right: 5px solid var(--secondary-gold);
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 25px;
}

html[dir="ltr"] .content-notice {
    border-right: none;
    border-left: 5px solid var(--secondary-gold);
}

.content-alert {
    background: #fff1f2;
    border-right: 5px solid #ef4444;
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 25px;
}

html[dir="ltr"] .content-alert {
    border-right: none;
    border-left: 5px solid #ef4444;
}

/* --- More Content Templates --- */
.grid-3col { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 991px) { .grid-3col { grid-template-columns: 1fr; } }

/* Quote Template */
.content-quote {
    margin: 40px 0;
    padding: 30px 40px;
    background: #f8fafc;
    border-right: 5px solid var(--secondary-gold);
    border-radius: var(--radius-md);
    position: relative;
    font-style: italic;
    font-size: 1.1em;
    color: var(--primary-blue);
}
html[dir="ltr"] .content-quote {
    border-right: none;
    border-left: 5px solid var(--secondary-gold);
}
.content-quote::before {
    content: '“';
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 80px;
    color: var(--secondary-gold);
    opacity: 0.2;
    font-family: serif;
}
html[dir="ltr"] .content-quote::before {
    right: auto;
    left: 20px;
}

/* Download List Template */
.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    margin-bottom: 15px;
}
.download-item:hover {
    border-color: var(--primary-blue);
    background: #f0f7ff;
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}
.download-info { display: flex; align-items: center; gap: 15px; }
.download-icon {
    width: 45px;
    height: 45px;
    background: rgba(30, 64, 175, 0.1);
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 20px;
}
.download-text h5 { margin: 0; font-size: 16px; color: var(--text-primary); }
.download-text span { font-size: 12px; color: var(--text-muted); }
.download-btn {
    color: var(--secondary-gold);
    font-size: 18px;
}

/* --- Image Based Templates --- */
.content-img-block {
    display: flex;
    align-items: center;
    gap: 40px;
    margin: 40px 0;
}
@media (max-width: 768px) { .content-img-block { flex-direction: column !important; } }

.img-container {
    flex: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: #f1f5f9;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 2px dashed #cbd5e1;
}
.img-container::after {
    content: '\f03e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 40px;
    color: #cbd5e1;
    position: absolute;
    z-index: 0;
}
.img-container img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    position: relative; 
    z-index: 1; 
    display: block; 
    min-height: 250px;
}

.text-container { flex: 1.2; }

.img-grid-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 30px 0;
}
.gallery-item {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}
.gallery-item:hover { transform: scale(1.03); box-shadow: var(--shadow-lg); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

.profile-card {
    max-width: 350px;
    text-align: center;
    padding: 30px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    margin: 20px auto;
}
.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 3px solid var(--secondary-gold);
}
.profile-img img { width: 100%; height: 100%; object-fit: cover; }
.profile-card h4 { margin: 10px 0 5px; color: var(--primary-blue); }
.profile-card p { font-size: 14px; color: var(--text-muted); }

/* --- Additional Templates --- */
.feature-box {
    padding: 25px;
    border-radius: 15px;
    background: #fff;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}
.feature-box:hover { transform: translateY(-5px); border-color: var(--secondary-gold); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.feature-icon {
    width: 50px;
    height: 50px;
    background: rgba(197, 160, 89, 0.1);
    color: var(--secondary-gold);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 20px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    text-align: center;
    margin: 30px 0;
}
.stat-box h2 { font-size: 36px; color: var(--primary-blue); margin: 0; }
.stat-box p { font-size: 14px; color: var(--text-muted); margin: 5px 0 0; }

[dir="ltr"] .content-img-block { flex-direction: row; }
[dir="ltr"] .content-img-block[style*="row-reverse"] { flex-direction: row-reverse !important; }

/* --- Table Styling for Content --- */
.content-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 15px;
    background: #fff;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.content-table thead tr {
    background-color: var(--primary-blue);
    color: #ffffff;
    text-align: right;
}

[dir="ltr"] .content-table thead tr {
    text-align: left;
}

.content-table th,
.content-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.content-table tbody tr {
    transition: background-color 0.2s ease;
}

.content-table tbody tr:nth-of-type(even) {
    background-color: #f8fafc;
}

.content-table tbody tr:hover {
    background-color: #f1f5f9;
}

.content-table tbody tr:last-of-type {
    border-bottom: 2px solid var(--secondary-gold);
}