/* The Stucco Guy Related Posts */

.tsg-related-posts {
    --tsg-rp-accent: #f15a24;
    --tsg-rp-text: #161a22;
    --tsg-rp-muted: #626a76;
    --tsg-rp-border: #e3e6ea;
    --tsg-rp-soft: #fff4ef;

    margin: 48px 0;
    color: var(--tsg-rp-text);
}

.tsg-related-posts *,
.tsg-related-posts *::before,
.tsg-related-posts *::after {
    box-sizing: border-box;
}

.tsg-related-posts__heading {
    margin-bottom: 18px;
}

.tsg-related-posts__accent {
    display: block;
    width: 44px;
    height: 3px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: var(--tsg-rp-accent);
}

.tsg-related-posts__heading h2 {
    margin: 0;
    color: var(--tsg-rp-text);
    font-size: clamp(1.65rem, 3vw, 2.1rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.tsg-related-posts__heading p {
    margin: 7px 0 0;
    color: var(--tsg-rp-muted);
    font-size: 0.98rem;
    line-height: 1.5;
}

.tsg-related-posts__list {
    display: grid;
    gap: 12px;
}

.tsg-related-card {
    display: grid;
    grid-template-columns: minmax(150px, 30%) minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--tsg-rp-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        border-color 180ms ease;
}

.tsg-related-card:hover {
    transform: translateY(-2px);
    border-color: #d4d9df;
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.10);
}

.tsg-related-card__image {
    display: block;
    min-height: 155px;
    background: #eceff2;
}

.tsg-related-card__image img {
    width: 100%;
    height: 100%;
    min-height: 155px;
    display: block;
    object-fit: cover;
}

.tsg-related-card__placeholder {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 155px;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    padding: 20px;
    color: #fff;
    background: linear-gradient(145deg, #e95a2a, #37343a);
    text-align: center;
}

.tsg-related-card__placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.12), transparent 42%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px);
}

.tsg-related-card__placeholder strong,
.tsg-related-card__placeholder small,
.tsg-related-card__placeholder-icon,
.tsg-related-card__swatches {
    position: relative;
    z-index: 1;
}

.tsg-related-card__placeholder strong {
    font-size: 1rem;
    line-height: 1.2;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.tsg-related-card__placeholder small {
    font-size: 0.72rem;
    opacity: 0.82;
}

.tsg-related-card__placeholder-icon {
    width: 54px;
    height: 44px;
    margin-bottom: 3px;
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: 8px;
    box-shadow: 12px 8px 0 -4px rgba(255, 255, 255, 0.28);
}

.tsg-related-card__placeholder--repair {
    background: linear-gradient(145deg, #e15b32, #49352f);
}

.tsg-related-card__placeholder--materials {
    background: linear-gradient(145deg, #b98b57, #514238);
}

.tsg-related-card__placeholder--costs {
    background: linear-gradient(145deg, #d48634, #4a423b);
}

.tsg-related-card__placeholder--finishes {
    background: linear-gradient(145deg, #c8a47c, #4a4039);
}

.tsg-related-card__placeholder--waterproofing {
    background: linear-gradient(145deg, #4b91a4, #303d44);
}

.tsg-related-card__placeholder--general {
    background: linear-gradient(145deg, #ef6030, #35343a);
}

.tsg-related-card__placeholder--colors {
    gap: 13px;
    background: linear-gradient(145deg, #f7f2ec, #e8e0d7);
    color: #27242a;
}

.tsg-related-card__placeholder--colors::after {
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.48), transparent 48%),
        repeating-linear-gradient(0deg, rgba(75, 57, 45, 0.025) 0 1px, transparent 1px 4px);
}

.tsg-related-card__swatches {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    transform: rotate(-5deg);
}

.tsg-related-card__swatches i {
    display: block;
    width: 22px;
    height: 68px;
    border: 3px solid rgba(255, 255, 255, 0.92);
    border-radius: 5px;
    box-shadow: 0 6px 14px rgba(45, 35, 30, 0.18);
}

.tsg-related-card__swatches i:nth-child(1) { height: 46px; background: #f0d8bd; }
.tsg-related-card__swatches i:nth-child(2) { height: 55px; background: #dda77e; }
.tsg-related-card__swatches i:nth-child(3) { height: 63px; background: #c97154; }
.tsg-related-card__swatches i:nth-child(4) { height: 68px; background: #a9b1a0; }
.tsg-related-card__swatches i:nth-child(5) { height: 59px; background: #7e9aa3; }
.tsg-related-card__swatches i:nth-child(6) { height: 49px; background: #d9c96f; }


.tsg-related-card__content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 16px 18px;
}

.tsg-related-card__category {
    align-self: flex-start;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    color: var(--tsg-rp-accent);
    background: var(--tsg-rp-soft);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.tsg-related-card__title {
    margin: 0;
    font-size: clamp(1.15rem, 2.3vw, 1.45rem);
    line-height: 1.24;
    letter-spacing: -0.02em;
}

.tsg-related-card__title a {
    color: var(--tsg-rp-text);
    text-decoration: none;
}

.tsg-related-card__title a:hover,
.tsg-related-card__title a:focus {
    color: var(--tsg-rp-accent);
}

.tsg-related-card__excerpt {
    margin: 7px 0 12px;
    color: var(--tsg-rp-muted);
    font-size: 0.94rem;
    line-height: 1.5;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.tsg-related-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: auto;
}

.tsg-related-card__time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--tsg-rp-muted);
    font-size: 0.86rem;
}

.tsg-related-card__time .dashicons {
    width: 17px;
    height: 17px;
    font-size: 17px;
}

.tsg-related-card__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--tsg-rp-accent);
    font-size: 0.93rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.tsg-related-card__link span {
    transition: transform 160ms ease;
}

.tsg-related-card__link:hover span,
.tsg-related-card__link:focus span {
    transform: translateX(3px);
}

@media (max-width: 700px) {
    .tsg-related-posts {
        margin: 38px 0;
    }

    .tsg-related-card {
        grid-template-columns: 1fr;
    }

    .tsg-related-card__image,
    .tsg-related-card__image img,
    .tsg-related-card__placeholder {
        min-height: 180px;
    }

    .tsg-related-card__content {
        padding: 16px;
    }
}

@media (max-width: 420px) {
    .tsg-related-card__footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}
