﻿* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
}

:root {
    --header-height: 78px;
    --sidebar-width: 270px;
    /* ---- Colour palette pulled from your Main Menu screenshot ---- */
    --frame-color: #142c46;
    --frame-color-light: #142c46;
    --accent-color: #f4c548;
    --highlight-color: #4fb6ec;
    --text-color-light: #dff3fd;
    /* Diagonal logo divider, two stripes */
    --header-slant: 24px;
    --header-divider-thickness: 10px;
    --header-divider-2-thickness: 16px;
    --header-divider-2-color: #142c46;
    --sidebar-slant-color: #142c46;
    --sidebar-hover-color: #fc4030;
}

/* ===================== SITE FRAME ===================== */
/* Flush to the browser edges now (no outer margin/rounding), and
       laid out with plain flexbox instead of a fixed-height grid, so
       the BROWSER ITSELF scrolls normally as the page grows taller
       than the screen - your mouse wheel works no matter where the
       cursor is. The header and sidebar use "position: sticky" so
       they still stay visibly pinned in place as you scroll past
       them, without trapping the scroll inside a separate box. */

.site-frame {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
    height: var(--header-height);
    background: var(--frame-color-light);
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid rgba(0,0,0,0.25);
    padding-left: calc(var(--sidebar-width) + var(--header-divider-thickness) + var(--header-divider-2-thickness));
}

.site-header-right {
    display: flex;
    align-items: stretch;
    background: #2f84c5;
    clip-path: polygon(var(--header-slant) 0, 100% 0, 100% 100%, 0 100%);
}

.site-logo {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 3;
    width: calc(var(--sidebar-width) + var(--header-slant));
    background: var(--frame-color);
    clip-path: polygon(0 0, 100% 0, calc(100% - var(--header-slant)) 100%, 0 100%);
}

.site-logo-img {
    display: block;
    width: var(--sidebar-width);
    height: 100%;
    object-fit: contain;
    padding: 1px;
}

.site-header-accent {
    flex-shrink: 0;
    align-self: stretch;
    width: calc(var(--header-slant) + var(--header-divider-thickness));
    background: var(--highlight-color);
    clip-path: polygon( var(--header-slant) 0, 100% 0, var(--header-divider-thickness) 100%, 0 100% );
}

.site-title {
    flex: 1;
    display: flex;
    align-items: center;
    padding-left: 28px;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.site-title-short {
    display: none;
}

.site-signin {
    margin: auto 28px;
    background: var(--accent-color);
    color: var(--frame-color);
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

/* Row below the header: sidebar + content side by side */
.site-body {
    display: flex;
    align-items: flex-start;
    flex: 1;
    width: 100%;
}

/* --- Sidebar: now bound to dbo.pcsPublic_SideMenu ---
       Sticky, pinned just below the header as the page scrolls; if
       you ever have enough icons to exceed the screen height, this
       box scrolls independently rather than pushing the header down. */

.site-sidebar {
    position: sticky;
    top: var(--header-height);
    flex-shrink: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--frame-color);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 24px 16px;
    overflow-y: auto;
}

.sidebar-icon {
    width: 100%;
    background: var(--highlight-color);
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 10px 16px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sidebar-icon {
    position: relative;
    overflow: hidden;
    --sidebar-slant: 18px;
    --sidebar-divider-thickness: 6px;
    --sidebar-right-width: 30px;
    background: var(--accent-color);
}

    .sidebar-icon::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: calc(var(--sidebar-right-width) - var(--sidebar-slant));
        background: var(--highlight-color);
        clip-path: polygon(0 0, 100% 0, calc(100% - var(--sidebar-slant)) 100%, 0 100%);
    }

    .sidebar-icon::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: calc(100% - var(--sidebar-right-width) - (var(--sidebar-divider-thickness) / 2));
        width: calc(var(--sidebar-slant) + var(--sidebar-divider-thickness));
        background: var(--sidebar-slant-color);
        clip-path: polygon( var(--sidebar-slant) 0, 100% 0, var(--sidebar-divider-thickness) 100%, 0 100% );
    }

    .sidebar-icon:hover {
        filter: brightness(1.15);
        background: var(--sidebar-hover-color);

    }

    .sidebar-icon img {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
        border-radius: 4px;
    }

.sidebar-label {
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.sidebar-icon img,
.sidebar-label {
    position: relative;
    z-index: 2;
}



.site-content {
    flex: 1;
    min-width: 0; /* stops wide images from stretching the flex row */
    width: 100%;
    background: #ffffff;
}

.page-wrap {
    padding: 20px;
}

/* --- Narrower desktop/tablet: shorten the header title --- */
@media (max-width: 1100px) {
    .site-title-full {
        display: none;
    }

    .site-title-short {
        display: inline;
    }
}

/* --- Phones: sidebar disappears, content takes the full width --- */
@media (max-width: 700px) {
    .site-sidebar {
        display: none;
    }

    .site-title {
        display: none;
    }

    .site-signin {
        margin: auto 14px;
        padding: 10px 18px;
        font-size: 14px;
    }

    .site-title {
        display: none;
    }

    .site-header-right {
        margin-left: auto;
    }
}

/* ===================== BUTTONS ===================== */

/* 2 columns side by side on larger screens (Column 1 on the left,
       Column 2 on the right), each internally still just a simple
       top-to-bottom stack. Below 700px this switches to flex-direction:
       column, which stacks column 2's whole block underneath column
       1's whole block - exactly "Column 1 first, then Column 2". */

.button-columns {
    display: flex;
    flex-direction: row;
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.button-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 700px) {
    .button-columns {
        flex-direction: column;
    }
}

.toy-button {
    --btn-color: #4a90d9;
    --divider-color: #ffffff;
    --hover-color: #2f6cb3;
    --text-color: #ffffff;
    --text-hover-color: #ffffff;
    --slant: 40px;
    --divider-thickness: 20px;
    --right-width: 150px;
    position: relative;
    display: block;
    width: 100%;
    height: 130px;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    text-decoration: none;
}

    .toy-button .toy-image {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: var(--right-width);
        height: 100%;
        object-fit: cover;
    }

    .toy-button .toy-panel {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: calc(var(--right-width) - var(--slant));
        background: var(--btn-color);
        clip-path: polygon(0 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
        transition: background 0.2s ease;
        display: flex;
        align-items: center;
    }

    .toy-button .toy-divider {
        position: absolute;
        top: 0;
        bottom: 0;
        left: calc(100% - var(--right-width) - (var(--divider-thickness) / 2));
        width: calc(var(--slant) + var(--divider-thickness));
        background: var(--divider-color);
        clip-path: polygon( var(--slant) 0, 100% 0, var(--divider-thickness) 100%, 0 100% );
        transition: background 0.2s ease;
    }

    .toy-button .toy-label {
        position: relative;
        z-index: 2;
        color: var(--text-color);
        font-weight: bold;
        font-size: 20px;
        letter-spacing: 1px;
        padding-left: 24px;
        transition: color 0.2s ease;
    }

    .toy-button:hover .toy-panel {
        background: var(--hover-color);
    }

    .toy-button:hover .toy-divider {
        background: var(--hover-color);
    }

    .toy-button:hover .toy-label {
        color: var(--text-hover-color);
    }

/* ===================== BANNER CAROUSEL ===================== */

.banner-viewport {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    /* margin-top: 30px; */
    /* margin-bottom: 30px; */
}

.banner-track {
    display: flex;
    height: 100%;
    transition: transform 0.6s ease;
}

.banner-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    display: block;
    text-decoration: none;
    cursor: pointer;
    --slant: 70px;
    --divider-thickness: 26px;
    --right-width: 40%;
}

    .banner-slide .banner-image {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: var(--right-width);
        height: 100%;
        object-fit: cover;
    }

    .banner-slide .banner-panel {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: calc(var(--right-width) - var(--slant));
        background: var(--btn-color);
        clip-path: polygon(0 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0 70px 0 48px;
    }

    .banner-slide .banner-divider {
        position: absolute;
        top: 0;
        bottom: 0;
        left: calc(100% - var(--right-width) - (var(--divider-thickness) / 2));
        width: calc(var(--slant) + var(--divider-thickness));
        background: var(--divider-color);
        clip-path: polygon( var(--slant) 0, 100% 0, var(--divider-thickness) 100%, 0 100% );
    }

.banner-heading {
    color: var(--text-color);
    font-size: 38px;
    font-weight: bold;
    letter-spacing: 1px;
    margin: 0 0 14px 0;
}

.banner-desc {
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.5;
    opacity: 0.92;
    max-width: 480px;
    margin: 0;
}

/* ===================== POSTS SECTION ===================== */

    .post {
        width: 100%;
        background: var(--post-color, #f2f2f2);
    }

    .post-inner {
        --post-image-width: 450px;
        max-width: 100%;
        margin: 0 auto;
        padding: 20px 20px;
        display: grid;
        gap: 24px 48px;
        align-items: start;
    }

.post-headwrap {
    grid-area: heading;
}

.post-heading {
    margin: 0 0 4px 0;
    font-size: 26px;
    color: #222;
}

.post-author {
    font-size: 14px;
    font-weight: bold;
    color: #222;
}

.post-date {
    margin-top: 2px;
    font-size: 13px;
    color: #222;
}

    .post-image {
        grid-area: image;
    }

        .post-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            border-radius: 6px;
        }

    .post-details {
        grid-area: details;
        white-space: pre-wrap;
        font-size: 16px;
        line-height: 1.6;
        color: #333;
    }

        .post-details p {
            margin: 0 0 12px 0;
        }

            .post-details p:last-child {
                margin-bottom: 0;
            }

    .post[data-position="1"] .post-inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "heading"
            "image"
            "details";
    }

.post[data-position="2"] .post-inner {
    grid-template-columns: 3fr 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "heading image"
        "details image";
}

.post[data-position="3"] .post-inner {
    grid-template-columns: 1fr 3fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "image heading"
        "image details";
}

    .post[data-position="4"] .post-inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "heading"
            "details"
            "image";
    }

    @media (max-width: 700px) {
        .post-inner {
            grid-template-columns: 1fr !important;
            grid-template-areas:
                "image"
                "heading"
                "details" !important;
            padding: 32px 24px;
            gap: 18px;
        }
    }


/* ===================== IMAGE LIGHTBOX ===================== */

.post-image img {
    cursor: zoom-in;
}

.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

    .lightbox-overlay.is-open {
        display: flex;
    }

.lightbox-frame {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

    .lightbox-frame img {
        display: block;
        max-width: 90vw;
        max-height: 90vh;
        border-radius: 8px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    }

.lightbox-close {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    color: var(--frame-color);
    border: none;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

    .lightbox-close:hover {
        filter: brightness(1.1);
    }

@media (max-width: 700px) {
    .lightbox-close {
        top: -14px;
        right: -14px;
        width: 34px;
        height: 34px;
    }
}