/* =====================================================================
   site.css — shared chrome + ALL responsive rules, loaded LAST on every page
   ---------------------------------------------------------------------
   Sections
     1. Menu bar (desktop, inner pages)        — replaces menu.css
     2. Mobile menu button + overlay           — replaces the overlay part of home-styles.css
     3. Subscribe side panel                   — replaces subscribe.css
     4. Footer                                 — replaces footer.css
     5. Responsive rules, page by page         — new
   Breakpoint: 900px. Below it the bar hides and the ☰ button + overlay take over.
   ===================================================================== */

/* ---------------------------------------------------------------- 1. MENU BAR */
.site-header {
    position: relative;
    z-index: 10;
    width: 100%;
}

.menu {
    position: relative;
    height: auto;
    margin-block: 10px;
    width: 100%;
    z-index: 10;
}

.menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
    width: 100%;
}

.menu li {
    display: inline-block;
    position: relative;
    margin: 0;
}

.menu a {
    display: block;
    text-align: center;
    font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
    font-size: 14pt;
    color: white;
    background: none;
    height: 35px;
    line-height: 35px;
    padding: 0 18px;
    text-decoration: none;
    white-space: nowrap;
}

.menu li:hover > a,
.menu a:hover,
.menu a.active {
    background: white;
    color: #FFB719;
}

/* dropdowns */
.menu li ul.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);   /* centred under the parent item */
    min-width: 100%;
    width: max-content;
    z-index: 1;
    text-align: left;
}

.menu li:hover > ul.submenu {
    display: block;
}

.menu li ul.submenu li {
    display: block;
}

.menu li ul.submenu a {
    background: rgba(51, 51, 51, 0.95);
    color: white;
    min-width: 220px;
    text-align: center;
}

.menu li ul.submenu a:hover,
.menu li ul.submenu a.active {
    background: white;
    color: #FFB719;
}

/* ---------------------------------------------------------------- 2. MOBILE BUTTON + OVERLAY */
.site-menu-btn {
    display: none;                 /* shown below the breakpoint, see §5 */
    font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
    font-size: 20px;
    font-weight: 300;
    color: white;
    background: none;
    border: 1px solid white;
    padding: 6px 14px;
    margin: 10px;
    cursor: pointer;
}

/* the homepage's ☰ MENU is an <h6> inside the banner: keep its look, show at every width */
h6.site-menu-btn {
    display: inline-block;
    border: none;
    margin: 0;
    padding-inline: 5px;
    font-size: 24px;
}

.site-menu-btn:hover,
.site-menu-btn:focus-visible {
    background: white;
    color: #FFB719;
    outline: 1px solid #FFB719;
}

.overlay {
    position: fixed;
    inset: 0;
    width: 0;
    height: 100%;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.92);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: width 0.2s;
    visibility: hidden;
}

.overlay.open {
    width: 100%;
    visibility: visible;
}

body.overlay-open {
    overflow: hidden;
}

.overlay a {
    display: block;
    height: auto;
    font-size: 16pt;
    color: white;
    text-decoration: none;
    outline: 1px solid white;
    padding: 5px;
    margin: 5px;
    transition: 0.2s;
    text-align: left;
    white-space: nowrap;
}

.overlay a:hover,
.overlay a:focus {
    color: #FFB719;
    background-color: white;
    outline: 1px solid #FFB719;
}

.overlay .box {
    display: flex;
    width: auto;
    height: auto;
    padding: 5px;
}

.overlay .overlay-body {
    min-height: 70%;
}

#overlay-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    text-align: left;
}

#overlay-menu > li {
    width: 350px;
    margin-left: 15%;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

#overlay-menu > li > a {
    flex: 1 1 100%;
    padding-right: 44px;           /* room for the arrow inside the box */
}

#overlay-menu .submenu-toggle {
    position: absolute;            /* inside the link box, at the right, like the original */
    right: 12px;
    top: 5px;
    height: calc(100% - 10px);
    background: none;
    border: none;
    padding: 0 6px;
    margin: 0;
    cursor: pointer;
    line-height: 0;
    display: flex;
    align-items: center;
}

#overlay-menu .arrow-icon {
    width: 20px;
    height: 20px;
    display: block;
    transition: transform 0.2s;
}

#overlay-menu .submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    width: 300px;
    background: rgba(51, 51, 51, 0.9);
    z-index: 1;
}

#overlay-menu .submenu li {
    margin-bottom: 10px;
}

/* fly-out on hover where a mouse exists; the toggle button also opens it */
@media (hover: hover) {
    #overlay-menu .has-submenu:hover .submenu { display: block; }
}
#overlay-menu .has-submenu.open .submenu { display: block; }
#overlay-menu .has-submenu.open .arrow-icon { transform: rotate(90deg); }

.overlay .overlay-title {
    text-align: right;
    margin-right: 2%;
    height: auto;
}

/* ---------------------------------------------------------------- 3. SUBSCRIBE PANEL */
.subscribe-lightbox {
    display: flex;
    position: fixed;
    top: 0;
    right: -30%;
    width: 30%;
    height: 100%;
    background-color: #323232;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    transition: right 0.3s ease-out;
    z-index: 99;
    justify-content: center;
}

.subscribe-lightbox.open {
    right: 0;
}

.subscribe-lightbox-content {
    height: auto;
    width: 90%;
}

.subscribe-lightbox-content h2 {
    margin-top: 40%;
    text-align: center;
    font-size: 36px;
    color: #FFB719;
}

.subscribe-lightbox-content p {
    margin: 5% auto 0;
    width: 80%;
}

.close-button {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    background-color: transparent;
    border: none;
    font-size: 60px;
    cursor: pointer;
}

.close-button:hover {
    color: #FFB719;
    background-color: transparent;
}

.subscribe-form {
    margin-top: 5%;
    text-align: center;
}

.subscribe-form input {
    display: inline-block;
    padding: 10px;
    font-size: 14px;
    margin-bottom: 10px;
    width: 80%;
}

.subscribe {
    display: inline-block;
    border: 1px solid white;
    font-size: 28px;
    padding: 5px 25px;
    cursor: pointer;
    color: white;
    text-decoration: none;
    text-align: center;
}

.subscribe:hover {
    background-color: #FFB719;
    color: white;
}

/* ---------------------------------------------------------------- 4. FOOTER */
footer {
    width: auto;
    background-color: #323232;
    padding: 20px 10%;
    color: white;
    text-align: center;
}

footer .list-container {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

footer .list {
    display: flex;
    flex-direction: column;
}

footer .list-item {
    text-align: left;
    padding-block: 2px;
    margin: 2px;
}

/* ---------------------------------------------------------------- 5. RESPONSIVE */

/* --- everywhere --- */
body { overflow-x: hidden; }
img, iframe, video { max-width: 100%; }

/* Headline sizes scale with the viewport instead of being fixed at 76/72px.
   On a desktop (>= 1000px wide) these evaluate to the same sizes as before. */
h1 { font-size: clamp(34px, 7.5vw, 76px); }
h3 { font-size: clamp(32px, 7vw, 72px); }
.info-container h1 { font-size: 32px; }          /* person page title keeps its own size */
#title-container h1 { font-size: 24px; }         /* archive item title too */

/* iOS ignores background-attachment: fixed and zooms the image; scroll it normally on touch screens */
@media (hover: none) {
    .img-container { background-attachment: scroll; }
}

/* --- tablet and down: menu bar -> button + overlay --- */
@media (max-width: 900px) {
    .site-header .menu { display: none; }
    .site-header .site-menu-btn { display: inline-block; }

    #overlay-menu > li { width: auto; margin: 0 6%; }
    #overlay-menu .submenu-toggle { height: auto; top: 10px; }
    #overlay-menu .submenu {                      /* accordion instead of fly-out */
        position: static;
        flex: 0 0 100%;
        width: auto;
        margin: 0 0 8px 18px;
        background: none;
    }
    #overlay-menu .submenu a { font-size: 14pt; }
    .overlay .overlay-title { font-size: 40px; }

    .subscribe-lightbox { width: 100%; right: -100%; }
    .subscribe-lightbox-content h2 { margin-top: 25%; font-size: 30px; }

    footer { padding: 20px 5%; }
}

/* --- homepage --- */
@media (max-width: 900px) {
    .inner-container[style*="width: 700px"] { width: 90% !important; }   /* the EXPLORE / LIBRARY headings */
    .inner-container h2[style*="48px"] { font-size: 34px !important; }

    #conflicts-container.grid-container,
    #libArch-container.grid-container {
        width: 92%;
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: minmax(130px, auto);
        margin-block: 4%;
    }
    #conflicts-container .buttonContainer { font-size: 26px !important; }
    #conflicts-container .buttonContainer[style*="span 2"] { font-size: 40px !important; }
    #libArch-container .buttonContainer { font-size: 18px; }
}

@media (max-width: 600px) {
    .img-container .inner-container { width: 92%; }
    .img-container .column {                 /* the two 50% halves under the title stack */
        float: none !important;
        width: 100% !important;
        display: block;
        text-align: center !important;
    }
    .img-container .column .box { justify-content: center; }
    .img-container h2 { font-size: 20px; }
}

/* --- era pages: WWI / WWII / Korea / Africa & ME / SE Asia --- */
@media (max-width: 900px) {
    .img-container { height: 60vh; min-height: 320px; }
    .gallery-container { width: 96%; gap: 8px; }
    .gallery-item { max-width: none; flex: 1 1 46%; }
    .gallery-item img { width: 100%; }
}

@media (max-width: 480px) {
    .img-container h4 { font-size: 18px; }
}

/* --- person page (content.html) --- */
@media (max-width: 768px) {
    .split-container { margin: 10px; }
    .right-column {
        position: static;
        height: auto;
        width: 100%;
    }
    .main-gallery-image img { max-height: 60vh; width: auto; max-width: 100%; }
    .info-container h1 { font-size: 26px; }
    #rank-branch h2 { font-size: 16px; }
    .sources { width: 92%; margin: 20px auto; }
}

/* --- archive item --- */
@media (max-width: 768px) {
    #pdf-container { height: 70vh; }
    #details-container { flex-direction: column; }
    #date, #details { text-align: left; margin-top: 10px; }
}

/* --- index & search / archives / links lists --- */
@media (max-width: 768px) {
    #search-bar { width: 100% !important; max-width: 100%; box-sizing: border-box; }
    #container { width: 96%; margin: 0 auto; }
    .info-table td { width: auto; padding-right: 4%; }
}

@media (max-width: 480px) {
    .item-container { flex-wrap: wrap; }
    #container .cover-image { width: 100px; }
}

/* --- about / support / contribute / copyright: two inline-styled columns in a flex wrapper --- */
@media (max-width: 768px) {
    div:has(> div.column) { flex-wrap: wrap; width: 92% !important; }
    div.column { width: 100% !important; margin: 0 0 24px !important; }
    .contact-section { padding: 20px 4% 40px; }
}
