/* =========================================================
   EchoSeiten – öffentliche Profilseiten
   Einheitliches Dark-Layout auf derselben 620-px-Achse wie Header und Feed.
   ========================================================= */

:root {
    --profile-rail: #2f3336;
    --profile-text: #f2f2f2;
    --profile-muted: #8b98a5;
    --profile-surface: #000;
    --profile-hover: #0a0a0a;
    --profile-card: #0b0b0b;
    --profile-radius: 12px;
}

body.public-profile-dark {
    min-height: 100vh;
    background: #000;
    color: var(--profile-text);
}

body.public-profile-dark #container {
    width: 100%;
    min-height: 100vh;
    padding-top: 0;
    background: #000;
}

/* Header wird vollständig zentral in public-ui.css definiert. */

body.public-profile-dark main.public-profile-page {
    width: min(100%, 620px);
    margin: 0 auto !important;
    padding: 4px 0 48px !important;
}

.public-profile-page {
    min-height: calc(100vh - 58px);
}

.public-profile-page__title {
    margin: 0;
    padding: 10px 16px 14px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

/* =========================================================
   Profil-Auswahl
   ========================================================= */

.profile-selection {
    padding: 0;
}

.profile-selection__list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.profile-selection__link,
.profile-selection__link:visited {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 58px;
    padding: 14px 16px;
    color: var(--profile-text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
    transition: background-color 160ms ease;
}

.profile-selection__link:last-child {
    border-bottom: 0;
}

.profile-selection__link:hover,
.profile-selection__link:focus-visible {
    background: var(--profile-hover);
}

.profile-selection__link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.profile-selection__arrow {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #71767b;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =========================================================
   Profil-Listen
   ========================================================= */

.profile-feed {
    width: 100%;
}

.profile-feed__list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.profile-feed-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--profile-rail);
    scroll-margin-top: 72px;
}

.profile-feed-item:last-child {
    border-bottom: 0;
}

.profile-feed-item__card,
.profile-feed-item__card:visited {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 18px;
    align-items: start;
    gap: 14px;
    min-height: 88px;
    padding: 16px;
    color: var(--profile-text);
    text-decoration: none;
    transition: background-color 160ms ease;
}

.profile-feed-item__card:hover,
.profile-feed-item__card:focus-visible {
    background: var(--profile-hover);
}

.profile-feed-item__card:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.profile-feed-item__avatar {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #111;
}

.profile-feed-item__content {
    min-width: 0;
}

.profile-feed-item__name {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.profile-feed-item__meta {
    margin: 5px 0 0;
    color: var(--profile-muted);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.profile-feed-item__arrow {
    width: 18px;
    height: 18px;
    margin-top: 18px;
    fill: none;
    stroke: #71767b;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =========================================================
   Profil-Detailseite
   ========================================================= */

.profile-detail {
    box-sizing: border-box;
    width: 100%;
    padding: 0 16px;
    color: var(--profile-text);
}

/* Ausrichtung mit dem geöffneten Hauptmenü:
   Das Menü beginnt 24 px unter dem 60-px-Header. main hat 4 px oberen
   Innenabstand, daher erhält der Profilkopf weitere 20 px. So liegt die
   Oberkante des Profil-Logos exakt auf derselben Achse wie „BEITRÄGE“. */
.profile-detail__head {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 20px 0 16px;
}

.profile-detail__avatar {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: #111;
}

.profile-detail__title {
    margin: 0;
    color: #fff;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.profile-detail__meta {
    margin: 5px 0 0;
    color: var(--profile-muted);
    font-size: 13px;
    line-height: 1.4;
}

.profile-detail__category-back,
.profile-detail__category-back:visited {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    color: var(--profile-muted);
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
}

.profile-detail__category-back:hover,
.profile-detail__category-back:focus-visible {
    color: #fff;
    text-decoration: none;
}

.profile-detail__category-back:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.profile-detail__category-back-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-detail__section {
    padding: 15px 0;
}

.profile-detail__section h3 {
    margin: 0 0 9px;
    color: var(--profile-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.profile-detail__section p,
.profile-detail__section address,
.profile-detail__section pre {
    margin: 0 0 7px;
    color: var(--profile-text);
    font: inherit;
    font-size: 15px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

/* Nur echte vorformatierte Inhaltsblöcke sollen Zeilenumbrüche erhalten.
   Bei normalen Absätzen/Adressen würden sonst Einrückungen aus dem PHP-Markup
   als sichtbarer Leerraum erscheinen. */
.profile-detail__section pre {
    white-space: pre-wrap;
}

.profile-detail__section p,
.profile-detail__section address {
    white-space: normal;
}

.profile-detail__section a,
.profile-detail__section a:visited {
    color: #fff;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.profile-detail__section a:hover,
.profile-detail__section a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.profile-detail__section a:focus-visible,
.profile-detail__button:focus-visible,
.profile-detail__post-link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.profile-detail__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.profile-detail__button,
.profile-detail__button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--profile-rail);
    border-radius: 999px;
    background: #080808;
    color: #e7e9ea;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.profile-detail__button:hover,
.profile-detail__button:focus-visible {
    background: #151515;
    border-color: #59636d;
    text-decoration: none;
}

.profile-detail__pdf-preview {
    display: block;
    max-width: 100%;
    margin-top: 10px;
    border: 1px solid var(--profile-rail);
    border-radius: 10px;
    overflow: hidden;
}

.profile-detail__pdf-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.profile-detail__posts-heading {
    margin: 0;
    padding: 22px 4px 10px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.profile-detail__empty {
    margin: 0;
    padding: 8px 4px 20px;
    color: var(--profile-muted);
    font-size: 14px;
}

.profile-detail__posts {
    margin: 0;
    padding: 0;
    list-style: none;
}

.profile-detail__post {
}

.profile-detail__post-link,
.profile-detail__post-link:visited {
    display: block;
    padding: 14px 4px 16px;
    color: var(--profile-text);
    text-decoration: none;
    transition: background-color 160ms ease, padding-left 160ms ease;
}

.profile-detail__post-link:hover,
.profile-detail__post-link:focus-visible {
    background: var(--profile-hover);
    padding-left: 10px;
    text-decoration: none;
}

.profile-detail__post-date {
    color: var(--profile-muted);
    font-size: 12px;
    line-height: 1.3;
}

.profile-detail__post-title {
    margin: 5px 0 0;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.profile-detail__post-media {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 120px));
    gap: 8px;
    margin-top: 10px;
}

.profile-detail__post-media img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid var(--profile-rail);
    border-radius: 8px;
}

/* =========================================================
   Footer – gleiche Achse wie Feed und Profile
   ========================================================= */

body.public-profile-dark footer {
    box-sizing: border-box;
    width: min(100%, 620px);
    margin: 0 auto;
    padding: 18px 12px 34px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    background: #000;
    color: #71767b;
}

body.public-profile-dark footer a,
body.public-profile-dark footer a:visited {
    display: inline-flex;
    margin: 0;
    padding: 4px 0;
    border: 0;
    color: #71767b;
    text-decoration: none;
}

body.public-profile-dark footer h2 {
    margin: 0;
    color: inherit;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}

body.public-profile-dark footer p {
    display: none;
}

body.public-profile-dark footer a:hover,
body.public-profile-dark footer a:focus-visible {
    color: #e7e9ea;
    text-decoration: underline;
    text-underline-offset: 2px;
}

body.public-profile-dark footer a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (max-width: 420px) {
    .profile-detail__head {
        grid-template-columns: 60px minmax(0, 1fr);
        padding-top: 20px;
    }

    .profile-detail__avatar {
        width: 60px;
        height: 60px;
    }

    .profile-detail__title {
        font-size: 19px;
    }

    .profile-feed-item__card {
        grid-template-columns: 50px minmax(0, 1fr) 16px;
        gap: 12px;
    }

    .profile-feed-item__avatar {
        width: 50px;
        height: 50px;
    }
}


/* Kontaktblock: kompakt, ohne künstliche Rasterlinien */
.profile-detail__address {
    display: block;
    margin: 0;
    font-style: normal;
    text-align: left;
    white-space: normal;
}

.profile-detail__address p {
    display: block;
    width: 100%;
    margin: 0;
    color: var(--profile-text);
    font-size: 16px;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
}

.profile-detail__address .profile-detail__email {
    margin-top: 10px;
}

.profile-detail__actions {
    margin-top: 16px;
}

/* Beiträge werden über Abstand und Typografie getrennt – nicht über Linien. */
.profile-detail__post + .profile-detail__post {
    margin-top: 6px;
}

.profile-detail__post-link,
.profile-detail__post-link:visited {
    padding: 14px 10px 16px;
    border-radius: 10px;
}

body.public-profile-dark footer {
    border-top: 0;
    align-content: flex-start;
    justify-content: flex-start;
    min-height: 0;
}

/* =========================================================
   Profil-Dokumente – bis zu drei PDFs
   Die eigentliche PDF wird erst beim Anklicken geladen.
   ========================================================= */

.profile-detail__documents {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 4px;
}

.profile-detail__document,
.profile-detail__document:visited {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 14px;
    min-height: 108px;
    padding: 10px 8px;
    border: 1px solid var(--profile-rail);
    border-radius: 12px;
    background: #070707;
    color: var(--profile-text);
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.profile-detail__document:hover,
.profile-detail__document:focus-visible {
    background: #111;
    border-color: #59636d;
    text-decoration: none;
}

.profile-detail__document:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.profile-detail__document-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    height: 108px;
    overflow: hidden;
    border: 1px solid #30363d;
    border-radius: 8px;
    background: #111;
}

.profile-detail__document-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-detail__document-preview--empty {
    color: #8b98a5;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .08em;
}

.profile-detail__document-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-detail__document-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.profile-detail__document-action {
    color: var(--profile-muted);
    font-size: 13px;
    line-height: 1.3;
}

.profile-detail__document-arrow {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #71767b;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 420px) {
    .profile-detail__document,
    .profile-detail__document:visited {
        grid-template-columns: 70px minmax(0, 1fr) 16px;
        gap: 12px;
        min-height: 96px;
        padding: 8px 6px;
    }

    .profile-detail__document-preview {
        width: 70px;
        height: 92px;
    }
}
