/* ==========================================================================
   Firmenverzeichnis – Frontend
   Schriften und Grundfarben werden vom aktiven Theme geerbt.
   Akzentfarbe (Stellen-Box): wir versuchen die Theme-Variable zu nutzen,
   mit sauberem Fallback.
   ========================================================================== */

.fv-wrap {
    --fv-accent:        var(--e-global-color-primary, var(--wp--preset--color--primary, #1f4e79));
    --fv-accent-text:   #ffffff;
    --fv-card-bg:       #ffffff;
    --fv-card-border:   #e5e7eb;
    --fv-card-shadow:   0 1px 3px rgba(0,0,0,.06);
    --fv-card-hover:    #f3f4f6;
    --fv-radius:        16px;
    --fv-muted:         #6b7280;
    --fv-text:          inherit;
    --fv-gap:           20px;

    color: var(--fv-text);
    box-sizing: border-box;
}

.fv-wrap *, .fv-wrap *::before, .fv-wrap *::after { box-sizing: border-box; }

/* ----------- Toolbar ----------------------------------------------------- */
.fv-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--fv-gap);
    flex-wrap: wrap;
}
.fv-toolbar .fv-sort-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}
.fv-toolbar .fv-sort {
    border: 1px solid var(--fv-card-border);
    border-radius: 8px;
    padding: 6px 10px;
    font: inherit;
    background: #fff;
    cursor: pointer;
}

/* ----------- Grid -------------------------------------------------------- */
.fv-grid {
    display: grid;
    gap: var(--fv-gap);
    grid-template-columns: 1fr;
}
@media (min-width: 540px)  { .fv-cols-2, .fv-cols-3, .fv-cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 820px)  { .fv-cols-3, .fv-cols-4             { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .fv-cols-4                          { grid-template-columns: repeat(4, 1fr); } }

/* ----------- Karte ------------------------------------------------------- */
.fv-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--fv-card-border);
    border-radius: var(--fv-radius);
    background: var(--fv-card-bg);
    box-shadow: var(--fv-card-shadow);
    text-decoration: none !important;
    color: inherit;
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
    height: 100%;
}
.fv-card:hover, .fv-card:focus-visible {
    background: var(--fv-card-hover);
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
    transform: translateY(-1px);
    outline: none;
}

.fv-card-logo {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    background: #fafafa;
}
.fv-card-logo img,
.fv-card-logo svg {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.fv-logo-pdf {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}
.fv-logo-pdf-embed {
    width: 100%; height: 100%;
    border: 0;
    pointer-events: none;
}
.fv-logo-pdf-fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--fv-muted);
    font-size: 12px;
    text-align: center;
}
@supports not (selector(embed)) {
    .fv-logo-pdf-embed { display: none; }
    .fv-logo-pdf-fallback { display: flex; }
}

.fv-logo-placeholder {
    width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    background: var(--fv-accent);
    color: var(--fv-accent-text);
    font-weight: 700;
    font-size: 28px;
    border-radius: 50%;
    text-transform: uppercase;
}

.fv-card-name {
    font-weight: 700;
    font-size: 1.08em;
    line-height: 1.25;
    margin-top: 4px;
}

.fv-card-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .94em;
    color: var(--fv-text);
}
.fv-card-meta li {
    display: flex;
    align-items: center;
    gap: 8px;
}
.fv-card-meta-spacer { margin-top: 8px; }

.fv-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    color: var(--fv-accent);
    flex-shrink: 0;
}
.fv-icon { display: block; }

.fv-empty {
    padding: 24px;
    text-align: center;
    color: var(--fv-muted);
    border: 1px dashed var(--fv-card-border);
    border-radius: var(--fv-radius);
}

/* ==========================================================================
   Stellen-Box (auffälliger als die normalen Karten)
   ========================================================================== */
.fv-stellen-box {
    --fv-accent:        var(--e-global-color-primary, var(--wp--preset--color--primary, #1f4e79));
    margin: 28px 0;
    border-radius: var(--fv-radius, 16px);
    padding: 22px 24px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--fv-accent) 10%, white), #ffffff 70%);
    border: 1px solid color-mix(in srgb, var(--fv-accent) 35%, white);
    box-shadow: 0 4px 18px color-mix(in srgb, var(--fv-accent) 15%, transparent);
}
@supports not (color: color-mix(in srgb, red, blue)) {
    .fv-stellen-box {
        background: #f1f6fb;
        border-color: #c9dcee;
    }
}

.fv-stellen-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.fv-stellen-head .fv-ic { color: var(--fv-accent); width: 24px; }
.fv-stellen-title {
    margin: 0;
    font-size: 1.35em;
    line-height: 1.2;
}
.fv-stellen-cat {
    margin: 14px 0 6px;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--fv-accent);
}
.fv-stellen-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fv-stelle-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--fv-accent) 18%, white);
    border-radius: 10px;
    transition: background-color .18s ease, transform .18s ease;
}
.fv-stelle-item:hover { background: #f3f4f6; }

.fv-stelle-link {
    flex: 1 1 auto;
    text-decoration: none !important;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.fv-stelle-title { font-weight: 700; }
.fv-stelle-firma { color: var(--fv-muted, #6b7280); font-size: .92em; }
.fv-stelle-excerpt { color: var(--fv-muted, #6b7280); font-size: .92em; margin-top: 2px; }

.fv-stelle-pdf {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--fv-accent);
    color: var(--fv-accent);
    border-radius: 8px;
    text-decoration: none !important;
    font-size: .9em;
}
.fv-stelle-pdf:hover { background: var(--fv-accent); color: #fff; }

/* ==========================================================================
   Detailseite
   ========================================================================== */
.fv-detail {
    --fv-accent:      var(--e-global-color-primary, var(--wp--preset--color--primary, #1f4e79));
    --fv-card-border: #e5e7eb;
    --fv-muted:       #6b7280;
    --fv-radius:      16px;
}
.fv-detail-intro {
    color: var(--fv-muted);
    margin: 0 0 8px;
    font-size: .98em;
}
.fv-detail-header {
    margin-bottom: 24px;
    padding: 22px;
    border: 1px solid var(--fv-card-border);
    border-radius: var(--fv-radius);
    background: #ffffff;
}
.fv-detail-title {
    margin: 0 0 12px;
    font-weight: 800;
    font-size: 2em;
    line-height: 1.1;
}
.fv-detail-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: var(--fv-muted);
}
.fv-detail-meta li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.fv-detail-meta a { color: inherit; }
.fv-detail-meta .fv-ic { color: var(--fv-accent); }

.fv-detail-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}
@media (min-width: 900px) {
    .fv-detail-grid { grid-template-columns: 280px 1fr; }
}

.fv-detail-side {
    border: 1px solid var(--fv-card-border);
    border-radius: var(--fv-radius);
    padding: 18px;
    background: #fff;
    height: fit-content;
}
.fv-detail-side-logo {
    width: 100%;
    aspect-ratio: 16/9;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: #fafafa;
    overflow: hidden;
    margin-bottom: 12px;
}
.fv-detail-side-logo img, .fv-detail-side-logo svg {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.fv-side-h {
    margin: 12px 0 6px;
    font-weight: 800;
    font-size: 1.05em;
}
.fv-side-name {
    margin: 0 0 8px;
    font-weight: 500;
}
.fv-side-contact {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fv-side-contact li {
    display: grid;
    grid-template-columns: 80px 1fr;
    align-items: baseline;
    gap: 8px;
}
.fv-side-contact strong { font-weight: 700; }
.fv-side-contact a { color: var(--fv-accent); text-decoration: none; word-break: break-word; }
.fv-side-contact a:hover { text-decoration: underline; }

.fv-side-h-social { margin-top: 16px; }
.fv-side-social {
    display: flex;
    gap: 10px;
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    flex-wrap: wrap;
}
.fv-side-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    color: var(--fv-accent);
    transition: background-color .18s ease, color .18s ease;
}
.fv-side-social a:hover { background: var(--fv-accent); color: #fff; }

.fv-detail-main {
    border: 1px solid var(--fv-card-border);
    border-radius: var(--fv-radius);
    padding: 22px;
    background: #fff;
}
.fv-detail-image {
    margin: 0 0 16px;
    border-radius: 12px;
    overflow: hidden;
}
.fv-detail-image img {
    width: 100%; height: auto; display: block;
}
.fv-detail-text { font-size: 1.02em; line-height: 1.6; }
.fv-detail-text :first-child { margin-top: 0; }

.fv-detail-pdf, .fv-stelle-detail-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.fv-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--fv-accent);
    color: #fff !important;
    text-decoration: none !important;
    transition: filter .18s ease;
    font-weight: 600;
}
.fv-pdf-btn:hover { filter: brightness(.92); }

/* Stellen-Detail */
.fv-stelle-detail {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 22px;
    background: #fff;
}
.fv-stelle-detail-firma { color: #6b7280; margin: 0 0 12px; }

/* Reduzierte-Bewegung */
@media (prefers-reduced-motion: reduce) {
    .fv-card, .fv-stelle-item, .fv-side-social a, .fv-pdf-btn { transition: none !important; }
}
