/* ============================================================
   Totally Locally Directory — public styles
   Designed to inherit from the active theme but provide
   sensible defaults so the directory looks decent out of the box.
   ============================================================ */

.tld-directory {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
}

/* ---- Filters ---- */
.tld-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1.5rem 0;
}
.tld-filter {
    background: transparent;
    border: 1px solid transparent;
    color: #1e3a5f;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    transition: background 0.2s, border-color 0.2s;
}
.tld-filter:hover { background: #f0f4f8; }
.tld-filter.is-active {
    border-color: #1e3a5f;
    background: #fff;
    font-weight: 600;
}

/* ---- Search ---- */
.tld-search {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0 2rem;
}
.tld-search-input {
    width: 100%;
    max-width: 480px;
    padding: 0.75rem 1.25rem;
    border: 1px solid #ddd;
    border-radius: 999px;
    font-size: 1rem;
    background: #fff;
}
.tld-search-input:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* ---- Grid ---- */
.tld-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* ---- Card ---- */
.tld-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}
.tld-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.tld-card-link { display: block; color: inherit; text-decoration: none; }
.tld-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}
.tld-card-body { padding: 1.25rem; }
.tld-card-title {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
    color: #1e3a5f;
}
.tld-card-category {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: #555;
}
.tld-card-desc {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #333;
}
.tld-card-cta {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: 1px solid #1e3a5f;
    border-radius: 999px;
    color: #1e3a5f;
    font-size: 0.875rem;
}
.tld-card:hover .tld-card-cta { background: #1e3a5f; color: #fff; }

.tld-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #666;
}

/* ============================================================
   Map
   ============================================================ */
.tld-map-wrap { margin: 1.5rem 0; }

.tld-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}
.tld-legend-item {
    --tld-pin-colour: #374151;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid #ddd;
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, border-color 0.2s;
}
.tld-legend-item.is-active {
    opacity: 1;
    border-color: var(--tld-pin-colour);
}
.tld-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--tld-pin-colour);
    display: inline-block;
}

.tld-map {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    z-index: 1; /* keep below sticky headers */
}

.tld-pin {
    background: none !important;
    border: none !important;
}
.tld-pin svg { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25)); }

.tld-map-popup {
    min-width: 180px;
    font-family: inherit;
}
.tld-map-popup img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: block;
}
.tld-popup-cat {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ============================================================
   Single business page
   ============================================================ */
.tld-single {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.tld-single-hero img {
    width: 100%;
    aspect-ratio: 16 / 7;
    object-fit: cover;
    border-radius: 8px;
}
.tld-single-intro { padding: 1.5rem 0; }
.tld-single-title {
    margin: 0 0 0.5rem;
    color: #1e3a5f;
    font-size: 2.25rem;
}
.tld-cat-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 0.25rem;
}
.tld-single-short {
    font-size: 1.15rem;
    color: #444;
    max-width: 60ch;
}

.tld-single-body {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 2.5rem;
    margin-top: 2rem;
}
@media (max-width: 768px) {
    .tld-single-body { grid-template-columns: 1fr; }
}

.tld-info-block {
    margin-bottom: 1.75rem;
}
.tld-info-block h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: #1e3a5f;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tld-info-block p { margin: 0 0 0.5rem; }
.tld-info-block a { color: #1e3a5f; }
.tld-info-block address {
    font-style: normal;
    line-height: 1.5;
    margin: 0 0 0.5rem;
}

.tld-email-reveal {
    background: transparent;
    border: 1px solid #d0d7de;
    color: #1e3a5f;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.tld-email-reveal:hover {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}
.tld-email-revealed {
    color: #1e3a5f;
    word-break: break-all;
}

.tld-socials {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tld-socials a {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: transparent;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875rem;
    color: #1e3a5f;
    transition: background 0.15s, border-color 0.15s;
}
.tld-socials a:hover {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

/* ============================================================
   Gallery — showcase (main image + thumbs) and grid layouts
   ============================================================ */
.tld-gallery h2 {
    margin: 0 0 1rem;
    color: #1e3a5f;
}

/* Showcase: main image with thumbnail strip below */
.tld-gallery-showcase {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tld-gallery-main {
    width: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}
.tld-gallery-main-link {
    display: block;
    width: 100%;
    height: 100%;
}
.tld-gallery-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.tld-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}
.tld-gallery-thumb {
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid transparent;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.15s, transform 0.1s;
}
.tld-gallery-thumb:hover {
    transform: translateY(-1px);
}
.tld-gallery-thumb.is-active {
    border-color: #1e3a5f;
}
.tld-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Grid layout (kept for legacy/option) */
.tld-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}
.tld-gallery-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* ============================================================
   Pagination
   ============================================================ */
.tld-pagination {
    margin: 2.5rem 0 1rem;
    display: flex;
    justify-content: center;
}
.tld-pagination-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.tld-pagination-list a,
.tld-pagination-list span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #1e3a5f;
    background: #fff;
    font-size: 0.95rem;
    transition: background 0.15s, border-color 0.15s;
}
.tld-pagination-list a:hover {
    background: #f0f4f8;
    border-color: #1e3a5f;
}
.tld-pagination-list .current {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
    font-weight: 600;
}
.tld-pagination-list .dots {
    border: none;
    background: transparent;
}

/* ============================================================
   Submission form — two columns on desktop
   ============================================================ */
.tld-submit-form {
    max-width: 880px;
    margin: 2rem auto;
    font-family: inherit;
}

.tld-form-section {
    border: none;
    padding: 0 0 1rem;
    margin: 0 0 1.5rem;
    background: transparent;
}

.tld-form-section legend {
    font-weight: 600;
    font-size: 1.05rem;
    color: #1e3a5f;
    padding: 0;
    margin: 0 0 1rem;
}

.tld-form-section .tld-optional {
    font-weight: 400;
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
}

.tld-form-row {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.tld-form-row.tld-cols-2 {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
    .tld-form-row.tld-cols-2 {
        grid-template-columns: 1fr;
    }
}

.tld-form-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
}

.tld-form-field:last-child {
    margin-bottom: 0;
}

.tld-form-field label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.tld-form-field .tld-req {
    color: #c62828;
    font-weight: 400;
}

.tld-form-field input[type="text"],
.tld-form-field input[type="email"],
.tld-form-field input[type="url"],
.tld-form-field input[type="tel"],
.tld-form-field input[type="file"],
.tld-form-field select,
.tld-form-field textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
    font-size: 0.95rem;
    background: #fff;
    color: #111;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.tld-form-field input:focus,
.tld-form-field select:focus,
.tld-form-field textarea:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.tld-form-field input[type="file"] {
    padding: 0.5rem;
    background: #f9fafb;
}

.tld-form-field textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.tld-form-field .tld-help,
.tld-form-submit .tld-help {
    display: block;
    margin-top: 0.4rem;
    color: #666;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
}

.tld-form-submit {
    text-align: center;
    padding: 1rem 0 2rem;
}

.tld-btn-primary {
    display: inline-block;
    padding: 0.85rem 2.5rem;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
}

.tld-btn-primary:hover {
    background: #16294a;
}

.tld-btn-primary:active {
    transform: translateY(1px);
}

.tld-form-submit .tld-help {
    margin-top: 1rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}
