/* ===== CSS RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0F2A47;
    --accent: #12A594;
    --accent-hover: #0E8C7D;
    --bg: #F7F9FB;
    --text: #1E1E1E;
    --text-light: #5A6478;
    --white: #FFFFFF;
    --shadow-sm: 0 2px 8px rgba(15, 42, 71, 0.06);
    --shadow-md: 0 4px 20px rgba(15, 42, 71, 0.1);
    --shadow-lg: 0 8px 40px rgba(15, 42, 71, 0.14);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --font-ar: 'Noto Sans Arabic', 'Inter', system-ui, sans-serif;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Arabic font when RTL */
html[dir="rtl"] body {
    font-family: var(--font-ar);
}

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

img, svg {
    max-width: 100%;
}

/* Keep SVGs inline inside buttons and badges */
.btn svg,
.badge svg,
.social-icon svg,
.skill-tag svg,
.cert-badge svg,
.edu-icon svg,
.timeline-content svg {
    display: block;
}

/* ===== REVEAL ANIMATION ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s var(--transition), transform 0.7s var(--transition);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

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

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--accent);
    margin: 12px auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 40px;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 42, 71, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: box-shadow var(--transition);
}

.navbar.scrolled {
    box-shadow: 0 2px 20px rgba(15, 42, 71, 0.3);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 2px;
    transition: color var(--transition);
}

.nav-logo:hover {
    color: var(--accent);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 3px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}

.lang-btn:hover {
    color: var(--white);
}

.lang-btn.active {
    background: var(--accent);
    color: var(--white);
}

/* Nav Links */
.nav-links {
    display: flex;
    list-style: none;
    gap: 28px;
    align-items: center;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active-link {
    color: var(--accent);
}

.nav-links a.active-link::after {
    width: 100%;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: all var(--transition);
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== HERO ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(170deg, var(--primary) 0%, #162d4d 50%, #1a3a5c 100%);
    padding: 100px 24px 60px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(18, 165, 148, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(18, 165, 148, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-image-wrapper {
    margin-bottom: 24px;
    display: inline-block;
}

.hero-image-placeholder {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(18, 165, 148, 0.3);
    margin: 0 auto;
}

.hero-image-placeholder svg {
    width: 100%;
    height: 100%;
}

.hero-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.hero-name {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 1.15rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 20px;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.location-badge {
    background: rgba(18, 165, 148, 0.15);
    color: var(--accent);
    border: 1px solid rgba(18, 165, 148, 0.3);
}

.lang-badge {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.15);
}

.hero-ctas {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    font-family: var(--font);
}

html[dir="rtl"] .btn {
    font-family: var(--font-ar);
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(18, 165, 148, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,0.4);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

/* ===== SOCIAL ICONS ===== */
.hero-socials {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    transition: all var(--transition);
}

.social-icon:hover {
    background: var(--accent);
    color: var(--white);
    transform: translateY(-2px);
}

.social-icon svg {
    width: 18px;
    height: 18px;
}

/* ===== ABOUT ===== */
.about {
    background: var(--white);
}

.about-content {
    max-width: 720px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.85;
    margin-bottom: 36px;
}

.about-highlights {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.highlight-item {
    text-align: center;
}

.highlight-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.2;
}

.highlight-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ===== PORTFOLIO ===== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* Make the last 2 items in the 5-item grid span nicely */
.portfolio-item:nth-child(4),
.portfolio-item:nth-child(5) {
    /* On 3-col layout, items 4-5 will be on row 2, centered */
}

.portfolio-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}

.portfolio-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.portfolio-image-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    flex-shrink: 0;
}

.portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.portfolio-item:hover .portfolio-img {
    transform: scale(1.04);
}

.portfolio-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0F2A47, #1a3a5c);
}

.portfolio-placeholder svg {
    width: 100%;
    height: 100%;
}

.portfolio-info {
    padding: 16px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.portfolio-info h3 {
    color: var(--primary);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.portfolio-info p {
    color: var(--text-light);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

/* Video Placeholder */
.video-placeholder {
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(135deg, #0F2A47, #1a3a5c);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition);
}

.video-placeholder:hover {
    transform: scale(1.02);
}

.video-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 16px;
    text-align: center;
}

.video-inner p {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
}

/* ===== EXPERIENCE / TIMELINE ===== */
.experience {
    background: var(--white);
}

.timeline {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding-left: 40px;
}

html[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), rgba(18, 165, 148, 0.2));
}

html[dir="rtl"] .timeline::before {
    left: auto;
    right: 0;
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.timeline-dot {
    position: absolute;
    left: -46px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--white);
    box-shadow: 0 0 0 3px rgba(18, 165, 148, 0.2);
}

html[dir="rtl"] .timeline-dot {
    left: auto;
    right: -46px;
}

.timeline-content {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.timeline-date {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(18, 165, 148, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.timeline-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.timeline-content h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 12px;
}

.timeline-content p {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.75;
}

/* ===== SKILLS ===== */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--white);
    border: 1px solid rgba(18, 165, 148, 0.2);
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.skill-tag:hover {
    border-color: var(--accent);
    background: rgba(18, 165, 148, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.skill-tag small {
    background: var(--accent);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== EDUCATION ===== */
.education {
    background: var(--white);
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.edu-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid transparent;
}

.edu-card:hover {
    border-color: rgba(18, 165, 148, 0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.edu-icon {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.edu-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.edu-card p {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 8px;
}

.edu-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Certifications */
.subsection-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 20px;
}

.cert-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.cert-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(18, 165, 148, 0.08);
    border: 1px solid rgba(18, 165, 148, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
}

.cert-badge svg {
    flex-shrink: 0;
}

/* ===== ARTICLES ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.article-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
}

.article-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition);
}

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

.article-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-card:hover {
    border-color: rgba(18, 165, 148, 0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.article-date {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 10px;
}

.article-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-card p {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 16px;
    flex: 1;
}

.read-more {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    transition: color var(--transition);
    align-self: flex-start;
}

.read-more:hover {
    color: var(--accent-hover);
}

/* ===== CONTACT ===== */
.contact {
    background: linear-gradient(170deg, var(--primary) 0%, #162d4d 100%);
    color: var(--white);
    text-align: center;
}

.contact .section-title {
    color: var(--white);
}

.contact .section-title::after {
    background: var(--accent);
}

.contact-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 1.05rem;
    max-width: 550px;
    margin: 0 auto 32px;
}

.contact-ctas {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.contact-socials {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-icon-lg {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    padding: 8px 20px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    transition: all var(--transition);
}

.social-icon-lg:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--primary);
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 2px;
}

.footer-copy {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
}

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    transition: color var(--transition);
    z-index: 2001;
}

html[dir="rtl"] .lightbox-close {
    right: auto;
    left: 24px;
}

.lightbox-close:hover {
    color: var(--accent);
}

.lightbox-body {
    max-width: 85vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-body img {
    max-width: 85vw;
    max-height: 85vh;
    border-radius: var(--radius);
    object-fit: contain;
}

.lightbox-body svg {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius);
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 900px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .education-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-name {
        font-size: 2.2rem;
    }

    .section {
        padding: 60px 0;
    }
}

/* Mobile */
@media (max-width: 700px) {
    /* Ensure tap targets are at least 44px */
    .lang-btn {
        min-height: 32px;
        min-width: 32px;
    }

    .social-icon {
        width: 44px;
        height: 44px;
    }

    .social-icon-lg {
        padding: 12px 20px;
    }

    .skill-tag {
        padding: 12px 18px;
    }

    .read-more {
        padding: 8px 0;
    }
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 42, 71, 0.98);
        flex-direction: column;
        justify-content: center;
        gap: 24px;
        padding: 80px 24px;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
    }

    html[dir="rtl"] .nav-links {
        transform: translateX(-100%);
    }

    .nav-links.open {
        transform: translateX(0);
    }

    .nav-links a {
        font-size: 1.3rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-name {
        font-size: 1.8rem;
    }

    .hero-title {
        font-size: 1rem;
    }

    .hero-image-placeholder {
        width: 100px;
        height: 100px;
    }

    .hero-ctas {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .about-highlights {
        gap: 28px;
    }

    .highlight-number {
        font-size: 1.8rem;
    }

    .timeline {
        padding-left: 30px;
    }

    html[dir="rtl"] .timeline {
        padding-left: 0;
        padding-right: 30px;
    }

    .timeline-dot {
        left: -36px;
        width: 12px;
        height: 12px;
    }

    html[dir="rtl"] .timeline-dot {
        left: auto;
        right: -36px;
    }

    .timeline-content {
        padding: 20px;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .lang-switcher {
        order: -1;
    }

    .nav-right {
        gap: 8px;
    }

    .lang-btn {
        font-size: 0.7rem;
        padding: 3px 6px;
    }

    .contact-ctas {
        flex-direction: column;
        align-items: center;
    }

    .contact-ctas .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

/* Small Mobile */
@media (max-width: 400px) {
    .hero-name {
        font-size: 1.5rem;
    }

    .section {
        padding: 50px 0;
    }

    .container {
        padding: 0 16px;
    }

    .nav-container {
        padding: 0 16px;
    }
}

/* ===== PRINT ===== */
@media print {
    .navbar, .hamburger, .lang-switcher, .lightbox, .back-to-top {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding: 40px 0;
    }

    .section {
        padding: 30px 0;
    }
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(18, 165, 148, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

html[dir="rtl"] .back-to-top {
    right: auto;
    left: 24px;
}

/* ===== ARTICLE PAGE ===== */
.article-page {
    padding-top: 100px;
    min-height: 100vh;
    background: var(--bg);
}

.article-header {
    background: linear-gradient(170deg, var(--primary) 0%, #162d4d 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.article-header-image {
    width: 100%;
    max-height: 340px;
    overflow: hidden;
}

.article-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.6;
    mix-blend-mode: luminosity;
}

.article-header-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 24px 40px;
    position: relative;
    z-index: 1;
}

.article-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(18, 165, 148, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 24px;
    transition: color var(--transition);
}

.article-back:hover {
    color: var(--accent);
}

.article-back svg {
    width: 16px;
    height: 16px;
}

.article-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.35;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-body {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 24px 60px;
}

.article-body h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    margin: 40px 0 16px;
}

.article-body h3 {
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--primary);
    margin: 28px 0 12px;
}

.article-body p {
    font-size: 1.02rem;
    line-height: 1.85;
    color: var(--text);
    margin-bottom: 20px;
}

.article-body ul, .article-body ol {
    margin: 0 0 20px 24px;
    font-size: 1.02rem;
    line-height: 1.85;
    color: var(--text);
}

html[dir="rtl"] .article-body ul,
html[dir="rtl"] .article-body ol {
    margin-left: 0;
    margin-right: 24px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin: 24px 0;
    background: rgba(18, 165, 148, 0.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-light);
}

html[dir="rtl"] .article-body blockquote {
    border-left: none;
    border-right: 3px solid var(--accent);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.article-body blockquote p {
    margin-bottom: 0;
}

.article-body .example-box {
    background: var(--white);
    border: 1px solid rgba(18, 165, 148, 0.15);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin: 24px 0;
}

.article-body .example-box h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.article-body .example-box p {
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.article-body .example-box p:last-child {
    margin-bottom: 0;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid rgba(15, 42, 71, 0.1);
}

.article-tag {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent);
    background: rgba(18, 165, 148, 0.08);
    padding: 4px 12px;
    border-radius: 12px;
}

/* Article nav link - on article pages, Articles link should be active */
.nav-links a.article-active {
    color: var(--accent);
}

.nav-links a.article-active::after {
    width: 100%;
}

/* Responsive article page */
@media (max-width: 700px) {
    .article-header h1 {
        font-size: 1.5rem;
    }

    .article-body {
        padding: 32px 20px 48px;
    }

    .article-body h2 {
        font-size: 1.2rem;
    }

    .article-meta {
        font-size: 0.78rem;
    }

    .article-header-image {
        max-height: 200px;
    }

    .article-header-inner {
        padding: 32px 20px 28px;
    }
}
.intro-video {
    width: 100%;
    max-width: 700px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    display: block;
    background-color: #0F2A47;
}

/* ===== ARTICLE OVERLAY (In-Page Article Viewer) ===== */
.article-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 42, 71, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.article-overlay-close {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 10001;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    color: var(--primary);
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
}

html[dir="rtl"] .article-overlay-close {
    right: auto;
    left: 24px;
}

.article-overlay-close:hover {
    background: var(--accent);
    color: var(--white);
    transform: rotate(90deg);
}

.article-overlay-content {
    position: relative;
    z-index: 10000;
    width: 90%;
    max-width: 860px;
    max-height: 90vh;
    background: var(--bg);
    border-radius: var(--radius);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-lg);
    animation: articleSlideUp 0.4s ease-out;
}

.article-overlay-content::-webkit-scrollbar {
    width: 6px;
}

.article-overlay-content::-webkit-scrollbar-track {
    background: transparent;
}

.article-overlay-content::-webkit-scrollbar-thumb {
    background: rgba(18, 165, 148, 0.3);
    border-radius: 3px;
}

.article-overlay-content::-webkit-scrollbar-thumb:hover {
    background: rgba(18, 165, 148, 0.5);
}

@keyframes articleSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Article overlay loading state */
.articles-grid:empty::before {
    content: 'Loading articles...';
    display: block;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 0.95rem;
}
.fiverr-link {
    color: #1DBF73; /* Fiverr's signature green — swap for your ACHARID brand color if you'd rather match your site's palette */
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

.fiverr-link:hover {
    color: #19a463;
}

.article-thumbnail {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: block;
}
/* ===================================================== */
/* ====== NEW COMPONENTS (added in revision) ============ */
/* ===================================================== */

/* ===== SKIP LINK (a11y) ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: var(--white);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 3000;
    border-radius: 0 0 var(--radius-sm) 0;
    transition: top var(--transition);
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* Focus styles for keyboard users */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== ARTICLE CARD LINK (full-card click target) ===== */
.article-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.article-card-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: var(--radius);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.85rem;
}

.breadcrumb-sep {
    color: rgba(255, 255, 255, 0.4);
}

/* ===== ARTICLE META ICONS ===== */
.article-meta svg {
    vertical-align: middle;
    margin-right: 4px;
}

html[dir="rtl"] .article-meta svg {
    margin-right: 0;
    margin-left: 4px;
}

/* ===== ARTICLE CTA (call to action at end of article body) ===== */
.article-cta {
    margin-top: 48px;
    padding: 32px 24px;
    background: linear-gradient(135deg, rgba(18, 165, 148, 0.08) 0%, rgba(18, 165, 148, 0.03) 100%);
    border: 1px solid rgba(18, 165, 148, 0.2);
    border-radius: var(--radius);
    text-align: center;
}

.article-cta h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.article-cta p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.article-cta .btn {
    margin-top: 4px;
}

/* ===== RELATED ARTICLES SECTION ===== */
.related-articles {
    background: var(--white);
    padding: 60px 0;
    border-top: 1px solid rgba(15, 42, 71, 0.06);
}

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

@media (max-width: 900px) {
    .related-articles .articles-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===== AD SLOT (single, clean, contained) ===== */
.ad-slot {
    max-width: 728px;
    margin: 24px auto;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px dashed rgba(15, 42, 71, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.ad-slot::before {
    content: 'Advertisement';
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== HERO IMAGE WIDTH/HEIGHT (prevent layout shift) ===== */
.hero-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

/* ===== HONOR REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ===== PRINT ===== */
@media print {
    .ad-slot, .article-cta, .related-articles, .back-to-top,
    .lightbox, .hamburger, .lang-switcher, .skip-link {
        display: none !important;
    }
}

/* ===================================================== */
/* ====== MULTILANG ARTICLE SWITCHING ================== */
/* ===================================================== */
/* All 3 language variants (en/fr/ar) are embedded in the HTML.
   CSS shows only the variant matching <html lang>. main.js
   updates <html lang> when the user clicks EN/FR/AR. */

.article-title,
.article-body-content {
    display: none;
}

html[lang="en"] .article-title[data-article-lang="en"],
html[lang="fr"] .article-title[data-article-lang="fr"],
html[lang="ar"] .article-title[data-article-lang="ar"],
html[lang="en"] .article-body-content[data-article-lang="en"],
html[lang="fr"] .article-body-content[data-article-lang="fr"],
html[lang="ar"] .article-body-content[data-article-lang="ar"] {
    display: block;
}

/* The active article-title needs to inherit the same H1 styling as a regular h1 */
.article-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.35;
    margin-bottom: 16px;
}

@media (max-width: 700px) {
    .article-title {
        font-size: 1.5rem;
    }
}

/* RTL article body content (Arabic) — inherits from html[dir="rtl"] but
   we also set it explicitly on the body-content div for safety */
.article-body-content[data-article-lang="ar"] {
    text-align: right;
}

/* ===================================================== */
/* ====== AD CONTAINERS (restored) ===================== */
/* ===================================================== */

/* Banner ad wrapper — replaced the original inline-style divs */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    min-height: 90px;
}

/* Article-ad slot (inside article body, between thumbnail and content) */
.article-ad {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 24px 0;
    min-height: 90px;
}

/* Centered referral button block (effectivecpmnetwork "Explore Translation Resources") */
.ad-referral-block {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

/* Adsterra GIF referral banner (720x90) */
.ad-referral-banner {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.ad-referral-banner img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* The original .article-thumbnail styles already exist above.
   Just adding responsive width for safety */
.article-thumbnail {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: block;
}

/* On mobile, ad banners may overflow — let them scroll / shrink */
@media (max-width: 768px) {
    .ad-container,
    .article-ad {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===================================================== */
/* ====== MULTILANG ARTICLE CARDS ===================== */
/* ===================================================== */
/* Article cards (homepage #articles grid + related-articles on detail pages)
   embed 3 language versions of the title (h3) and excerpt (p).
   Show only the variant matching <html lang>. */

.article-card-title,
.article-card-excerpt {
    display: none;
}

html[lang="en"] .article-card-title[data-article-lang="en"],
html[lang="fr"] .article-card-title[data-article-lang="fr"],
html[lang="ar"] .article-card-title[data-article-lang="ar"],
html[lang="en"] .article-card-excerpt[data-article-lang="en"],
html[lang="fr"] .article-card-excerpt[data-article-lang="fr"],
html[lang="ar"] .article-card-excerpt[data-article-lang="ar"] {
    display: block;
}

/* The visible h3.article-card-title should inherit the original .article-card h3
   styling defined earlier in this file */
.article-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-card-excerpt {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 16px;
    flex: 1;
}

/* RTL excerpt alignment when in Arabic */
html[lang="ar"] .article-card-excerpt,
html[lang="ar"] .article-card-title {
    text-align: right;
}
