header{
    padding: 12px 80px;
    background-color: white;
    border-bottom: 1px solid var(--outline);
}
header a{
    font-weight: 400;
}
header a.active{
    font-weight: 800;
}
/* Responsive nav */
.menu-toggle{ display: none; background: none; border: none; padding: 8px; cursor: pointer; }
#primary-nav{ display: flex; gap: 24px; }


.secondary-button{
    padding: 16px;
    border: 1px solid var(--primary);
    background-color: white;
    width: fit-content;
}
.secondary-button:hover{
    background-color: var(--primary);
    color: white;
}
.logo{
    width: 164px;
    height: 125px;
}
section{
    padding: 80px 124px;
}
.grey-bg{
    background-color: var(--surface-1);
}
/* Hero */
.hero{ 
    padding: 40px 80px; /* Add vertical padding to prevent overlap */
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: visible; /* Allow content to be visible */
    box-sizing: border-box;
}
#hero-bg{
    background-color: var(--primary);
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -2;
}
.hero h1{
    padding: 0;
    margin-bottom: 40px;
    color: white;
    text-align: center;
}
.link{
    text-decoration: underline;
}

/* Filters + Shows grid */
.filters{ flex-wrap: wrap; }
.filter-btn{
    padding: 8px 16px;
    border: 1px solid var(--outline);
    background: white;
    cursor: pointer;
}
.filter-btn.is-active{
    background: var(--primary);
    color: var(--on-primary);
    border-color: var(--primary);
}
.shows-grid{
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
}
.show-card{ width: 100%; position: relative; overflow: hidden; }
.show-card img{
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.show-meta{
    position: absolute;
    left: 0; right: 0; bottom: 0; top: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.0) 90%);
    color: white;
    opacity: 0;
    transition: opacity 160ms ease-in-out;
    pointer-events: none;
}
.show-meta h5,
.show-meta p{
    color: white;
    font-size: 18px;
}
.show-card:hover .show-meta{ opacity: 1; }
.show-name{ font-weight: 600; font-size: 14px; line-height: 1.2; }
.show-subline{ font-size: 12px; opacity: 0.9; margin-top: 4px; }
.show-card img:hover{
   cursor: pointer;
}
.img-124{
    width: 124px;
    height: 124px;
}
@media (max-width: 1024px){
    .shows-grid{ grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 700px){
    .shows-grid{ grid-template-columns: repeat(2, 1fr); }
}
/* Card */
.case-studies-grid-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    width: 100%;
}

.case-study-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.case-study-card{
    height: 100%;
    display: flex;
    flex-direction: column;
}
.card-image,
.case-study-card-image{
    height: 258px;
    width: 100%;
    background-size: cover;
    background-position: center center;
}
#support{
    background-image: url('./assets/support.png');
}
.card-info{
    padding: 24px 16px;
}
/* Case studies */
.case-study-card-info{
    padding: 16px;
    background-color: white;
    height: 240px;
    overflow: hidden;
}
#traitors{
    background-image: url('./assets/traitors.png');
}
#drugs-map{
    background-image: url('./assets/drug-map-of-britain.jpg');
}
/* Case study images are now loaded dynamically from CMS */

/* Page Header */
.page-header{
    height: 256px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    background-position: center;
}
.page-header h2{
    color: white;
}
.page-header#about-us{
    background-image: url('./assets/about-us-bg.png');
   
}
.page-header#services{
    background-image: url('./assets/servicesbg.png');
}
.page-header#clients{
    background-image: url('./assets/clients.png');
}
.page-header#productions{
    background-image: url('./assets/productions-bg.png');
}


/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 40px; /* space between items */
}

/* Team Member Card */
.team-member:hover {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.team-member img{
    width: 248px;
    height:248px;
    object-fit: cover;   /* fill box, cropping as needed */
    object-position: center; /* always center the crop */
}


/* Team Member Modal Specific Styles */
#team-member-modal .modal-subtitle {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--primary);
}

#team-member-modal .modal-text {
    line-height: 1.6;
}

#team-member-modal .modal-text p {
    margin: 16px 0;
}

#team-member-modal .modal-text p:first-child {
    margin-top: 0;
}

#team-member-modal .modal-text p:last-child {
    margin-bottom: 0;
}

#team-member-modal .modal-text ul {
    margin: 16px 0;
    padding-left: 24px;
    list-style-type: disc;
}

#team-member-modal .modal-text li {
    margin: 8px 0;
    line-height: 1.6;
}

#team-member-modal .modal-text h1,
#team-member-modal .modal-text h2,
#team-member-modal .modal-text h3 {
    margin-top: 16px;
    margin-bottom: 8px;
}

#team-member-modal .modal-text a {
    color: var(--primary);
    text-decoration: underline;
}

#team-member-modal .modal-text a:hover {
    opacity: 0.8;
}

/* Carousel */

.carousel{
    position: relative;
    overflow: hidden;
    width: 80%;
    max-width: 1000px;
    margin: 0 auto;
    flex-shrink: 0;
}
.carousel-track-container{ overflow: hidden; }
.carousel-track{
    display: flex;
    transition: transform 500ms ease;
    will-change: transform;
}
.carousel .slide{
    min-width: 100%;
    max-width: 100%;
    aspect-ratio: 100 / 60;
}
.carousel .slide img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.carousel-btn{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}
.carousel-btn.prev{ left: 16px; }
.carousel-btn.next{ right: 16px; }
.carousel-dots{
    position: absolute;
    left: 0; right: 0; bottom: 12px;
    display: flex; gap: 8px;
    justify-content: center;
    z-index: 2;
}
.carousel-dots .dot{
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255,255,255,0.7);
    border: none; cursor: pointer;
}
.carousel-dots .dot.is-active{ background: white; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.is-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.modal-header {
    padding: 32px 32px 16px 32px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.modal-body {
    padding: 24px 32px 32px 32px;
}

.modal-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin-bottom: 24px;
}

/* Lightbox image */
.image-modal-img{
    width: 100%;
    height: auto;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.modal-text {
    margin-bottom: 24px;
    line-height: 1.6;
    color: #555;
}

.modal-text ul {
    margin: 16px 0;
    padding-left: 24px;
    list-style-type: disc;
}

.modal-text li {
    margin: 8px 0;
    line-height: 1.6;
}

.modal-text p {
    margin: 16px 0;
}

.modal-text p:first-child {
    margin-top: 0;
}

.modal-text p:last-child {
    margin-bottom: 0;
}

.modal-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-features li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: #555;
}

.modal-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
}

/* Modal actions */
.modal-actions {
    margin-top: 24px;
    text-align: center;
    display: flex !important;
    justify-content: flex-start;
}

.enquire-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--primary);
    padding: 12px 24px;
    border: 1px solid var(--primary);
    border-radius: 0px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.enquire-btn:hover {
    background-color: var(--primary);
    color: white;
    text-decoration: none;
}

/* Card hover effect */
.card,
.case-study-card
 {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover,
.case-study-card:hover{
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Card background images */
#training {
    background-image: url('https://images.unsplash.com/photo-1552664730-d307ca884978?w=400&q=80&auto=format&fit=crop');
}
#mental-health{
    background-image: url('./assets/mental-health.avif');
}
#duty-of-care{
    background-image: url('./assets/duty-of-care.avif');
}
#script{
    background-image: url('./assets/script-and-development.avif');
}
#employee-assistance{
    background-image: url('./assets/employee-assistance.avif');
}
#on-call-support{
    background-image: url('./assets/on-call-support.avif');
}
/* Case study images are now loaded dynamically from CMS */
#production-lifespan{
    background-image: url('./assets/production-lifespan.png');
}

footer{
    background-color: var(--primary);
    padding: 80px 124px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
/* Responsive video iframe (16:9) at 50% width */
.responsive-video{
    width: 50%;
    aspect-ratio: 16 / 9;
    height: auto;
    display: block;
    align-self: center;
    max-width: 100%;
}
#hcpc, #bps{
    height: 80px;
    border-radius: 4px;
}
footer .logo{
    width: 164px;
    height: 125px;
}

#mindzone-infographic{
    width: 500px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
#mindzone-infographic:hover{
    transform: scale(1.02);
}
#about-us-container{
    max-width: 80%;
    margin: 0 auto;
}

/* Our Services grid layout */
#our-services{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}
#our-services  .card{
    width: 100%;
}
#our-services > .horizontal{
    display: contents; /* Flatten row wrappers so cards become grid items */
}


/* Splash screen */
#splash{
    position: fixed;
    inset: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transform: translateY(0);
    transition: transform 600ms ease-in-out;
}

#splash.is-hidden{
    transform: translateY(-100%);
    pointer-events: none;
}

.splash-logo{
    width: 240px;
    height: 182px;
    animation: splash-pulse 1.5s ease-in-out infinite;
}

@keyframes splash-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.production-partners{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 24px;
    align-items: center;
}

/* Broadcasters Infinite Carousel */
.broadcasters-carousel-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
}

.broadcasters-carousel {
    display: flex;
    overflow: hidden;
    user-select: none;
    gap: 0;
}

.broadcasters-track {
    display: flex;
    gap: 80px;
    align-items: center;
    animation: scroll-infinite 45s linear infinite;
    will-change: transform;
}

.broadcasters-track img {
    height: 120px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.broadcasters-track img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

/* Pause animation on hover */
.broadcasters-carousel:hover .broadcasters-track {
    animation-play-state: paused;
}

@keyframes scroll-infinite {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}
.testimonials {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
.testimonial{
    border: 1px solid var(--outline);
    padding: 64px;
    position: relative;
}

.quote-img{
    position: absolute;
    left: 16px;
    top: 16px;
}
.article-content{
    width: 800px;
    margin: 0 auto;
}


@media (min-width: 900px){
    #our-services{ gap: 40px; }
}

@media (max-width: 768px) and (min-width: 501px){
    .hero{ 
        padding: 30px 40px; /* Add vertical padding to prevent overlap */
        height: calc(100vh - 140px); /* Account for header height on tablet */
        min-height: 550px;
    }
    .hero h1{
        font-size: 42px;
        line-height: 50px;
        margin-bottom: 32px;
    }
    .carousel{
        width: 90%;
    }
    .carousel .slide{ height: 240px; }
}

@media (max-width: 500px){
    .hero{ 
        padding: 20px 24px; /* Add vertical padding to prevent overlap */
        height: calc(100vh - 92px); /* Account for mobile header height (76px logo + 16px padding) */
        min-height: 500px;
    }
    .hero h1{
        padding: 0;
        margin-bottom: 24px;
        font-size: 28px;
        line-height: 36px;
    }
    #hero-bg{
        height: 100%;
    }
    .carousel{
        width: 100%;
    }
    .carousel .slide{ height: 200px; }
    .responsive-video{ width: 100%; }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 24px 24px 16px 24px;
    }
    
    .modal-title {
        font-size: 20px;
    }
    
    .modal-body {
        padding: 20px 24px 24px 24px;
    }
    
    .modal-image {
        height: 150px;
        margin-bottom: 20px;
    }
    header{ 
        position: relative;
        padding: 8px 16px;
        z-index: 100;
    }
    section{
        padding: 40px 16px;
    }
    #primary-nav{ 
        display: none;
        position: absolute;
        top: 100%; left: 0;
        right: 0; 
        background: white; 
        padding: 24px; 
        flex-direction: column; 
        gap: 40px; 
        border-top: 1px solid var(--outline);
        z-index: 100;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    #primary-nav.is-open{ display: flex; }
    .menu-toggle{ display: inline-flex; align-items: center; justify-content: center; }
    .logo{
        width: 100px;
        height: 76px;
    }
    footer{
        padding: 40px 16px;
        display: flex;
        flex-direction: column;
        row-gap: 32px;
    }
    footer .icon-24{
        width: 40px;
        height: 40px;
    }
    .production-partners{
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
        justify-content: center;
        align-items: center;
        justify-content: center;
    }
    .production-partners img{
        width: 80px;
    }
    
    /* Broadcasters carousel mobile adjustments */
    .broadcasters-track {
        gap: 40px;
        animation-duration: 30s;
    }
    
    .broadcasters-track img {
        height: 40px;
    }
    .page-header{
        height: 164px;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        color: white;
    }
    .team-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
        gap: 24px; /* space between items */
    }
    #mindzone-infographic{
        width: 100%;
    }
    .case-study-card-info{
        height: auto;
    }
    .case-studies-grid-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .testimonials {
        grid-template-columns: repeat(1, 1fr);
      }
    .team-member img{
        width: 148px;
        height: 148px;
    }
}

