/* General Styles */

@font-face {
  font-family: "Redwood";
  src: url("../fonts/RWR.ttf");
}

* {
  box-sizing: border-box;
}

:root {
  --header-offset: 160px;
  /* Header offset fallback */
}

body {
  margin: 0;
  padding: 0;
  padding-top: var(--header-offset);
  font-family: "Redwood";
  font-weight: bolder;
  background-color: #F2F2F2;
  overflow-x: hidden;
}

body p {
    color: #000;
    font-size: 1.4rem
}

body a {
    color: #000;
    text-decoration: none
}

.main-section {
    min-height: 100vh;
}

/* Header */

header {
    width: 95vw;
    height: -moz-fit-content;
    height: fit-content;
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    font-size: 1.7rem;
    border-bottom: 2px solid #000;
    margin: auto
}

header img {
    height: 125px;
    width: 190px
}

header .nav-toggle {
    display: none;
    color: #404040;
    background: rgba(0, 0, 0, 0);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    transition: transform .4s ease
}

header .navigation {
    display: flex;
    justify-content: right;
    width: 100%;
    margin: auto;
    gap: 20px;
}

header .navigation .navigation-link {
    position: relative;
    display: inline-block;
    line-height: 1.5;
    padding: 5px 10px;
}

header .navigation .navigation-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #000;
    transform: scaleX(0);
    transition: transform .2s ease-out;
    transform-origin: center
}

header .navigation .navigation-link:hover::after {
    transform: scaleX(1)
}

header .navigation .navigation-link.center::after {
    transform-origin: bottom center
}

header .navigation .navigation-link.center::after:hover {
    transform-origin: bottom center
}

/* Active Link */
header .navigation .navigation-link.active::after,
.navigation-link.active::after {
  transform: scaleX(1) !important;
  transition: none !important;
}

/* Keep it underlined on hover, still no animation */
header .navigation .navigation-link.active:hover::after,
.navigation-link.active:hover::after {
  transform: scaleX(1) !important;
}

header#header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 9999;

    background: #F2F2F2;
    transition: transform 0.25s ease;
    will-change: transform;
}

header#header.header--hidden {
    transform: translateX(-50%) translateY(-110%);
}

/* Hide header whenever an art piece modal is open */
body.modal-open header#header {
    transform: translateX(-50%) translateY(-110%);
}

/* (Optional but recommended) stop the page behind the modal from scrolling */
body.modal-open {
    overflow: hidden;
}

.gallery-selector-container {
    display: flex;
    justify-content: center;
    gap: 150px
}

.gallery-selector-container .gallery-selector-button {
    color: black;
    border: 0;
    background-color: #f2f2f2;
    width: 120px;
    font-size: 22px;
    font-family: "Redwood";
    font-weight: bold;
    padding: 10px 25px;
    border-radius: 100px;
    margin-top: 50px;
    margin-bottom: 50px;
    transition: all .25s ease-in-out
}

.gallery-selector-container .gallery-selector-button:hover {
    background-color: #aeaeae;
    cursor: pointer
}

.gallery-selector-container .gallery-selector-button:active {
    background-color: #aeaeae !important
}

.gallery-selector-container .gallery-selector-button.active {
    background-color: #aeaeae
}

.gallery {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 100px;
    width: 70%;
    margin: 0 auto
}

.gallery .gallery-img-container {
    width: 100%;
    transition: transform .2s
}

.gallery .gallery-img-container img {
    width: 100%;
    box-shadow: 10px 15px rgba(64, 64, 64, .4784313725);
    -o-object-fit: cover;
    object-fit: cover
}

.gallery .gallery-img-container img:hover {
    transform: none
}

.gallery .gallery-img-container:has(img:hover) {
    transform: scale(1.1)
}

.gallery .gallery-img-container p {
    font-size: medium;
    margin: 0
}

.gallery .gallery-img-container p:first-of-type {
    margin-top: 16px;
    font-size: 25px
}

.gallery .gallery-img-container p:last-of-type {
    font-size: 18px;
}

.gallery .gallery-img-container.landscape {
    grid-column: span 2;
}

.gallery .gallery-img-container.align-left {
    text-align: left;
}

.gallery .gallery-img-container.align-center {
    text-align: center;
}

.gallery .gallery-img-container.align-right {
    text-align: right;
}

.gallery .gallery-img-container.extra-landscape-double {
    grid-column: span 2;
    text-align: left
}

.gallery .gallery-img-container.extra-landscape-single {
    grid-column: span 1;
    text-align: center
}

#modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .7);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease
}

#modal.show {
    opacity: 1;
    visibility: visible
}

#modal .modal-content {
    background-color: #f2f2f2;
    display: flex;
    flex-direction: row;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    padding: 30px;
    border-radius: 10px;
    gap: 30px;
    position: relative;
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform .3s ease;
    margin: auto
}

#modal.show .modal-content {
    transform: scale(1)
}

#modal .close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #404040;
    background-color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
    transition: background-color .25s, transform .2s;
    z-index: 10;
    line-height: 1;
    padding: 0
}

#modal .close:hover {
    background-color: #f0f0f0;
    transform: scale(1.1)
}

#modal-img {
    max-width: 50%;
    max-height: 80vh;
    height: auto;
    -o-object-fit: contain;
    object-fit: contain;
    border-radius: 5px
}

#modal .description {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1
}

#modal .description h2 {
    margin: 0 0 10px 0;
    font-size: 28px
}

#modal .description p {
    margin: 0 0 10px 0;
    font-size: 20px;
}

#modal .meta-boxes {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 15px;
    margin-top: auto
}

#modal .meta-boxes .price {
    font-weight: bold;
    font-size: 28px
}

#modal .meta-boxes .contact {
    padding: 12px 20px;
    font-size: 18px;
    background-color: #404040;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color .25s
}

#modal .meta-boxes .contact:hover {
    background-color: #aeaeae
}

/* Footer */


footer {
    width: 95vw;
    height: 150px;
    margin: auto;
    margin-top: 50px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    padding: 20px 0;
    border-top: 2px solid #000
}

footer .footer-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-end
}

footer .footer-left p {
    margin: 0
}

footer .footer-right {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    text-align: right
}

footer .footer-right a {
    text-decoration: underline
}

footer .footer-right p {
    margin: 0
}

footer .footer-mobile {
    display: none
}

@media(max-width: 767px) {

    
    header {
        width: 100vw;
        margin: 0;
        padding: 10px 0 0;
        display: flex;
        flex-direction: column;
        align-items: center
    }

    header img {
        height: 125px;
        width: 175px
    }

    header .nav-toggle {
        display: block;
        margin: 10px 0
    }

    header .navigation {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        border-top: 1px solid #000;
        transition: max-height .4s ease, opacity .4s ease
    }

    header .navigation.open {
        max-height: 300px;
        opacity: 1
    }

    header .navigation .navigation-link {
        width: 100%;
        padding: 15px 0;
        font-size: 1.7rem;
        text-align: center
    }

    header .navigation .navigation-link::after {
        display: none
    }

    header#header {
        left: 0;
        width: 100vw;
        transform: translateY(0);
        overflow: visible;
        /* allow dropdown to hang below */
        background: #F2F2F2;
    }

    header#header.header--hidden {
        transform: translateY(-110%);
    }

    body.modal-open header#header {
        transform: translateY(-110%);
    }

    /* dropdown overlays page (does not change header height) */
    #primary-nav.navigation {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;

        background: #F2F2F2;

        max-height: 0;
        opacity: 0;
        overflow: hidden;

        border-top: 1px solid #000;
        border-bottom: 0;

        pointer-events: none;
        transition: max-height 0.4s ease, opacity 0.4s ease;
    }

    #primary-nav.navigation.open {
        max-height: 350px;
        opacity: 1;
        pointer-events: auto;

        border-bottom: 2px solid #000;
        /* ✅ bottom line under dropdown */
    }

    .gallery-selector-container {
        gap: 50px
    }

    .gallery {
        grid-template-columns: 1fr 1fr;
        gap: 0;
        width: 100%
    }

    .gallery .gallery-img-container {
        margin: 10px;
        width: auto
    }

    .gallery .gallery-img-container.align-left {
        text-align: left
    }

    .gallery .gallery-img-container.align-center {
        text-align: center
    }

    .gallery .gallery-img-container.align-right {
        text-align: right
    }

    .gallery .gallery-img-container img {
        width: 100%;
        height: auto
    }

    .gallery .gallery-img-container:has(img:hover) {
        transform: scale(1.05)
    }

    #modal .modal-content {
        flex-direction: column;
        width: 95%;
        padding: 20px;
        max-height: 95vh;
        overflow-y: auto
    }

    #modal-img {
        max-width: 100%;
        max-height: 50vh;
        margin-bottom: 20px
    }

    #modal .description {
        justify-content: flex-start;
        gap: 10px
    }

    #modal .description h2 {
        margin-bottom: 10px
    }

    #modal .description p {
        margin-bottom: 15px
    }

    #modal .meta-boxes {
        flex-direction: row;
        justify-content: flex-start;
        gap: 15px;
        align-items: center
    }

    #modal .meta-boxes .price {
        font-size: 22px
    }

    #modal .meta-boxes .contact {
        padding: 12px 20px;
        font-size: 16px
    }

    footer {
        width: 100vw;
        padding: 20px;
        display: block
    }

    footer .footer-left,
    footer .footer-right {
        display: none
    }

    footer .footer-mobile {
        display: flex;
        flex-direction: column;
        text-align: center
    }

    footer .footer-mobile .footer-image-links {
        display: flex;
        justify-content: space-between;
        width: 70%;
        margin: auto
    }

    footer .footer-mobile .footer-image-links img {
        height: 110px
    }
}