/*
Theme Name:   Twenty Twenty-Five Malax Museum
Description:  Child theme for Twenty Twenty-Five - Malax Museum
Author:       Andreas
Template:     twentytwentyfive
Version:      1.0.2
Text Domain:  twentytwentyfive-malaxmuseum
*/

/* Your custom CSS goes below this line */
:root {
    --min-viewport: 360px;
    --max-viewport: 1600px;
    --viewport-range: 1240;
    /* 1600-360 */

    --content-border: clamp(2px, 0.2vw, 3px) solid var(--wp--preset--color--frame);
}

body {
    /* Calculate fluid padding once
       For content padding */
    --fluid-padding: clamp(0px,
            calc((50 / var(--viewport-range)) * 100vw - (50 / var(--viewport-range)) * var(--min-viewport)),
            50px);

    --wp--style--root--padding-left: var(--fluid-padding);
    --wp--style--root--padding-right: var(--fluid-padding);
}

.wp-site-blocks>footer {
    margin-block-start: 0 !important;

    /* The footer colored block */
    .wp-block-group .wp-block-group {
        min-height: clamp(40px, 5vw, 80px);
        border: var(--content-border);
    }
}

.wp-site-blocks strong {
    font-weight: 700;
}

.image-frame {
    border-color: var(--wp--preset--color--image-frame);
}

.image-hover-animate {
    transition: 0.3s ease;
}

.image-hover-animate:hover {
    filter: brightness(90%);
}

p.no-style a,
p.no-style a:visited,
p.no-style a:hover,
p.no-style a:active,
p.no-style a:focus {
    text-decoration: none;
    color: inherit;
    outline: none;
}

/* Header */
.header-content-container {
    font-size: 16px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding-inline: clamp(5px,
            calc((80 / var(--viewport-range)) * 100vw - (80 / var(--viewport-range)) * var(--min-viewport)),
            80px);

    padding-block: clamp(0px,
            calc((40 / var(--viewport-range)) * 100vw - (40 / var(--viewport-range)) * var(--min-viewport)),
            40px);

    height: calc(0.22 * min(100vw, 1400px));
}

.header-first-row {
    align-items: start;

    & .header-languages {
        color: #1a1a1a;
        font-size: clamp(1rem, 2vw, 1.5rem);
        line-height: 1;
    }
}

.header-second-row {
    margin-block-start: 0;
    align-items: end;
    gap: 0;
    justify-content: space-between;

    & .header-title-container {
        display: flex;
        align-items: end;

        & .header-title {
            color: #1a1a1a;
            margin-top: 0;
            margin-right: 0;
            margin-bottom: clamp(-0.3rem, -0.3vw, 0rem);
            margin-left: clamp(0.5rem, 3vw, 3rem) !important;
            font-size: clamp(1rem, 5vw, 4rem);
            line-height: 0.8;
        }

        & .custom-logo {
            width: clamp(2rem, 6vw, 6rem);
        }
    }

    & .header-slogan {
        padding: clamp(0rem, 1vw, 1rem);
        font-size: clamp(0.8rem, 2vw, 1.5rem);
        line-height: 1;

        & .slogan-second-row {
            padding-left: clamp(0rem, 5cqw, 6rem);
        }
    }
}

/* The simple header for all pages */
.header-page-content-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    aspect-ratio: 1400 / 308;
    /* so that background image of 1400x308px always is fully visible */

    & .custom-logo {
        width: clamp(2rem, 6vw, 6rem) !important;
    }

    & p {
        margin-block-start: 0;
    }
}

.header-page-content-container,
.header-content-container {
    border-top-left-radius: clamp(10px, 2vw, 20px);
    border-top-right-radius: clamp(10px, 2vw, 20px);
    border: var(--content-border);
}

.entry-content {
    padding-top: clamp(0.5rem, 3cqw, 3rem);
    padding-bottom: clamp(0.5rem, 3cqw, 3rem);
    padding-inline: 5px;
}

/* Navigation */
.header-navigation {
    margin-block-start: 0;
    margin-block-end: 0;
    gap: clamp(0.2rem, 1vw, 1rem);

    & .wp-block-navigation {
        margin: 0;
        margin-block-start: 0;
        margin-block-end: 0;
    }
}

.wp-block-navigation-item__content {
    display: inline-block;
    padding: clamp(0rem, 1vw, 1rem) clamp(0.05rem, 0.6vw, 0.6rem);
    line-height: 1;
    background: var(--wp--preset--color--content-background);
    border-radius: 3px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid #303030;
    transition: background-color 0.25s ease;
}

.wp-block-navigation-item__content:hover {
    background-color: color-mix(in srgb, var(--wp--preset--color--content-background) 80%, black);
}

.wp-block-navigation__container {
    display: flex;
}

.wp-block-navigation-item {
    flex: 1;
}

.wp-block-navigation-item__content {
    width: 100%;
    text-align: center;
}

/* Mobile overrides */
@media (max-width: 781px) {

    /* Always show the menu container on mobile */
    .wp-block-navigation__responsive-container {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        position: static !important;
        height: auto !important;
        width: 100% !important;
        background: none !important;
        padding: 0 !important;
    }

    /* Show the actual menu list */
    .wp-block-navigation__responsive-container-content {
        display: block !important;
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    /* Hide the hamburger */
    .wp-block-navigation__responsive-container-open,
    .wp-block-navigation__responsive-container-close {
        display: none !important;
    }
}

.event-item {
    margin-bottom: 60px;
    border: 2px solid var(--wp--preset--color--frame);
    padding-inline: clamp(0rem, 2vw, 2rem);
    padding-block: clamp(0rem, 2vw, 1rem);
}

.event-date {
    font-size: 1.2rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
}

.event-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.event-description {
    margin-bottom: 1rem;
}

.event-image {
    text-align: right;
}

@media (min-width: 800px) {
    .event-item .wp-block-columns {
        gap: 40px;
    }
}


@media (max-width: 781px) {

    /* Mobile stacking fix */
    .event-row .event-text {
        order: 1;
    }

    .event-image {
        order: 2;
        text-align: center;
    }
}

.wp-block-separator {
    border-bottom-width: clamp(3px, 0.5vw, 5px);
    border-color: var(--wp--preset--color--frame);
    margin-inline: 20px !important;
    max-width: 100%;
}


/* Brinken specifics */

.brinken {
   /* .content-group {
        border-left: var(--content-border);
        border-right: var(--content-border);
    } */

    .footer-group {
        min-height: 500px;
        background-size: contain !important;
        background-repeat: no-repeat;
        background-position-x: center;
    }
}

/* Kvarkens båtmuseum specifics */

.kvarken {

    .header-page-content-container,
    .header-content-container {
        /* margin-top: clamp(40px, 5vw, 80px); */
        border-bottom: none;
    }

    .content-group {
        border-left: var(--content-border);
        border-right: var(--content-border);
    }

    .footer-group {
        min-height: 500px;
        background-size: contain !important;
        background-repeat: no-repeat;
        background-position-x: center;
    }
}


/* VS Event list (calendar) */

/* --- New layout: image on one side, date+title+info stacked on the other --- */

/* Turn each event into a 2-column grid: image column + content column. */
.vsel-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: min-content 1fr;
    column-gap: 40px;

    margin-bottom: 60px !important;
    border: 2px solid var(--wp--preset--color--frame);
    border-bottom: 2px solid var(--wp--preset--color--frame) !important;
    padding-inline: clamp(0rem, 2vw, 2rem) !important;
    padding-block: clamp(0rem, 2vw, 1rem) !important;
}

/* Make .vsel-info "disappear" from the box model so its children
     (the image + the text) become direct grid items of .vsel-content,
     sitting alongside .vsel-meta instead of being trapped inside .vsel-info. */
.vsel-info {
    display: contents;
}

/* Change the layout of the meta fields, date+time on one row and the title under it */
.vsel-meta {
    display: grid;
    grid-template-areas:
        "date time"
        "title title";
}

.vsel-meta-date {
    grid-area: date;
}

.vsel-meta-time {
    grid-area: time;
}

.vsel-meta-title {
    grid-area: title;
}

/* Hide the Heldagsevenemang label */
.vsel-meta-all-day {
    display: none;
}

/* Place the image in column 1, spanning both rows so it sits
     next to both the date and the info text combined. */
.vsel-content figure.vsel-image {
    grid-column: 1;
    grid-row: 1 / span 2;
    float: none !important;
    /* overrides vsel-alignleft's float */
    max-width: 100% !important;
    /* overrides inline style="max-width:40%" */
    margin: 0;
}

.vsel-content figure.vsel-image img {
    /* crops to fill 320x240 without distorting */
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

/* --- Alternate image side: even events flip image to the right --- */
.vsel-content:nth-child(even) {
    grid-template-columns: 1fr 320px;
}

.vsel-content:nth-child(even) figure.vsel-image {
    grid-column: 2;
}

/* --- Fallback: events without a featured image --- */

/* If there's no figure.vsel-image inside this event, collapse
     back to a single column so date+text use the full width
     instead of leaving an empty 320px gap. */
.vsel-content:not(:has(figure.vsel-image)) {
    grid-template-columns: 1fr;
}

/* Fonts and colors */
.vsel-meta-date,
.vsel-meta-time {
    font-size: 1.2rem !important;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem !important;
}

.vsel-meta-title {
    font-size: 1.5rem !important;
    font-weight: 600;
    margin-bottom: 1.2rem !important;
}

/* Stacked layout on mobile */
@media (max-width: 781px) {

    .vsel-content,
    .vsel-content:nth-child(even) {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .vsel-content .vsel-meta,
    .vsel-content:nth-child(even) .vsel-meta {
        grid-column: 1;
        grid-row: 1;
    }

    .vsel-content .vsel-text,
    .vsel-content:nth-child(even) .vsel-text {
        grid-column: 1;
        grid-row: 2;
    }

    .vsel-content figure.vsel-image,
    .vsel-content:nth-child(even) figure.vsel-image {
        grid-column: 1;
        grid-row: 3;
        max-width: 100% !important;
    }

    .vsel-content figure.vsel-image img {
        height: auto;
        /* let it scale naturally instead of forcing 240px on mobile */
    }
}