.main-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

/* ================= ENGLISH FONTS (OFFLINE) ================= */

/* Anton - titles */
@font-face {
    font-family: 'Anton';
    src: url('../fonts/Anton-Regular.ttf') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Inter - body font - weight 300 */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Light.ttf') format('ttf');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* Inter - body font - weight 400 */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Regular.ttf') format('ttf');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Inter - body font - weight 600 */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-SemiBold.ttf') format('ttf');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* Inter - body font - weight 700 */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Bold.ttf') format('ttf');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ================= PERSIAN FONTS ================= */

/* Yekan Bakh برای متن‌های معمولی */
@font-face {
    font-family: 'Yekan Bakh';
    src: url('../fonts/YekanBakh-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Peyda Black برای تیترهای خیلی درشت و خشن */
@font-face {
    font-family: 'Peyda';
    src: url('../fonts/PeydaWeb-Black.woff2') format('woff2');
    font-weight: 900; /* Black */
    font-style: normal;
    font-display: swap;
}

/* Kalameh Bold برای تیترهای فرعی */
@font-face {
    font-family: 'Kalameh';
    src: url('../fonts/KalamehWeb-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* 1. Tailwind-like Reset & Box-Sizing */
*, ::before, ::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: #e5e7eb;
}

html {
    scroll-behavior: smooth;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
}

body, h1, h2, h3, h4, p, ul, ol {
    margin: 0;
    padding: 0;
}

button, select, input {
    font-family: inherit;
    font-size: 100%;
    margin: 0;
}

/* 2. Variables */
:root {
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gray-900: #111827;
    --color-gray-800: #1f2937;
    --color-gray-700: #374151;
    --color-gray-500: #6b7280;
    --color-gray-400: #9ca3af;
    --color-red-600: #dc2626;
}

/* 3. Fonts */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-white);
    color: var(--color-gray-900);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-condensed {
    font-family: 'Anton', sans-serif;
}

/* RTL Overrides */
html[dir="rtl"] body {
    font-family: 'Yekan Bakh', sans-serif;
}
html[dir="rtl"] .font-condensed {
    font-family: 'Peyda', sans-serif;
    font-weight: 900;
}

/* Layout Structure */
.site-body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex-grow: 1;
}

/* Add top padding for inner pages so the solid header doesn't cover the content */
.inner-page-offset {
    padding-top: 5rem;
}

/* ================= FOOTER ================= */
.site-footer {
    background-color: var(--color-black);
    color: var(--color-white);
    padding: 4rem 1.5rem;
    border-top: 20px solid var(--color-red-600);
}

.footer-container {
    max-width: 80rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 768px) {
    .footer-container {
        grid-template-columns: repeat(4, 1fr);
    }
    .footer-brand-section {
        grid-column: span 2 / span 2;
    }
}

.footer-brand-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.brand-badge {
    width: 3rem;
    height: 3rem;
    background-color: var(--color-red-600);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: -0.025em;
    text-transform: uppercase;
}

.brand-desc {
    color: var(--color-gray-400);
    font-weight: 300;
    max-width: 24rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.footer-copyright {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--color-gray-500);
}

.footer-heading {
    font-size: 1.5rem;
    font-family: 'Anton', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 1.5rem;
    font-weight: normal;
}
html[dir="rtl"] .footer-heading {
    font-family: 'Peyda', sans-serif;
    font-weight: 900;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links li a {
    color: var(--color-gray-400);
    font-size: 0.875rem;
    font-weight: 300;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links li a:hover {
    color: var(--color-red-600);
}

.header-scrolled {
    background-color: var(--color-black) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* ================= DYNAMIC HEADER STYLES ================= */

/* Ensure the header is always floating */
.main-header {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: background-color 0.4s ease, padding 0.4s ease; 
}

/* ---- LIGHT THEME (For inner pages at the very top) ---- */

/* Target all navigation links specifically to override base styles */
.header-light-theme .top-nav a,
.header-light-theme .main-nav a,
.header-light-theme .brand-title {
    color: #000000;
    transition: color 0.4s ease;
}

/* Add a nice hover effect for the black text */
.header-light-theme .top-nav a:hover,
.header-light-theme .main-nav a:hover {
    color: rgba(204, 32, 39, 1);
}

.header-light-theme .language-select {
    color: rgba(204, 32, 39, 1);
    border-color: #000000;
}

.header-light-theme .language-select:hover {
    color: rgba(0,0,0);
}

/* Keep the back button and AUT badge RED! */
.header-light-theme .back-home-btn {
    color: rgba(204, 32, 39, 1) !important;
}

.header-light-theme .back-home-btn:hover {
    color: rgba(0,0,0) !important;
}

/* ---- SCROLLED STATE (When user scrolls down) ---- */

/* The background becomes black */
.main-header.scrolled {
    background-color: #000000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Revert ALL text colors back to white when scrolled */
.main-header.scrolled.header-light-theme .top-nav a,
.main-header.scrolled.header-light-theme .main-nav a,
.main-header.scrolled.header-light-theme .brand-title {
    color: #ffffff;
}

/* Maintain hover effect on dark background */
.main-header.scrolled.header-light-theme .top-nav a:hover,
.main-header.scrolled.header-light-theme .main-nav a:hover {
    color: rgba(204, 32, 39, 1);
}

.main-header.scrolled.header-light-theme .language-select {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

.main-header.scrolled.header-light-theme .language-select:hover {
    color: rgba(204, 32, 39, 1);
}

/* Always keep the back button red */
.main-header.scrolled.header-light-theme .back-home-btn {
    color: rgba(204, 32, 39, 1) !important; 
}
.main-header.scrolled.header-light-theme .back-home-btn:hover {
    color: #ffffff !important;
}

/* ================= MOBILE MENU (HAMBURGER) ================= */

/* Hide the hamburger button on desktop */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 105;
}

/* Style the 3 lines of the hamburger */
.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Make hamburger lines black on light theme (when not scrolled) */
.header-light-theme:not(.scrolled) .hamburger-line {
    background-color: #000000;
}

/* =========================================================
   CENTERED HEADER LOGO
   ========================================================= */

.header-main {
    position: relative; 
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.center-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%); 
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10; 
}

@media (max-width: 300px) {
    .center-logo {
        display: none;
    }
}

.center-logo img {
    height: 75px; 
    width: auto;
    transition: height 0.3s ease; 
}

/* ---- Mobile Center Logo ---- */
@media (max-width: 1100px) {
    .center-logo img {
        height: 55px; 
    }
}

@media (max-width: 700px) {
    .center-logo img {
        display: none;
    }
}

/* =========================================================
   DROPDOWN MENUS (DESKTOP)
   ========================================================= */

.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-dropdown-menu {
    margin-top: 1rem;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background-color: #000000; 
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    border-top: 3px solid rgba(204, 32, 39, 1); 
    z-index: 110;
    padding: 0.5rem 0;
}

html[dir="rtl"] .nav-dropdown-menu {
    left: auto;
    right: 0;
}

.nav-dropdown-menu a {
    color: #ffffff !important; 
    padding: 0.75rem 1.5rem !important;
    border-bottom: 1px solid #1f2937 !important;
    transition: background-color 0.2s ease, padding 0.2s ease !important;
}

.nav-dropdown-menu a:last-child {
    border-bottom: none !important;
}

.nav-dropdown-menu a:hover {
    background-color: #111827;
    color: rgba(204, 32, 39, 1) !important;
    padding-left: 1.75rem !important;
}

html[dir="rtl"] .nav-dropdown-menu a:hover {
    padding-left: 1.5rem !important;
    padding-right: 1.75rem !important;
}

.nav-dropdown.active .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* =========================================================
   DROPDOWN ARROW ANIMATION (GLOBAL)
   ========================================================= */

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem; 
}

.nav-dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.3s ease, margin 0.3s ease;
    margin-bottom: 2px; 
}

html[dir="rtl"] .nav-dropdown-toggle::after {
    transform: rotate(135deg);
}

.nav-dropdown.active .nav-dropdown-toggle::after,
html[dir="rtl"] .nav-dropdown.active .nav-dropdown-toggle::after {
    transform: rotate(45deg);
    margin-bottom: 0;
    margin-top: 4px; 
}

/* =========================================================
   MOBILE LAYOUT OVERRIDES (max-width: 1100px)
   ========================================================= */
@media (max-width: 1100px) {
    
    /* ---- Hamburger Menu ---- */
    .hamburger-btn {
        display: flex;
    }

    .main-nav {
        display: flex !important;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #000000;
        flex-direction: column;
        align-items: flex-start;
        padding: 0 1.5rem; 
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, padding 0.4s ease;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    }

    .main-nav.menu-open {
        max-height: 500px; /* Increased to fit dropdowns */
        padding: 1.5rem;
    }

    .main-nav a {
        padding: 0.75rem 0;
        width: 100%;
        border-bottom: 1px solid #333333;
        color: #ffffff !important;
        text-align: left;
    }
    
    html[dir="rtl"] .main-nav a {
        text-align: right;
    }
    
    .main-nav a:last-child {
        border-bottom: none;
    }

    .main-nav a:hover {
        color: rgba(204, 32, 39, 1) !important;
    }

    .hamburger-btn.menu-open .hamburger-line:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .hamburger-btn.menu-open .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    .hamburger-btn.menu-open .hamburger-line:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* ---- Header Top Swipe Menu ---- */
    .header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
        gap: 1rem;
        width: 100%;
        overflow: hidden;
    }

    .top-nav {
        display: flex;
        align-items: center;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 1rem;
    }

    .top-nav::-webkit-scrollbar {
        display: none; 
    }

    .top-nav a {
        flex-shrink: 0;
        font-size: 0.75rem;
    }

    .language-form {
        flex-shrink: 0;
    }

    .language-select {
        font-size: 0.75rem;
        padding: 0.15rem 0.5rem;
    }

    /* ---- Mobile Dropdown Accordion ---- */
    .nav-dropdown {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-dropdown-menu {
        position: relative;
        top: 0;
        width: 100%;
        box-shadow: none;
        border-top: none;
        background-color: #111827; 
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        padding: 0;
    }

    .nav-dropdown.active .nav-dropdown-menu {
        display: flex; 
    }

    .nav-dropdown-menu a {
        padding-left: 2.5rem !important; 
        border-bottom: 1px solid #374151 !important;
        font-size: 0.9rem;
    }

    html[dir="rtl"] .nav-dropdown-menu a {
        padding-right: 2.5rem !important;
        padding-left: 1.5rem !important;
    }
}

/* =========================================================
   SCROLL OFFSET FOR FIXED HEADER
   ========================================================= */

#contact-section {
    /* Adjust this value based on your header's height (e.g., 80px, 6rem, etc.) */
    scroll-margin-top: 120px; 
}

/* =========================================================
   PARK WEBSITE INFORMATION ARCHITECTURE
   Park public-site information architecture
   ========================================================= */

.main-header .header-top,
.main-header .header-main {
    width: 100%;
    max-width: 96rem;
    margin-inline: auto;
}

.main-header .header-top {
    justify-content: space-between;
    padding: 0.45rem 1.5rem;
}

.main-header .top-nav {
    display: flex;
    align-items: center;
    gap: 1.15rem;
}

.main-header .top-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.main-header .header-main {
    padding: 0.85rem 1.5rem;
    gap: 1.5rem;
}

.park-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 245px;
}

.header-light-theme:not(.scrolled) .park-brand {
    color: #111;
}

.main-header.scrolled .park-brand {
    color: #fff;
}

.park-brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}

.park-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.park-brand-copy strong {
    font-size: 0.95rem;
    font-weight: 800;
}

.park-brand-copy small {
    margin-top: 0.15rem;
    font-size: 0.68rem;
    opacity: 0.8;
    white-space: nowrap;
}

.main-header .main-nav {
    gap: 0.8rem;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    margin-inline-start: auto;
}

.main-header .main-nav > a,
.main-header .main-nav > .nav-dropdown > .nav-dropdown-toggle {
    white-space: nowrap;
}

.nav-dropdown-menu {
    max-height: min(70vh, 600px);
    overflow-y: auto;
    min-width: 250px;
}

.nav-dropdown-menu-wide {
    min-width: 290px;
}

.nav-menu-label {
    display: block;
    padding: 0.7rem 1.5rem 0.35rem;
    color: #9ca3af;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #1f2937;
}

html[dir="rtl"] .nav-menu-label {
    text-align: right;
}

.footer-park-logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
}

.footer-university {
    margin-top: 0.25rem;
    color: var(--color-gray-400);
    font-size: 0.78rem;
}

.footer-contact-line {
    margin: 0.3rem 0;
}

.footer-contact-line a,
.footer-social-links a {
    color: var(--color-gray-400);
    text-decoration: none;
}

.footer-contact-line a:hover,
.footer-social-links a:hover {
    color: var(--color-red-600);
}

.footer-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin: 1.25rem 0 1.5rem;
    font-size: 0.78rem;
}

.footer-trust {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.footer-trust img {
    max-width: 90px;
    height: auto;
}

@media (min-width: 1101px) {
    .main-header .main-nav {
        display: flex;
    }

    .main-header .nav-dropdown:hover > .nav-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

@media (max-width: 1260px) and (min-width: 1101px) {
    .park-brand {
        min-width: auto;
    }

    .park-brand-copy small {
        display: none;
    }

    .main-header .main-nav {
        gap: 0.55rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 1100px) {
    .main-header .header-main {
        padding: 0.8rem 1rem;
    }

    .park-brand {
        min-width: 0;
    }

    .park-brand-logo {
        width: 42px;
        height: 42px;
    }

    .park-brand-copy strong {
        font-size: 0.85rem;
    }

    .park-brand-copy small {
        font-size: 0.62rem;
    }

    .main-nav.menu-open {
        max-height: 78vh;
        overflow-y: auto;
    }

    .main-header .main-nav {
        gap: 0;
        margin-inline-start: 0;
    }

    .nav-dropdown-menu,
    .nav-dropdown-menu-wide {
        min-width: 0;
        max-height: none;
        overflow: visible;
    }

    .nav-menu-label {
        width: 100%;
        padding-inline: 2.5rem 1.5rem;
        background: #0b0f16;
    }
}

@media (max-width: 620px) {
    .main-header .header-top {
        padding-inline: 1rem;
    }

    .main-header .top-nav {
        gap: 0.8rem;
    }

    .park-brand-copy small {
        display: none;
    }
}


/* ================= HEADER ALIGNMENT / SPACING FIX ================= */

/* Give desktop navigation items enough breathing room. */
@media (min-width: 1101px) {
    .main-header .main-nav {
        gap: 1.45rem;
    }

    .main-header .main-nav > a,
    .main-header .main-nav > .nav-dropdown > .nav-dropdown-toggle {
        padding: 0.35rem 0;
    }

    /* English: navigation belongs on the left, brand on the right. */
    html[dir="ltr"] .main-header .header-main {
        flex-direction: row-reverse;
    }

    html[dir="ltr"] .main-header .main-nav {
        margin-inline-start: 0;
        margin-inline-end: auto;
        justify-content: flex-start;
    }

    html[dir="ltr"] .main-header .park-brand {
        margin-inline-start: 2rem;
    }

    /* Persian keeps the existing RTL arrangement. */
    html[dir="rtl"] .main-header .main-nav {
        margin-inline-start: auto;
        margin-inline-end: 0;
    }
}

/* Do not squash the navigation at medium desktop widths. */
@media (max-width: 1260px) and (min-width: 1101px) {
    .main-header .main-nav {
        gap: 1rem;
        font-size: 0.74rem;
    }
}
