/* Force scrollbar to always be visible */
html {
    overflow-y: scroll;
}

/* Prevent Bootstrap from adding padding when modal opens */
body.modal-open {
    padding-right: 0 !important;
}

/* Keep scrollbar visible even when overflow is hidden */
body.modal-open {
    overflow: visible !important;
}

/* Homepage hero spacing - adjust this value as needed */
#page-1 #page_content {
    padding-top: 15px; /* Make sure that the hero element is closer to the navigation */
}

h2.h2-lg {
    font-size: 2.5em;
    margin-bottom: 24px;
}

.br-8 {
    border-radius: 8px;
    overflow: hidden;
}

.text-bold {
    font-weight: normal;
    font-family: 'puristabold', sans-serif;
}

@media (min-width: 768px) {
    .gutter-x-50 {
        --bs-gutter-x: 50px;
    }
    .gutter-x-60 {
        --bs-gutter-x: 60px;
    }
    .gutter-x-30 {
        --bs-gutter-x: 30px;
    }
    .gutter-x-20 {
        --bs-gutter-x: 20px;
    }
    .gutter-y-50 {
        --bs-gutter-y: 50px;
    }
    .gutter-y-70 {
        --bs-gutter-y: 70px;
    }
    .gutter-y-30 {
        --bs-gutter-y: 30px;
    }
    .gutter-y-20 {
        --bs-gutter-y: 20px;
    }
}

/* Make sure background colour is black */
html {
    background-color: #000 !important;
}

/* Bootstrap overrides */
.bg-dark {
    background-color: #1F274D !important;
}
.icon-box-content {
    padding: 20px;
}
.icon-box-content.bg-dark {
    background-color: rgba(0, 0, 0, 0.45) !important;
}
.icon-box-content.bg-dark .backmargin-complete {
    margin: -25rem;
}

td {
    vertical-align: top;
}

body {
    line-height: 1.42857143;
}

body.template-film h1,
body.template-film h2,
body.template-film h3,
body.template-film h4,
body.template-film h5,
body.template-film h6 {
    line-height: 1.1;
}

.icon-box-content.bg-transparent {
    background-color: transparent;
    padding: 0 !important;
}

@media (max-width: 767px) {
    .backmargin-complete {
        margin: 0 !important;
    }

    .icon-box-content-image {
        padding: 0 !important;
    }

    .icon-box-content-image figure {
        margin: 0;
        padding: 0;
    }
}

/* No underline on links */
a.nav-link {
    text-decoration: none;
}

/* Links for the footer */
footer {
    background-color: #000 !important;
}
footer a {
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}

/* Text shadows for flipcards */
.flipcard h3,
.flipcard p {
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.8) !important;
    /* Remove any Bootstrap 5 box-shadow */
    box-shadow: none !important;
}

/* Format tables */
.icon-box-content table {
    width: 100%;
    border-collapse: collapse;
    border: 0 !important;
}
    .icon-box-content table td:first-child {
        padding-right: 10px;
    }

/* Format matrix elements */
.matrix-headline-wrapper {
    display: block;
    padding-bottom: 20px;
}
h3.matrix-headline {
    /*max-width: 70%;*/
    margin: 0;
}

.matrix-links {
    margin-bottom: 0;
    float: left;
    width: 100%;
}

.matrix-image {
    clear: both;
}

/* Links at the bottom of posts */
p.post-link {
    margin: 0 !important;
}

/* Responsive video embed */
.icon-box-content.no-padding {
    padding: 0 !important;
}

.video-responsive {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Make modal backdrop darker */
.modal-backdrop {
    --bs-backdrop-opacity: 0.9;
    background-color: rgb(0, 0, 0) !important;
}

/* Social icons */
.social-links {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
}

.social-links li {
    margin: 0;
}

.social-links .nav-link {
    padding: 0.375rem 0.1rem;
    transition: opacity 0.2s ease;
}

.social-links .nav-link:hover {
    opacity: 0.8;
}

.social-links svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Brand colors for social icons */
.social-links .social-youtube img {
    height: 16px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.55;
}

.social-links .social-instagram svg {
    fill: rgba(255,255,255,.55);
}

.social-links .social-facebook svg {
    fill: rgba(255,255,255,.55);
}

@media (max-width: 1498px) {
    .container, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl {
        width: 100%;
        max-width: 100%;
        padding-left: 32px;
        padding-right: 32px;
    }
}

@media (max-width: 768px) {
    .container, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (min-width: 1499px) {
    .container, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl {
        width: 1400px;
    }
}

/**
 * ====================
 * Hero Video Full Width
 * ====================
 */
.hero-video-fullwidth {
    width: 100%;
    overflow: hidden;
    background: transparent;
    margin-bottom: -20px; /* Make sure that the video element isn't too tall on the homepage */
}

.hero-video-fullwidth video {
    width: 100%;
    height: auto;
    display: block;
}

.hero-video-fullwidth .video-responsive {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.hero-video-fullwidth .video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/**
 * ====================
 * Swiper Slider Styles
 * ====================
 */
.hero-slider {
    height: 500px; /* Fixed height that will match text column */
    width: 100%;
    overflow: hidden;
}

.hero-slider .swiper-slide {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.hero-slider .slide-image-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-slider .slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Hover zoom effect */
.hero-slider .swiper-slide:hover .slide-image {
    transform: scale(1.05);
}

/* Text overlay */
.hero-slider .slide-content {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 10;
    text-align: right;
}

.hero-slider .slide-title {
    color: white;
    font-size: 1.5rem;
    font-family: 'puristabold', sans-serif;
    margin-bottom: 0;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
}

.hero-slider .slide-subtitle {
    color: white;
    font-size: 1rem;
    margin-bottom: 0;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
}

.hero-slider .slide-text-link {
    color: white;
    text-decoration: none;
}

.hero-slider .slide-text-link:hover {
    color: #ccc;
}

/* Swiper navigation */
.hero-slider .swiper-pagination {
    bottom: 15px !important;
}

.hero-slider .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.hero-slider .swiper-pagination-bullet-active {
    background: white;
}

.hero-slider .swiper-button-next,
.hero-slider .swiper-button-prev {
    color: white;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.hero-slider .swiper-button-next:hover,
.hero-slider .swiper-button-prev:hover {
    opacity: 1;
}

/* Hide navigation arrows by default, show on hover */
.hero-slider .swiper-button-next,
.hero-slider .swiper-button-prev {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-slider:hover .swiper-button-next,
.hero-slider:hover .swiper-button-prev {
    opacity: 0.7;
}

/* Ensure equal heights */
.topslider.row-eq-height {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    --bs-gutter-x: 2rem;
}

.topslider.row-eq-height > [class*="col-"] {
    display: flex;
}

.topvideo {
    --bs-gutter-x: 2rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .hero-slider {
        height: 300px;
    }

    .hero-slider .slide-title {
        font-size: 1.2rem;
    }

    .hero-slider .slide-subtitle {
        font-size: 0.9rem;
    }

    .hero-slider .slide-content {
        bottom: 45px;
        right: 15px;
    }
}

/* Simpler equal height for metadata sections */
#metadata.row-eq-height {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

#metadata.row-eq-height > [class*="col-"] {
    display: flex;
}

#metadata #facts .icon-box,
#metadata #credits .icon-box {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#metadata #facts .icon-box-content,
#metadata #credits .icon-box-content {
    flex: 1;
}

/* Feedback slider positioning only */
.feedback-slider .swiper-pagination {
    position: absolute !important;
    bottom: 10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

.feedback-slider .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.feedback-slider .swiper-pagination-bullet-active {
    background: white;
}

/* Navigation arrows */
.feedback-slider .swiper-button-next,
.feedback-slider .swiper-button-prev {
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback-slider:hover .swiper-button-next,
.feedback-slider:hover .swiper-button-prev {
    opacity: 0.7;
}

/*===================
Read more link styles
=====================*/
.read-more-link,
.read-less-link {
    color: #fff;
    text-decoration: underline;
    font-family: 'puristabold', sans-serif;
    letter-spacing: normal;
}

.read-more-link:hover,
.read-less-link:hover {
    text-decoration: none;
}

/*==========
Text columns
============*/

.text-columns {
    column-count: 1;
    column-gap: 2rem;
}

@media (min-width: 768px) {
    .text-columns {
        column-count: 2;
    }
}

@media (min-width: 992px) {
    .text-columns {
        column-count: 3;
    }
}


/*==============
Edit link styles
================*/
.edit-link {
    position: fixed;
    top: 94px;
    right: 10px;
    z-index: 999999;
}

.edit-item-link {
    position: absolute;
    top: 10px;
    right: 10px;
}

/*==============
Buttons
================*/
.btn.btn-white-filled {
    background-color: #fff;
    border-color: #fff;
    color: #1F274D;
    font-family: 'puristabold', sans-serif;
    display: inline-flex;
    align-items: center;
}


/*==============
All films
================*/
#featured_projects {
    margin-top: 42px;
}

#featured_projects figure {
    margin-bottom: 0;
}


/*==============
Film Single
================*/
.film-description {
    padding: 20px !important;
}
@media (min-width: 992px) {
    .film-description-row > [class*="col-lg-"] {
        display: flex;
    }
    .film-description-row > [class*="col-lg-"] > .icon-box {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    .film-description-row > [class*="col-lg-"] > .icon-box > .icon-box-content {
        flex: 1;
    }
    .film-description-row > [class*="col-lg-"] > .icon-box {
        margin-bottom: 0;
    }
}
.film-description .columize {
    column-count: 2;
}
#metadata {
    font-size: 14px;
}
#metadata .icon-box-content {
    padding: 40px 20px 20px;
}
@media (max-width: 767px) {
    .film-description {
        padding: 20px !important;
        margin-bottom: 20px;
    }
    #metadata {
        margin-top: -80px;
    }
}

/*==============
Awards
================*/
.award .text h3 {
    font-size: 1.1em;
}

.award .category.text-bold {
    font-weight: normal;
    font-family: puristalight, sans-serif;
    margin-top: 2px;
    font-size: 14px;
}

.award .filmtitle {
    margin-top: 6px;
}

/*==============
Team & Mission
================*/
.row + .row h3.text-2x {
    margin-top: 0.5em;
}

.teamtext a {
    text-decoration: underline !important;
}
@media (min-width: 768px) {
    .teaserboxes-header .icon-box-content.bg-transparent {
        display: flex;
        align-items: center;
        padding-right: 32px !important;
    }
}

/*==============
Header
================*/
.navbar-brand {
    padding-left: 0 !important;
}
@media (min-width: 768px) {
    .main-nav .navbar-brand .site-logo {
        height: 48px;
        width: auto;
        margin-bottom: 6px;
    }
}

/*================================
Make the new slider look old again
==================================*/

/* Keep swiper wrapper overflow visible so parent layout isn't clipped */
.swiper-container.position-relative {
    overflow: visible;
}

.custom-swiper-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4); /* Semi-transparent dark background */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: larger;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 3px;
    height: 40px;
    width: 40px;
}

.custom-swiper-arrow i {
    font-size: 32px;
}

.custom-swiper-prev {
    left: 10px; /* Slide out beyond left margin */
}

.custom-swiper-next {
    right: 10px; /* Slide out beyond right margin */
}

/* Show arrows on hover - covers all swiper types */
.swiper-container:hover .custom-swiper-arrow,
.swiper:hover .custom-swiper-arrow,
.hero-slider:hover .custom-swiper-arrow,
.film-slider:hover .custom-swiper-arrow,
.feedback-slider:hover .custom-swiper-arrow {
    opacity: 1;
}

/* Slight hover effect on the arrows themselves */
.custom-swiper-arrow:hover {
    background: rgba(51, 100, 199, 1);
    transform: translateY(-50%) scale(1.05);
}

/*========================================
Modifications to backdrop for full credits
========================================*/
.modal.lightbox,
#desktop-modal.dark-backdrop {
    background-color: rgba(0, 0, 0, 0.75) !important;
    padding-bottom: 40px !important;
}

#desktop-modal .btn {
    margin-bottom: 40px !important;
}

/*========================================
Bootstrap 5 Lightbox - Fix Vimeo share button overlap
========================================*/
.modal.lightbox .btn-close {
    display: none !important; /* Hide the default Bootstrap lightbox close button for videos */
}

/* Custom close button for video lightboxes: positioned like credits modal */
.custom-video-close {
    position: absolute;
    display: inline-block;
    top: 30px;
    right: 50px;
    color: #fff;
    font-size: 64px;
    font-weight: 100;
    line-height: 1;
    -webkit-transition: color .15s ease-out;
    transition: color .15s ease-out;
    z-index: 9999;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    opacity: 1;
}

.custom-video-close:hover {
    color: #2568CB;
}

/* Mobile responsive adjustments to match credits modal */
@media (max-width: 767px) {
    .custom-video-close {
        top: 0;
        right: 10px;
        font-size: 48px;
        font-weight: 100;
    }
}

/* Prevent background scrolling when lightbox is open */
body.lightbox-open {
    overflow: hidden !important;
}


/*========================================
Newsblocks
========================================*/
.newsblock h3 {
    font-size: 1.5em;
    line-height: 1.1;
}
    @media(max-width: 767px) {
        .newsblock h3 {
            font-size: 1.3em
        }
    }

.newsblock b,
.newsblock strong {
    font-family: 'puristabold', sans-serif;
    font-weight: normal;
}

/* Match homepage/news table typography on film pages without affecting homepage styling */
body.template-film .icon-box-content table b,
body.template-film .icon-box-content table strong {
    font-family: 'puristabold', sans-serif;
    font-weight: bold;
}

body.template-film .icon-box-content table td {
    line-height: 24px;
}

.newsblock tr td:first-child {
    width: 90px;
}

.newsblock img.align_right {
    margin-bottom: 12px;
}

/* Images extend to edge of content box */
.newsblock .icon-box-content,
.icon-box-round .icon-box-content:not(.bg-transparent) {
    overflow: hidden;
}

/* Reset figure margins */
.icon-box-content figure,
.icon-box-content .matrix-image figure {
    margin: 0;
}

/* ALL images/videos extend to left/right edges (except aligned ones, except teamblock) */
.icon-box-content .matrix-image,
.icon-box-content > div:has(video):not(:has(.align_left)):not(:has(.align_right)),
:not(.teamblock) > .icon-box > .icon-box-content > div:has(figure):not(:has(.align_left)):not(:has(.align_right)),
:not(.teamblock) > .icon-box > .icon-box-content > div:has(> img:not(.align_left):not(.align_right)) {
    margin-left: -20px;
    margin-right: -20px;
    width: calc(100% + 40px);
}

.icon-box-content .matrix-image img,
.icon-box-content .matrix-image video,
.icon-box-content .matrix-image iframe,
.icon-box-content > div:has(video) video,
:not(.teamblock) > .icon-box > .icon-box-content > div:has(figure) figure,
:not(.teamblock) > .icon-box > .icon-box-content > div:has(figure) img {
    width: 100%;
}

.icon-box-content .matrix-image iframe {
    aspect-ratio: 16 / 9;
    display: block;
}

/* Team member photos - small centered photos like live site */
.teamblock .icon-box-content figure,
.teamblock .icon-box-content > div:has(figure),
.teamblock .icon-box-content > div:has(img),
.teamblock .icon-box-content .team-photo-small {
    margin: 0 0 15px 0 !important;
    width: auto !important;
    display: flex;
    justify-content: center;
}
.teamblock .icon-box-content figure img,
.teamblock .team-photo-small img {
    width: 200px !important;
    height: 160px !important;
    object-fit: cover;
    border-radius: 0 !important;
}
.teamblock .icon-box-content header h3 {
    font-size: 1.4em;
}
.teamblock .jobtitle {
    font-size: 1em;
    opacity: 0.8;
}
.teamblock .teamtext {
    font-size: 14px;
}
.teamblock a {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}
.teamblock .icon-box-content {
    padding-bottom: 20px !important;
}
@media (min-width: 992px) {
    .row-eq-height .teamblock {
        display: flex;
    }
    .teamblock .icon-box {
        flex: 1 1 100%;
        display: flex;
        flex-direction: column;
    }
    .teamblock .icon-box-content {
        flex: 1;
    }
}
@media (max-width: 991px) {
    .teamblock,
    .teamblock .icon-box-content {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }
    .teamblock .icon-box {
        display: block !important;
        height: auto !important;
    }
    .teamblock {
        margin-bottom: 1rem;
    }
    .newsblock,
    .newsblock .icon-box-content {
        height: auto !important;
        flex: none !important;
    }
    .newsblock > .icon-box {
        height: auto !important;
        flex: none !important;
        overflow: hidden;
    }
    .newsblock {
        margin-bottom: 1rem;
    }
}

/* FIRST child with media: also extend to top + rounded top corners */
.icon-box-content > .matrix-image:first-child,
.icon-box-content > div:first-child:has(video),
.icon-box-content > div:first-child:has(figure),
.icon-box-content > div:first-child:has(img) {
    margin-top: -20px;
    margin-bottom: 20px;
}

.icon-box-content > .matrix-image:first-child img,
.icon-box-content > .matrix-image:first-child video,
.icon-box-content > .matrix-image:first-child iframe,
.icon-box-content > div:first-child:has(video) video,
.icon-box-content > div:first-child:has(figure) img,
.icon-box-content > div:first-child:has(img) img {
    border-radius: 8px 8px 0 0;
}

/* LAST child with media: also extend to bottom + rounded bottom corners */
/* Also handle case where .edit-item-link follows the last media element */
.icon-box-content > .matrix-image:last-child,
.icon-box-content > .matrix-image:has(+ .edit-item-link:last-child),
.icon-box-content > div:last-child:has(video),
.icon-box-content > div:last-child:has(figure),
.icon-box-content > div:not(.senderlogos):last-child:has(img),
.icon-box-content > div:has(video):has(+ .edit-item-link:last-child),
.icon-box-content > div:has(figure):has(+ .edit-item-link:last-child),
.icon-box-content > div:has(img):has(+ .edit-item-link:last-child) {
    margin-top: 20px;
    margin-bottom: -20px !important;
    padding-bottom: 0 !important;
}

.icon-box-content > .matrix-image:last-child img,
.icon-box-content > .matrix-image:last-child video,
.icon-box-content > .matrix-image:last-child iframe,
.icon-box-content > .matrix-image:last-child figure,
.icon-box-content > .matrix-image:has(+ .edit-item-link:last-child) img,
.icon-box-content > .matrix-image:has(+ .edit-item-link:last-child) video,
.icon-box-content > .matrix-image:has(+ .edit-item-link:last-child) iframe,
.icon-box-content > .matrix-image:has(+ .edit-item-link:last-child) figure,
.icon-box-content > div:last-child:has(video) video,
.icon-box-content > div:last-child:has(figure) figure,
.icon-box-content > div:last-child:has(figure) img,
.icon-box-content > div:not(.senderlogos):last-child:has(img) img,
.icon-box-content > div:has(figure):has(+ .edit-item-link:last-child) figure,
.icon-box-content > div:has(figure):has(+ .edit-item-link:last-child) img,
.icon-box-content > div:has(video):has(+ .edit-item-link:last-child) video {
    border-radius: 0 0 8px 8px;
    margin-bottom: 0 !important;
}

/* When media is BOTH first AND last child (only element) */
.icon-box-content > .matrix-image:first-child:last-child img,
.icon-box-content > .matrix-image:first-child:last-child video,
.icon-box-content > .matrix-image:first-child:last-child iframe,
.icon-box-content > div:first-child:last-child:has(video) video,
.icon-box-content > div:first-child:last-child:has(figure) img,
.icon-box-content > div:first-child:last-child:has(img) img {
    border-radius: 8px;
}

.row.teaserboxes-start.gx-5 {
    --bs-gutter-x: 4em;
}
