/* Setting variables in order to calculate sizes below */

:root {
    --containerwidth: 1200px;
    --footerheight: 80px;
    --navbarheight: 100px;
    --mobilemenuitemheight: 60px;
    --speed: .3s;
    --space: 20px;

    /* Navbar background color */
    --navbarcolor: #090909;

    /* Navbar font and button color */
    --navbaritemcolor: #c1cddb;

    --lightestcolor: #adb5be;
    --mainbody: #adb5be;

    /* Alternative bg color */
    --brcolor: #363636;

    --footercolor: #414141;

    --phonecolor: #e7ebf0;

    /* Table colours */
    --tablecolor: #829ca6;
    --thcolor: #c9d5de;
    --oddrowcolor: #e7edf0;
    --evenrowcolor: white;
    --bordercolor: #829ca6;

    /* Homepage sellings specific colors */
    --sellings-bg: #f8f9fa;
    --sellings-border: #e9ecef;
    --sellings-shadow: rgba(0, 0, 0, 0.1);
    --sellings-hover-shadow: rgba(0, 0, 0, 0.15);
    --sellings-title-color: #2c3e50;
    --sellings-price-color: #000e29;
}

/* Mutual settings for the both, mobile and desktop layouts */

phone {
    display: flex;
    width: 100%;
    max-width: var(--containerwidth);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background-color: var(--phonecolor);
    padding: calc(var(--space) / 2) var(--space);
}

phone>span>a,
phone>span>a:hover,
phone>span>a:active,
phone>span>a:visited {
    color: #000000;
}

.profile_form {
    background-color: #616a6c;
    padding: var(--space);
}

.work-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.work {
    width: 100%; /* The work block takes up the full width of its container */
    height: 0; /* Height is initially set to 0 */
    padding-top: 60%; /* Aspect ratio control: height is 60% of the width */
    background-size: cover; /* Cover the area of the div */
    background-position: right top; /* Align the image to the top right corner */
    position: relative; /* For positioning the overlay link */
    border: 1px solid gray; /* Add a border to the image */
    overflow: hidden; /* Ensure any part of the image that exceeds the div dimensions is hidden */
}

.work::before {
    content: "";
    position: absolute;
    top: 0; /* Adjust as needed to ensure the logo is cut off */
    right: 0; /* Adjust as needed */
    bottom: 0; /* Adjust as needed */
    left: 0; /* Adjust as needed */
    background: inherit; /* Inherit the background of the .work div */
    background-size: 113%; /* Make the background image slightly larger */
    background-position: right top;
    z-index: 0; /* Ensure it stays below the overlay link */
}


.work__link-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
}

.work__header {
    width: 100%;
    padding: calc(var(--space)/2) 0;
    box-sizing: border-box;
}

.work__header a {
    font-weight: bold;
}

.work__header__title {
    font-size: large;
}

.work__header__title, .work__header__date {
    margin: 5px 0;
}

@media (max-width: 1024px) or (orientation: portrait) {
    phone {
        flex-direction: column;
        gap: 5px;
    }

    .work-container, .work, .work__header {
        width: 100%;
    }

    .work__header__title, .work__header__date {
        margin: 0 var(--space);
    }

    .work {
        border-left-style: none;
        border-right-style: none;
    }

    .sellings-section .work__header__title {
        font-size: 1.1em;
    }

    .sellings-section .work__header__date {
        font-size: 1em;
    }

    .works-container {
        margin-bottom: 0;
    }

    .sellings-section .works-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(100%, 2fr));
        gap: var(--space);
        margin-top: 0;
        margin-bottom: 0;
        padding: 0;
        border-radius: 8px;
        overflow: hidden;
        width: 100%;
    }
}

@media (min-width: 1025px) and (orientation: landscape) {
    .works-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .work-container {
        width: calc(50% - var(--space)/2);
    }

    .work__header__title, .work__header__date {
        margin: 0;
    }

    .sellings-section .work-container {
        width: 100%;
    }

    .sellings-section {
        width: calc(100% - var(--space)*2);
        margin: 0;
        padding: 0;
        transform: none;
    }

    .sellings-section .works-container {
        grid-template-columns: 1fr 1fr !important;
        width: 100%;
        gap: var(--space);
    }

    .sellings-section .work {
        width: 100%;
        min-width: 0;
        max-width: none;
    }
}

/* Homepage sellings section - specific styling */
.sellings-section {
    top: var(--space);
    margin-left: var(--space);
    margin-right: var(--space);
}

.sellings-section .works-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space);
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.sellings-section .work-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px var(--sellings-hover-shadow);
}

.sellings-section .work {
    border: none;
    border-radius: 8px 8px 0 0;
    position: relative;
    overflow: hidden;
}

.sellings-section .work::before {
    background-size: cover;
    background-position: center;
    transition: transform var(--speed) ease;
}

.sellings-section .work-container:hover .work::before {
    transform: scale(1.05);
}

.sellings-section .work__header {
    padding: var(--space);
    background: white;
    border-radius: 0 0 8px 8px;
}

.sellings-section .work__header__title {
    color: var(--sellings-title-color);
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.sellings-section .sellings-price {
    color: var(--sellings-price-color);
    font-weight: 1000;
    font-size: 1.1em;
}
