/* CSS Variables for easy theming */
:root {
    --primary-bg: #355664;
    --article-bg: #213E4A;
    --dark-bg: #142830;
    --border-color: #24404c;
    --border-light: #416371;
    --text-light: #fcfcfc;
    --text-dark: #565656;
    --link-color: #0196e3;
    --link-hover: #cccccc;
    --max-width: 1200px;
    --spacing: 1rem;
    --spacing-lg: 2rem;
    --border-radius: 10px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-light);
    background-color: var(--primary-bg);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    text-decoration: underline;
}

/* Typography */
h1, h2, h3 {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    text-transform: uppercase;
    padding: 0.5em 0 0;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: normal;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    margin-bottom: var(--spacing);
}

h3 {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: normal;
    margin: 0 0 0.5em;
}

p {
    margin-bottom: var(--spacing);
}

ul {
    margin-bottom: var(--spacing);
    padding-left: 1.5rem;
}

/* Layout */
#page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* Header */
header {
    padding: var(--spacing-lg) 0;
    position: relative;
}

header hgroup {
    margin-bottom: var(--spacing);
}

header .location {
    margin: 0;
}

/* Navigation */
nav {
    position: relative;
    background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
}

/* Hamburger Button - Hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background-color: var(--text-dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    justify-content: center;
}

nav a {
    display: block;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: bold;
    padding: 0.7rem 1rem;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    border-radius: calc(var(--border-radius) - 2px);
    white-space: nowrap;
}

nav a:hover {
    background-color: #f0f0f0;
    text-decoration: none;
}

/* Main Content */
main {
    margin: var(--spacing-lg) 0;
}

/* Articles */
article {
    background-color: var(--article-bg);
    border-radius: var(--border-radius);
    padding: clamp(1rem, 3vw, 2rem);
    margin-bottom: var(--spacing-lg);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

article::before {
    content: '';
	display: block;
    height: 1px;
    background-color: var(--border-color);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--spacing);
}

/* Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
	height: 0;
    overflow: hidden;
    margin-bottom: var(--spacing);
    border-radius: var(--border-radius);
    width: 100%;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Make video full-width on desktop */
@media screen and (min-width: 769px) {
    .video-container {
        margin-left: calc(-1 * clamp(1rem, 3vw, 2rem));
        margin-right: calc(-1 * clamp(1rem, 3vw, 2rem));
        width: calc(100% + 2 * clamp(1rem, 3vw, 2rem));
        max-width: none;
    }
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: var(--spacing);
}

.gallery a {
    display: block;
    border-radius: calc(var(--border-radius) / 2);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery a:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(77, 119, 136, 0.8);
}

.gallery img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

/* Figure */
figure {
    border: 3px solid var(--dark-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: var(--spacing);
    transition: box-shadow 0.3s ease;
}

figure:hover {
    box-shadow: 0 0 10px rgba(77, 119, 136, 0.8);
}

/* PDF Link */
.pdf-link {
    display: inline-block;
    padding-right: 24px;
    background: url("img/pdf_16x16.gif") no-repeat right center;
    background-size: 16px 16px;
}

/* Back to Top */
.back-to-top {
    display: inline-block;
    color: var(--link-hover);
    background-color: var(--article-bg);
    padding: 0.5rem 1rem;
    border-radius: calc(var(--border-radius) / 2);
    float: right;
    margin-top: var(--spacing);
}

.back-to-top:hover {
    background-color: var(--dark-bg);
    text-decoration: none;
}

/* Footer */
footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    border-top: 1px solid var(--border-color);
    margin-top: var(--spacing-lg);
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--link-hover);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.lightbox .close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.lightbox .close:hover {
    color: #bbb;
}

.lightbox .prev,
.lightbox .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.3s;
    border-radius: 0 3px 3px 0;
    user-select: none;
}

.lightbox .next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox .prev:hover,
.lightbox .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.lightbox-caption {
    margin: auto;
    display: block;
    max-width: 80%;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    /* Mobile Hamburger Menu */
    .hamburger {
        display: flex;
        margin: 0 auto;
    }

    nav {
        padding: 1rem;
    }

    nav ul {
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease, margin 0.4s ease;
        padding: 0;
        margin: 0;
    }

    nav ul.active {
        max-height: 500px;
        opacity: 1;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
    }

    nav li {
        margin: 0;
    }

    nav a {
        text-align: center;
        width: 100%;
        padding: 1rem;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }

    .gallery img {
        height: 80px;
    }

    figure {
        margin: 0 auto var(--spacing);
        max-width: 100%;
    }

    .back-to-top {
        float: none;
        display: block;
        text-align: center;
        margin: var(--spacing) auto;
    }

    .lightbox-content {
        max-width: 95%;
    }

    .lightbox .prev,
    .lightbox .next {
        padding: 12px;
        font-size: 18px;
    }
}

@media screen and (min-width: 769px) {
    figure {
        float: right;
        max-width: 520px;
        margin-left: var(--spacing-lg);
    }

    .content {
        overflow: auto;
    }
}

@media screen and (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .gallery img {
        height: 70px;
    }
}
