/*
 * Trusted Business Directory — Frontend v1.2
 * Themed to match denehyhomes.com
 *
 * Site palette:
 *   --tn-warm-white : #FDFAF5
 *   --tn-cream      : #F5F0E6
 *   --tn-tan        : #C9B99A  (borders)
 *   --tn-green-dark : #1C3829  (headings, hover)
 *   --tn-orange     : #C85A1A  (accents / CTAs)
 *   body text       : #1A2A1E
 *   body font       : "Source Sans 3", sans-serif
 */

.tbd-directory {
    font-family: "Source Sans 3", sans-serif;
    font-size: 15px;
    color: #1A2A1E;
    max-width: 100%;
}

/* ── Search bar ── */
.tbd-search-bar { margin-bottom: 0; }
.tbd-search-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.tbd-search-input,
.tbd-cat-select {
    padding: 9px 14px;
    border: 1.5px solid #C9B99A;
    border-radius: 8px;
    font-family: "Source Sans 3", sans-serif;
    font-size: 15px;
    color: #1A2A1E;
    background: #FDFAF5;
    transition: border-color .18s;
}
.tbd-search-input { flex: 1 1 200px; }
.tbd-search-input:focus,
.tbd-cat-select:focus { outline: none; border-color: #1C3829; }
.tbd-cat-select { cursor: pointer; }

.tbd-search-btn {
    padding: 9px 22px;
    background: #1C3829;
    color: #FDFAF5;
    border: none;
    border-radius: 8px;
    font-family: "Source Sans 3", sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s;
    white-space: nowrap;
}
.tbd-search-btn:hover { background: #142d20; }

.tbd-clear-btn {
    padding: 8px 14px;
    color: #C85A1A;
    font-size: 14px;
    font-family: "Source Sans 3", sans-serif;
    text-decoration: none;
    border: 1.5px solid #C9B99A;
    border-radius: 8px;
    background: transparent;
    transition: border-color .18s, color .18s;
    white-space: nowrap;
}
.tbd-clear-btn:hover { border-color: #C85A1A; color: #a04614; text-decoration: none; }

/* ── Category pills ── */
.tbd-cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 22px;
}
.tbd-cat-pill {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    border: 1.5px solid #C9B99A;
    background: #FDFAF5;
    color: #1A2A1E;
    font-family: "Source Sans 3", sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .18s, background .18s, color .18s;
}
.tbd-cat-pill:hover {
    border-color: #1C3829;
    background: #F5F0E6;
    color: #1C3829;
    text-decoration: none;
}
.tbd-cat-pill.active {
    background: #1C3829;
    border-color: #1C3829;
    color: #FDFAF5;
    font-weight: 700;
}
.tbd-cat-pill.active:hover {
    background: #142d20;
    border-color: #142d20;
    color: #FDFAF5;
}

/* ── Meta labels ── */
.tbd-results-count {
    font-size: 14px;
    color: #1A2A1E;
    opacity: .55;
    margin: 0 0 18px;
}
.tbd-section-label {
    font-size: 15px;
    font-weight: 700;
    color: #1C3829;
    margin: 0 0 18px;
}
.tbd-no-results {
    padding: 40px;
    text-align: center;
    color: #1A2A1E;
    opacity: .5;
}

/* ── Grid ── */
.tbd-grid { display: grid; gap: 18px; }
.tbd-cols-1 .tbd-grid { grid-template-columns: 1fr; }
.tbd-cols-2 .tbd-grid { grid-template-columns: repeat(2, 1fr); }
.tbd-cols-3 .tbd-grid { grid-template-columns: repeat(3, 1fr); }
.tbd-cols-4 .tbd-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
    .tbd-cols-3 .tbd-grid,
    .tbd-cols-4 .tbd-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) { .tbd-grid { grid-template-columns: 1fr !important; } }

/* ── Card — matches .denehy-tool-card exactly ── */
.tbd-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #FDFAF5;
    border: 1.5px solid #C9B99A;
    border-radius: 12px;
    box-shadow: rgba(44, 62, 45, 0.06) 0px 2px 8px;
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s, transform .18s;
    color: #1A2A1E;
    text-decoration: none;
}
.tbd-card:hover {
    border-color: #1C3829;
    box-shadow: rgba(44, 62, 45, 0.13) 0px 6px 20px;
    transform: translateY(-2px);
}
.tbd-card--favorite {
    border-color: #C9B99A;
    background: #FDFAF5;
}
.tbd-card--favorite:hover { border-color: #1C3829; }
.tbd-fav-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 15px;
    line-height: 1;
}

/* Logo area */
.tbd-card__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
    background: #F5F0E6;
    border-bottom: 1.5px solid #C9B99A;
    padding: 14px;
}
.tbd-card__logo img {
    max-height: 82px;
    max-width: 100%;
    object-fit: contain;
}
.tbd-card__logo--placeholder {
    background: linear-gradient(135deg, #1C3829 0%, #2e5c41 100%);
}
.tbd-card__logo--placeholder span {
    color: #FDFAF5;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: "Source Sans 3", sans-serif;
}

/* Card body */
.tbd-card__body {
    padding: 16px 18px 8px;
    flex: 1;
}
.tbd-card__name {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: #1C3829;
    font-family: "Source Sans 3", sans-serif;
}
.tbd-card__category {
    display: inline-block;
    background: #F5F0E6;
    border: 1px solid #C9B99A;
    color: #1C3829;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-family: "Source Sans 3", sans-serif;
}
.tbd-card__desc {
    font-size: 14px;
    color: #1A2A1E;
    opacity: .7;
    line-height: 1.55;
    margin: 6px 0 0;
    font-family: "Source Sans 3", sans-serif;
}

/* Card footer */
.tbd-card__footer {
    padding: 10px 18px 16px;
    border-top: 1.5px solid #C9B99A;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tbd-card__contact {
    font-size: 14px;
    color: #1A2A1E;
    text-decoration: none;
    opacity: .75;
    line-height: 1.4;
    font-family: "Source Sans 3", sans-serif;
}
.tbd-card__contact:hover { opacity: 1; color: #1C3829; text-decoration: none; }
.tbd-card__address {
    font-size: 14px;
    color: #1A2A1E;
    opacity: .65;
    margin: 0;
    line-height: 1.4;
    font-family: "Source Sans 3", sans-serif;
}
.tbd-card__website {
    display: inline-block;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #C85A1A;
    text-decoration: none;
    font-family: "Source Sans 3", sans-serif;
    transition: color .18s;
}
.tbd-card__website:hover { color: #a04614; text-decoration: none; }
.tbd-card__website::after { content: " →"; }

/* ── Pagination ── */
.tbd-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin-top: 32px;
}
.tbd-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1.5px solid #C9B99A;
    border-radius: 8px;
    background: #FDFAF5;
    color: #1A2A1E;
    font-size: 14px;
    font-family: "Source Sans 3", sans-serif;
    text-decoration: none;
    transition: border-color .18s, background .18s, color .18s;
    cursor: pointer;
}
.tbd-page-btn:hover {
    border-color: #1C3829;
    background: #F5F0E6;
    color: #1C3829;
    text-decoration: none;
}
.tbd-page-btn--current {
    background: #1C3829;
    border-color: #1C3829;
    color: #FDFAF5;
    font-weight: 700;
    cursor: default;
}
.tbd-page-btn--current:hover {
    background: #1C3829;
    color: #FDFAF5;
}
