/* ═══════════════════════════════════════════════════════════════════
   ÖFFENTLICHE DETAILANSICHT + KARTEN (Neuigkeiten + Abstimmungen)
   Gemeinsam genutzt von neuigkeiten.html und allFeedback.html.
   Detailansicht: Präfix pd-. Karten in den Listen: Präfix pc- (ganz unten). Referenz: openspec/changes/
   redesign-web-public-detail-view/mockups/detail-leiste.html
═══════════════════════════════════════════════════════════════════ */
.pd-overlay {
    --pd-line: #e3e7ea;
    --pd-mute: #5a656b;
    --pd-ink: #1b1c1c;
    --pd-red: #b3261e;
    --pd-ease: cubic-bezier(.23, 1, .32, 1);
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(16, 24, 28, .62);
    font-family: var(--ff, 'Inter'), system-ui, sans-serif;
    color: var(--pd-ink);
    -webkit-font-smoothing: antialiased;
    animation: pd-fade .18s ease-out;
}
.pd-overlay, .pd-overlay * { box-sizing: border-box; }
.pd-overlay h2, .pd-overlay p { margin: 0; }
.pd-overlay button, .pd-overlay a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.pd-overlay :focus-visible { outline: 2px solid var(--primary, #006684); outline-offset: 2px; }
.pd-overlay button, .pd-overlay a.pd-btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pd-overlay .material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-size: 20px;
    line-height: 1;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    user-select: none;
}
.pd-overlay.is-closing { animation: pd-fade-out .12s ease-in forwards; }

.pd-overlay .pd-dialog:focus-visible { outline: none; }
.pd-dialog {
    position: relative;
    display: flex;
    width: min(1080px, 100%);
    height: min(680px, 100%);
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
    outline: none;
    animation: pd-pop .22s var(--pd-ease);
}

/* ── Detail ─────────────────────────────────────────────────── */
.pd-main { flex: 1; min-width: 0; min-height: 0; display: flex; }
.pd-detail { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; }

.pd-media { display: flex; flex-direction: column; background: #111; min-height: 0; }
.pd-stagewrap { position: relative; flex: 1; min-height: 0; }
.pd-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #111;
    overflow: hidden;
    cursor: zoom-in;
}
/* Das Foto wird nie beschnitten (contain). Eine unscharfe Kopie füllt die Ränder,
   damit keine harten schwarzen Balken entstehen. */
.pd-stage img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pd-stage-img { object-fit: contain; }
.pd-stage-bg { object-fit: cover; transform: scale(1.15); filter: blur(18px) brightness(.55); }
.pd-stage:focus-visible { outline-offset: -4px; }
/* Der Zähler "1 / n" ist nur für Screenreader; sehen tut man die Punkte. */
.pd-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.pd-arrow {
    position: absolute;
    top: 50%;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    margin-top: -22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #1b1c1c;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
    cursor: pointer;
    touch-action: manipulation;
    transition: opacity .15s ease, transform .12s ease;
}
.pd-arrow-l { left: 12px; }
.pd-arrow-r { right: 12px; }
.pd-arrow:active { transform: scale(.94); }
.pd-arrow:disabled { opacity: .35; cursor: default; }
.pd-arrow:focus-visible { outline: 3px solid var(--primary, #006684); outline-offset: 2px; }
.pd-arrow .material-symbols-outlined { font-size: 26px; }
.pd-dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.pd-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.pd-dots span.is-on { width: 18px; border-radius: 4px; background: #fff; }

.pd-bar4 {
    height: 5px;
    border-radius: 9px;
    background: linear-gradient(90deg,
        var(--Green, #B2C900) 0 25%, var(--Blue, #55B9E1) 25% 50%,
        var(--Purple, #C9508B) 50% 75%, var(--Red, #E2001A) 75% 100%);
}

.pd-poster {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    padding: 34px;
    overflow: hidden;
    background: var(--on-primary-container, #00475d);
    color: #fff;
}
.pd-poster-bg {
    position: absolute;
    right: -40px; bottom: -50px;
    font-size: 300px !important;
    color: rgba(255, 255, 255, .07);
    pointer-events: none;
}
.pd-poster-n { font-size: 68px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.pd-poster-n.is-text { font-size: 34px; letter-spacing: -.02em; line-height: 1.15; }
.pd-poster-cap { display: block; margin-top: 8px; font-size: 14px; color: rgba(255, 255, 255, .72); }
/* Gleiche Zahl im Textteil, wenn links ein Foto steht */
.pd-stat { margin-top: 4px; }
.pd-stat .pd-poster-n { font-size: 52px; color: var(--primary, #006684); }
.pd-stat .pd-poster-n.is-text { font-size: 26px; color: var(--pd-ink); }
.pd-stat .pd-poster-cap { margin-top: 6px; color: var(--pd-mute); }

.pd-status-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 34px;
    background: linear-gradient(135deg, #eef3d2, #e3f4fb);
    color: #3f4a00;
    text-align: center;
}
.pd-status-panel .pd-bar4 { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; border-radius: 0; }
.pd-status-icon { font-size: 76px !important; font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48 !important; color: #586400; }
.pd-status-panel strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.pd-status-panel small { display: block; margin-top: 4px; font-size: 14px; color: #5b6a1f; }

.pd-text { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pd-head { flex: none; padding: 22px 170px 0 30px; display: flex; align-items: center; min-height: 58px; }
.pd-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 11px 0 8px;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.pd-chip .material-symbols-outlined { font-size: 16px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20; }
.pd-chip-done { background: #f1f6cf; color: #586400; }
.pd-chip-vote { background: #ffe3ee; color: var(--md-secondary, #a4326d); }

.pd-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 30px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.pd-title { font-size: 1.6875rem; font-weight: 800; line-height: 1.18; letter-spacing: -.02em; text-wrap: balance; overflow-wrap: anywhere; }
.pd-meta { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--pd-mute); }
.pd-meta .material-symbols-outlined { font-size: 17px; }
.pd-desc { font-size: 1rem; line-height: 1.65; color: var(--on-surface-variant, #3e484e); white-space: pre-wrap; overflow-wrap: anywhere; }

.pd-ratio { height: 8px; border-radius: 99px; background: #f6d5d2; overflow: hidden; }
.pd-ratio.is-empty { background: var(--pd-line); }
.pd-ratio-fill { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--primary, #006684); transition: width .3s var(--pd-ease); }
.pd-rl { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--pd-mute); }
.pd-rl b { color: var(--pd-ink); }

.pd-actions {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 30px 18px;
    border-top: 1px solid var(--pd-line);
}
.pd-actions-row { display: flex; gap: 10px; }
.pd-msg { font-size: 13px; font-weight: 600; color: var(--pd-red); }
.pd-msg:empty { display: none; }

.pd-btn {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    font: 700 15px/1.2 var(--ff, 'Inter'), system-ui, sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, transform .12s ease;
}
.pd-btn:active { transform: scale(.97); }
.pd-btn:disabled { opacity: .6; cursor: progress; }
.pd-btn-g { background: var(--surface-container-low, #f5f3f3); color: var(--pd-ink); }
.pd-btn-icon { padding: 12px 14px; }
.pd-btn-like, .pd-btn-dislike { flex: 1 1 0; }
.pd-btn-like { background: #e3f2f8; color: var(--primary, #006684); }
.pd-btn-like.is-on { background: var(--primary, #006684); color: #fff; }
.pd-btn-dislike { background: #fdeceb; color: var(--pd-red); }
.pd-btn-dislike.is-on { background: var(--pd-red); color: #fff; }

/* ── Steuerung oben rechts ──────────────────────────────────── */
.pd-controls { position: absolute; top: 14px; right: 14px; z-index: 3; display: flex; gap: 6px; }
.pd-ctl {
    display: grid;
    place-items: center;
    width: 40px; height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--surface-container-low, #f5f3f3);
    color: var(--pd-ink);
    cursor: pointer;
    transition: background-color .15s ease, transform .12s ease;
}
.pd-ctl:active { transform: scale(.94); }
.pd-ctl:disabled { opacity: .4; cursor: default; }

@media (hover: hover) {
    .pd-btn-g:hover { background: var(--surface-container, #efeded); }
    .pd-btn-like:not(.is-on):hover { background: #d3eaf3; }
    .pd-btn-dislike:not(.is-on):hover { background: #fadbd9; }
    .pd-ctl:not(:disabled):hover { background: var(--surface-container, #efeded); }
}

/* ── Handy: Vollbild-Blatt, Leiste entfällt ─────────────────── */
@media (max-width: 899px) {
    .pd-overlay { padding: 0; }
    .pd-dialog {
        width: 100%;
        height: 100%;
        height: 100dvh;
        border-radius: 0;
        animation-name: pd-sheet;
    }
    .pd-detail { display: flex; flex-direction: column; }
    .pd-visual { flex: none; height: min(38dvh, 320px); min-height: 200px; }
    .pd-poster, .pd-status-panel { height: auto; min-height: 190px; padding: 28px 24px; }
    .pd-poster-n { font-size: 52px; }
    .pd-text { flex: 1; }
    .pd-head { padding: 16px 20px 0; min-height: 0; }
    .pd-scroll { padding: 12px 20px 20px; }
    .pd-actions { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); }
    .pd-btn { min-height: 48px; }
    .pd-btn-like, .pd-btn-dislike { padding-inline: 10px; font-size: 14px; }
    .pd-controls { top: calc(12px + env(safe-area-inset-top)); right: 12px; }
    .pd-ctl:disabled { opacity: .55; }
    .pd-ctl { background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .28); }
    .pd-title { font-size: 1.4375rem; }
}

@media (max-width: 420px) {
    .pd-btn-like .material-symbols-outlined, .pd-btn-dislike .material-symbols-outlined { display: none; }
}

@keyframes pd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pd-fade-out { to { opacity: 0; } }
@keyframes pd-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pd-sheet { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .pd-overlay, .pd-dialog { animation: none; }
    .pd-ratio-fill, .pd-btn, .pd-ctl, .pd-arrow { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   KARTEN (pc-): Quadratisches Foto oben, Text darunter auf heller Fläche.
   Das Foto füllt das Quadrat (cover, mittig); im Detail steht es ganz.
   Ohne Foto zeigt dieselbe Fläche den Status (Neuigkeit) oder die Zustimmung (Abstimmung).
═══════════════════════════════════════════════════════════════════ */
.pc-card, .pc-card * { box-sizing: border-box; }
.pc-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(16, 24, 28, .08), 0 6px 20px -12px rgba(16, 24, 28, .25);
    color: #1b1c1c;
    font-family: var(--ff, 'Inter'), system-ui, sans-serif;
    cursor: pointer;
    transition: transform .2s cubic-bezier(.23, 1, .32, 1);
}
.pc-card h3, .pc-card p { margin: 0; }
.pc-card .material-symbols-outlined { font-family: 'Material Symbols Outlined'; line-height: 1; }

.pc-media {
    position: relative;
    flex: none;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #e3f2f8;
}
.pc-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .45s cubic-bezier(.23, 1, .32, 1);
}

/* Fläche ohne Foto */
.pc-media.is-fallback {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 56px 20px 20px;
}
.pc-media--vote { background: #e3f2f8; color: var(--primary, #006684); }
.pc-media--news { background: #eef3d2; color: #586400; }
.pc-deco {
    position: absolute;
    right: -26px;
    top: 28px;
    font-size: 200px;
    opacity: .14;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48;
    pointer-events: none;
}
.pc-fb-n { position: relative; font-size: 3.25rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.pc-fb-n.is-text { font-size: 1.75rem; letter-spacing: -.02em; line-height: 1.15; }
.pc-fb-cap { position: relative; display: block; margin-top: 8px; font-size: 0.875rem; font-weight: 600; }

.pc-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px 0 7px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #586400;
    background: #fff;
    border-radius: 999px;
}
.pc-badge-vote { color: var(--primary, #006684); }
.pc-badge .material-symbols-outlined {
    font-size: 16px;
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}
.pc-count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 10px 0 8px;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #fff;
    background: rgba(0, 0, 0, .62);
    border-radius: 999px;
}
.pc-count .material-symbols-outlined { font-size: 15px; }

.pc-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px 18px;
}
.pc-date { font-size: 0.8125rem; line-height: 1.4; color: #5b6468; }
.pc-card h3 { font-size: 1.1875rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; overflow-wrap: anywhere; color: #1b1c1c; }
/* Die ganze Karte ist die Schaltfläche: Der Knopf im Titel spannt sich über die Karte. */
.pc-open {
    all: unset;
    cursor: pointer;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.pc-open::after { content: ""; position: absolute; inset: 0; }
.pc-card:has(.pc-open:focus-visible) { outline: 3px solid var(--primary, #006684); outline-offset: 3px; }

.pc-card p {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #4a5256;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Stimm-Knöpfe liegen über der Karten-Schaltfläche (z-index), damit sie selbst klickbar bleiben.
   margin-top: auto schiebt sie nach unten, damit sie in einer Zeile auf einer Linie stehen. */
.pc-votes { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; }
.pc-vote {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    font: 700 0.875rem/1 var(--ff, 'Inter'), system-ui, sans-serif;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .15s ease, color .15s ease, transform .12s ease;
}
.pc-vote .material-symbols-outlined { font-size: 18px; font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 20; }
.pc-vote.is-on .material-symbols-outlined { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20; }
.pc-vote:active { transform: scale(.95); }
.pc-vote:disabled { opacity: .7; cursor: progress; }
.pc-vote:focus-visible { outline: 2px solid var(--primary, #006684); outline-offset: 2px; }
.pc-vote-like { background: #e3f2f8; color: var(--primary, #006684); }
.pc-vote-like.is-on { background: var(--primary, #006684); color: #fff; }
.pc-vote-dislike { background: #fdeceb; color: #b3261e; }
.pc-vote-dislike.is-on { background: #b3261e; color: #fff; }
.pc-vote-msg { font-size: 0.8125rem; font-weight: 600; color: #1b1c1c; }
@media (pointer: coarse) { .pc-vote { min-height: 44px; } }

.pc-card:active { transform: scale(.985); }
.pc-card:has(.pc-vote:active) { transform: none; }
@media (hover: hover) and (pointer: fine) {
    .pc-card:hover { transform: translateY(-4px); }
    .pc-card:hover .pc-img { transform: scale(1.04); }
    .pc-vote-like:not(.is-on):hover { background: #d3eaf3; }
    .pc-vote-dislike:not(.is-on):hover { background: #fadbd9; }
}
@media (prefers-reduced-motion: reduce) {
    .pc-card, .pc-img, .pc-vote { transition: none; }
    .pc-card:hover, .pc-card:active, .pc-card:hover .pc-img, .pc-vote:active { transform: none; }
}
