/* ModelMakers Blog - Theme overrides using V2 design system */

.blog--homebanner { background-color: #000; color: #fff; padding: 30px 0; }
.blog--homebanner h1 { color: #fff; font-size: 2.5rem !important; margin-top: unset; margin-bottom: 10px; }
.blog--homebanner > div { font-size: 1.5rem; }

@media screen and (max-width: 599px) {
    .blog--homebanner > div { font-size: 1rem; }
}

.blog-body .section { display: flex; flex-wrap: wrap; }

/* Post date */
.post-date {
    color: #ca161e;
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
    line-height: 26px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Heading links */
h1 a, h2 a { text-decoration: none; }

/* Post info */
.post .post-info { font-size: 13px; color: #000; }
.post .post-info a { color: #000; text-decoration: none; font-size: 0.875rem; font-weight: 600; line-height: 1; }

/* Post body text */
.post-body.text,
.post-body.text p,
.post-body.text span { font-style: normal; font-size: 1rem !important; color: #000; }

/* Index thumbnail — override the centring margin from the inline style */
.post-image img { margin-left: 0 !important; margin-right: 0 !important; }

/* Post body images */
.post-body img { max-width: 100%; height: auto; }

/* Lightbox — copied from main site internal-page.css, CSS vars replaced with blog values */
.ip-lightbox-open { overflow: hidden; }
.ip-lightbox { position: fixed; inset: 0; z-index: 1000; }
.ip-lightbox[hidden] { display: none; }
.ip-lightbox__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.39); }
.ip-lightbox__dialog { position: relative; display: flex; align-items: center; justify-content: center; width: min(calc(100vw - 2rem), 74.5rem); min-height: calc(100vh - 2rem); margin: 1rem auto; }
.ip-lightbox__frame { position: relative; width: 100%; margin: 0; border: 3px solid #fff; background: #191a15; overflow: hidden; box-shadow: 0 1.5rem 3rem rgba(0,0,0,0.2); }
.ip-lightbox__image { display: block; width: 100%; max-height: calc(100vh - 5rem); background: #191a15; object-fit: contain; transition: opacity 180ms ease; opacity: 1; }
.ip-lightbox__caption { position: absolute; right: 0; bottom: 0; left: 0; margin: 0; padding: 0.875rem 1rem 1rem; background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0)); font-size: 0.9375rem; line-height: 1.5; color: #fff; transition: opacity 180ms ease; opacity: 1; }
.ip-lightbox.is-fading-out .ip-lightbox__image,
.ip-lightbox.is-fading-out .ip-lightbox__caption { opacity: 0; }
.ip-lightbox.is-fading-in .ip-lightbox__image,
.ip-lightbox.is-fading-in .ip-lightbox__caption { opacity: 1; }
.ip-lightbox__close { position: absolute; top: -3px; right: -3px; z-index: 2; display: flex; align-items: center; justify-content: center; width: 2.5625rem; height: 2.5625rem; padding: 0; border: 0; background: #fff; color: #000; cursor: pointer; }
.ip-lightbox__close span { position: absolute; width: 1.125rem; height: 0.125rem; background: currentColor; }
.ip-lightbox__close span:first-child { transform: rotate(45deg); }
.ip-lightbox__close span:last-child { transform: rotate(-45deg); }
.ip-lightbox__nav { position: absolute; top: 50%; z-index: 2; display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 1px solid #fff; border-radius: 50%; color: #fff; cursor: pointer; transform: translateY(-50%); }
.ip-lightbox__nav--prev { left: 0.375rem; background: rgba(125,125,125,0.85); }
.ip-lightbox__nav--next { right: 0.375rem; background: #ca161e; }
.ip-lightbox__nav span { display: block; width: 0.75rem; height: 0.75rem; border-top: 2px solid currentColor; border-right: 2px solid currentColor; }
.ip-lightbox__nav--prev span { margin-left: 0.25rem; transform: rotate(-135deg); }
.ip-lightbox__nav--next span { margin-right: 0.25rem; transform: rotate(45deg); }
@media (min-width: 768px) {
    .ip-lightbox__dialog { width: min(calc(100vw - 4rem), 74.5rem); min-height: calc(100vh - 4rem); margin: 2rem auto; }
    .ip-lightbox__image { max-height: calc(100vh - 8rem); }
    .ip-lightbox__caption { padding: 1rem 1.5rem 1.25rem; font-size: 1rem; }
    .ip-lightbox__nav { width: 3.5rem; height: 3.5rem; }
    .ip-lightbox__nav--prev { left: 0.5rem; }
    .ip-lightbox__nav--next { right: 0.5rem; }
}

/* 3-image post grid — built by post-images.js */
.post-img-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 15px; max-width: 100%; }
.post-img-grid > p:first-child { grid-column: 1 / -1; }
.post-img-grid > p { margin: 0; padding: 0; }
.post-img-grid > p a { display: block; }
.post-img-grid > p img { float: none !important; width: 100% !important; height: auto; display: block; margin: 0; }

@media screen and (max-width: 599px) {
    .post-img-grid { grid-template-columns: 1fr; }
    .post-img-grid > p:first-child { grid-column: 1; }
}
.post-body.text a { text-decoration: underline; color: #ca161e; transition: color 150ms ease, text-decoration-color 150ms ease; }
.post-body.text a.blogbutton { text-decoration: none; }
.post-body.text a.blogbutton:hover { color: #000 !important; }

/* Read more link */
.post .read-more { font-size: 0.9375rem; font-weight: 700 !important; }

/* Admin edit link (visible to authenticated users only) */
a.post-edit-link { font-size: 0.8125rem; font-weight: 600; color: #ca161e; text-decoration: underline; }
a.post-edit-link:hover { color: #000; }

/* Blog CTA button */
a.blogbutton {
    clear: both;
    margin: 20px 0 0 0;
    padding: 0 24px;
    text-decoration: none !important;
    color: #fff !important;
    min-height: 48px;
    background-color: #000;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #000;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: background-color 150ms ease, color 150ms ease;
}
a.blogbutton:hover { background-color: #fff; color: #000 !important; }

/* Post body and tag hover */
.post .post-body a:hover { color: #000; text-decoration-color: #000; }
.post .post-tags a:hover { color: #ca161e; text-decoration-color: #ca161e; }

/* Sidebar links */
.sidebar-wrapper ul li a {
    font-size: 1rem !important;
    color: #000 !important;
    text-decoration: none !important;
    font-weight: 500;
}
.sidebar-wrapper ul li a:hover { color: #ca161e !important; }

/* Widgets */
.widget { padding: 3% 0; margin-bottom: 0; }
.widget ul { list-style: none; padding: 0; margin: 0; }

/* Search widget */
#searchbox { display: flex; }

.widget-content #searchbox input[type=text] {
    border-radius: 0.375rem 0 0 0.375rem;
    background-color: #fff;
    border: 1px solid #d7d7d7;
    border-right: none;
    padding: 0 12px;
    height: 44px;
    width: 66%;
    outline: none !important;
    font-size: 0.9375rem;
}
.widget-content #searchbox input[type=submit] {
    float: right;
    border: none;
    padding: 0 12px;
    height: 44px;
    width: 34%;
    background-color: #000;
    color: #fff;
    border-radius: 0 0.375rem 0.375rem 0;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 150ms ease;
}
.widget-content #searchbox input[type=submit]:hover { background-color: #ca161e; }

/* Search page */
.search-page .search-page-searchbox form input[type=submit] {
    border: none;
    padding: 0;
    height: 44px;
    width: 150px;
    background-color: #000;
    color: #fff;
    border-radius: 0.375rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 150ms ease;
}
.search-page .search-page-searchbox form input[type=submit]:hover { background-color: #ca161e; }
.search-page .searchresult a { color: #000; font-weight: 700; text-decoration: none; font-size: 1.2rem; }
.search-page .searchresult a:hover { color: #ca161e; }
.search-page .searchpage ul.paging li.active { background-color: #000; }

/* --- Blog filter panel --- */
.bl-filter-panel { background-color: #fff; height: 100%; border-left: 1px solid #e8e8e8; }
.bl-filter-panel .filter-body.main { padding: 45px 15px 30px 40px; }

.bl-filter-panel .widget { padding: 0; margin-bottom: 0; border-bottom: 1px solid rgba(0,0,0,0.1); }
.bl-filter-panel .widget:last-child { border-bottom: none; }

.bl-filter-panel .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 3px 16px 0;
    margin: 0;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.2;
    color: #000;
    cursor: pointer;
    user-select: none;
}
.bl-filter-panel .widget-header::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-left: 1.5px solid #000;
    border-bottom: 1.5px solid #000;
    transform: rotate(-45deg);
    transition: transform 200ms ease;
    flex-shrink: 0;
    margin-left: 0.75rem;
}
.bl-filter-panel .widget.open > .widget-header::after { transform: rotate(135deg); }

.bl-filter-panel .widget-content { display: none; flex-direction: column; gap: 4px; padding-bottom: 16px; }
.bl-filter-panel .widget.open > .widget-content { display: flex; }

.bl-filter-panel .widget-content ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.bl-filter-panel .widget-content ul li { padding: 4px 0; }
.bl-filter-panel .widget-content ul li a {
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.4;
    color: #000 !important;
    opacity: 0.65;
    transition: opacity 150ms ease, color 150ms ease;
    text-decoration: none !important;
}
.bl-filter-panel .widget-content ul li a:hover { opacity: 1; color: #ca161e !important; }

/* --- Desktop sidebar --- */
@media screen and (min-width: 992px) {
    .blog-body { background: linear-gradient(90deg, #f7f7f7 50%, #fff 0%); }
    .blog-body .main-section { background: linear-gradient(90deg, #f7f7f7 90%, #fff 0%); }
    .blog-body .content-wrapper { background-color: #f7f7f7; width: 75% !important; padding-right: 30px; min-height: calc(100vh - 600px); }
    .sidebar-wrapper { width: 25% !important; }
    .bl-filter-panel .widget.open > .widget-content { display: flex; }
    .bl-filter-togg { display: none; }
    .bl-filter-head { display: none; }
    .bl-filter-overlay { display: none; }
    .bl-filter-panel .filter-body.main { position: sticky; top: 115px; max-height: calc(100vh - 130px); overflow: auto; }
}

/* --- Mobile sidebar (slide-up bottom sheet) --- */
@media screen and (max-width: 991px) {
    .bl-filter-togg {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
        padding: 0;
        height: 50px;
        font-size: 16px;
        font-weight: 600;
        color: #262121;
        cursor: pointer;
        user-select: none;
        white-space: nowrap;
    }
    .bl-filter-togg::after {
        content: "";
        display: inline-block;
        width: 8px;
        height: 8px;
        border-left: 1.5px solid #000;
        border-bottom: 1.5px solid #000;
        transform: rotate(-45deg);
        transition: transform 200ms ease;
        flex-shrink: 0;
        margin-left: 0.75rem;
    }
    .bl-filter-togg:hover { background-color: #f7f7f7; }

    .sidebar-wrapper { position: static; background-color: #fff; }
    .content-wrapper { background-color: #f7f7f7; }

    .bl-filter-panel {
        position: fixed;
        left: 0;
        bottom: 0;
        width: 100%;
        z-index: 21;
        background-color: #fff;
        border-radius: 15px 15px 0 0;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.2s ease;
        border-left: none;
        display: flex;
        flex-direction: column;
    }
    .bl-filter-panel.open { max-height: calc(100vh - 90px); opacity: 1; border-bottom: 1px solid #dbdbdb; }

    .bl-filter-head {
        background-color: #fafafa;
        padding: 20px 15px 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-shrink: 0;
    }
    .bl-filter-head span { color: #1b1b1b; font-size: 20px; font-weight: 700; }
    .bl-filter-head .close { width: 25px; height: 25px; position: relative; transform: rotate(45deg); cursor: pointer; }
    .bl-filter-head .close::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) rotate(90deg);
        width: 2px;
        height: 100%;
        border-radius: 10px;
        background-color: #000;
    }
    .bl-filter-head .close::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 2px;
        height: 100%;
        border-radius: 10px;
        background-color: #000;
    }

    .bl-filter-panel .filter-body.main { flex: 1; min-height: 0; overflow-y: auto; padding: 0 15px 30px; }
    .bl-filter-panel .widget { border-bottom: 1px solid #000; }

    .bl-filter-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #000;
        opacity: 0;
        z-index: 20;
        cursor: pointer;
        transition: opacity 0.2s ease;
    }
    .bl-filter-overlay.active { display: block; opacity: 0.5; }
    .blog-body .main-section { display: flex; flex-direction: column-reverse; gap: 0; }
}
