/* image-modal.css — Bild-Modal */

.imgModal-open { overflow: hidden; }

/* Backdrop */
.imgModal__backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9000;
}

/* Modal box */
.imgModal__box {
    display: none;
    position: fixed;
    inset: 4vh 4vw;
    background: #1a1a1a;
    color: #eee;
    z-index: 9001;
    flex-direction: column;
}

/* Header */
.imgModal__header {
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 16px;
    background: #000;
}

.imgModal__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0 8px;
}

.imgModal__close:hover { color: #bbb; }

/* Body: left + right columns */
.imgModal__body {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* Left column */
.imgModal__left {
    flex: 0 0 70%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Image wrapper */
.imgModal__imgWrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 16px;
    flex-direction: column;
}

.imgModal__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.imgModal__punkfriedhof {
    width: 100%;
    margin-bottom: 8px;
}

/* Strip area */
.imgModal__strip {
    flex: 0 0 100px;
    display: flex;
    align-items: center;
    background: #0f0f0f;
}

.imgModal__thumbs {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 4px;
    overflow: hidden;
    height: 100%;
}

.imgModal__stripArrow {
    flex: 0 0 32px;
    height: 80px;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.imgModal__stripArrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.imgModal__thumbSlot {
    flex: 0 0 auto;
    height: 80px;
    width: 80px;
    padding: 2px;
    background: none;
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
}

.imgModal__thumbSlot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.imgModal__thumbSlot--active { border-color: #fff; }

/* Right column */
.imgModal__right {
    flex: 0 0 32%;
    min-width: 360px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
    background: #222;
    border-left: 1px solid #444;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.4);
    font-size: 15px;
    line-height: 1.5;
}

/* Links in der rechten Spalte: kräftiges Gelb (auf dunklem Hintergrund gut lesbar) */
.imgModal__right a {
    color: #ffeb3b;
    text-decoration: none;
}

.imgModal__right a:hover {
    color: #fff176;
    text-decoration: underline;
}

.imgModal__caption {
    font-size: 1.15em;
    font-weight: bold;
    color: #fff;
    border-bottom: 1px solid #444;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.imgModal__albumInfo,
.imgModal__uploader,
.imgModal__viewCount,
.imgModal__photographer,
.imgModal__story {
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

/* Comment form */
.imgModal__commentForm {
    margin-bottom: 12px;
}

.imgModal__form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.imgModal__form input,
.imgModal__form textarea {
    padding: 8px;
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #555;
    font-family: inherit;
    font-size: 1em;
    box-sizing: border-box;
    width: 100%;
}

.imgModal__form button[type="submit"] {
    padding: 10px 16px;
    background: #65c507;
    color: #000;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
}

.imgModal__formError {
    color: #ff6666;
    min-height: 1em;
    font-size: 1em;
}

/* Fehlerhinweis-Checkbox: Checkbox links neben mehrzeiligem Label-Text */
.imgModal__formCheckbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    line-height: 1.4;
    font-size: 0.9em;
    color: #ccc;
}

.imgModal__formCheckbox input[type="checkbox"] {
    flex: 0 0 auto;
    width: auto;
    margin-top: 3px;
}

.imgModal__formCheckbox span {
    flex: 1;
}

/* Comment list */
.imgModal__commentList {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.imgModal__comment {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #444;
}

/* Variante ohne Avatar (z.B. karlnagel): Body nutzt die volle Breite. */
.imgModal__comment--noAvatar {
    grid-template-columns: 1fr;
}

.imgModal__commentAvatar img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Avatar-Border im Modal: schmaler als auf der Bildseite (5px global -> 3px hier).
   Selektor `.imgModal__commentAvatar .commentAvatar` schlägt die globale
   `.commentAvatar`-Regel via höherer Spezifität. */
.imgModal__commentAvatar .commentAvatar {
    border-width: 3px;
}

.imgModal__commentBody {
    min-width: 0;  /* erlaubt Umbrechen langer Wörter im Text */
}

.imgModal__commentHeader {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.imgModal__commentDate {
    color: #888;
    font-size: 0.9em;
}

.imgModal__commentText {
    font-size: 1em;
    line-height: 1.5;
}

/* === Trigger-Button auf der Bildseite === */

.imgModalContainer {
    position: relative;
    display: inline-block;
    line-height: 0; /* keine Inline-Lücke unter dem Bild */
}

.imgModalTrigger {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    cursor: pointer;
    line-height: 0;
    z-index: 10;
    transition: background 0.15s, border-color 0.15s;
}

.imgModalTrigger:hover,
.imgModalTrigger:focus {
    background: rgba(0, 0, 0, 0.9);
    border-color: #fff;
    outline: none;
}

.imgModalTrigger__icon {
    width: 22px;
    height: 22px;
}

/* === Mobile (max 767px) === */
@media (max-width: 767px) {
    .imgModal__box { inset: 0; }
    .imgModal__body {
        flex-direction: column;
        overflow-y: auto;
    }
    .imgModal__left,
    .imgModal__right { flex: 1 1 auto; }
    .imgModal__right { min-width: 0; overflow-y: visible; }
    .imgModal__img { max-height: 50vh; }
    .imgModal__commentList { overflow-y: visible; }
}

/* === Tablet (768px–1023px) === */
@media (min-width: 768px) and (max-width: 1023px) {
    .imgModal__box { inset: 0; }
    .imgModal__body {
        flex-direction: column;
        overflow-y: auto;
    }
    .imgModal__left,
    .imgModal__right { flex: 1 1 auto; }
    .imgModal__right { min-width: 0; overflow-y: visible; }
    .imgModal__img { max-height: 60vh; }
    .imgModal__commentList { overflow-y: visible; }
}
