/* Custom Stylesheet for Dexterity
  This file contains all custom CSS that isn't handled by Tailwind CSS.
*/

/* CSS Variables (Custom Properties)
  These variables define the core color palette of the site, making it easy to 
  maintain brand consistency. They are based on the logo you provided.
*/
:root {
    --dx-blue: #00A9E2;
    --dx-green: #6CC24A;
    --dx-dark: #1A1A1A;     /* For primary text */
    --dx-light: #ffffff;    /* For backgrounds on colored sections */
    --dx-bg: #F8F9FA;       /* Main page background color */
}

/* Global Body Styles
  Sets the default font, background color, and text color for the entire page.
  Also prevents horizontal scrolling for a cleaner experience on all devices.
*/
body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--dx-bg);
    color: var(--dx-dark);
    overflow-x: hidden;
}

/* This class is added by JavaScript to prevent the page from scrolling when the menu is open */
body.nav-open {
    overflow: hidden;
}

/* Custom Font Application
  Applies the 'Fredoka' font to all heading elements and any element with the
  .font-fredoka class for a playful, branded look.
*/
h1, h2, h3, .font-fredoka {
    font-family: 'Fredoka', sans-serif;
}

/* Gradient Text Utility
  This class applies the brand's blue-to-green gradient to any text.
  It's a key part of the visual identity.
*/
.gradient-text {
    background: linear-gradient(90deg, var(--dx-blue), var(--dx-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* Page Load Logo Animation
  This keyframe animation makes the logo "swirl" into view when the page first loads.
  It adds a dynamic and engaging introduction.
*/
@keyframes swirl-in {
    0% {
        transform: scale(0.5) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}
/* Applies the swirl-in animation to the logo */
.logo-animate {
    animation: swirl-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* "Squaircle" Card Styles for the "Community in Action" Section
  This creates the unique, playful, rounded-square shape for the member cards.
*/
.squaircle-card {
    aspect-ratio: 1 / 1; /* Ensures the card is always a perfect square */
    border-radius: 35%; /* This value creates the "squaircle" shape */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    position: relative;
    overflow: hidden; /* Hides parts of the image that go outside the rounded corners */
}
.squaircle-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the card without stretching */
    transition: transform 0.4s ease;
}
/* Dark overlay at the bottom of the card to make text readable */
.squaircle-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 1;
    transition: opacity 0.4s ease;
    color: white;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
/* The "fun fact" text that appears on hover */
.squaircle-card .fun-fact {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    opacity: 0; /* Hidden by default */
    transform: scale(0.9);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Carousel Hover Effects
  These rules create the 3D pop-out effect when a user hovers over a card.
*/
/* When hovering over the whole container, slightly shrink all cards */
.carousel-container:hover .squaircle-card {
    transform: scale(0.95) !important; /* !important is used to override inline styles from JS */
}
/* When hovering over a SPECIFIC card, make it larger and pop forward */
.carousel-container .squaircle-card:hover {
    transform: scale(1.1) translateY(-10px) !important;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3);
    z-index: 10;
}
/* Zoom the image inside the hovered card */
.carousel-container .squaircle-card:hover img {
    transform: scale(1.1);
}
/* Hide the default overlay on hover */
.carousel-container .squaircle-card:hover .overlay {
    opacity: 0;
}
/* Show the fun fact on hover */
.carousel-container .squaircle-card:hover .fun-fact {
    opacity: 1;
    transform: scale(1);
}

/* Scroll-triggered Animations
  These classes control the fade-in-from-bottom effect for sections as you scroll.
*/
/* Initial state of the elements: hidden and slightly lower */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
/* The state when the element becomes visible in the viewport */
.fade-in-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* =================================================================== */
/* START: New Header Menu Styles                                       */
/* =================================================================== */

/* Hamburger Menu Button */
.hamburger {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    padding: 0;
}

.hamburger .line {
    width: 32px;
    height: 3px;
    background: var(--dx-dark);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* Animation for the hamburger icon turning into an 'X' */
.hamburger.active .line-1 {
    transform: rotate(45deg) translate(8px, 8px);
}
.hamburger.active .line-2 {
    opacity: 0;
}
.hamburger.active .line-3 {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Fullscreen Navigation Overlay */
.fullscreen-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dx-blue), var(--dx-green));
    z-index: 40; /* Sits below the header (z-50) but above everything else */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Hidden by default */
    opacity: 0;
    pointer-events: none;
    transform: scale(1.1);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* State when the menu is open */
.fullscreen-nav.open {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.fullscreen-nav .nav-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.fullscreen-nav .nav-link {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.5rem; /* Large, readable text */
    color: var(--dx-light);
    text-decoration: none;
    font-weight: 600;
    /* Hidden for animation */
    opacity: 0;
    transform: translateY(20px);
    transition: color 0.3s, transform 0.5s, opacity 0.5s;
}

/* The state of the links when the menu is open */
.fullscreen-nav.open .nav-link {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for links appearing one after the other */
.fullscreen-nav.open .nav-link:nth-child(1) { transition-delay: 0.2s; }
.fullscreen-nav.open .nav-link:nth-child(2) { transition-delay: 0.3s; }
.fullscreen-nav.open .nav-link:nth-child(3) { transition-delay: 0.4s; }
.fullscreen-nav.open .nav-join-button { transition-delay: 0.5s; } /* The button appears last */

.fullscreen-nav .nav-link:hover {
    transform: scale(1.1); /* Fun hover effect */
}

/* The "Join Us" button inside the menu */
.fullscreen-nav .nav-join-button {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dx-blue);
    background-color: var(--dx-light);
    padding: 1rem 2.5rem;
    border-radius: 9999px;
    margin-top: 1rem;
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.3s, background-color 0.3s, opacity 0.5s;
}

.fullscreen-nav.open .nav-join-button {
    opacity: 1;
    transform: translateY(0);
}

.fullscreen-nav .nav-join-button:hover {
    transform: scale(1.05);
}
