:root {
    --psp-bg: #f6f9f7;
    --psp-panel: #ffffff;
    --psp-accent: #1f8a44;
    --psp-accent-dark: #176b35;
    --psp-green: #1f8a44;
    --psp-green-pale: #e3f3e7;
    --psp-text: #16201a;
    --psp-text-muted: #5b6b5f;
    --psp-border: #dbe6dd;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 900px 420px at 50% -10%, rgba(31, 138, 68, 0.10), transparent 70%),
        var(--psp-bg);
    color: var(--psp-text);
    font-family: "Barlow", sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Oswald", sans-serif;
    letter-spacing: 0.02em;
}

a {
    color: var(--psp-green);
}

/* ==========================================================
   HEADER / NAV
   ========================================================== */

.header-bar {
    background: var(--psp-green);
    border-bottom: 1px solid var(--psp-accent-dark);
    padding: 14px 0;
    z-index: 10;
}

.header-bar .logo img.logo {
    height: 48px;
    margin-right: 14px;
}

.header-bar h1 {
    font-family: "Jersey 10", "Oswald", sans-serif;
    font-size: 2.2rem;
    line-height: 1;
    margin: 0;
    color: #ffffff;
}

.header-bar .subhead {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.header-bar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    padding: 8px 14px;
}

.header-bar .nav-link:hover,
.header-bar .nav-link.active {
    color: #ffffff;
}

@media (max-width: 767.98px) {
    .header-bar h1 {
        font-size: 1.7rem !important;
    }

    .header-bar .subhead {
        font-size: 0.7rem;
    }

    .header-bar .nav-link {
        padding: 4px 8px;
        font-size: 0.75rem;
        letter-spacing: 0.01em;
    }
}

/* ==========================================================
   HERO / PAGE TITLE
   ========================================================== */

.hero {
    background: linear-gradient(180deg, var(--psp-green-pale) 0%, var(--psp-bg) 100%);
    border-bottom: 1px solid var(--psp-border);
}

.hero h2 {
    font-size: 2.4rem;
}

.hero .lead {
    color: var(--psp-text-muted);
}

.pagetitle-bar {
    background: var(--psp-panel);
    border-top: 3px solid var(--psp-green);
    border-bottom: 1px solid var(--psp-border);
    padding: 40px 0;
    position: relative;
}

.pagetitle-bar .pagesection {
    color: var(--psp-green);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.pagetitle-bar .pagesection a {
    color: inherit;
    text-decoration: none;
}

.pagetitle-bar .pagesection a:hover {
    text-decoration: underline;
}

.pagetitle-bar h2 {
    margin: 0;
}

.pagetitle-bar .notes {
    color: var(--psp-text-muted);
    margin: 6px 0 0;
}

.page-fill-bg {
    background-color: #ffffff;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex: 1 0 auto;
}

/* ==========================================================
   HOMEPAGE CATEGORY SECTIONS
   ========================================================== */

.category-section {
    margin-bottom: 3rem;
}

.category-section + .category-section {
    border-top: 1px solid var(--psp-border);
    padding-top: 3rem;
}

.category-section h3 {
    margin-bottom: 8px;
}

.category-section .category-description {
    color: var(--psp-text-muted);
    max-width: 720px;
    margin-bottom: 24px;
}

/* ==========================================================
   GALLERY GRID (category tiles, gallery tiles, photo grid)
   ========================================================== */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.gallerylink,
.photolink {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--psp-border);
    aspect-ratio: 4 / 3;
    box-shadow: 0 1px 3px rgba(22, 32, 26, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.photolink {
    cursor: pointer;
}

.gallerylink:hover,
.photolink:hover {
    border-color: var(--psp-green);
    box-shadow: 0 4px 14px rgba(22, 32, 26, 0.14);
}

.gallerylink a {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.gallerylink img,
.photolink img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallerylink:hover img,
.photolink:hover img {
    transform: scale(1.05);
}

/* Photo grid inside a single gallery/album - some tiles run double size */
.photogrid {
    grid-auto-flow: dense;
    grid-auto-rows: 195px;
}

.photogrid .photolink {
    aspect-ratio: auto;
    height: 100%;
}

.photogrid .photolink.featured {
    grid-column: span 2;
    grid-row: span 2;
}

@media (max-width: 599px) {
    .photogrid .photolink.featured {
        grid-column: span 1;
        grid-row: span 1;
    }
}

.gallerytile-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--psp-text-muted);
    font-size: 2.5rem;
}

.gallerybar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px;
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    color: #fff;
    font-weight: 600;
}

.gallerybar::before {
    content: "";
    position: absolute;
    left: -25%;
    right: -25%;
    bottom: 0;
    height: 115px;
    background: var(--psp-green);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    opacity: 0;
    transform: translateY(30%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 0;
    pointer-events: none;
}

.gallerylink:hover .gallerybar::before {
    opacity: 0.85;
    transform: translateY(0);
}

.gallerybar-text {
    position: relative;
    z-index: 1;
}

.gallerybar p {
    margin: 2px 0 0;
    font-weight: 400;
    font-size: 0.85rem;
    color: #d8d8d8;
}

/* ==========================================================
   LIGHTBOX
   ========================================================== */

.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1050;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay.visible {
    display: flex;
}

.lightbox-inner {
    position: relative;
    max-width: 92vw;
    max-height: 92vh;
}

.lightbox-inner img {
    max-width: 92vw;
    max-height: 92vh;
    display: block;
    border-radius: 4px;
}

.lightbox-overlay .close-btn {
    position: absolute;
    top: -44px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.6rem;
}

.lightbox-overlay .photo-counter {
    position: absolute;
    bottom: -52px;
    left: 0;
    color: #cfd6d1;
    line-height: 38px;
}

.lightbox-key {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(200, 200, 200, 0.25);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-bottom-width: 4px;
    border-radius: 8px;
    font-size: 1.3rem;
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.1s ease, border-bottom-width 0.1s ease;
}

.lightbox-key:hover {
    opacity: 1;
    background: rgba(30, 30, 30, 0.9);
}

.lightbox-key:active {
    border-bottom-width: 1px;
    transform: translateY(calc(-50% + 3px));
}

.lightbox-key-prev {
    left: 12px;
}

.lightbox-key-next {
    right: 12px;
}

/* ==========================================================
   BUTTONS / FORMS / ADMIN
   ========================================================== */

.btn-psp-primary {
    background-color: var(--psp-accent);
    border-color: var(--psp-accent);
    color: #ffffff;
    font-weight: 600;
}

.btn-psp-primary:hover {
    background-color: var(--psp-accent-dark);
    border-color: var(--psp-accent-dark);
    color: #ffffff;
}

.header-bar .btn-psp-primary {
    background-color: #ffffff;
    border-color: #ffffff;
    color: var(--psp-green);
}

.header-bar .btn-psp-primary:hover {
    background-color: var(--psp-green-pale);
    border-color: var(--psp-green-pale);
    color: var(--psp-green);
}

.header-bar .btn-outline-secondary {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.75);
    color: #ffffff;
}

.header-bar .btn-outline-secondary:hover {
    background-color: #ffffff;
    border-color: #ffffff;
    color: var(--psp-green);
}

.loginbox {
    max-width: 420px;
}

.form-control, .form-select {
    background-color: #ffffff;
    border-color: var(--psp-border);
    color: var(--psp-text);
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff;
    color: var(--psp-text);
    border-color: var(--psp-accent);
    box-shadow: 0 0 0 0.2rem rgba(31, 138, 68, 0.25);
}

.form-label, .form-text, .form-check-label {
    color: var(--psp-text-muted);
}

.table {
    color: var(--psp-text);
}

/* ==========================================================
   FOOTER
   ========================================================== */

.footer-bar {
    background: var(--psp-panel);
    border-top: 1px solid var(--psp-border);
    padding: 20px 0;
    margin-top: auto;
    color: var(--psp-text-muted);
}
