/* Global Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding: 0;
    /* Corrected background-image path using root-relative path */
    background-image: url(../../images/bundlebg.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

/* --- REMOVED OLD IMG STYLES. img selector only for header logo now --- */
/*
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    display: inline-block;
}
*/

/* Wrapper for Max Width and Centering */
.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Main Content & Grid Wrapper Styles */
main {
    margin-top: 0;
    padding: 0;
    min-height: calc(100vh - 8vw - 40px);
}

.makeroom {
  min-height: 14em;
}

.mowide {}

/* Grid Specific Styles */
/* --- IMPORTANT: Styles applied to the <a> tag as the grid item --- */
.grid-wrapper > a { /* Changed selector from > div to > a */
    display: flex; /* For label content centering */
    justify-content: center; /* For label content centering */
    align-items: center; /* For label content centering */
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    text-decoration: none; /* Remove default link underline */
    color: inherit; /* Inherit text color, or set specific link color */
    cursor: pointer;

    /* --- Default Background Image Properties for ALL grid <a> items --- */
    background-repeat: no-repeat;
    background-size: 110%; /* Default: Cover the entire <a> area */
    background-position: center; /* Default: Center the image */
    transition: all 1s ;
    transition-timing-function: ease-out


}

.grid-wrapper > a:hover { /* Changed selector from > div to > a */

    background-size: 130% ;

}


/* REMOVED .grid-wrapper > div > img as <img> tags are gone */
/*
.grid-wrapper > div > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}
*/

.grid-wrapper {
    display: grid;
    grid-gap: 60px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Default 4 columns */
    grid-auto-rows: 320px;
    grid-auto-flow: dense;
    padding: 20px;
}

/* Change selectors from .grid-wrapper .wide to .grid-wrapper a.wide */
.grid-wrapper a.wide {
    grid-column: span 2;


}

.grid-wrapper a.tall { /* Change selector */
    grid-row: span 2;
    /* --- Custom Background Properties for TALL items (from your solution) --- */
    background-position: center 0%;
    background-size: 150%;
}

.grid-wrapper a.big { /* Change selector */
    grid-column: span 2;
    grid-row: span 2;
}

/* --- CSS for Grid Item Labels --- */
.item-label {
    position: absolute;
    z-index: 5; /* Label above image */
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    font-size: 0.9em;
    text-align: left;
    pointer-events: none; /* Crucial: allows clicks to pass through to the <a> parent */
    box-sizing: border-box;
    top: 0;
    left: 0;
    transform: none;
    width: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-family: 'Roboto', sans-serif; /* Applied Roboto Font */
}

.item-label {
    position: absolute;
    z-index: 5; /* Label above image */
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    font-size: 1em;
    font-weight: 200;
    text-align: left;
    pointer-events: none; /* Crucial: allows clicks to pass through to the <a> parent */
    box-sizing: border-box;
    top: 0;
    left: 0;
    transform: none;
    width: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-family: 'Roboto', sans-serif; /* Applied Roboto Font */
}
.item-label > span {
    font-weight: 700;
}
/* Footer Styles */
footer {
    text-align: center;
    padding: 10px 0;
    background: #333;
    color: #fff;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    main {
        margin-top: calc(70px + 15px);
    }

    .grid-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        grid-auto-rows: 220px;
        grid-gap: 20px;
        padding: 25px;
    }

    /* Responsive overrides for .item-label */
    .item-label {
        padding: 6px 8px;
        font-size: 0.8em;
    }

    /* Resetting wide/tall grid spans for smaller screens */
    .grid-wrapper a.wide, /* Changed selector */
    .grid-wrapper a.tall, /* Changed selector */
    .grid-wrapper a.big { /* Changed selector */
        grid-column: span 1;
        grid-row: span 1;
        /* --- IMPORTANT: Revert background-position/size for single-column mobile view --- */
        background-position: center !important; /* !important to override inline style */
        background-size: cover !important; /* !important to override inline style */
    }
}

@media (max-width: 480px) {
    main {
        margin-top: calc(min(8vw, 70px) + 15px);
    }

    .grid-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        grid-auto-rows: 150px;
        grid-gap: 20px;
        padding: 15px;
    }

    /* Responsive overrides for .item-label */
    .item-label {
        padding: 5px 8px;
        font-size: 0.7em;
    }
}