/*
 * Created and maintained by Nick Hilton. All rights reserved.
 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #303030;
    color: white;
}

header {
    background-color: #303030;
    color: white;
    padding: 15px;
    text-align: center;
}

.header-title {
    letter-spacing: 4px;
    font-weight: normal;
}

nav {
    display: flex;
    justify-content: center;
    background-color: #404040;
    padding: 10px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 10px;
    margin: 0 10px;
    display: block;
}

nav a:hover {
    background-color: #505050;
}

.menu-item {
    position: relative;
    display: inline-block;
}

:root {
    --ani-speed: 0.5s; /* Define the variable at the root level */
}

/* Hide sub-menu initially */
.sub-menu {
    position: absolute;
    top: 100%; /* Position below the parent menu item */
    left: 0;
    background-color: #292929;
    padding: 5px;
    z-index: 1;
    opacity: 0;
    height: 0;
    border-top: 1px solid white;
    border-bottom: 1px solid white;
    overflow: hidden;
    transition: height var(--ani-speed) ease, opacity var(--ani-speed) ease;
}

/* Show sub-menu on hover, with smooth animation */
.menu-item:hover .sub-menu {
    display: inline-block;
    opacity: 1;
    height: auto;
}

main {
    padding: 20px;
}

footer {
    background-color: #303030;
    color: white;
    text-align: center;
    padding: 10px;
    position: fixed;
    bottom: 0;
    width: 100%;
}

/* original chat gpt work to make a resize able grid of images. */

/* Base styles for the grid items */
.grid-item {
    position: relative; /* Required for the ::before pseudo-element */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
}

/* Image styles */
.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Pseudo-element styles for the white overlay on hover */
.grid-item::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(255, 255, 255, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

/* Hover styles */
.grid-item:hover::before {
    opacity: 1;
}

/* Grid styles */
.grid-container {
    display: grid;
    grid-gap: 10px;
    align-items: center;
}

/* The popup when clicking on a gallery image */

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 10;
    width: 95%;
    height: 95%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    text-align: center; /* horizontal alignment */

    display: flex;
    flex-direction: column; /* Arrange items vertically */
    align-items: center; /* Center content horizontally */
}

.popup-ctx {
    position: absolute;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    top: 50%;
    transform: translate(0%, -50%);

    display: flex;
    flex-direction: column;
    align-items: center;
}

.popup img {
    max-height: 95%;
    max-width: 95%;
    /* Ensure the image container doesn't force alignment issues */
    margin: 0 auto;
}

.popup p {
    text-align: center;
    font-size: 24px;
}

.title-container {
    display: flex;
    align-items: center;
}

.title-container button {
    margin-right: 10px; /* Adjust spacing as needed */
}

/* --- Button Styling (Consolidated for clarity) --- */

/* Base button properties moved to the general 'button' selector below */
.like-button {
    background-image: url('like-button.svg');
}

.like-button.active {
    background-image: url('like-button-active.svg');
}

.share-button {
    background-image: url("share.svg");

    /* Ensure the background scaling is present to prevent tiling */
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

.share-button.active {
    background-image: url("share-pressed.svg");
}

/* General button styles - now manages size, background, and tiling prevention */
button {
    background: transparent;
    background-color: transparent;

    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;

    border: none;
    cursor: pointer;
    padding: 10px;
    color: white;

    width: 24px;
    height: 24px;
}

.popup button {
    top: 10px;
    right: 10px;
    z-index: 100;
}

.button-text {
    opacity: 0;
    transition: opacity 0.3s ease-in-out; /* Smooth transition */
}

button svg {
    stroke: #FFFFFF;
    stroke-width: 1.5052;
    stroke-linecap: round;
    stroke-linejoin: miter;
    padding-bottom: 10px;
}

button:hover svg {
    stroke: #FFFFFF;
}
button:hover .button-text {
    opacity: 1; /* Make text visible on hover */
}

.common-style {
    max-width: min(95%, 600px);
    width: auto;
    margin: 0 auto;
}

.common-style a {
    color: white;
    text-decoration: none;
    padding: 10px;
    margin: 0 10px;
    display: block;
}

.gallery-style {
    max-width: 90%;
    width: 90%;
    margin: 0 auto;
}

/*
 * Mobile styles.
 */
@media (max-width: 1100px)
{
    .common-style, .gallery-style {
        max-width: 100%;
        width: 100%; /* Make the section full width on smaller screens */
    }

    /*
    .popup p {
        font-size: 36px;
    }

    .like-button,
    .like-button.active,
    .share-button {
        width: 36px;
        height: 36px;
    }
    */
}