/* =========================================
   Global Variables & Base Reset
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,100..900;1,100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&family=Noto+Nastaliq+Urdu:wght@400..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
    /* Colors */
    --primary: #046A38;
    --primary-dark: #024D28;
    --primary-light: #067a57;

    --gold: #D4AF37;
    --gold-light: #F4E5B0;

    --bg-light: #fdfbf7;
    /* Cream */
    --bg-dark: #102216;
    /* Deep Green/Black for footer */
    --surface-light: #ffffff;
    /* pure white for cards */

    --text-main: #0d1b12;
    /* Headings */
    --text-muted: #5a7a6a;
    /* Body */
    --text-white: #fdfbf7;

    /* Typography */
    --font-display: 'Noto Serif', serif;
    --font-body: 'Noto Sans', sans-serif;
    --font-urdu: 'Noto Nastaliq Urdu', serif;

    /* Shadows */
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-gold: 0 4px 20px -2px rgba(212, 175, 55, 0.25);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--text-muted);
    background-color: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.urdu-text {
    font-family: var(--font-urdu);
    line-height: 2;
    direction: rtl;
}

/* =========================================
   Layout & Utilities
   ========================================= */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

.section {
    padding: 5rem 0;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary);
}

.text-gold {
    color: var(--gold);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 50px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(4, 106, 56, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(4, 106, 56, 0.3);
}

.btn-gold {
    background-color: var(--gold);
    color: var(--text-white);
    box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
    background-color: #c29d2d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: var(--text-white);
}

/* Islamic Arch Shapes */
.islamic-arch-top {
    border-radius: 50% 50% 0 0 / 25% 25% 0 0;
}

.islamic-arch-container {
    border-radius: 100px 100px 0 0;
}

/* Islamic Pattern Background */
.bg-pattern {
    position: relative;
}

.bg-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20.125c0-1.25.938-2.25 2.125-2.25 1.188 0 2.125 1 2.125 2.25 0 1.25-.938 2.25-2.125 2.25-1.188 0-2.125-1-2.125-2.25M20 19c-1.25 0-2.125-1-2.125-2.25 0-1.25.875-2.25 2.125-2.25 1.25 0 2.125 1 2.125 2.25 0 1.25-.875 2.25-2.125 2.25M20 13.5c0-1.25.938-2.25 2.125-2.25 1.188 0 2.125 1 2.125 2.25 0 1.25-.938 2.25-2.125 2.25-1.188 0-2.125-1-2.125-2.25M20 25.75c1.25 0 2.125 1 2.125 2.25 0 1.25-.875 2.25-2.125 2.25-1.25 0-2.125-1-2.125-2.25 0-1.25.875-2.25 2.125-2.25' fill='%23D4AF37' fill-opacity='1' fill-rule='evenodd'/%3E%3C/svg%3E");
    z-index: 0;
    pointer-events: none;
}

/* Decorative Divider */
.decorative-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
}

.decorative-divider::before,
.decorative-divider::after {
    content: "";
    height: 1px;
    background: var(--gold);
    flex: 1;
    opacity: 0.3;
    max-width: 100px;
}

.decorative-divider span {
    padding: 0 1rem;
    color: var(--gold);
}

/* =========================================
   Header & Navigation
   ========================================= */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(253, 251, 247, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 4px solid var(--primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    height: 60px;
    /* Adjust as needed for the header */
    width: auto;
    object-fit: contain;
}

.footer-logo-bg {
    background-color: var(--surface-light);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    flex-shrink: 0;
}

.brand-logo-footer {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.footer .society-name,
.footer .school-name {
    color: var(--surface-light);
}

.logo-text-full {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.society-name {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    line-height: 1.2;
}

.school-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-dark);
    font-family: var(--font-display);
    line-height: 1.2;
}

@media (min-width: 768px) {
    .society-name {
        font-size: 0.75rem;
    }

    .school-name {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .logo-wrapper {
        gap: 0.5rem;
    }

    .society-name {
        font-size: 0.55rem;
        line-height: 1.1;
    }

    .school-name {
        font-size: 0.95rem;
    }

    .brand-logo {
        height: 45px;
    }
}

.nav-links {
    display: none;
    align-items: center;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .nav-links {
        display: flex;
        margin-left: 1.5rem;
        margin-right: auto;
        gap: 1.5rem;
    }

    .header .container {
        max-width: 1600px;
        padding: 0 1.5rem;
        justify-content: flex-start;
    }
}

@media (min-width: 992px) and (max-width: 1264px) {
    .nav-links {
        margin-left: 0.5rem;
        gap: 0.75rem;
        align-items: center;
    }

    .nav-link {
        font-size: 0.75rem;
    }

    .brand-logo {
        height: 40px;
    }

    .school-name {
        font-size: 0.95rem;
    }

    .society-name {
        font-size: 0.6rem;
    }

    .header .btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

@media (min-width: 1200px) {
    .nav-links {
        margin-left: 3rem;
        gap: 2rem;
    }
}

@media (min-width: 1400px) {
    .nav-links {
        margin-left: 4.5rem;
        gap: 2.5rem;
    }
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 0.25rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--gold);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--surface-light);
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    border-radius: 0.5rem;
    z-index: 1000;
    border-top: 3px solid var(--gold);
}

.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: capitalize;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dropdown-item:hover {
    background-color: rgba(212, 175, 55, 0.05);
    color: var(--primary);
}

.mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 2rem;
    cursor: pointer;
}

@media (min-width: 992px) {
    .mobile-menu-btn {
        display: none;
    }
}

.header-actions {
    display: none;
}

@media (min-width: 992px) {
    .header-actions {
        display: flex;
    }
}

/* Mobile Menu */
.mobile-nav {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: var(--surface-light);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    z-index: 99;
}

.mobile-nav.open {
    transform: translateY(0);
}

.mobile-nav a {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
}

/* =========================================
   Footer
   ========================================= */

.footer {
    background-color: var(--bg-dark);
    color: rgba(255, 255, 255, 0.8);
    border-top: 6px solid var(--gold);
    padding: 4rem 0 2rem;
    position: relative;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

/* Mobile wrap for the links to sit side by side */
.footer-links-wrapper {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 3rem;
}

@media (min-width: 768px) {
    .footer-inner {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-links-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .footer-inner {
        grid-template-columns: 2fr 3fr;
    }
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-brand {
        align-items: flex-start;
        text-align: left;
    }
}

.footer-brand .logo-text h1 {
    color: var(--surface-light);
}

.footer-desc {
    margin-top: 1rem;
    font-size: 0.9rem;
    line-height: 1.8;
    max-width: 400px;
}

.footer-heading {
    color: var(--gold);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-display);
    text-align: center;
}

@media (min-width: 768px) {
    .footer-heading {
        text-align: left;
    }
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--gold);
    transform: translateX(4px);
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.footer-contact .material-symbols-outlined {
    color: var(--gold);
    font-size: 1.25rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    font-size: 0.8rem;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* ==========================================================================
   Animation Utilities
   ========================================================================== */

/* Global Fade-Up Animation */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Effects for Grids/Lists */
.stagger-1 {
    transition-delay: 0.1s;
}

.stagger-2 {
    transition-delay: 0.2s;
}

.stagger-3 {
    transition-delay: 0.3s;
}

.stagger-4 {
    transition-delay: 0.4s;
}

/* Stat Counters Styling Adjustment */
.stat-number {
    display: inline-block;
    min-width: 60px;
    /* Prevent reflows while counting up */
}

/* =========================================
   Gallery Carousel (Neo-Traditional)
   ========================================= */

.gallery-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 2rem;
    padding: 1rem 0.5rem 2rem 0.5rem;
    /* Padding to prevent shadow clipping */
    margin-top: 1rem;

    /* Custom Scrollbar for Desktop */
    scrollbar-width: thin;
    scrollbar-color: var(--gold) rgba(0, 0, 0, 0.05);
}

.gallery-carousel::-webkit-scrollbar {
    height: 8px;
}

.gallery-carousel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.gallery-carousel::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 10px;
}

.gallery-item {
    flex: 0 0 350px;
    /* Fixed width so they slide left-to-right */
    scroll-snap-align: center;
    position: relative;
    padding-top: 12px;
    padding-left: 12px;
}

/* The Gold Offset Border */
.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    border: 2px solid var(--gold);
    border-radius: 50% 50% 0 0 / 25% 25% 0 0;
    z-index: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-item:hover::before {
    transform: translate(6px, 6px);
}

.gallery-img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 50% 50% 0 0 / 25% 25% 0 0;
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.gallery-item:hover .gallery-img {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* Mobile Scroll Layout */
@media (max-width: 768px) {
    .gallery-carousel {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1.5rem;
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;

        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .gallery-carousel::-webkit-scrollbar {
        display: none;
    }

    .gallery-carousel .gallery-item {
        flex: 0 0 85%;
        scroll-snap-align: center;
    }
}

/* =========================================
   Vision & Mission Cards (Neo-Traditional)
   ========================================= */

.vision-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

@media (min-width: 768px) {
    .vision-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.vision-card {
    background: var(--surface-light);
    padding: 3.5rem 2.5rem;
    border-radius: 120px 120px 0 0 !important;
    box-shadow: var(--shadow-soft);
    border-bottom: 6px solid var(--gold);
    color: var(--text-main);
    position: relative;
    height: 100%;
}

.vision-card .vision-icon {
    color: var(--primary-dark);
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
    text-align: center;
}

.vision-card h3 {
    color: var(--primary-dark);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.vision-card p {
    color: var(--text-muted);
    font-family: var(--font-body);
    line-height: 1.7;
    margin-bottom: 0;
}

.vision-card ul {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-left: 0;
}

.vision-card li {
    position: relative;
    padding-left: 2rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    line-height: 1.6;
    list-style-type: none;
}

/* Gold Outline Checkmark */
.vision-card li::before {
    content: 'check_circle';
    font-family: 'Material Symbols Outlined';
    position: absolute;
    left: 0;
    top: 2px;
    color: var(--gold);
    font-size: 1.25rem;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* Mobile Background Adjustment */
@media (max-width: 768px) {

    .page-header,
    .hero {
        background-position: center top !important;
    }
}