* {
    box-sizing: border-box;
}

body {
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    margin: 0;
    padding: 0;
    position: relative;
    min-height: 100vh;
    padding-bottom: 100px; /* reserve space for fixed footer */
}

/* create a fixed pseudo-element that renders and blurs the background image */
body::before{
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("image/Octagon.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(6px);           /* adjust blur strength here (e.g. 4px, 8px) */
    transform: scale(1.03);      /* prevents visible edges after blur */
    z-index: -1;                 /* keep it behind page content */
    will-change: filter, transform;
}

/* make sure page content sits above the blurred bg (not always necessary) */
header, ul.topnav, .flex-container, footer {
    position: relative;
    z-index: 0;
}

header {
    background-color: #2b0097;
    padding: 10px;
    text-align: center;
    color: white;
}

/* Style the topnav */
ul.topnav {
    display: flex;
    list-style-type: none;
    margin: 0;
    padding: 0;
    background-color: #333333;
    justify-content: center;
}

/* Style links in topnav */
ul.topnav li a {
    display: block;
    color: #f1f1f1;
    padding: 14px 16px;
    text-decoration: none;
}

/* Change color on hover */
ul.topnav li a:hover {
    background-color: #dddddd;
    color: black;
}

div.gallery {
    display: grid;
    gap: 28px;
    width: min(700px, 94%);             /* narrower max width so cards look nice */
    margin: 40px auto;
    padding: 0 12px;
}

div.gallery-item {
    margin: 0 auto;
    border: 1px solid #000;
    background-color: #fff;
    width: 100%;
    max-width: 640px;                   /* optional card max width */
    border-radius: 6px;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

div.gallery-item img {
    width: 100%;
    height: 320px;                      /* taller image for single-column layout */
    object-fit: cover;
    display: block;
}

div.gallery-item .desc {
    padding: 16px;
    text-align: center;
    font-size: 0.95rem;
}

/* hover effect */
div.gallery-item:hover {
    transform: translateY(-6px);
}

/* Style the footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    color: white;
    background-color: #525252;
    padding: 8px;
    text-align: center;
    z-index: 1000;
}

/* Use media query and show the flex items vertically if screen width is less than 600px */
@media screen and (max-width:600px) {
    div.flex-container {
        flex-direction: column;
  }
}