/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body */
body {
    height: 100vh;
    font-family: 'Montserrat';
}

/* Ensure background behind landing is dark to hide any tiny gaps */
body {
    background: #000;
}

/* Landing container */
.landing {
    height: 100vh;
    width: 100%;
    display: flex;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Single image element behind zones to prevent seams */
.landing {
    position: relative;
    overflow: hidden;
}

.landing-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    pointer-events: none;
    z-index: 0;
}

/* Ensure zones sit above the image */
.zone {
    z-index: 1;
    background: transparent;
}

/* Paint/compositing tweaks to avoid hairline seams between flex children */
.landing {
    gap: 0;
    -webkit-font-smoothing: antialiased;
    transform: translateZ(0);
}
/* keep landing as a single background image; individual zones use overlay only */

/* Zoner */
.zone {
    /* Use fixed thirds to avoid subpixel flex rounding gaps */
    flex: 0 0 33.3333333%;
    min-width: 0;
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    text-decoration: none;
    color: white;
    font-size: 3rem;
    letter-spacing: 4px;

    overflow: hidden;
    cursor: pointer;
    user-select: none;
}

.zone:focus {
    /* Use an inner subtle glow for keyboard focus to avoid drawing bright outlines that can create seams */
    box-shadow: inset 0 0 0 3px rgba(255,255,255,0.08);
    outline: none;
}

/* Removed overlap hack — let zones sit flush and avoid negative margins which caused rendering artifacts in some browsers. */

/* Prevent hairline seams by ensuring there's a tiny transparent border between zones */
.zone + .zone {
    border-left: 1px solid transparent;
}

/* Avoid subpixel rendering artifacts */
.zone {
    backface-visibility: hidden;
}

/* Overlay */
.zone::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 0.4s ease;
}

/* Tekst */
.zone span {
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Hover-effekt */
.zone:hover::before {
    background: rgba(0,0,0,0.55);
}

.zone:hover span {
    opacity: 1;
}

/* Submenu (fold-out on click) */
.submenu {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    padding: 8px 10px;
    border-radius: 6px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.28s ease, opacity 0.28s ease, transform 0.28s ease;
    z-index: 3;
}

.zone.open .submenu {
    max-height: 200px;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.sub-link {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 6px 8px;
    font-size: 1rem;
    white-space: nowrap;
}

.sub-link + .sub-link {
    margin-top: 6px;
}

/* Mobil fallback (ingen hover) */
@media (max-width: 768px) {
    .landing {
        flex-direction: column;
    }

    .zone {
        font-size: 2rem;
    }

    .zone::before {
        background: rgba(0,0,0,0.45);
    }

    .zone span {
        opacity: 1;
    }

    /* remove overlap on stacked mobile layout */
    .landing > .zone + .zone {
        margin-left: 0;
    }
}

/* Page layout styles */
.page {
    font-family: 'Montserrat';
    min-height: 100vh;
    background: #f2efe9;
    color: #111;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
}

/* Site header / navigation */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 40;
}

.site-header .brand {
    font-size: 1.2rem;
}

.site-nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 14px;
    font-size: 1rem;
    opacity: 0.95;
}

.site-nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

.page-header h1 {
    font-size: 2.2rem;
}

.home-link {
    text-decoration: none;
    color: #111;
    opacity: 0.8;
}

.content {
    padding: 20px;
}

.video-wrap iframe {
    max-width: 100%;
    width: 720px;
    height: 405px;
}

/* Responsive videos grid for musik page */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.video-item {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
}

.video-item iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.art-caption {
    margin-top: 6px;
    font-size: 0.9rem;
    color: #333;
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.lightbox.open {
    display: flex;
}

.lightbox-content {
    /* constrain lightbox box to viewport and keep controls visible */
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 6px;
    object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 10px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 4px;
}

.lightbox-close { right: 10px; }
.lightbox-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 10px; top: 50%; transform: translateY(-50%); }

.lightbox-caption {
    margin-top: 10px;
    text-align: center;
    color: #ddd;
}

.gallery img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

/* Uniform thumbnail tiles: anchors act as tiles with a fixed aspect ratio;
   images are cover-cropped to fill the tile without stretching. */
.gallery a {
    display: block;
    overflow: hidden;
    aspect-ratio: 4/3; /* adjust ratio if you prefer square tiles (1/1) */
    border-radius: 6px;
}

.gallery img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Poems styling: preserves stanza breaks and makes long text readable */
pre.poems {
    font-family: Arial, sans-serif;
    white-space: pre-wrap;
    font-size: 1rem;
    line-height: 1.6;
    color: #111;
    background: #fff;
    padding: 22px;
    border-radius: 8px;
    max-width: 980px;
    margin-top: 12px;
    overflow: auto;
}

@media (max-width: 720px) {
    pre.poems { padding: 14px; font-size: 0.95rem; }
}

/* Table of Contents */
.toc {
    margin: 18px 0 6px 0;
    padding: 12px 14px;
    background: #fff;
    border-radius: 8px;
    max-width: 980px;
}
.toc h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: bold;
}
.toc ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 12px;
}
.toc a {
    color: #111;
    text-decoration: none;
    padding: 6px 8px;
    display: inline-block;
    border-radius: 6px;
    font-weight: bold;
}
.toc a:hover { background: rgba(0,0,0,0.04); }

@media (max-width: 520px) {
    .toc ul { grid-template-columns: 1fr; }
}
/* Font overrides for poem sections */
.poem h2 {
    font-family: Arial, sans-serif;
    font-weight: bold;
}

.toc {
    font-family: Arial, sans-serif;
}

.toc h2 {
    font-weight: 700 !important;
}

.content h1 {
    font-family: Arial, sans-serif;
}