@import url("https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap");

:root {
    --primary-color: #ca305f;
    --primary-hover-light: #ca305f59;
    /* rgba(217, 57, 91, 0.35) */
    /* rgba(217, 57, 91, 0.5) */
    --background-color: #f7eee2;
    --text-title: #1b1b1b;
    --text-body: #535353;
    /* #514F4D; */
    --text-caption: #666666;
    --navbar-bg: rgba(255, 255, 255, 0.8);
}

/* @media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #ffffff;
        --primary-color: #ff6584;
        --border-color: #444;
    }
} */

/* =================
   GENERAL
================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background-color);
    flex-flow: column;
    display: flex;
    align-items: center;
    font-family: "Open Sans", sans-serif;
    font-size: 1rem;
    color: var(--text-body);
}

main {
    width: 90%;
    max-width: 1200px;
    margin: 24px 0px;
    margin: auto;
    padding-top: 90px;
}

p,
li {
    line-height: 1.75rem;
}

img {
    display: block;
    max-width: 100%;
}
/* @media (max-width: 768px) {
    main {
        width: auto;
        margin: 0 2rem;
    }
} */

.scroll-down {
    position: absolute;
    bottom: 1em;
    text-align: center;
    width: 100%;
}

.section {
    flex-flow: row;
    flex: 1;
    justify-content: space-between;
    align-self: center;
    align-items: stretch;
    max-width: 1400px;

    padding-bottom: 0;
    display: block;
    overflow: hidden;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: bold;
    font-family: Ubuntu, Helvetica, sans-serif;
    line-height: normal;
    color: var(--text-title);
}

h1 {
    font-size: 2rem;
    line-height: 2.5rem;
    font-weight: 500;
    margin-bottom: 36px;
}

/* h3 {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 46px;
}

h4 {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 38px; 
}*/

.display-1 {
    text-transform: none;
    margin-top: 10px;
    margin-bottom: 10px;
    font-family: Ubuntu, Helvetica, sans-serif;
    font-size: 4rem;
    font-weight: 700;
    line-height: 5rem;
}

.display-1.greeting {
    color: var(--light--white);
    font-size: 3rem;
    line-height: 4rem;
    position: relative;
}

/* Text Elements */
a {
    color: inherit;
    text-decoration: none;
}

/* =================
   PAGE TRANSITION
================== */
/* The pink block starts above the viewport */
/* .page-start-transition {
    position: fixed;
    top: 0%; 
    left: 0;
    width: 100%;
    height: 100vh;  
    background-color: pink;
    z-index: 9999;
    transition: top 0.4s ease-in-out;
}

.page-start-transition.active {
    top: 100%;
}

.page-end-transition {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: pink;
    z-index: 9999;
    transition: top 0.4s ease-in-out;
}

.page-end-transition.active {
    top: 0;
} */

/* =================
   HEADER NAVBAR
================== */
header {
    position: fixed;
    width: 90%;
    max-width: 1200px;
    z-index: 10;
    top: 16px;
    
}

#logo {
    font-family: Ubuntu, Helvetica, sans-serif;
    font-weight: 600;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 60px;
    margin: 0 auto;
    
    padding: 12px 24px;
}

#desktop-menu {
    background-color: var(--navbar-bg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    border-radius: 2em;
    backdrop-filter: blur(10px);
}

/* Navbar Links */
.navbar-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: static;
    /* transform: scaleY(100%) !important; */
    list-style: none;
    gap: 24px;
}

#desktop-links {
    /* display: block; */
    visibility: visible;
    opacity: 1;
    /* position: static; */
    height: 100%;
    width: auto;
}

#mobile-menu {
    display: none;
}

.navbar-links a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-body);
    font-weight: 600;
    /* position: relative; */
    transition: all 0.3s;
}

/* Hover nav link effect */
.navbar-links a:hover {
    color: var(--primary-color);
}

.navbar-links a::after {
    content: "";
    display: block;
    height: 2px;
    width: 0;
    background: var(--primary-color);
    transition: width 0.3s;
}

.navbar-links a:hover::after {
    width: 100%;
}

/* Hamburger Icon */
#navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.icon-bar {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-body);
    transition: transform 0.3s, opacity 0.3s;
}

/* Mobile Menu */
@media (max-width: 768px) {
    #desktop-links {
        display: none;
        visibility: hidden;
        opacity: 0;
    }

    #mobile-menu.active {
        opacity: 1;
        display: block;
        margin-top: 8px;
        padding: 0;
    }

    #mobile-links {
        flex-direction: column;
        background-color: var(--navbar-bg);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
        border-radius: 2em;
        backdrop-filter: blur(10px);
        gap: 0px;
        padding: 0 8px;
    }

    .navbar-item {
        margin: 8px 0;
        width: 100%;
    }
    .navbar-link {
        /* color: #d9d9d9; */
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 16px;
        border-radius: 1.5em;
    }

    /* No underline for hover */
    .navbar-links a:hover::after {
        width: 0;
    }

    /* #navbar-toggle.active   */
    #mobile-menu.active {
        opacity: 1;
        display: block;
    }
    .navbar-links {
        /* list-style: none; */
        position: absolute;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        height: auto;
        border-radius: 2em;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
        backdrop-filter: blur(10px);
        /* TODO: blur filter try backdrop-filter: blur(10px); */
        background-color: var(--navbar-bg);
        /* TODO: fix hover colour overflow */
        padding: 0px 24px;
        transform-origin: top; /* Set the scaling point to the top of the ul */
        /* transform: scaleY(0%); */
        transition: transform 0.3s ease-in-out;
    }
    .navbar-link:hover {
        background-color: var(--primary-hover-light);
    }

    #navbar-toggle {
        cursor: pointer;
        border: none;
        background-color: transparent;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }
    #navbar-toggle.active + #mobile-menu .navbar-links {
        transform: scaleY(100%);
    }

    /* Animated Hamburger */
    #navbar-toggle.active .icon-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    #navbar-toggle.active .icon-bar:nth-child(2) {
        opacity: 0;
    }
    #navbar-toggle.active .icon-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* =================
   HOME
================== */
/* Container using Flexbox */
.works-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center the cards */
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
}

/* Project Card */
.project-card {
    display: none;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
}

.project-card:hover {
    box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
    border-radius: 8px 8px 48px; /* Expanded bottom corners */
}

.project-card:focus-within {
    outline: var(--primary-color) 2px solid;
    box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
    border-radius: 8px 8px 48px;
}

.card-image {
    width: 100%;
    height: auto;
    display: block;
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.card-description {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #f2f2f2; /* Light grey background */
    color: #333; /* Dark text */
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 24px;
}

/* Right Arrow */
.arrow {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 32px;

    position: absolute;
    bottom: 24px;
    right: 24px;
    font-size: 1.5rem;
    color: #ca305f;
    border: #ca305f 1px solid;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
}

/* arrow Hover Effect */
.project-card:hover .arrow, .project-card:focus-within .arrow {
    transform: rotate(-30deg); /* Slight lift and rotate ↗ */
    opacity: 1;
}

@media (min-width: 768px) {
    .works-container {
        justify-content: flex-start;
    }

    .project-card {
        width: calc(50% - 1rem); /* Two cards per row */
    }
}


/* =================
   CARD FILTER
================== */
.show {
    display: block;
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-bottom: 36px;

}

/* Style the buttons */
.filter {
    border: 2px solid transparent;
    outline: none;
    padding: 12px 16px;
    background-color: var(--navbar-bg);
    color: var(--text-body);
    cursor: pointer;
    border-radius: 24px;
    font-size: 1rem;
    transition: all 0.2s;
}

/* Add a light grey background on mouse-over */
.filter:hover, .filter:focus {
    border: var(--primary-color) 2px solid;
    color: var(--primary-color)
}

/* Add a dark background to the active button */
.filter.active {
    background-color: var(--primary-color);
    color: white;
}



/* =================
   PROEJCT DETAIL
================== */

.grid2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.grid1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.grid1-1 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.overview-tags .tag {
    background: var(--navbar-bg);
    color: #333; 
}

.overview-image {
    margin: 24px 0;
    box-sizing: content-box;
    object-fit: fill;
    border-radius: 8px;
    width: 100%;
    overflow: clip;
}

.detail-section {
    display: flex;
    flex-direction: column;
    /* justify-content: center; */
    align-items: center;
    max-width: 1200px;

    padding-bottom: 0;
    overflow: hidden;
}

/* project detail section title */
.detail-section h2 {
    font-size: 2rem;
    line-height: 2.5rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.detail-text-container {
    width: 100%;
    max-width: 800px;
    /* TODO: fix margin */
    margin: 48px 0;
}

/* TODO: a heading tag? h5? */
.label {
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: Ubuntu, Helvetica, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.625rem;
}

.list {
    margin-top: 0;
    margin-bottom: 24px;
    padding-left: 32px;
}

.detail-image-container {
    border-radius: 8px;
    overflow: hidden;
}
.detail-image-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
}


figcaption {
    /* text-align: center; */
    color: var(--text-caption);
    /* flex-flow: wrap; */
    font-size: 0.875rem;
    /* line-height: 1.25rem; */
    /* display: block; */
}

embed {
    margin: auto;
    display: block;
}

@media (max-width: 768px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }

    .grid1-2 {
        grid-template-columns: 1fr;
    }
    .grid1-1 {
        grid-template-columns: 1fr;
    }
}

/* =================
   ART WORK
================== */
.grid {
    --gap: 1em;
    --columns: 3;
    max-width: 1200px;
    margin: 0 auto;
    display: column;
    columns: var(--columns);
    gap: var(--gap);
}

.grid > * {
    break-inside: avoid;
    margin-bottom: var(--gap);
}

video {
    max-width: 100%;
}

@supports (grid-template-rows: masonry) {
    .grid {
        display: grid;
        grid-template-columns: repeat(var(--columns), 1fr);
        grid-template-rows: masonry;
        grid-auto-flow: dense;
        /* align-tracks: stretch; */
    }

    .grid > * {
        margin-bottom: 1em;
    }
}

/* The Modal (background) */
.modal-trigger{
    transition: 0.3s;
}
.modal-trigger:hover {
    cursor: zoom-in;
    transform: scale(1.02);
}

.modal {
    display: none;
    position: fixed;
    z-index: 20;
    /* TODO: centre the image */
    /* padding-top: 80px;  */
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0, 0, 0); /* Fallback color */
    background-color: rgba(0, 0, 0, 0.9); /* Black w/ opacity */
}

.modal-content {
    margin: auto;
    display: block;
    /* width: 80%; */
    /* max-width: 80vw; */
    max-height: 80vh;
    margin-top: 80px;
}

.modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 800px;
    text-align: center;
    /* TODO: change text colour */
    color: #fff;
    padding: 10px 0;
    /* height: 150px; */
}

/* Add Animation - Zoom in the Modal */
.modal-content,
#caption {
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* The Close Button */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* 100% Image Width on Smaller Screens */
@media only screen and (max-width: 700px) {
    .modal-content {
        width: 100%;
    }
}

/* =================
   ABOUT
================== */

/* =================
   FOOTER
================== */
.footer-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* position: absolute; */
    bottom: 0;
    width: 100%;
}

.footer-links {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.link-block {
    display: inline-block;
    transition: transform 0.2s ease-in-out;
}

.icon {
    fill: var(--text-caption);
    transition: fill 0.2s ease-in-out;
}

.link-block:hover .icon {
    fill: var(--primary-color);
}

footer p {
    font-size: 0.875rem;
}
