/* ── Ingbau Directory: Frontend Styles ────────────────────────────────────── */

.ingbau-directory,
.ingbau-locations,
.ingbau-search-wrap {
    font-family: 'Urbanist', inherit;
    color: #2c3338;
    line-height: 1.5;
}

/* ── Roter Stern ────────────────────────────────────────────────────────────── */
.ingbau-star {
    color: #d63638;
    font-weight: 700;
}

/* ── Header-Zeile pro Abteilung ─────────────────────────────────────────────── */
.ingbau-list-header {
    display: grid;
    grid-template-columns: 200px 1fr 180px 160px;
    gap: 12px;
    padding: 7px 10px;
    background: #f6f7f7;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.82em;
    font-weight: 600;
    color: #555;
}
.ingbau-header-left { grid-column: 1 / 3; }
.ingbau-header-phone { }
.ingbau-header-mobile { }

@media (max-width: 900px) {
    .ingbau-list-header {
        grid-template-columns: 1fr 1fr;
    }
    .ingbau-header-left { grid-column: 1 / 3; }
    .ingbau-header-phone, .ingbau-header-mobile { display: none; }
}
@media (max-width: 560px) {
    /* Header: Direktnummer/Mobiltelefon ausblenden, * erweiterte GL bleibt sichtbar */
    .ingbau-list-header {
        display: block;
        padding: 6px 10px;
        background: #f6f7f7;
        border-bottom: 1px solid #e0e0e0;
    }
    .ingbau-header-left:empty { display: none; }
    .ingbau-header-phone,
    .ingbau-header-mobile { display: none; }
}

/* ── Abteilungstitel (nur bei [ingbau_directory] ohne department="...") ─────── */

.ingbau-dept-title {
    font-size: 1.05em;
    font-weight: 600;
    color: #1a1a1a;
    margin: 32px 0 6px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}
.ingbau-dept:first-child .ingbau-dept-title {
    margin-top: 0;
}

/* ── Standort-Titel ──────────────────────────────────────────────────────────── */

.ingbau-section-title {
    font-size: 1.05em;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

/* ── Mitarbeiterliste ────────────────────────────────────────────────────────── */

.ingbau-employee-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 4 Spalten: Name | Berufstitel | Direktnummer | Mobiltelefon */
.ingbau-employee {
    display: grid;
    grid-template-columns: 200px 1fr 180px 160px;
    align-items: center;
    padding: 9px 10px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
    transition: background 0.12s ease;
}
.ingbau-employee:nth-child(even) {
    background: #f5f5f5;
}
.ingbau-employee:hover {
    background: #eef4fb;
}
.ingbau-employee:last-child {
    border-bottom: none;
}

/* Name */
.ingbau-emp-name-col {
    min-width: 0;
}
.ingbau-emp-name {
    color: #1a6dae;
    font-weight: 500;
    font-size: 0.95em;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.12s ease;
}
.ingbau-emp-name:hover {
    color: #0f4c80;
    text-decoration: underline;
}
.ingbau-emp-name--no-mail {
    color: #1a1a1a;
    font-weight: 500;
    font-size: 0.95em;
}

/* Berufstitel */
.ingbau-emp-title-col {
    font-size: 0.88em;
    color: #555;
    min-width: 0;
}

/* Direktnummer & Mobiltelefon */
.ingbau-emp-phone,
.ingbau-emp-mobile {
    font-size: 0.9em;
    white-space: nowrap;
}
.ingbau-emp-phone a,
.ingbau-emp-mobile a {
    color: #1a6dae;
    text-decoration: none;
}
.ingbau-emp-phone a:hover,
.ingbau-emp-mobile a:hover {
    color: #0f4c80;
    text-decoration: underline;
}
.ingbau-dash {
    color: #ccc;
}

/* ── Standortliste – benutzt dasselbe Grid wie .ingbau-employee ─────────────── */

.ingbau-location-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Standort-Zeile = identisches 4-Spalten-Grid wie Mitarbeiter */
.ingbau-location {
    display: grid;
    grid-template-columns: 200px 1fr 180px 160px;
    align-items: start;
    padding: 9px 10px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
    transition: background 0.12s ease;
}
.ingbau-location:nth-child(even) { background: #f5f5f5; }
.ingbau-location:last-child { border-bottom: none; }
.ingbau-location:hover { background: #eef4fb; }

/* Untertitel unter Firmenname */
.ingbau-loc-subtitle {
    display: block;
    font-size: 0.82em;
    color: #666;
    margin-top: 2px;
    font-weight: normal;
}

/* Tel/Fax und Lageplan/Wegbeschrieb nutzen emp-phone / emp-mobile Klassen */
.ingbau-location .ingbau-emp-phone,
.ingbau-location .ingbau-emp-mobile {
    line-height: 1.6;
}
.ingbau-location .ingbau-emp-phone a,
.ingbau-location .ingbau-emp-mobile a {
    color: #1a6dae;
}

/* ── Suchresultate: 5-Spalten-Grid inkl. E-Mail ─────────────────────────────── */

.ingbau-search-results .ingbau-employee {
    grid-template-columns: 1fr 160px 150px 220px;
    align-items: start;
}

.ingbau-emp-title-inline {
    font-size: 0.88em;
    color: #555;
    margin-top: 2px;
    line-height: 1.4;
}

.ingbau-emp-email {
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.ingbau-emp-email a {
    color: #1a6dae;
    text-decoration: none;
}
.ingbau-emp-email a:hover {
    color: #0f4c80;
    text-decoration: underline;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .ingbau-employee,
    .ingbau-location {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }
    .ingbau-emp-name-col { grid-column: 1; grid-row: 1; }
    .ingbau-emp-title-col { grid-column: 2; grid-row: 1; }
    .ingbau-emp-phone    { grid-column: 1; grid-row: 2; }
    .ingbau-emp-mobile   { grid-column: 2; grid-row: 2; }

    /* Suchresultate tablet: Name+Titel+Abteilungen in col1, Telefone/Email nebeneinander */
    .ingbau-search-results .ingbau-employee {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-rows: auto auto;
    }
    .ingbau-search-results .ingbau-emp-name-col  { grid-column: 1 / -1; grid-row: 1; }
    .ingbau-search-results .ingbau-emp-title-col { display: none; } /* in name-col eingebettet */
    .ingbau-search-results .ingbau-emp-phone     { grid-column: 1; grid-row: 2; }
    .ingbau-search-results .ingbau-emp-mobile    { grid-column: 2; grid-row: 2; }
    .ingbau-search-results .ingbau-emp-email     { grid-column: 3; grid-row: 2; }
}

@media (max-width: 560px) {
    .ingbau-employee,
    .ingbau-location {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 2px;
        padding: 10px 6px;
    }
    .ingbau-emp-name-col,
    .ingbau-emp-title-col,
    .ingbau-emp-phone,
    .ingbau-emp-mobile,
    .ingbau-emp-email { grid-column: 1; grid-row: auto; }

    .ingbau-emp-title-col { color: #888; font-size: 0.84em; }

    .ingbau-emp-phone::before,
    .ingbau-emp-mobile::before,
    .ingbau-emp-email::before {
        display: inline-block;
        width: 16px;
        font-weight: 700;
        color: #1a6dae;
        font-size: 0.85em;
    }
    .ingbau-emp-phone::before  { content: "D"; }
    .ingbau-emp-mobile::before { content: "M"; }
    .ingbau-emp-email::before  { content: "E"; }

    .ingbau-search-results .ingbau-employee {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .ingbau-search-results .ingbau-emp-name-col,
    .ingbau-search-results .ingbau-emp-title-col,
    .ingbau-search-results .ingbau-emp-phone,
    .ingbau-search-results .ingbau-emp-mobile,
    .ingbau-search-results .ingbau-emp-email {
        grid-column: 1; grid-row: auto;
    }
}

/* ── Suche ───────────────────────────────────────────────────────────────────── */

.ingbau-search-wrap {
    margin-bottom: 24px;
    width: 100%;
}

.ingbau-search-box {
    position: relative;
    width: 100%;
}

/* Browser-eigenes X beim type=search entfernen */
.ingbau-search-input::-webkit-search-cancel-button,
.ingbau-search-input::-webkit-search-decoration { -webkit-appearance: none; }
.ingbau-search-input[type=search]::-ms-clear { display: none; }

.ingbau-search-input {
    width: 100%;
    padding: 14px 50px 14px 52px;
    border: 2px solid #c3c4c7;
    border-radius: 20px !important;
    font-size: 1em;
    font-family: inherit;
    color: #2c3338;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.ingbau-search-input:focus {
    border-color: #1a6dae;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26,109,174,.12);
}
.ingbau-search-input::placeholder { color: #bbb; }

.ingbau-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    opacity: 0.5;
}
.ingbau-search-icon svg {
    width: 20px;
    height: 20px;
    stroke: #1a6dae;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ingbau-search-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: #e8e8e8;
    border: none;
    cursor: pointer;
    color: #666;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    transition: background .15s, color .15s;
}
.ingbau-search-clear:hover { background: #d63638; color: #fff; }

.ingbau-search-empty {
    padding: 20px 0;
    color: #787c82;
    font-style: italic;
    font-size: 0.9em;
}

.ingbau-search-results {
    margin-top: 16px;
    border: none;
    border-radius: 0;
    overflow: visible;
}
.ingbau-search-results .ingbau-dept-title {
    margin: 0;
    padding: 8px 16px;
}
.ingbau-search-results .ingbau-employee-list {
    margin: 0;
}

/* ── Namen-nur Ansicht ───────────────────────────────────────────────────────── */

.ingbau-names-only .ingbau-employee--name-only {
    display: block;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background .12s;
}
.ingbau-names-only .ingbau-employee--name-only:last-child { border-bottom: none; }
.ingbau-names-only .ingbau-employee--name-only:hover { background: #f0f6fc; }
.ingbau-names-only .ingbau-employee--name-only.ingbau-emp--active {
    background: #e8f0fe;
    border-left: 3px solid #1a6dae;
    padding-left: 9px;
}

.ingbau-emp-name-link {
    color: #1a6dae;
    font-size: 0.95em;
    font-weight: 500;
}

/* ── Detail-Box ─────────────────────────────────────────────────────────────── */

.ingbau-detail-box {
    font-family: 'Urbanist', inherit;
    min-height: 120px;
}

.ingbau-detail-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: #aaa;
    font-size: 0.9em;
    font-style: italic;
}

.ingbau-detail-inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.ingbau-detail-photo-col {
    flex-shrink: 0;
}
.ingbau-detail-photo {
    width: 100px;
    max-height: 130px;
    object-fit: cover;
    object-position: top;
    border-radius: 4px;
    display: block;
}

.ingbau-detail-info-col {
    flex: 1;
    min-width: 0;
}

.ingbau-detail-name {
    font-size: 1.15em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.ingbau-detail-title {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 6px;
}

.ingbau-detail-extra {
    font-size: 0.88em;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.6;
}

.ingbau-detail-contacts {
    font-size: 0.88em;
    line-height: 2;
}
.ingbau-detail-contacts a {
    color: #1a6dae;
    text-decoration: none;
}
.ingbau-detail-contacts a:hover { text-decoration: underline; }

/* ── Card Grid ───────────────────────────────────────────────────────────────── */

.ingbau-cards {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    font-family: 'Urbanist', inherit;
    width: 100% !important;
    box-sizing: border-box !important;
}

.ingbau-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s ease, transform .2s ease;
}
.ingbau-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

/* Foto */
.ingbau-card__photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden !important;
    background: #f0f0f0;
    border-radius: 8px 8px 0 0 !important;
    -webkit-mask-image: -webkit-radial-gradient(white, black); /* Safari fix */
}
.ingbau-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    border-radius: 8px 8px 0 0 !important;
}

/* Body */
.ingbau-card__body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Name */
.ingbau-card__name {
    font-size: 0.97em;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    word-break: break-word;
}
.ingbau-card__name a {
    color: #1a6dae;
    text-decoration: none;
}
.ingbau-card__name a:hover { text-decoration: underline; }

/* Titel */
.ingbau-card__title {
    font-size: 0.82em;
    color: #666;
    line-height: 1.4;
    word-break: break-word;
}

/* Freitext */
.ingbau-card__extra {
    font-size: 0.82em;
    color: #555;
    line-height: 1.5;
    margin-top: 2px;
    word-break: break-word;
}

/* Kontakte */
.ingbau-card__contacts {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ingbau-card__contact {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.82em;
    color: #444;
    word-break: break-all;
}
.ingbau-card__contact-label {
    font-weight: 700;
    color: #1a6dae;
    width: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}
.ingbau-card__contact a {
    color: #2c3338;
    text-decoration: none;
    word-break: break-all;
}
.ingbau-card__contact a:hover { color: #1a6dae; }

/* Responsive */
@media (max-width: 900px) {
    .ingbau-cards { grid-template-columns: repeat(2, 1fr) !important; gap: 14px !important; }
}
@media (max-width: 480px) {
    .ingbau-cards { grid-template-columns: 1fr !important; }
}

/* ── Mehrfach-Abteilungen Anzeige in Suchresultaten ─────────────────────────── */
.ingbau-emp-depts {
    font-size: 0.78em;
    color: #888;
    margin-top: 3px;
    line-height: 1.6;
}
