/* ==================================================================== */
/* CSS Variables */
/* ==================================================================== */
:root {
    /* Colors */
    --color-white: #fff;
    --color-off-white: #fafafa;
    --color-light-gray: #ccc;
    --color-black: #000;
    --color-brown: #963;
    --color-red: #FF2600;
    --color-blue: #00f;
    --color-purple: #800080;
    --color-link-hover: #f00;
    --color-link-active: #0f0;

    /* Fonts */
    --font-serif: Baskerville, 'Palatino Linotype', Palatino, 'Century Schoolbook L', 'Times New Roman', serif;
    --font-sans-serif: Arial, Helvetica, sans-serif;

    /* Spacing */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 20px;
}

/* ==================================================================== */
/* Global page styles for overall look and feel */
/* ==================================================================== */
body {
    background-color: var(--color-white);
    font-family: var(--font-serif);
    text-align: left;
    font-size: medium;
    max-width: 960px;
    margin: 0 auto;
}

/* Base element styles */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans-serif);
    text-align: center;
}

a:link {
    color: var(--color-blue);
}

a:visited {
    color: var(--color-purple);
}

a:hover {
    color: var(--color-link-hover);
}

a:active {
    color: var(--color-link-active);
}

img, embed, object, video {
    max-width: 100%;
    height: auto;
}

figure {
    margin: 0;
    width: 100%;
    /* Removed display: flex; as it's not needed here and can cause issues. */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

figcaption {
    padding: var(--spacing-sm) 0;
    width: 100%;
    text-align: left;
}

/* ==================================================================== */
/* Utility and Layout Classes */
/* ==================================================================== */
main {
    background-color: var(--color-off-white);
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.gallery {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: space-between;
}

.gallery-item {
    width: 48%;
    max-width: 500px;
    box-sizing: border-box;
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--color-light-gray);
    padding: var(--spacing-sm);
    background-color: var(--color-white);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Custom spacing for gallery items on the main page */
.gallery-item h3 {
    margin-bottom: var(--spacing-xs);
}

.gallery-item p {
    margin-bottom: var(--spacing-md);
}

.gallery-item ul {
    list-style: none; /* Removes the default bullet points */
    padding-left: 0;
    margin-top: var(--spacing-xs);
}

.gallery-item li {
    margin-bottom: 8px; /* Adds space between list items */
}

.divider {
    border: none;
    height: 1px;
    background-color: var(--color-black);
    margin: var(--spacing-md) 0;
}

/* Alignment and Float classes */
.floatleft {
    float: left;
    margin-right: var(--spacing-md);
}

.floatright {
    float: right;
    margin-left: var(--spacing-md);
}

.center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.right {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: right;
}

/* Color and font classes */
.brown {
    color: var(--color-brown);
}

.red {
    color: var(--color-red);
}

.blue {
    color: var(--color-blue);
}

.sans-serif {
    font-family: Verdana, Geneva, sans-serif;
}

/* ==================================================================== */
/* Responsive adjustments for smaller screens (e.g., mobile devices) */
/* ==================================================================== */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        text-align: center;
    }
    .gallery {
        flex-direction: column;
    }
    .gallery-item {
        width: 100%;
    }
}