/* Archive */

.archive h1{
    text-transform: uppercase;
    color: #223365;
    margin-top: 4rem!important;
}
.archive .responsive-background{
    height:14.375rem;
}
.archive .responsive-background img:not(.exclude){
    position:unset!important;
}
.archive .row.posts{
    margin-top:2rem;
}
.row.posts{
    margin-top:1rem;
}
.row.posts .inner{
    background:#223365;
    padding: 1.875rem 1.25rem;
    height:11.25rem;
    position:relative;
}
.row.posts .inner span{
    color:#fff;
    display:block;
}
.row.posts .inner .read-more,
.row.posts .inner .title{
    margin-top:1rem;
}
.row.posts .inner .read-more{
    position:absolute;
    bottom:1.875rem;
}
.row.posts .inner .read-more a{
    color:#fff;
    font-size:1rem;
    text-transform:uppercase;
}
.row.posts .inner .title{
    font-size:1.25rem;
    font-weight:600;
}
.row.posts .inner .date{
    font-size:1.063rem;
}

/* Filter */

.search-posts{
    width:100%;
    display:flex;
    align-items:center;
    margin-top:2rem;
}
.search-posts input[type=text], 
.search-posts select{
    box-shadow: 0px 1px 3px #304A9929;
    border-radius: 100px!important;
    border:0;
    padding:1rem 1.5rem;
    font-size:1.125rem;
    color:#707070;
    font-style:italic;
    width:16.25rem;
}
.search-posts select{
    margin-left:2rem;
    background:url(../svg/chevron-down.svg) right 1.5rem center no-repeat;
}
.search-posts .search-bar{
    position:relative;
}
.search-posts .search-btn,
.search-posts input[type=submit]{
    position:absolute;
    right:0;
    display:inline-block;
    background:transparent;
    padding: 1rem 1.5rem;
    text-align:center;
    box-shadow:unset;
    cursor:pointer;
    border:0;
}
.search-posts .search-btn{
    z-index:0;
}
.search-posts input[type=submit]{
    z-index:50;
}
.search-posts .search-btn svg{
    height:1.188rem;
    width:1.188rem;
}
.reset{
    margin-left:2rem;
    color:#707070;
    font-weight:500!important;
    text-transform:uppercase;
    font-size:.8rem
}
@media only screen and (max-width: 900px){
	.search-posts{
        flex-wrap:wrap;
    }
    .search-posts .search-bar,
    .search-posts input[type=text],
    .search-posts select{
        width:100%;
    }
    .search-posts .search-bar,
    .search-posts select{
        margin: .5rem 0;
    }
    .reset{
        margin: 0.5rem 0 0.5rem 1.5rem;
    }
}

/*Pagination*/
.pagination{
    display:flex;
    justify-content:center
}
.pagination .pages{
    color:#C0314C;
    padding: 0 1rem;
    font-size: .9rem;
    font-style: italic;
}
.pagination a{
    height:1.125rem;
    width:1.125rem;
    position:relative;
    display:inline-block;
    transform: translateY(3px);
}
.pagination a::before{
    content:url(../svg/chevron-right.svg);
    display:inline-block;
    height:1.125rem;
    width:1.125rem;
    position:absolute;
    left:0;
}
.pagination .newer a::before{
    transform: translateY(1px) rotate(180deg);
}


/* Single Case Study */
section.single-case-study-body {
    margin-bottom: 30px;
    padding: 25px 10px;
}

.single-case-study-body h1, .single-case-study-body h2, .single-case-study-body h3, .single-case-study-body h4{
    padding: 0px 0px 5px 0px;
}

.meta-area {
    display: flex;
    align-items: center;
    margin: 20px 0 8px;
    color: #666;
    font-size: 16px;
    padding: 15px 0px;
}

.meta-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.date-icon {
    color: #e2231a; /* matches your red accent */
    flex-shrink: 0;
}

.row.related-articles-section {
    margin-top: 30px;
}

/* Gallery */
.gallery-wrapper {
    width: 100%;
    max-width: 850px; /* reduced overall gallery width */
    margin: 30px auto;
}

/* ===== Main slider ===== */
.gallery-slider {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #fafafa;
    border: 1px solid #eee;
}

.gallery-track {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3; /* smaller, more compact than 16:9 */
    max-height: 480px;
}

.slide-item {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.02);
    transition: opacity 0.5s ease, transform 0.6s ease;
}

.slide-item.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* keeps product-style images fully visible */
    display: block;
    /* padding: 24px; */
    box-sizing: border-box;
}

.single-case-study-body .responsive-background {
    height: 14.375rem;
}

.single-case-study-body .responsive-background img:not(.exclude) {
    position: unset!important;
}

/* ===== Arrows ===== */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #C0314C;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background 0.2s ease, transform 0.2s ease;
}

.gallery-arrow:hover {
    /* background: #c81d15; */
    transform: translateY(-50%) scale(1.08);
}

.gallery-arrow svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gallery-prev { left: 14px; }
.gallery-next { right: 14px; }


/* ===== Thumbnails ===== */
.gallery-thumbs {
    display: flex;
    position: relative;
    justify-content: flex-start; /* left-aligned so overflow scroll makes sense */
    flex-wrap: nowrap;           /* changed: no wrapping, items stay in one row */
    overflow-x: auto;            /* enables horizontal scroll when items overflow */
    overflow-y: hidden;
    gap: 10px;
    margin-top: 18px;
    padding-bottom: 10px;         /* space for scrollbar so it doesn't touch thumbs */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
    scrollbar-width: thin;
    scrollbar-color: #c7c7c7d9 #ffffff00;
}

/* Optional: styled scrollbar for WebKit browsers */
.gallery-thumbs::-webkit-scrollbar {
    height: 6px;
}
.gallery-thumbs::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}
.gallery-thumbs::-webkit-scrollbar-thumb {
    background: #C0314C;
    border-radius: 4px;
}

.thumb-item {
    flex: 0 0 auto;   /* already had this — keeps items from shrinking/growing */
    width: 120px;
    height: 80px;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #fafafa;
    opacity: 0.65;
    scroll-snap-align: start;    /* nice snap-to-thumb effect when scrolling */
    transition: border-color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    box-sizing: border-box;
}

.thumb-item.is-active {
    border-color: #C0314C;
    opacity: 1;
}

.thumb-item:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* Add snap scrolling container behavior */
.gallery-thumbs {
    scroll-snap-type: x proximity;
}

@media (max-width: 600px) {
    .gallery-wrapper { max-width: 100%; padding: 0 12px; }
    .thumb-item { width: 90px; height: 72px; }
    .gallery-arrow { width: 32px; height: 32px; }
    .gallery-thumbs { gap: 8px; }
}

@media (max-width: 400px) {
    .thumb-item { width: 60px; height: 60px; }
}