body {
    font-size: 16px;
}

/**
 * ==========================================================================
 * 4. Animations
 * ==========================================================================
 */
@keyframes fade {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

/**
 * ==========================================================================
 * 6. Slideshow Component
 * ==========================================================================
 */
.fade {
    animation-name: fade;
    animation-duration: 1.5s;
    animation-timing-function: ease-in-out;
    will-change: opacity;
}

/**
 * ==========================================================================
 * 8. Main Content Layout
 * ==========================================================================
 */
main {
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    background-color: transparent;
}

.contents {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Slideshow main container */
.slideshow-container {
    max-width: 1000px;
    position: relative;
    margin: 0 auto;
    min-height: 235px;
    margin-top: 55px;
}

/* Individual slide */
.mySlides {
    display: none;
}

/* Image within a slide */
.mySlides img {
    width: 100%;
    height: 235px;
    object-fit: cover;
    object-position: right;
    vertical-align: middle;
    padding: 5px;
    background-color: var(--gray_800);
    box-sizing: border-box;
}

/* Next & previous navigation buttons */
.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
    color: var(--white);
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border-radius: 50%;
    user-select: none;
    background-color: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    text-decoration: none;
    z-index: 10;
    border: none;
    /* Reset button border */
    padding: 0;
    /* Reset button padding */
}

.next {
    right: 20px;
}

.prev {
    left: 20px;
}

/* Show buttons on container hover or keyboard focus */
.slideshow-container:hover .prev,
.slideshow-container:hover .next,
.slideshow-container:focus-within .prev,
.slideshow-container:focus-within .next,
.prev:focus-visible,
.next:focus-visible {
    opacity: 1;
}

/* Darker background on button hover */
.prev:hover,
.next:hover {
    background-color: var(--overlay-hover);
}

/* Dot indicator container */
.dot-container {
    text-align: center;
    padding-bottom: 10px;
}

/* Individual dot indicator */
.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 2px;
    background-color: var(--gray_700);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

/* Active state */
.dot.active,
.dot:hover {
    background-color: var(--white);
}


/**
 * ==========================================================================
 * 7. Sustainment Section
 * ==========================================================================
 */
.sustainment {
    height: auto;
    background-color: var(--yblue);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--white);
    font-size: 1.6rem;
    max-width: 1000px;
    margin: 0 auto;
}

.sustainment-icons img {
    height: 50px;
    width: auto;
}


/**
 * ==========================================================================
 * 9. Content Components (Cards)
 * ==========================================================================
 */
/* General spacing for content sections */
.Overview {
    margin-top: 20px;
}

.links {
    margin-bottom: 0px;
}

/* Base styles for content cards */
.Overview,
.Leader,
.links,
.Connect {
    background-color: var(--gray_50);
    color: var(--gray_900);
    padding: 20px;
    box-shadow: 0 4px 6px var(--overlay-bg);
    overflow: hidden;
}

/* Header style for content cards */
.Overview h2,
.Overview h3,
.Leader h2,
.Leader h3,
.links h2,
.links h3,
.Connect h2,
.Connect h3 {
    margin: -20px -20px 20px -20px;
    padding: 5px 20px;
    background-color: var(--gray_900);
    color: var(--gold);
    text-align: center;
    font-size: 1.17em;
    font-weight: bold;
}

.Connect h2:nth-of-type(2),
.Connect h3:nth-of-type(2) {
    margin-top: 20px;
}

/* Leader card specific styles */
.Leader {
    text-align: center;
    background-image: url('/assets/images/CASCOM_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.Leader p {
    font-weight: bold;
}

/* Overview card specific styles */
.Overview p,
.Overview li {
    line-height: 1.2;
}

.Overview p,
.Overview ul {
    margin-bottom: 10px;
}

.Overview ul {
    padding-left: 30px;
}

/* Buttons within the Overview card */
.overview-buttons {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
}

/* Links card specific styles */
.links ul {
    list-style: none;
}

/* List item style within the Links card */
.links li {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray_300);
}

.links li:last-child {
    border-bottom: none;
}

/* Link style within the Links card */
.links li a {
    color: var(--black);
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

/* Arrow icon for links */
.links li a::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: rotate(45deg);
    margin-right: 10px;
}

.links li a:hover {
    color: var(--blue);
}

/* Container for image-based links */
.link-images {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

/* Connect card specific styles */
.image-row {
    display: flex;
    gap: 25px;
    justify-content: center;
    align-items: center;
}

/* Container for social media icons/images */
.connect-media {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}


/**
 * ==========================================================================
 * 11. Responsive Styles
 * ==========================================================================
 */

@media (max-width: 1024px) {
    .sustainment {
        padding-bottom: 5px;
    }

    .sustainment-icons {
        display: flex;
        gap: clamp(15px, 4vw, 30px);
        flex-wrap: wrap;
        justify-content: center;
        padding: 0 20px;
    }

    .sustainment span {
        font-size: clamp(15px, 3.5vw, 24px);
        text-align: center;
        padding: 5px 10px 0;
    }

    #main-content {
        margin: 0 auto;
    }

    .links {
        margin-bottom: 20px;
    }

    .links ul {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 20px;
    }

    .image-row img {
        max-width: 265px;
    }

    .connect-media {
        flex-direction: column;
    }

    .connect-media img {
        width: 100%;
        height: auto;
    }

    .link-images img {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 768px) {
    .links ul {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .image-row {
        width: 100%;
    }

    .slideshow-container {
        min-height: auto;
    }

    .mySlides img {
        height: auto;
    }

    .sustainment {
        padding-bottom: 10px;
    }

    .sustainment-icons {
        gap: 15px;
    }
}

@media (min-width: 1025px) {
    body {
        background-image: url('/assets/images/home_imgs/Background.jpg');
        background-position: top center;
        background-repeat: no-repeat;
    }

    main {
        padding: 12px 2px 2rem;
    }

    .contents {
        grid-template-columns: repeat(10, 1fr);
    }

    .Overview {
        grid-column: span 7;
        min-height: 420px;
        margin-top: 0;
    }

    .Leader {
        grid-column: span 3;
        min-height: 420px;
        margin-top: 0;
    }

    .Connect {
        grid-column: span 6;
        min-height: 650px;
        margin-bottom: 0;
    }

    .links {
        grid-column: span 4;
        min-height: 650px;
    }

    .sustainment {
        background-color: transparent;
        font-size: 1.5rem;
        flex-direction: row;
        justify-content: space-between;
        height: 70px;
        padding: 0 20px;
        margin-top: -7px;
        gap: 0;
    }

    .sustainment-icons {
        display: flex;
        gap: 15px;
    }

    .sustainment-icons img {
        height: 70px;
        width: auto;
    }

    .slideshow-container {
        min-height: 235px;
        margin-top: 0;
    }

    .mySlides img {
        height: 235px;
        object-position: right;
    }
}