/* ================================================================
 * BDL Icons v2 — Phosphor-Bold Webfont (korrekte Codepoints)
 * fiveandfriends 2026-10-08
 *
 * Analog zur Intranet-Loesung: selbstgehosteter Phosphor-Bold-Webfont.
 * Ersetzt die ca. 40 Legacy-PNG-Icons unter /sys/img/icons/ durch
 * Vector-Glyphs — scharf auf Retina, farbbar via currentColor,
 * ein einziger Font-Download statt dutzende PNG-Varianten.
 *
 * Codepoints offiziell aus @phosphor-icons/web@2.1.2 (bold/style.css).
 * Nutzung:
 *   Utility-Klassen:  <i class="ph ph-caret-right"></i>
 *   Direkt via CSS:   content: "\e13a"; font-family: "Phosphor-Bold";
 * ================================================================ */

@font-face {
    font-family: "Phosphor-Bold";
    src: url("/sys/fonts/phosphor/Phosphor-Bold.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

/* Basis-Klasse */
.ph,
.ph-icon {
    font-family: "Phosphor-Bold" !important;
    font-weight: normal;
    font-style: normal;
    speak: none;
    display: inline-block;
    text-decoration: none;
    text-transform: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1;
    vertical-align: -0.125em;
}

/* ---- Icons mit Named-Klassen ---- */
.ph-caret-right::before      { content: "\e13a"; }
.ph-caret-left::before       { content: "\e138"; }
.ph-caret-down::before       { content: "\e136"; }
.ph-caret-up::before         { content: "\e13c"; }
.ph-arrow-right::before      { content: "\e06c"; }
.ph-arrow-left::before       { content: "\e058"; }
.ph-arrow-square-out::before { content: "\e5de"; }
.ph-download::before         { content: "\e20a"; }
.ph-download-simple::before  { content: "\e20c"; }
.ph-printer::before          { content: "\e3dc"; }
.ph-envelope::before         { content: "\e214"; }
.ph-envelope-simple::before  { content: "\e218"; }
.ph-phone::before            { content: "\e3b8"; }
.ph-map-pin::before          { content: "\e316"; }
.ph-magnifying-glass::before { content: "\e30c"; }
.ph-rss-simple::before       { content: "\e402"; }
.ph-link::before             { content: "\e2e2"; }
.ph-copy::before             { content: "\e1ca"; }
.ph-check::before            { content: "\e182"; }
.ph-check-circle::before     { content: "\e184"; }
.ph-list::before             { content: "\e2f0"; }
.ph-newspaper::before        { content: "\e344"; }
.ph-calendar::before         { content: "\e108"; }
.ph-info::before             { content: "\e2ce"; }
.ph-house::before            { content: "\e2c2"; }
.ph-chat::before             { content: "\e15c"; }
.ph-file-pdf::before         { content: "\e702"; }
.ph-facebook-logo::before    { content: "\e226"; }
.ph-linkedin-logo::before    { content: "\e2ee"; }

/* ================================================================
 * REPLACEMENTS — ersetzt vorhandene PNG-Hintergrund-Icons durch
 * Phosphor-Glyphs. Scope so eng wie moeglich.
 * ================================================================ */

/* ---- Sidebar-Teaser-Boxen: Chevron rechts ---- */
/* Erhoehte Spezifitaet: #right .frame .frame-type-header a (= 3-class)
 * damit wir die bdl-chrome.css-Regel ueberschreiben. */
.frame-type-header.frame-layout a,
#right .frame-type-header a,
#right .frame .frame-type-header a {
    background-image: none !important;
    padding-right: 36px !important;
    position: relative;
}
.frame-type-header.frame-layout a::after,
#right .frame-type-header a::after,
#right .frame .frame-type-header a::after {
    content: "\e13a"; /* caret-right */
    font-family: "Phosphor-Bold";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    line-height: 1;
    color: inherit;
    -webkit-font-smoothing: antialiased;
}

/* Download-Variante (PDF/Satzung etc.): Download-Icon statt Pfeil */
.frame-type-header.frame-layout a[href$=".pdf"]::after,
.frame-type-header.frame-layout a.download::after,
#right .frame-type-header a[href$=".pdf"]::after,
#right .frame .frame-type-header a[href$=".pdf"]::after {
    content: "\e20c"; /* download-simple */
}

/* ---- Content-Buttons .btn-light-blue / .btn-dark-blue ---- */
a.btn-light-blue,
a.btn-dark-blue {
    background-image: none !important;
    padding-right: 36px !important;
    position: relative;
}
a.btn-light-blue::after,
a.btn-dark-blue::after {
    content: "\e13a"; /* caret-right */
    font-family: "Phosphor-Bold";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    line-height: 1;
    color: #ffffff;
    -webkit-font-smoothing: antialiased;
}

/* ---- Accordion-Icons (down/up) ---- */
.accordion-trigger::after,
[class*="accordion"] > [aria-expanded]::after {
    content: "\e136"; /* caret-down */
    font-family: "Phosphor-Bold";
    display: inline-block;
    margin-left: 8px;
    transition: transform 180ms ease;
    -webkit-font-smoothing: antialiased;
}
.accordion-trigger[aria-expanded="true"]::after,
[class*="accordion"] > [aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* ---- Suchfeld-Button-Icon ---- */
#right form[action*="kesearch"] button[type="submit"],
.suchfeld button[type="submit"] {
    position: relative;
    overflow: hidden;
    text-indent: -9999px;
}
#right form[action*="kesearch"] button[type="submit"]::before,
.suchfeld button[type="submit"]::before {
    content: "\e30c"; /* magnifying-glass */
    font-family: "Phosphor-Bold";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-indent: 0;
    font-size: 18px;
    color: var(--c-blue);
    -webkit-font-smoothing: antialiased;
}

/* ================================================================
 * SHARING-BAR (unter Content auf Detail-Seiten)
 *
 * Struktur:
 *   DIV
 *     SPAN.social-sharing-label "Teilen"  (toggle, siehe bdl-interactions.js)
 *     UL.social-media-sharing[.close]
 *       LI.social-media-sharing-icon.twitter | .facebook | .linkedin
 *          | .copy-url | .email | .close
 *
 * Beziehungs-Links drumherum:
 *   A.button_back / A.button_print / A.button_rss (RSS deprecated -> hide)
 * ================================================================ */

/* ---- RSS-Feeds komplett raus (deprecated) ---- */
/* 1) Sharing-Bar: .button_rss-Links (Aktuelles, Presse) */
a.button_rss,
.button_rss {
    display: none !important;
}
/* 2) Footer: RSS-Links haben ?type=9818 oder title="... RSS-Feed" */
a[href*="type=9818"],
a[title*="RSS-Feed"],
a[title*="RSS Feed"] {
    display: none !important;
}
/* ggf. das umschliessende LI auch verstecken */
li:has(> a[href*="type=9818"]),
li:has(> a[title*="RSS-Feed"]) {
    display: none !important;
}

/* Twitter/X in der Sharing-Bar: deprecated (analog Xing). */
.social-media-sharing-icon.twitter {
    display: none !important;
}

/* Sharing-Popup: 'close'-Klasse versteckt die Icon-Liste. */
.social-media-sharing.close {
    display: none !important;
}

/* ---- Funktions-Buttons im #functions-Container ----
 * Original-Markup: <a class="button_X"><span class="addthis_text">Label</span></a>
 * Alte PNG-Icons liegen als background-image auf .addthis_text — raus.
 * Phosphor-Icons kommen als ::before auf das <a>. */
#functions .button_back,
#functions .button_print,
#functions .social-sharing-label,
.button_back,
.button_print {
    background-image: none !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    text-decoration: none !important;
    color: var(--c-text-soft, #55606e) !important;
    cursor: pointer;
    transition: color 180ms ease;
}
#functions .button_back:hover,
#functions .button_print:hover,
#functions .social-sharing-label:hover,
#functions .social-sharing-label[aria-expanded="true"],
.button_back:hover,
.button_print:hover {
    color: var(--c-blue, #1C4F9C) !important;
}

/* Alte Icon-SPANs: Hintergrundbild weg */
#functions .button_back .addthis_text,
#functions .button_print .addthis_text,
.button_back .addthis_text,
.button_print .addthis_text {
    background-image: none !important;
    padding-left: 0 !important;
    display: inline;
}

/* Phosphor-Icons */
#functions .button_back::before,
.button_back::before { content: "\e138"; /* caret-left */ }
#functions .button_print::before,
.button_print::before { content: "\e3dc"; /* printer */ }
#functions .social-sharing-label::before,
.social-sharing-label::before { content: "\e2e2"; /* link - fuer sharing */ }

#functions .button_back::before,
#functions .button_print::before,
#functions .social-sharing-label::before,
.button_back::before,
.button_print::before,
.social-sharing-label::before {
    font-family: "Phosphor-Bold" !important;
    font-size: 16px;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
}

/* ---- Social-Media-Icons: Text verstecken, Phosphor-Icon anzeigen ---- */
.social-media-sharing-icon a,
.social-media-sharing-icon button {
    position: relative !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0 !important;           /* versteckt Original-Text komplett */
    line-height: 1 !important;
    text-indent: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: var(--radius-md, 4px) !important;
    transition: background-color 180ms ease, color 180ms ease;
    cursor: pointer;
    color: var(--c-blue-dark, #003a78) !important;
    text-decoration: none !important;
}
.social-media-sharing-icon a:hover,
.social-media-sharing-icon button:hover {
    background-color: var(--c-blue, #1C4F9C) !important;
    color: #ffffff !important;
}
.social-media-sharing-icon a::before,
.social-media-sharing-icon button::before {
    font-family: "Phosphor-Bold" !important;
    font-size: 18px !important;
    line-height: 1 !important;
    color: inherit !important;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
}

/* Icon-Zuordnung per Container-Klasse */
.social-media-sharing-icon.facebook a::before { content: "\e226"; } /* facebook-logo */
.social-media-sharing-icon.linkedin a::before { content: "\e2ee"; } /* linkedin-logo */
.social-media-sharing-icon.email a::before    { content: "\e218"; } /* envelope-simple */
.social-media-sharing-icon.copy-url button::before { content: "\e2e2"; } /* link */
.social-media-sharing-icon.close a::before    { content: "\e5fe"; } /* x — Phosphor-Bold hat ggf. kein 'x', fallback via text */

/* UL-Container fuer Popup-Look. Original hat position:absolute + width/height 0 — ueberschreiben. */
.social-media-sharing {
    display: inline-flex !important;
    gap: 6px !important;
    width: auto !important;
    height: auto !important;
    position: static !important;
    margin: 0 0 0 8px !important;
    padding: 4px !important;
    list-style: none !important;
    background: #ffffff !important;
    border: 1px solid var(--c-border, #d8dee6) !important;
    border-radius: var(--radius-md, 4px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    vertical-align: middle !important;
    overflow: visible !important;
}
.social-media-sharing-icon {
    display: inline-block !important;
    margin: 0;
}
/* Twitter bleibt deprecated - overrides */
.social-media-sharing-icon.twitter {
    display: none !important;
}

/* Close-Icon zeigt kein Icon-Button sondern Text (Phosphor hat kein 'x' in Bold).
 * Daher Close-Link als normaler Link rendern. */
.social-media-sharing-icon.close a {
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    text-indent: 0 !important;
    padding: 6px 10px;
    font-size: 13px;
}
.social-media-sharing-icon.close a::before { content: none !important; }
