/* ==========================================================================
   THY Resources — Blog & Case Study unified page
   ========================================================================== */

/* Layout
   ========================================================================== */
.thy-res-wrap {
    font-family: inherit;
    color: #000;
}

.thy-res-main {
    display: grid;
    grid-template-columns: 460px 1fr;
    grid-template-areas:
        "toolbar toolbar"
        "sidebar featured"
        "list list";
    gap: 2rem 4rem;
    align-items: start;
}

.thy-res-sidebar     { grid-area: sidebar; }
.thy-res-toolbar     { grid-area: toolbar; }
.thy-res-featured-wrap { grid-area: featured; }
.thy-res-grid        { grid-area: list; }

.thy-res-main.is-loading {
    position: relative;
}

.thy-res-main.is-loading:before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.8);
    z-index: 10;
}

/* ==========================================================================
    Sidebar
    ========================================================================== */

.thy-res-sidebar {
    background-color: #2D2E2D;
    color: #fff;
    padding-right: 4rem;
    padding-bottom: 4rem;
    position: relative;
    z-index: 100;
}

.thy-res-sidebar:after {
    content: "";
    background: inherit;
    position: absolute;
    left: -50vw;
    top: -50vh;
    bottom: 0;
    right: 0;
    z-index: -1;
}


.thy-res-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.thy-res-sidebar__title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e35c27;
    margin: 0;
}

.thy-res-sidebar__close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    color: #000;
}

.thy-res-filter__group {
    padding: 1.25rem 0;
}

.thy-res-filter__group--types {
    border-top: none;
    padding-top: 0;
    margin-bottom: 0.25rem;
}

.thy-res-filter__group-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #000;
    margin: 0 0 0.875rem;
}

.thy-res-filter__check {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.35rem;
    font-weight: 300;
    line-height: 1.4;
    cursor: pointer;
    padding: 0.2rem 0;
    color: #fff;
    transition: color 0.2s;
}

.thy-res-filter__check:hover { color: #e35c27; }

.thy-res-filter__check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 1.5px solid #999;
    background-color: #fff;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
}

.thy-res-filter__check input[type="checkbox"]:checked {
    background: #e35c27;
    border-color: #e35c27;
}

.thy-res-filter__check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.thy-res-filter__clear {
    color: #e35c27;
    background-color: #fff;
    transition: color 0.2s, background-color 0.2s;
    text-transform: none;
    font-family: inherit;
    width: auto;
    min-width: 0;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.thy-res-filter__submit {
    display: block;
    margin-top: 1rem;
    width: 100%;
    padding: 0.625rem;
    background: #e35c27;
    color: #fff;
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 2px;
}

/* ==========================================================================
   Toolbar
   ========================================================================== */
.thy-res-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.thy-res-toolbar__cat-select-wrap {
    position: relative;
    display: none;
}

.thy-res-toolbar__cat-select-wrap:after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.95rem;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
    color: #fff;
}

.thy-res-toolbar__cat-select {
    display: none;
    appearance: none;
    -webkit-appearance: none;
    min-width: 9.5rem;
    width: 100%;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.2;
    padding: 0.5rem 2.5rem 0.5rem 0.95rem;
    border: 1.5px solid #ddd;
    border-radius: 2rem;
    background: rgba(0, 0, 0, 0);
    color: #fff;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s, box-shadow 0.2s;
    text-align: center;
}

.thy-res-toolbar__cat-select:hover {
    border-color: #ddd;
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
}

.thy-res-toolbar__cat-select:focus {
    outline: none;
    border-color: #fff;
    background-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 0 0 3px rgba(34,34,34,0.12);
}

.thy-res-toolbar__filter-btn {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: none;
    border: 1.5px solid #222;
    border-radius: 2px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: #222;
}

.thy-res-toolbar__filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e35c27;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.25rem;
}

.thy-res-toolbar__sort {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: #666;
    margin-top: 1rem;
}

.thy-res-toolbar__sort-label {
    font-size: 1.4rem;
    color: #fff;
}

.thy-res-toolbar__sort-select-wrap {
    position: relative;
    flex: 1;
}

.thy-res-toolbar__sort-select-wrap:after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.95rem;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
    color: #fff;
}

.thy-res-toolbar__sort-select {
    appearance: none;
    -webkit-appearance: none;
    min-width: 9.5rem;
    width: 100%;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.2;
    padding: 0.5rem 2.5rem 0.5rem 0.95rem;
    border: 1.5px solid #ddd;
    border-radius: 2rem;
    background: rgba(0, 0, 0, 0);
    color: #fff;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s, box-shadow 0.2s;
    text-align: center;
}

.thy-res-toolbar__sort-select:hover {
    border-color: #ddd;
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
}

.thy-res-toolbar__sort-select:focus {
    outline: none;
    border-color: #fff;
    background-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 0 0 3px rgba(34,34,34,0.12);
}

/* ==========================================================================
   Featured Hero
   ========================================================================== */
.thy-res-featured-wrap { margin-bottom: 4rem; }

.thy-res-featured {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    gap: 2.5rem;
    align-items: center;
    text-align: center;
}

.thy-res-featured__image {
    display: block;
    aspect-ratio: 3.2 / 2;
    overflow: hidden;
    border-radius: 5px;
    position: relative;
}

.thy-res-featured__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.thy-res-featured:hover .thy-res-featured__image img { transform: scale(1.03); }

.thy-res-featured__image:after {
    content: '';
    display: block;
    position: absolute;
    inset: 0;
    z-index: 10000;
}

.thy-res-featured .thy-res-card__video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thy-res-featured__image .thy-res-card__video iframe {
    width: 120%;
    height: 100%;
    aspect-ratio: 3.2 / 2;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.thy-res-featured:hover .thy-res-card__video,
.thy-res-featured:active .thy-res-card__video,
.thy-res-featured:focus .thy-res-card__video {
    opacity: 1;
}

.thy-res-featured__label {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e35c27;
    margin-bottom: 0;
}

.thy-res-featured__title {
    font-size: 1.65rem;
    font-weight: 500;
    line-height: 1.25;
    margin: 0 0 1.25rem;
}

.thy-res-featured__title a { color: inherit; text-decoration: none; transition: color 0.2s; }
.thy-res-featured__title a:hover { color: #e35c27; }

.thy-res-featured__excerpt {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.5;
    color: #444;
    margin: 0 0 1.5rem;
}

.thy-res-featured__cta {
    display: inline-block;
    color: #000;
    transition: color 0.2s;
    min-width: 0;
    padding: 0.75rem 1.25rem;
    width: auto;
}

.thy-res-featured__cta:hover { color: #fff; }

/* ==========================================================================
   Grid
   ========================================================================== */
.thy-res-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem 2rem;
}

/* ==========================================================================
   Cards — shared
   ========================================================================== */
.thy-res-card { font-size: 0.95rem; font-weight: 300; line-height: 1.5; }

.thy-res-card__thumb {
    display: block;
    aspect-ratio: 3 / 2.5;
    overflow: hidden;
    background: #eee;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    position: relative;
}

.thy-res-card__thumb:after {
    content: '';
    display: block;
    position: absolute;
    inset: 0;
    z-index: 10000;
}

.thy-res-card .thy-res-card__video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thy-res-card__thumb .thy-res-card__video iframe {
    height: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.thy-res-card:hover .thy-res-card__video,
.thy-res-card:active .thy-res-card__video,
.thy-res-card:focus .thy-res-card__video {
    opacity: 1;
}

.thy-res-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.thy-res-card:hover .thy-res-card__thumb img { transform: scale(1.04); }

.thy-res-card__title { font-size: 1.5rem; font-weight: 500; line-height: 1.4; margin: 0 0 0.875rem; }
.thy-res-card__title a { color: #000; text-decoration: none; transition: color 0.2s; }
.thy-res-card__title a:hover { color: #e35c27; text-decoration: underline; }

.thy-res-card__excerpt { font-size: 1rem; font-weight: 300; line-height: 1.5; color: #444; margin: 0 0 1.25rem; }

/* Case Study */
.thy-res-card--case-study .thy-res-card__label {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e35c27;
    margin-bottom: 0.625rem;
}

.thy-res-card__cta {
    display: inline-block;
    color: #000;
    transition: color 0.2s;
    min-width: 0;
    padding: 0.75rem 1.25rem;
    width: auto;
}

.thy-res-card__cta:hover { color: #fff; }

/* Blog */
.thy-res-card--blog .thy-res-card__meta { font-size: 1rem; font-weight: 300; color: #666; margin-bottom: 0.75rem; }
.thy-res-card--blog .thy-res-card__author,
.thy-res-card--blog .thy-res-card__date { display: block; }

.thy-res-empty { font-size: 1rem; color: #666; padding: 3rem 0; }

.thy-res-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; }
.thy-res-overlay.is-active { display: block; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .thy-res-main {
        grid-template-columns: 1fr;
        grid-template-areas:
            "toolbar"
            "featured"
            "list";
    }

    .thy-res-sidebar {
        display: none;
    }

    .thy-res-toolbar {
        justify-content: center;
        background: #2D2E2D;
        padding: 1rem 1.5rem;
        margin-top: -1.7rem;
        margin-left: -1.25rem;
        margin-right: -1.25rem;
        position: relative;
        z-index: 100;
    }

    .thy-res-toolbar__cat-select-wrap {
        display: block;
        width: 100%;
        max-width: 22rem;
    }

    .thy-res-toolbar__cat-select {
        display: block;
    }

    .thy-res-grid { grid-template-columns: repeat(2, 1fr); gap: 3rem 1.5rem; }
    .thy-res-featured { grid-template-columns: 1fr; gap: 1.5rem; }
    .thy-res-featured__title { font-size: 1.375rem; }
    .thy-res-grid .thy-res-card__excerpt {
        display: none;
    }

    .thy-res-card:hover .thy-res-card__thumb img,
    .thy-res-featured:hover .thy-res-featured__image img { transform: none; }

    .thy-res-card__meta {
        display: flex;
        gap: 0.25rem;
    }
    .thy-res-card__author:after {
        content: ', ';
    }
}

@media (max-width: 760px) {
    .thy-res-grid { grid-template-columns: 1fr; }
}

#ct-builder .thysse-resource-element-placeholder:before {
    content: "This block serves as a placeholder. After adding it, it will automatically pull in and display your most recent case studies and blog posts.";
    display: block;
    padding: 1rem;
    background: #f9f9f9;
    border: 1px solid #ccc;
    color: #666;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 2rem;
}

#ct-builder .thy-res-wrap {
    position: relative;
}

#ct-builder .thy-res-wrap:after {
    content: '';
    position: absolute;
    inset: -2rem;
    background-color: rgba(255, 255, 255, 0.5);
    z-index: 100;
}

#ct-builder .thy-res-sidebar:after {
    left: -2rem;
    top: -2rem;
}