/* =================== GENERAL RESET =================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --content-max: 1200px;
    --content-padding: clamp(1rem, 5vw, 3rem);
}

/* =================== BASE STYLES =================== */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #000;
    background-color: #f9f9f9;
}

/* =================== HEADER STICKY OVERLAY =================== */
header {
    position: relative;
    width: 100%;
    z-index: 100;
}

.logo-row {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem var(--content-padding);
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 110;
    transition: background 0.3s ease;
    height: 100px;
}

.logo-row .logo img {
    max-height: 100px;
    width: auto;
    display: block;
}

.top-links {
    display: flex;
    gap: 1.5rem;
}

.top-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.7rem;
    transition: color 0.3s ease;
}

.top-links a:hover {
    text-decoration: underline;
}

/* =================== NAV BAR =================== */
.main-menu {
    position: fixed;
    top: 100px;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 105;
    transition: background 0.3s ease;
}

.horizontal-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0.7rem;
    gap: 5rem;
}

.horizontal-menu li {
    display: flex;
    align-items: center;
    justify-content: center;
}

.horizontal-menu a {
    color: #fff;
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.horizontal-menu a:hover {
    text-decoration: underline;
}

/* =================== DROPDOWN MENU =================== */
.horizontal-menu li.dropdown {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.horizontal-menu li.dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    list-style: none;
    padding: 0;
    min-width: 180px;
    z-index: 200;
    border-radius: 2px;
    background-color: rgba(0, 0, 0, 0.85);
}

.horizontal-menu li.dropdown .dropdown-menu li a {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    color: #fff;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: background 0.3s ease;
}

.horizontal-menu li.dropdown .dropdown-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.horizontal-menu li.dropdown:hover .dropdown-menu {
    display: block;
}

/* =================== MOBILE / HAMBURGER MENU =================== */
.menu-toggle {
    display: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 22px;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: 0.3s ease;
}

/* =================== MEDIA QUERIES =================== */
@media (max-width: 1024px) {
    .image-item,
    .two-box-left,
    .two-box-right {
        flex: 1 1 48%;
    }
}

@media (max-width: 768px) {
    .logo-row {
        flex-direction: row;
        justify-content: space-between;
        height: auto;
    }

    .top-links {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .horizontal-menu {
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 1rem 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.85);
    }

    .main-menu.active .horizontal-menu {
        display: flex;
    }

    .horizontal-menu li.dropdown {
        width: 100%;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: relative;
    }

    .horizontal-menu li.dropdown .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        display: none;
        flex-direction: column;
        min-width: 180px;
        padding: 0;
        background-color: rgba(0, 0, 0, 0.85);
        border-radius: 0;
        text-align: center;
    }

    .horizontal-menu li.dropdown.active .dropdown-menu {
        display: flex;
    }

    .horizontal-menu li.dropdown .dropdown-menu li a {
        width: 100%;
        text-align: center;
        padding: 0.5rem 1rem;
    }

    .two-box {
        flex-direction: column;
        padding: 1rem var(--content-padding);
        border-bottom: 1px solid #ccc;
    }

    .two-box-left,
    .two-box-right {
        flex: 1 1 100%;
        border-left: none;
        padding-left: 0;
    }

    .image-item {
        flex: 1 1 100%;
    }

    .image-row .image-item:first-child::before,
    .image-row .image-item:last-child::after {
        display: none;
    }

    .image-row .image-item + .image-item::before {
        height: 100%;
        top: 0;
    }

    .footer-container {
        flex-direction: column;
    }

    .mediabutton {
        font-size: 0.8rem;
        padding: 12px 0;
    }
}

/* =================== LARGE HEADER IMAGE =================== */
.index-large-image {
    position: relative;
    width: 100%;
    height: auto;
    margin-top: 0;
}

.index-large-image img {
    width: 100%;
    display: block;
}

/* =================== IMAGE MAP =================== */
.image-map {
    width: 60%;
    height: auto;
    display: block;
    margin: 0 auto;
    padding-top: 20px;
}

/* =================== TWO BOX SECTION =================== */
.two-box {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
    background-color: #f9f9f9;
    padding: 1rem var(--content-padding);
    max-width: var(--content-max);
    margin: 0 auto;
}

.two-box::after {
    content: "";
    display: block;
    width: 100%;
    margin: 0 auto;
    border-bottom: 1px solid #ccc;
}

.two-box-left,
.two-box-right {
    flex: 1 1 45%;
    min-width: 250px;
}

.two-box-right {
    border-left: 1px solid #ccc;
    padding-left: 10px;
}
.two-box-right img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =================== TEXT BOX =================== */
.text-box {
    font-size: 0.9rem;
    padding: 2rem var(--content-padding);
    max-width: var(--content-max);
    margin: 0 auto;
}

.text-box-content h2,
.text-box-content h3 {
    margin: 1rem 0;
}

.text-box-content p,
p.title {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* =================== IMAGE TABLE =================== */
.image-table,
.photologueimage-table {
    padding: 2rem var(--content-padding);
    max-width: var(--content-max);
    margin: 0 auto;
}

.image-row,
.photologueimage-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid #ccc;
    margin-bottom: 0.2rem;
    position: relative;
}

.image-item,
.photologueimage-item {
    flex: 1 1 23%;
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 9px;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

/* Vertical dividers */
.image-row .image-item + .image-item::before,
.photologueimage-row .image-item + .image-item::before {
    content: "";
    position: absolute;
    width: 1px;
    height: 90%;
    top: 50%;
    left: 0;
    background-color: #ccc;
    transform: translateY(-50%);
}

.image-row .image-item:first-child::before,
.photologueimage-row .image-item:first-child::before {
    top: 5%;
}

.image-row .image-item:last-child::after,
.photologueimage-row .image-item:last-child::after {
    top: 5%;
}

/* IMAGE AND OVERLAY EFFECTS */
.image-item img,
.photologueimage-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.3s ease-in-out, transform 0.3s ease-in-out;
    border-radius: 2px;
}

.image-item .overlay,
.photologueimage-item a .overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 118, 0.3);
    opacity: 0;
    pointer-events: none;
    border-radius: 2px;
    transition: opacity 0.3s ease-in-out;
}

.image-item:hover img,
.photologueimage-item a:hover img {
    filter: brightness(50%);
    transform: scale(1.02);
}

.image-item:hover .overlay,
.photologueimage-item a:hover .overlay {
    opacity: 1;
}

/* Captions */
.image-item .caption,
.photologueimage-item .caption {
    display: block;
    text-align: left;
    font-size: 0.8rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ccc;
    margin-top: 0.5rem;
    color: #333;
}

.image-item .figcaption,
.photologueimage-item .figcaption {
    display: block;
    text-align: center;
    font-size: 0.7rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ccc;
    margin-top: 0.5rem;
}

/* =================== INDEX OVERLAY =================== */
.indexoverlay {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 2px;
    cursor: pointer;
}

.indexoverlay > a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.indexoverlay img {
    display: block;
    width: 100%;
    height: auto;
    transition: filter 0.3s ease-in-out;
}

.indexoverlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 118, 0.3); /* match editions.html */
    pointer-events: none;
    border-radius: inherit;
    opacity: 1; /* always visible */
}

.indexoverlay:hover img,
.indexoverlay:focus-within img {
    filter: brightness(60%);
}

.indexoverlay:hover::after,
.indexoverlay:focus-within::after {
    opacity: 1;
}

.indexoverlay > a:focus {
    outline: 3px solid rgba(255, 204, 0, 0.8);
    outline-offset: 3px;
}

/* Overlay Text (merged indexoverlay + map-overlay) */
.indexoverlay .overlay-text,
.map-overlay .overlay-text {
    position: absolute;
    top: 30%;
    left: 5%;
    transform: translateY(-50%);
    font-family: Helvetica, Arial, sans-serif;
    font-size: 42pt;
    font-weight: 700;
    color: #fff;
    z-index: 5;
    line-height: 1.1;
}

.indexoverlay .overlay-text span,
.map-overlay .overlay-text span {
    display: block;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 4px solid #fff;
}

.indexoverlay .overlay-text span:last-child,
.map-overlay .overlay-text span:last-child {
    margin-bottom: 0;
}

/* Overlay subtext */
.overlay-subtext {
    position: absolute;
    top: calc(30% + 60px);
    left: 5%;
    transform: translateY(0);
    font-family: Helvetica, Arial, sans-serif;
    font-size: 15pt;
    font-weight: 500;
    color: #fff;
    z-index: 5;
    line-height: 1.5;
}

.overlay-subtext span {
    display: block;
    margin-bottom: 6px;
}

.overlay-subtext .map-link {
    color: #fff;
    text-decoration: underline;
    margin-left: 6px;
    font-weight: 550;
    transition: opacity 0.25s ease, border-color 0.25s ease;
}

.overlay-subtext .map-link:hover {
    opacity: 0.75;
    border-bottom-color: #fff;
}

.overlay-subtext .map-link:active {
    opacity: 0.6;
}

.overlay-subtext .map-link:visited {
    color: rgba(255, 255, 255, 0.85);
}

/* Media queries for overlay text */
@media (max-width: 1024px) {
    .indexoverlay .overlay-text,
    .map-overlay .overlay-text {
        font-size: 32pt;
        top: 28%;
    }
    .indexoverlay .overlay-text span,
    .map-overlay .overlay-text span {
        border-bottom-width: 3px;
    }
    .overlay-subtext {
        font-size: 16pt;
        top: calc(28% + 80px); 
    }
}

@media (max-width: 768px) {
    .indexoverlay .overlay-text,
    .map-overlay .overlay-text {
        font-size: 24pt;
        top: 25%;
    }
    .indexoverlay .overlay-text span,
    .map-overlay .overlay-text span {
        border-bottom-width: 2px;
    }
    .overlay-subtext {
        font-size: 14pt;
        top: calc(25% + 60px); 
    }
}

/* ===== 5 images per row ===== */
.image-row.five-images .image-item,
.photologueimage-row.five-images .photologueimage-item {
    flex: 1 1 18%;
}

/* ===== 5-image rows: sharpen images ===== */
.image-row.five-images img,
.photologueimage-row.five-images img {
    filter: contrast(1.08) saturate(1.06);
    image-rendering: -webkit-optimize-contrast;
}

/* ===== Disable overlay for 5-image rows ===== */
.image-row.five-images .overlay,
.photologueimage-row.five-images .overlay {
    display: none;
}

/* ===== 5-image rows: lighter borders ===== */
.image-row.five-images,
.photologueimage-row.five-images {
    border-bottom: 1px solid #e5e5e5;
}

/* Vertical dividers (lighter) */
.image-row.five-images .image-item + .image-item::before,
.photologueimage-row.five-images .image-item + .image-item::before {
    background-color: #e5e5e5;
}

/* Remove hover effects for 5-image rows */
.image-row.five-images .image-item:hover img,
.photologueimage-row.five-images .photologueimage-item:hover img {
    transform: none !important;
    transition: none !important;
    filter: contrast(1.08) saturate(1.16) !important;
}

/* ===== 6 images per row ===== */
.image-row.six-images .image-item,
.photologueimage-row.six-images .photologueimage-item {
    flex: 1 1 14%;
}

/* =================== MEDIA BUTTONS =================== */
.media-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 15px;
}

.mediabutton {
    display: block;
    width: 100%;
    padding: 12px 0;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: #000;
    background-color: rgba(0, 0, 118, 0.3);
    border: none;
    text-decoration: none;
    transition: all 0.5s ease;
    cursor: pointer;
}

.mediabutton:hover {
    background-color: rgba(0, 0, 118, 0.2);
}

/* =================== FOOTER =================== */
footer {
    background-color: #23231f;
    color: #fff;
    padding: 2rem var(--content-padding);
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-column {
    flex: 0 0 33%;
}

.footer-column h3 {
    font-size: 0.8rem;
}

.footer-column p {
    font-size: 0.8rem;
    line-height: 1.75;
    color: #ccc;
}

/* =================== MAP OVERLAY IMAGE =================== */
.map-overlay {
    position: relative;
    display: block;
    border-radius: 2px;
}

.map-overlay img {
    display: block;
    width: 65%;
    height: auto;
    margin: 0 0 0 auto;
    border-radius: inherit;
}

.map-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 118, 0.39); /* index.jpg overlay color */
    pointer-events: none;
    border-radius: inherit;
    z-index: 1;
    opacity: 1; 
    transition: none; 
}

/* Overlay text stays on top of map */
.map-overlay .overlay-text span:last-child {
    margin-bottom: 0;
}

/* End of CSS */