:root{
    --bg-color:#343a40;
    --panel-color:rgba(0, 128, 0, 0.70);
    --element-color: #3B838C;
    --element-color-hover:#337179;
    --card-color:rgba(0, 0, 0, 0.35);;
}

* {
    margin: 0px;
    padding: 0px;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

body {
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
i,
span,
li,
a{
    color: whitesmoke;
    padding-left: 10px;
}

hr{
    color: whitesmoke;
    border-bottom: solid;
    border-width: 2px;
    padding: 0% 10%;
    opacity: 0.75;
    /*margin-left: 17%;
    margin-right: 17%;*/
    width: 70%;
    margin: 20px auto;
}

#TopBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    border: none;
    outline-color: transparent;
    background-color: var(--panel-color);
    color: whitesmoke;
    cursor: pointer;
    border-radius: 50%;
    font-size: 18px;
    height: 50px;
    width: 50px;
}

a:hover{
    color: #818181;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(59, 131, 140, 0.75);
}

.nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    position: relative;
    z-index: 100;
    height: 80px;
    width: 100%;
    background-color: var(--element-color);
    padding-top: 5px;
    padding-right: 2%;
    padding-left: 2%;
}

.nav > a {
    grid-column: 1;
}

.nav .openbtn {
    grid-column: 3;
    justify-self: end;
}

.navsmall {
    display: none;
}

@media (min-width:900px) {
    .navsmall {
            display: flex;
            justify-content: center; /* Centers the links horizontally */
            align-items: center;
            gap: 30px;              /* Adds consistent space between links */
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: auto;            /* Removes the 450px restriction */
            margin: 0 auto;         /* Centers the UL itself in the nav */
            padding: 0;
            list-style: none;
        }
}

.navsmall li {
    list-style: none;
}

.navsmall a {
    font-weight: bold;
    color: whitesmoke;
    text-decoration: none;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown > a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-dropdown > a::after {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.nav-dropdown:hover > a::after,
.nav-dropdown:focus-within > a::after {
    transform: rotate(225deg) translate(-2px, -1px);
}

.nav-dropdown::after {
    content: '';
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 28px;
}

.nav-dropdown:hover::after,
.nav-dropdown:focus-within::after {
    display: block;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 28px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    padding: 0.5rem 0;
    margin-top: 0;
    background-color: var(--element-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.55rem 1rem;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus {
    background-color: var(--element-color-hover);
    color: whitesmoke;
}

.mnav {
    height: 100%;
    width: 0;
    max-width: 420px;
    position: fixed;
    z-index: 1001;
    top: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.96);
    overflow-x: hidden;
    overflow-y: auto;
    transition: 0.5s;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.35);
    visibility: hidden;
}

.mnav[aria-hidden="false"] {
    visibility: visible;
}

.mnav .closebtn {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-size: 44px;
    line-height: 1;
    color: #a8a8a8;
    background: transparent;
    border: 0;
    padding: 0.25rem;
}

@media screen and (max-height: 450px) {
    .mnav a {
        font-size: 20px
    }

    .mnav .closebtn {
        font-size: 50px;
        top: 15px;
        right: 35px;
    }
}

.mnav-content {
    position: relative;
    width: 100%;
    min-height: 100%;
    text-align: left;
    margin-top: 0;
    padding: 5.5rem 1.25rem 2rem;
    border: none;
}

.mnav-content br {
    display: none;
}

.mnav a {
    padding: 0.65rem 0.75rem;
    text-decoration: none;
    font-size: clamp(1.25rem, 6vw, 1.65rem);
    color: #d8d8d8;
    display: block;
    border-radius: 6px;
    transition: 0.3s;
}

.mnav a:not(.mnav-subitem) {
    margin-top: 0.75rem;
    font-weight: 700;
    color: whitesmoke;
    border-left: 3px solid var(--element-color);
}

.mnav a:not(.mnav-subitem):first-of-type {
    margin-top: 0;
}

.mnav a.mnav-subitem {
    margin-left: 1.25rem;
    padding: 0.45rem 0.75rem 0.45rem 1rem;
    font-size: clamp(1rem, 5vw, 1.2rem);
    color: #b7b7b7;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.mnav a:hover,
.mnav a:focus {
    color: #f1f1f1;
    background-color: rgba(255, 255, 255, 0.08);
}

.nav .closebtn:hover {
    color: #f1f1f1;
}

@media (min-width:900px) {
    .nav .openbtn {
        display: none;
    }
}

.openbtn {
    font-size: 50px;
    cursor: pointer;
    color: whitesmoke;
    background: transparent;
    border: 0;
    line-height: 1;
    padding: 0.25rem;
}


.openbtn:hover {
    color: rgb(204, 204, 204);
}

.mnav u {
    padding: 8px;
    font-size: 36px;
    color: #05a50a;
    display: block;
    transition: 0.3s;
}

.mnav .closebtn {
    cursor: pointer;
}


.TextSpace{
    margin-left: 15% ;
    margin-right: 15% ;
}

.Start {
    background-position-y: 490px;
    background-color: var(--bg-color);
    background-image: url("Media/Start/IMG_1241.jpg"); /* Ensure this path is correct */
    background-size: cover;      /* Scales image to fill the box without stretching */
    background-position: center; /* Keeps the focus of the photo in the middle */
    background-repeat: no-repeat; /* Prevents the image from duplicating */
    min-height: 400px;           /* Ensures the box has height even if empty */
    width: 100%;                 /* Spans the full width of the screen */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.Start h1,
.Start h4,
.Start h5 {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85), 0 0 18px rgba(0, 0, 0, 0.65);
}

.Start h1 {
    font-weight: 800;
}

.Start h4,
.Start h5 {
    font-weight: 700;
}

.About, .Education, .Jobs, .Projects {
    height: auto !important; /* Allow the box to grow with the text */
    min-height: 400px;       /* Keeps the desktop look, but allows growth */
    padding-bottom: 80px;    /* Makes room for the button at the bottom */
}

.Heading {
    display: flex;
    align-items: center;
    text-align: center;
}
.Heading::before,
.Heading::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid whitesmoke;
}
.Heading:not(:empty)::before {
    margin-right: .25em;
}
.Heading:not(:empty)::after {
    margin-left: .25em;
}
h1{
    color: whitesmoke;
}

.Social {
    width: 100%;          /* Occupy full width to allow centering */
    max-width: 400px;     /* Limits the row width on desktop */
    height: auto;         /* Allow height to adjust to icon size */
    display: flex;        /* Enables flexbox */
    flex-direction: row;  /* FORCES HORIZONTAL ROW */
    justify-content: center; /* Centers icons horizontally */
    align-items: center;  /* Aligns icons vertically */
    gap: 20px;            /* Consistent space between icons */
    margin: 20px auto;    /* Centers the whole block in the Start section */
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background-color: rgba(0, 0, 0, 0.32);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}

.Social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 0;
    border-radius: 8px;
    transition: transform 0.2s;
}

.Social a:hover,
.Social a:focus {
    transform: translateY(-2px);
}

.Social img {
    width: 60px;          /* Larger size for Desktop */
    height: 60px;
    flex-shrink: 0;       /* Prevents squishing */
    object-fit: contain;  /* Keeps the logo aspect ratio */
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    transition: transform 0.2s, filter 0.2s;
    padding: 5px;
}

.Social img:hover {
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.9)) brightness(1.15);
    transform: scale(1.08); /* Subtle grow effect on hover */
}

.About{
    background-color: var(--panel-color);
    padding: 1.5rem 5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 400px;
    height: auto;
    border-radius: 1rem;
    backdrop-filter: blur(20px);
    display: grid;
    container-type: inline-size;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

#age{
    padding: 0;
}

.AboutPhoto {
    grid-column: auto;
    background-image: url("Media/Alex.jpg");
    background-size: cover; /* Changed to cover to fill the circle better */
    background-position: center;
    border: solid whitesmoke 0.5rem; /* Reduced border for mobile */
    border-radius: 50%;
    aspect-ratio: 1;
    width: 70%;         /* Fill most of the available column space */
    max-width: 450px;   /* Allow a larger portrait on desktop */
    margin: 0 auto;     /* Center it */
}

.AboutText{
    grid-column: auto;
}

.AboutText,
.EducationBox,
.JobsBox,
.ProjectsItems {
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
}

.EducationBox,
.JobsBox,
.ProjectsItems {
    content-visibility: auto;
    contain-intrinsic-size: 320px;
}

.EducationBox, .JobsBox {
    backdrop-filter: blur(3px);
    background-color: rgba(0, 0, 0, 0.20);
    padding: 0.5rem;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}


.Education {
    background-color: var(--panel-color);
    padding: 2rem 5rem; /* Keep original desktop padding */
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    height: auto;      /* Changed from fixed 450px */
    border-radius: 1rem;
    display: grid;      /* Use Grid for side-by-side */
    container-type: inline-size;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 5rem;
    backdrop-filter: blur(20px);
}

.EducationUTC, .EducationBCG {
    grid-column: auto !important; /* Overrides the grid-column: 1/2 */
    width: 100%;
    min-height: 350px;
}

.EducationUTC{
    background-color: rgb(2, 112, 2);
    background-image: url(Media/UTC.jpg);
    background-size: cover;
    background-position: center;
    grid-column: 1;
    width: 100%;
}

.EducationBCG{
    background-color: rgb(2, 112, 2);
    background-image: url(Media/BCG.jpg);
    background-size: cover;
    background-position: center;
    grid-column: 2;
    width: 100%;
}

.Jobs {
    background-color: var(--panel-color);
    padding: 2rem 5rem; /* Match Education padding for consistency */
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    height: auto;       /* Allow flexible height */
    border-radius: 1rem;
    display: grid;      /* Use Grid for side-by-side */
    container-type: inline-size;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive columns */
    gap: 2rem;
    backdrop-filter: blur(20px);
}

.JobsNewsPapers, .JobsLifeguarding, .JobsItTechnition {
    grid-column: auto !important;
    width: 100%;
    min-height: 300px;    /* Give them enough height for the text */
    display: grid;
}

.JobsNewsPapers{
    background-color: rgb(2, 112, 2);
    background-image: url(Media/Budgens.jpg);
    background-size: cover;
    background-position: center;
    grid-column: 1;
    width: 100%;
    text-align: center;
}

.JobsLifeguarding{
    background-color: rgb(2, 112, 2);
    background-image: url(Media/AquaVale.jpg);
    background-size: cover;
    background-position: center;
    grid-column: 2;
    width: 100%;
    text-align: center
}

.JobsItTechnition{
    background-color: rgb(2, 112, 2);
    background-image: url(Media/CWAT.jpeg);
    background-size: cover;
    background-position: center;
    grid-column: 3;
    width: 100%;
    text-align: center
}

.JobsBox{
    backdrop-filter: blur(3px);
    background-color: rgba(0, 0, 0, 0.20);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    width: 100%;
}

.ReadMoreBtn {
    background-color: var(--element-color);
    border: none;
    color: whitesmoke;
    text-decoration: none;
    padding: 10px 20px;
    margin-top: auto;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
    border-radius: 1rem;
    cursor: pointer;
}

.ReadMoreBtn:hover{
    color: whitesmoke;
    background-color: var(--element-color-hover);
}

.ReadMoreArtical{
    background-color: var(--element-color);
    padding: 10px 10%;
    margin-bottom: 20px;
    transform: translateY(-5px);
    text-align: center;
    display: inline-block;
    width: 100%;
    border-radius: 1rem;
    text-decoration: none;
    
}

.ReadMoreArtical:hover{
    color: whitesmoke;
    background-color: var(--element-color-hover);
}

.Projects{
    background-color: var(--panel-color);
    padding: 2rem 5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 1rem;
    backdrop-filter: blur(20px);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    align-content: flex-start;
}

.ProjectsItems{
    background-color: var(--card-color);
    flex: 0 1 260px;
    min-height: 420px;
    height: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.ProjectIMGBox{
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.ProjectsItems p {
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: calc(1.4em * 4);
    margin: 0.5rem 0;
}

.ProjectsItems h4 {
    margin: 0.5rem 0;
}

.ProjectsItems p {
    flex-grow: 1;
}

.ProjectsItems .ReadMoreArtical {
    margin-top: auto;
    margin-bottom: 0;
}

.ProjectIMGBox{
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.projectIMG{
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: top center;
}

@media (max-width: 1044px) {
    .TextSpace.Projects {
        margin: 0 !important;
        padding: 1rem 0.75rem 1.25rem !important;
    }
    
    section[alt="Projects"] {
        position: relative;
        background-color: transparent;
        padding: 1rem 0;
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
        border-radius: 0;
        backdrop-filter: blur(10px);
    }
    
    .Projects {
        margin: 0;
        width: 100%;
        max-width: 100%;
        background-color: var(--panel-color);
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 0;
        scroll-behavior: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        position: relative;
        margin-bottom: 0;
        justify-content: flex-start;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .Projects::-webkit-scrollbar {
        display: none;
    }

    .ProjectsItems {
        flex: 0 0 280px;
        min-width: 280px;
        margin: 0 0.5rem;
        margin-bottom: 0;
        height: auto;
        background-color: var(--card-color);
        padding: 1rem;
        display: flex;
        flex-direction: column;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    .ProjectIMGBox {
        height: 150px;
    }

    .projectIMG {
        position: static;
    }
}

@media (min-width: 769px) and (max-width: 1044px) {
    section[alt="Projects"] {
        padding-bottom: 1rem;
    }

    .Projects {
        scroll-behavior: smooth;
        scroll-snap-type: none;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.55) rgba(0, 0, 0, 0.18);
    }

    .Projects::-webkit-scrollbar {
        display: block;
        height: 0.65rem;
    }

    .Projects::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.18);
        border-radius: 999px;
    }

    .Projects::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.55);
        border-radius: 999px;
    }

    .ProjectsItems {
        flex-basis: 320px;
        min-width: 320px;
        scroll-snap-align: none;
    }
}

@media (max-width: 768px) {
    section[alt="Projects"] {
        padding-bottom: 2.75rem;
    }

    .TextSpace {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .Projects {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .Projects::-webkit-scrollbar {
        display: none;
    }

    .ProjectsItems {
        flex-basis: 280px;
        min-width: 280px;
    }
}

/* Scroll indicator dots */
.scroll-indicator {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    justify-content: center;
    z-index: 100;
    pointer-events: auto;
}

@media (max-width: 1044px) {
    .scroll-indicator {
        bottom: 0.75rem;
    }
}

@media (min-width: 769px) {
    .scroll-indicator {
        display: none;
    }
}

.scroll-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.scroll-dot.active {
    background-color: rgba(255, 255, 255, 0.9);
    width: 24px;
    border-radius: 4px;
}

footer,
.footer {
    position: relative;
    bottom: auto;
    margin-top: auto;
    height: 50px;
    padding-top: 12.5px;
    padding-left: 10px;
    padding-right: 10px;
    width: 100%;
    text-align: center;
    background-color: var(--element-color);
    color: whitesmoke;
}

@media (max-width: 768px) {
    .navsmall {
        display: none; /* Hide the horizontal list on mobile */
    }

    .openbtn {
        display: block; /* Ensure the menu button is visible */
    }

    .TextSpace {
        margin-left: 5%;   /* Reduce those 15% margins so you have room */
        margin-right: 5%;
    }

    .About {
        display: flex;          /* Switch from Grid to Flex on mobile */
        flex-direction: column; /* This forces the text UNDER the photo */
        height: auto;           /* Remove the fixed 400px height */
        padding: 1.5rem;        /* Reduce internal padding */
        align-items: center;
    }

    .AboutText {
        padding-top: 1rem;
        text-align: center;     /* Centers text for a cleaner mobile look */
    }

    .Jobs {
            display: flex;
            flex-direction: column;
            height: auto !important; 
            padding: 1.5rem !important;
        }

    .JobsNewsPapers, 
    .JobsLifeguarding, 
    .JobsItTechnition {
        grid-column: auto !important;
        width: 100% !important;
        min-height: 350px; /* Ensures enough room for text and button */
    }

    .Education {
        display: flex;           /* Switch back to flex for mobile */
        flex-direction: column;  /* Stack them vertically */
        height: auto;            /* IMPORTANT: Let it grow tall enough for text */
        padding: 1.5rem;         /* Shrink padding so it fits on a phone */
        gap: 2rem;
    }

    .EducationUTC, .EducationBCG {
            grid-column: auto !important;
            width: 100%;
            min-height: 300px;
        }
        
    .ReadMoreBtn {
            margin-top: auto;
            margin-left: auto;
            margin-right: auto;
            margin-bottom: 10px;
            display: block;
        }

    .Social img {
            width: 40px !important;  /* Smaller size for Mobile */
            height: 40px !important;
            padding: 2px;
        }

    .Social a {
            width: 40px;
            height: 40px;
        }
}

@media (max-width: 700px) {
    .TextSpace {
        margin-left: 2%;
        margin-right: 2%;
    }

    .About {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 1rem;
        width: auto;
        grid-template-columns: 1fr;
    }

    .AboutPhoto {
        order: 1;
        max-width: 220px;
        width: 100%;
        min-width: 0;
        margin-bottom: 1rem;
    }

    .AboutText {
        order: 2;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        text-align: left;
    }

    .AboutText h2 {
        font-size: 1.5rem;
    }

    .AboutText p {
        font-size: 0.95rem;
        line-height: 1.6;
        word-break: normal;
    }
}

@container (max-width: 400px) {
    .About {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .AboutPhoto {
        max-width: 220px;
        width: 100%;
        min-width: 0;
        margin: 0 auto 1rem;
    }

    .AboutText {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        text-align: left;
    }

    .AboutText h2 {
        font-size: 1.5rem;
    }

    .AboutText p {
        font-size: 0.95rem;
        line-height: 1.6;
        word-break: normal;
    }
}

@container (max-width: 400px) {
    .Education {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .EducationUTC,
    .EducationBCG {
        width: 100%;
        height: auto;
    }

    .EducationBox {
        padding: 0.5rem;
        height: auto;
    }

    .EducationBox h3 {
        font-size: 1.1rem;
    }

    .EducationBox p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

/* Desktop: Vertically center content in About section */
@media (min-width: 900px) {
    .About {
        align-items: center;
    }
}
