/* ── Design tokens ── */
:root {
    --bg: #0a0a0a;
    --surface: #111111;
    --border: rgba(255, 255, 255, 0.12);
    --border-hover: rgba(200, 160, 100, 0.55);
    --accent: #c0392b;
    --accent-warm: #c8874a;
    --text: #e8e0d4;
    --text-muted: #7a7065;
    --nav-link: #c8c0b4;
    --nav-active: #ffffff;
    --gap: 6px;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-ui: 'Raleway', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    font-family: var(--font-ui);
    font-weight: 300;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body.viewpermission-view {
    background: var(--bg);
    color: var(--text);
}

.external-link {
  color: #df0303;
}

/* ── Header ── */
#portal-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 8, 8, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-inner>* {
    margin: 24px;
}

.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.site-logo img {
    max-width: 100%;
    height: auto;
    display: block;
}

#portal-globalnav {
    display: flex;
    align-items: center;
    gap: 36px;
    margin: 0;
    padding: 0;
}

#portal-globalnav li {
    list-style: none;
}

#portal-globalnav a {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--nav-link);
    text-decoration: none;
    position: relative;
    padding: 0 0 4px 0;
    transition: color 0.25s;
}

#portal-globalnav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--accent-warm);
    transition: width 0.3s ease;
}

#portal-globalnav a:hover {
    color: var(--nav-active);
}

#portal-globalnav a:hover::after,
#portal-globalnav .current a::after {
    width: 100%;
}

#portal-globalnav .current a {
    color: var(--nav-active);
}



/* ── Main content ── */
main {
    padding: 40px 0 60px;
}

.content-wrap {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

.userrole-anonymous .content-wrap header {
    display: none;
}


/* ── Gallery grid ── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
}

/* ── Gallery item ── */
.gallery-item {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    background: #0d0d0d;
    transition: border-color 0.35s ease;
}

.gallery-item:hover {
    border-color: var(--border-hover);
}

.gallery-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        filter 0.55s ease;
    filter: brightness(0.92);
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(1);
}

/* ── Caption overlay ── */
.gallery-item .caption {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) 40%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gallery-item:hover .caption {
    opacity: 1;
}

.caption-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 300;
    font-style: italic;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 4px;
}

.caption-technique {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-warm);
}

/* ── Magnific Popup overrides ── */
.mfp-bg {
    background: #050505;
    opacity: 0.97;
}

.mfp-figure::after {
    background: transparent;
    box-shadow: none;
}

.mfp-figure figure {
    margin: 0;
}

.mfp-bottom-bar {
    padding: 10px 0 0;
}

.mfp-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-style: italic;
    font-weight: 300;
    color: #e8e0d4;
    letter-spacing: 0.04em;
}

.mfp-counter {
    font-family: var(--font-ui);
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

button.mfp-close,
button.mfp-arrow {
    color: #e8e0d4;
    opacity: 0.7;
    transition: opacity 0.2s;
}

button.mfp-close:hover,
button.mfp-arrow:hover {
    opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    
    #portal-globalnav {
        gap: 20px;
    }

    main {
        padding: 24px 0 48px;
    }

    .content-wrap {
        padding: 0 12px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }

    .gallery-item .caption {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    
    .header-inner {
        flex-direction: column;
    }

    .gallery-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 4px;
    }
}