/* Related-plans mini browser. Card styles come from cards.css. */
/* The top rule and centered black heading match the original static
   "Find More Barndominium Floor Plans" section it follows. */
.blpb-related {
    border-top: 3px solid #1a1a1a;
    margin: 36px 0;
    padding-top: 26px;
}

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

.blpb-related__head {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin: 0 0 18px;
    text-align: center;
}

.blpb-related__heading {
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
    text-align: center;
}

.blpb-related__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

/* The filters share the full content width as equal thirds. */
.blpb-related__control {
    flex: 1 1 120px;
    min-width: 0;
}

.blpb-related__control select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--blpb-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2366747f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 13px;
    border: 1px solid var(--blpb-border);
    border-radius: 999px;
    color: var(--blpb-text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    min-height: 38px;
    padding: 6px 30px 6px 13px;
}

.blpb-related__control select:focus-visible {
    outline: 3px solid var(--blpb-focus);
    outline-offset: 2px;
}

/* The shared results-grid fragment renders compact three-up inside the
   plan-page content column. */
.blpb-related__viewport {
    position: relative;
}

.blpb-related .blpb-results-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, 1fr);
}

/* Reserve fixed line counts for the title and meta so every card is the same
   height regardless of content; otherwise the grid stretches rows to the
   tallest card and the cards look different from page to page. */
.blpb-related .blpb-plan-card__title {
    font-size: 14px;
    min-height: 2.6em; /* 2 lines */
}

.blpb-related .blpb-plan-card__meta {
    font-size: 12px;
    max-height: 2.7em; /* 2 lines */
    min-height: 2.7em;
    overflow: hidden;
}

.blpb-related .blpb-plan-card__features {
    display: none;
}

.blpb-related .blpb-plan-card__body {
    gap: 6px;
    padding: 11px 12px;
}

.blpb-related .blpb-plan-card__price {
    font-size: 13px;
}

.blpb-related .blpb-plan-card__cta {
    font-size: 12px;
}

.blpb-related .blpb-plan-card__footer {
    padding-top: 8px;
}

.blpb-related__viewport[aria-busy="true"] > * {
    opacity: 0.45;
    transition: opacity 0.15s ease;
}

.blpb-related__message {
    background: var(--blpb-tint);
    border: 1px solid var(--blpb-border);
    border-radius: 12px;
    color: var(--blpb-text);
    font-weight: 600;
    margin: 0;
    padding: 22px;
    text-align: center;
}

.blpb-related__footer {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    justify-content: space-between;
    margin-top: 16px;
    min-height: 40px;
}

.blpb-related__pager {
    align-items: center;
    display: flex;
    gap: 10px;
}

/* Doubled selectors with explicit states outrank theme button/link styling. */
.blpb-related .blpb-related__page-btn.blpb-related__page-btn,
.blpb-related .blpb-related__page-btn.blpb-related__page-btn:hover,
.blpb-related .blpb-related__page-btn.blpb-related__page-btn:focus,
.blpb-related .blpb-related__page-btn.blpb-related__page-btn:active {
    background: var(--blpb-surface);
    border: 1px solid var(--blpb-border);
    border-radius: 999px;
    color: var(--blpb-text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: normal;
    min-height: 38px;
    padding: 6px 14px;
    text-transform: none;
}

.blpb-related .blpb-related__page-btn.blpb-related__page-btn:hover:not(:disabled) {
    border-color: var(--blpb-text);
}

.blpb-related .blpb-related__page-btn.blpb-related__page-btn:disabled {
    cursor: default;
    opacity: 0.45;
}

.blpb-related__page-btn:focus-visible {
    outline: 3px solid var(--blpb-focus);
    outline-offset: 2px;
}

.blpb-related__page-label {
    color: var(--blpb-muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.blpb-related .blpb-related__browse-all.blpb-related__browse-all {
    border-bottom: 0;
    box-shadow: none;
    color: var(--blpb-accent);
    font-size: 14px;
    font-weight: 700;
    margin-left: auto;
    text-decoration: none;
}

.blpb-related .blpb-related__browse-all.blpb-related__browse-all:hover,
.blpb-related .blpb-related__browse-all.blpb-related__browse-all:focus {
    color: var(--blpb-accent-deep);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blpb-related [hidden] {
    display: none !important;
}

@media (max-width: 782px) {
    .blpb-related .blpb-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .blpb-related .blpb-results-grid {
        gap: 12px;
        grid-template-columns: repeat(2, 1fr);
    }

    .blpb-related .blpb-plan-card__cta {
        display: none;
    }
}
