/* com_phsocial - Kacheln (auch im Startseiten-Kasten), Einzelseite, Verwaltung */
.phsocial {
    box-sizing: border-box;
    width: min(1040px, 100%);
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    color: var(--ars-text);
}

.phsocial__kopf { margin-bottom: 1.25rem; text-align: center; }
.phsocial__kopf h1 { margin: 0.25rem 0 0.5rem; }
.phsocial__leer { padding: 2rem 0; text-align: center; color: var(--ars-text-soft); }
.phsocial__entwurf { padding: 0.7rem 1rem; border: 2px dashed var(--ars-orange); border-radius: 10px; text-align: center; font-weight: 650; }

.phsocial__filter,
.phsocial__seiten { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem; margin: 0 0 1.25rem; }
.phsocial__seiten { margin-top: 1.5rem; }

.phsocial__filter a,
.phsocial-knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.35rem 1.2rem;
    border: 1px solid var(--ars-border);
    border-radius: 999px;
    background: var(--ars-bg);
    color: var(--ars-text);
    font: inherit;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.phsocial__filter a[aria-current="true"],
.phsocial-knopf--haupt { border-color: #94132f; background: #94132f; color: #fff; }
.phsocial-knopf--haupt:hover { color: #fff; }
.phsocial-knopf:disabled { opacity: 0.55; cursor: wait; }

.phsocial-nur-vorlesen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* --- Kacheln --- */
.phsocial-raster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.9rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.phsocial-raster > li { min-width: 0; margin: 0; }

.phsocial-kachel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--ars-border);
    border-radius: 12px;
    background: var(--ars-bg);
    color: var(--ars-text);
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.phsocial-kachel:hover { color: var(--ars-text); box-shadow: var(--ars-shadow); transform: translateY(-2px); }
.phsocial-kachel:focus-visible { outline: var(--ars-focus); outline-offset: 2px; }

.phsocial-kachel__flaeche { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: #03262e; }
/* Außerhalb des Textflusses: Sonst dehnt ein hochkantes Bild die Fläche, und
   die Kacheln werden verschieden hoch. */
.phsocial-kachel__flaeche img,
.phsocial-kachel__flaeche video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.phsocial-kachel__marke {
    position: absolute;
    z-index: 1;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: rgb(0 0 0 / 65%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.phsocial-kachel__fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; padding: 0.6rem 0.7rem 0.75rem; font-size: 0.78rem; }
.phsocial-kachel__fuss time { color: var(--ars-text-soft); }

.phsocial-kachel__titel {
    display: -webkit-box;
    width: 100%;
    overflow: hidden;
    font-size: 0.9rem;
    font-weight: 600;
    hyphens: auto;
    overflow-wrap: anywhere;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.phsocial-kachel__kanal { padding: 0.1rem 0.55rem; border-radius: 999px; background: #59616a; color: #fff; font-size: 0.72rem; font-weight: 800; }
.phsocial-kanal--instagram { background: #a62a74; }
.phsocial-kanal--facebook { background: #1465d8; }
.phsocial-kanal--tiktok { background: #101014; }
.phsocial-kanal--youtube { background: #b3121c; }

/* Als Knopf (YouTube auf der Startseite) sieht die Kachel aus wie als Link. */
button.phsocial-kachel { width: 100%; padding: 0; font: inherit; text-align: left; cursor: pointer; }
button.phsocial-kachel .phsocial-kachel__fuss { align-content: flex-start; }
/* Die Vorschaubilder von YouTube haben oben und unten schwarze Balken. */
.phsocial-kachel--youtube .phsocial-kachel__flaeche { overflow: hidden; }
.phsocial-kachel--youtube .phsocial-kachel__flaeche img { transform: scale(1.34); }
.phsocial-kachel--youtube .phsocial-kachel__marke { z-index: 1; }

/* --- Eine Reihe zum seitlichen Blättern, alle Kacheln gleich groß --- */
.phsocial-raster.phsocial-reihe {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    padding: 4px 2px 0.9rem;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 2px;
}

.phsocial-raster.phsocial-reihe > li { flex: 0 0 200px; scroll-snap-align: start; }
.phsocial-reihe:focus-visible { outline: var(--ars-focus); outline-offset: 2px; }
.phsocial-reihe .phsocial-kachel__fuss { flex: 1; align-content: flex-start; }
.phsocial-reihe .phsocial-kachel__titel { min-height: 2.7em; }

/* Der Balken soll sichtbar bleiben - macOS blendet ihn sonst aus. */
.phsocial-reihe::-webkit-scrollbar { height: 10px; }
.phsocial-reihe::-webkit-scrollbar-track { border-radius: 999px; background: var(--ars-border); }
.phsocial-reihe::-webkit-scrollbar-thumb { border-radius: 999px; background: #94132f; }

@supports not selector(::-webkit-scrollbar) {
    .phsocial-reihe { scrollbar-color: #94132f var(--ars-border); scrollbar-width: thin; }
}

@media (max-width: 575.98px) {
    .phsocial-raster.phsocial-reihe > li { flex-basis: 62%; }
}

/* --- Einzelner Beitrag --- */
.phsocial-beitrag { max-width: calc(var(--ars-content-width) + 2rem); }
.phsocial-medien figure { margin: 0; text-align: center; }

.phsocial-medien img,
.phsocial-medien video { display: block; width: auto; max-width: 100%; height: auto; max-height: 80vh; margin: 0 auto; border-radius: 14px; }
.phsocial-medien video { width: 100%; background: #000; }

.phsocial-medien--mehrere { display: flex; gap: 0.75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; }
.phsocial-medien--mehrere figure { flex: 0 0 88%; scroll-snap-align: center; align-self: center; }
.phsocial-medien figcaption { margin-top: 0.35rem; color: var(--ars-text-soft); font-size: 0.85rem; }

.phsocial-beitrag__text { margin: 1.25rem 0; overflow-wrap: anywhere; }
.phsocial-beitrag__original { text-align: center; }

/* --- Verwaltung --- */
.phsocial-liste { margin: 0; padding: 0; list-style: none; }
.phsocial-liste li { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 0.9rem; padding: 0.8rem 0; border-top: 1px solid var(--ars-border); }
.phsocial-liste img,
.phsocial-liste__ohne { display: grid; place-items: center; width: 64px; height: 80px; border-radius: 8px; object-fit: cover; background: #03262e; color: #fff; }
.phsocial-liste li > div > span { display: block; color: var(--ars-text-soft); font-size: 0.875rem; }
.phsocial-liste__aktionen { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.phsocial-liste__aktionen form { margin: 0; }

.phsocial-stand { padding: 0.05rem 0.6rem; border: 1px solid var(--ars-orange); border-radius: 999px; color: var(--ars-text); font-style: normal; font-weight: 700; }
.phsocial-stand--sichtbar { border-color: var(--ars-gruen); }

.phsocial-bearbeiten { max-width: 760px; }
.phsocial-formular > label,
.phsocial-formular fieldset label { display: block; margin-bottom: 1rem; font-weight: 650; }
.phsocial-formular label small { color: var(--ars-text-soft); font-weight: 400; }

.phsocial-formular input:not([type="checkbox"]),
.phsocial-formular select,
.phsocial-formular textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--ars-border);
    border-radius: 8px;
    background: var(--ars-bg);
    color: var(--ars-text);
    font: inherit;
    font-weight: 400;
}

.phsocial-formular fieldset { margin: 0 0 1.25rem; padding: 1rem; border: 1px solid var(--ars-border); border-radius: 12px; }
.phsocial-formular legend { float: none; width: auto; padding: 0 0.4rem; font-size: 1.05rem; font-weight: 750; }
.phsocial-formular fieldset label.phsocial-formular__haken { display: flex; align-items: flex-start; gap: 0.6rem; font-weight: 400; }
.phsocial-formular__haken input { flex: none; width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; }
.phsocial-formular__haken { display: block; }
.phsocial-formular__medium { display: grid; grid-template-columns: 120px 1fr; gap: 0.9rem; margin-bottom: 1rem; }
.phsocial-formular__medium img,
.phsocial-formular__medium video { width: 120px; max-height: 180px; border-radius: 8px; object-fit: contain; background: #000; }
.phsocial-formular__hinweis { color: var(--ars-text-soft); font-size: 0.875rem; }
.phsocial-formular__knoepfe { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: flex-end; }
.phsocial-formular__loeschen { margin-top: 2rem; }

@media (max-width: 575.98px) {
    .phsocial-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .phsocial-liste li { grid-template-columns: 64px 1fr; }
    .phsocial-liste__aktionen { grid-column: 1 / -1; justify-content: flex-start; }
    .phsocial-formular__medium { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .phsocial-kachel { transition: none; }
    .phsocial-kachel:hover { transform: none; }
}
