/* Wall controls */
.wall-controls {
    max-width: 1400px;
    margin: 0 auto;
    padding: 25px 30px 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

/* Sort buttons */
.sort-btn {
    background: transparent;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    font-size: 0.76em;
    color: #bbb;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
    transition: color 0.15s;
    position: relative;
}

.sort-btn:hover { color: var(--gray-mid); }

.sort-btn.active {
    color: var(--gray-dark);
}

.sort-btn.active::after {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--teal);
    margin: 3px auto 0;
}

/* Board nav buttons */
.board-btn {
    background: transparent;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    font-size: 0.7em;
    color: #ccc;
    font-family: 'Inter', sans-serif;
    transition: color 0.15s;
    min-width: 16px;
    position: relative;
}

.board-btn:hover { color: var(--gray-mid); }

.board-btn.active {
    color: var(--gray-dark);
}

.board-btn.active::after {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--teal);
    margin: 3px auto 0;
}

/* ===== Masonry Wall ===== */
.wall-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px 60px;
}

.masonry-wall {
    columns: 4;
    column-gap: 20px;
}
/* ===== Cards ===== */
.card {
    break-inside: avoid;
    margin-bottom: 16px;
    background: var(--white);
    cursor: pointer;
}
.card:hover .card-image {
    opacity: 0.92;
}
.card-image {
    width: 100%;
    display: block;
    height: auto;
    transition: opacity 0.2s;
}
.card-auto-image {
    width: 100%;
    height: 160px;
    background: var(--teal-light);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}
.card-body {
    padding: 7px 2px 6px;
}
.card-title {
    display: flex; align-items: center; gap: 4px;
    font-family: var(--font-serif);
    font-size: 0.88em;
    color: var(--gray-dark);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}
.card-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7em;
    color: #aaa;
}
.card-meta-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}
.card-author {
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-date {
    font-size: 0.82em;
    color: #ccc;
    white-space: nowrap;
    flex-shrink: 0;
}
.card-meta-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    color: #bbb;
}
.card-likes, .card-comments {
    font-size: 0.7em;
    color: #bbb;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
}
.card-audio-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #bbb;
    display: flex;
    align-items: center;
}
.card-audio-btn:hover,
.card-audio-btn.playing {
    color: var(--teal);
}

.card-human-stamp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    position: relative;
    vertical-align: middle;
    margin-left: 4px;
}
.card-human-stamp::after {
    content: 'Human Made';
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.65);
    color: white;
    font-family: var(--font-sans);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.card-human-stamp:hover::after {
    opacity: 1;
}

/* ============================================================
   wall_write.css — Wall 글쓰기 슬라이드업 패널
   style.css 또는 wall.css 에 @import 또는 붙여넣기
   ============================================================ */

.wall-write-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.wall-write-backdrop.open {
    display: block;
    opacity: 1;
}

/* ---------- Panel — desktop: center modal ---------- */
.wall-write-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.97);
    z-index: 1101;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    width: min(92vw, 560px);
    max-height: 80vh;
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.28s ease;
    will-change: transform, opacity;
}
.wall-write-panel.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* ---------- 핸들 ---------- */
.wall-write-handle {
    display: none;
    justify-content: center;
    padding: 10px 0 4px;
    cursor: grab;
    flex-shrink: 0;
}

.wall-write-handle:active { cursor: grabbing; }
.wall-write-handle-bar {
    width: 36px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
}

/* ---------- 헤더 ---------- */
.wall-write-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 22px 12px;
    flex-shrink: 0;
    border-bottom: 1px solid #f0f0f0;
}

/* ── Write panel tabs ── */
.wall-write-tabs {
    display: flex;
    gap: 0;
    padding: 0 22px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.wall-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 18px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    color: #bbb;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}
.wall-tab-btn:hover { color: var(--gray-mid); }
.wall-tab-btn.active {
    color: var(--gray-dark);
    border-bottom-color: var(--teal);
}
.wall-tab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.15s;
    flex-shrink: 0;
}
.wall-tab-btn.active .wall-tab-dot {
    background: var(--teal);
}

.wall-write-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    letter-spacing: 0.01em;
}
.wall-write-title-art   { color: var(--teal, #5BC8C0); }
.wall-write-title-sep   { color: #ccc; margin: 0 4px; }
.wall-write-title-word  { color: #111; }

.wall-write-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}
.wall-write-close:hover { color: #333; }

/* ---------- 에러 ---------- */
.wall-write-error {
    margin: 0 22px 8px;
    padding: 8px 12px;
    background: #fff5f5;
    border: 1px solid #fcc;
    border-radius: 3px;
    color: #c0392b;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ---------- 바디 ---------- */
.wall-write-body {
    display: block;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 16px 22px;
}

.wall-write-col {
    padding: 16px 22px;
}
.wall-write-col-media {
    border-right: 1px solid #f0f0f0;
}
.wall-write-col-poem {
    display: flex;
    flex-direction: column;
}

/* ---------- 필드 ---------- */
.wall-write-field {
    margin-bottom: 14px;
}
.wall-write-field--grow {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.wall-write-field--grow .wall-write-textarea {
    flex: 1;
    min-height: 120px;
}

.wall-write-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 5px;
}
.wall-write-req {
    color: #e74c3c;
    font-weight: 700;
}

.wall-write-input,
.wall-write-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 8px 11px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    color: #111;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
    outline: none;
}
.wall-write-input:focus,
.wall-write-textarea:focus {
    border-color: var(--teal, #5BC8C0);
    background: #fff;
}
.wall-write-textarea {
    resize: vertical;
    line-height: 1.6;
    min-height: 100px;
}

/* ---------- 파일 업로드 ---------- */
.wall-write-file-wrap {
    position: relative;
    border: 1.5px dashed #ddd;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s;
    min-height: 64px;
}
.wall-write-file-wrap:hover { border-color: var(--teal, #5BC8C0); }
.wall-write-file-wrap input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 0; /* prevent iOS label flash */
}

.wall-write-file-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    gap: 4px;
    pointer-events: none;
}
.wall-write-file-icon { font-size: 1.4rem; }
.wall-write-file-hint { font-size: 0.75rem; color: #aaa; }

/* 이미지 프리뷰 */
.wall-write-img-preview {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    display: block;
    border-radius: 2px;
}

/* 오디오 프리뷰 */
.wall-write-audio-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    gap: 8px;
}
.wall-write-audio-name {
    font-size: 0.8rem;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.wall-write-file-wrap--audio { min-height: 52px; }

/* Clear 버튼 */
.wall-write-clear {
    font-size: 0.72rem;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
    z-index: 1;
    position: relative;
}
.wall-write-clear:hover { color: #c0392b; background: #fff5f5; }
/* clear 버튼은 file input 위에 오도록 */
.wall-write-img-preview + .wall-write-clear {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255,255,255,0.85);
}

/* ---------- 푸터 ---------- */
.wall-write-footer {
    padding: 12px 22px 20px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wall-write-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    color: #888;
    line-height: 1.5;
    cursor: pointer;
}
.wall-write-consent-check {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--teal, #5BC8C0);
}

.wall-write-submit {
    width: 100%;
    padding: 13px;
    background: var(--teal, #5BC8C0);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.18s, transform 0.1s;
    letter-spacing: 0.02em;
}
.wall-write-submit:hover  { background: var(--teal-dark, #3da8a0); }
.wall-write-submit:active { transform: scale(0.98); }
.wall-write-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/*
 * wall-rating-option uses 3-level specificity to override browser default
 * (label is inline by default). Never simplify to .wall-rating-option alone
 * or the flex layout will break.
 */
.wall-write-footer .wall-rating-section .wall-rating-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 7px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

/* 여기서부터 rating CSS */

.wall-rating-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.wall-rating-label {
    font-size: 0.75rem;
    color: #aaa;
    font-family: var(--font-sans);
    margin-right: 4px;
}
.wall-rating-btn {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 5px 14px;
    font-size: 0.78rem;
    color: #aaa;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.15s;
}
.wall-rating-btn:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}
.wall-rating-btn.active {
    background: var(--teal-light);
    border-color: var(--teal);
    color: var(--teal-dark);
    font-weight: 500;
}

/* Posting button loading animation */
.posting-dots span {
    animation: blink 1.2s infinite;
    opacity: 0;
}
.posting-dots span:nth-child(2) { animation-delay: 0.2s; }
.posting-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 100% { opacity: 0; }
    50%       { opacity: 1; }
}

/* Wall content filter — subtle, right corner of controls */
.wall-filter-wrap {
    position: relative;
    margin-left: auto;
}

.wall-filter-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 1rem;
    letter-spacing: 0.08em;
    padding: 5px 8px;
    border-radius: 4px;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wall-filter-btn:hover { color: var(--gray-mid); }

.wall-filter-btn.active {
    color: var(--teal-dark);
}

.wall-filter-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
    z-index: 100;
    min-width: 160px;
    overflow: hidden;
}

.wall-filter-menu.open { display: block; }

.wall-filter-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--gray-dark);
    cursor: pointer;
    transition: background 0.12s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.wall-filter-menu-item:hover { background: var(--gray-light); }

.wall-filter-menu-item.active {
    color: var(--teal-dark);
    background: var(--teal-light);
}

.wall-filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wall-filter-dot.general  { background: var(--teal); }
.wall-filter-dot.mature   { background: #e67e22; }
.wall-filter-dot.sensitive { background: #c0392b; }

/* Wall search */
.wall-search {
    display: flex;
    align-items: center;
}

.wall-search input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 4px 8px;
    font-size: 0.76em;
    letter-spacing: 0.3px;
    font-family: 'Inter', sans-serif;
    color: var(--gray-dark);
    outline: none;
    width: 160px;
    transition: border-color 0.2s;
}

.wall-search input:focus { border-bottom-color: var(--teal); }
.wall-search input::placeholder { color: #ccc; }

/* =============================================
   POST MODAL
   ============================================= */

#postModal {
    padding: 0;
    background: #fff;
}

#postModal {
    padding: 0;
    background: #fff;
}

#postModal .modal-box {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    max-width: 100vw;
    border-radius: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    background: #ffffff;
}

/* Top bar */
.post-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 0.5px solid var(--border);
    flex-shrink: 0;
    background: #ffffff;
}

.post-nav-btns {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-nav-btn {
    background: none;
    border: 0.5px solid var(--border);
    border-radius: 2px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #888;
    font-size: 16px;
    transition: all 0.15s;
}
.post-nav-btn:hover { border-color: #aaa; color: #333; }
.post-nav-btn:disabled { opacity: 0.25; cursor: default; }

.post-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #aaa;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}
.post-close-btn:hover { color: #111; }

/* Scrollable content */
.post-scroll {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-bottom: 80px;
}

/* Artwork */
.post-artwork-section {
    width: 100%;
    background: #f8f8f8;
    display: block;
}
.post-artwork-section img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    background: #f8f8f8;
}
.post-artwork-section iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
}

/* Caption */
.post-artwork-caption {
    background: #fff;
    padding: 8px 32px 12px;
    font-size: 11px;
    color: #bbb;
    font-family: var(--font-sans);
    letter-spacing: 0.3px;
    border-bottom: 0.5px solid var(--border);
}

/* Poem section */
.post-poem-section {
    background: #fff;
    padding: 36px 32px 28px;
    border-bottom: 0.5px solid var(--border);
}

.post-poem-title {
    font-family: var(--font-serif);
    font-size: 1.7em;
    color: var(--black);
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.post-meta {
    font-size: 0.75em;
    color: #aaa;
    margin-bottom: 24px;
    font-family: var(--font-sans);
    letter-spacing: 0.3px;
}
.post-meta a { color: inherit; text-decoration: none; }
.post-meta a:hover { text-decoration: underline; }

.post-poem-text {
    font-family: var(--font-serif);
    font-size: 1em;
    color: #1a1a1a;
    line-height: 2.4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Audio */
.post-audio-wrap {
    margin: 20px 0 0;
    max-width: 100%;
}
.post-audio-wrap audio { width: 100%; }

/* Post actions */
.post-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-like {
    background: transparent;
    border: 0.5px solid var(--border);
    padding: 6px 14px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.78em;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #888;
    font-family: var(--font-sans);
}
.btn-like:hover { border-color: #C9A99A; color: #C9A99A; }
.btn-like.liked { border-color: #C9A99A; color: #C9A99A; }

.btn-report {
    background: transparent;
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 0.72em;
    color: #ccc;
    transition: color 0.15s;
    font-family: var(--font-sans);
}
.btn-report:hover { color: #e74c3c; }

.btn-edit {
    background: transparent;
    border: 0.5px solid var(--border);
    color: #aaa;
    padding: 6px 14px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.78em;
    transition: all 0.15s;
    font-family: var(--font-sans);
}
.btn-edit:hover { border-color: var(--teal); color: var(--teal-dark); }

/* Reflections */
.reflections-section {
    background: #fff;
    padding: 28px 32px 0;
}

.reflections-heading {
    font-family: var(--font-sans);
    font-size: 0.65em;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #ccc;
    margin-bottom: 20px;
    font-weight: 400;
}

.reflection-item {
    padding: 16px 0;
    border-bottom: 0.5px solid #f5f5f5;
    max-width: 100%;
}
.reflection-item:last-of-type { border-bottom: none; }

.reflection-author {
    font-size: 0.72em;
    font-weight: 500;
    color: var(--teal-dark);
    margin-bottom: 6px;
    font-family: var(--font-sans);
}
.reflection-author a { color: inherit; text-decoration: none; }
.reflection-author a:hover { text-decoration: underline; }

.reflection-text {
    font-family: var(--font-serif);
    font-size: 0.95em;
    color: #444;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
}
.reflection-text.withdrawn {
    color: #ccc;
    font-style: italic;
    font-family: var(--font-sans);
    font-size: 0.82em;
}

.btn-edit-comment {
    background: none;
    border: none;
    color: #ccc;
    font-size: 0.72em;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 4px;
    font-family: var(--font-sans);
    transition: color 0.15s;
}
.btn-edit-comment:hover { color: var(--teal-dark); }

/* Reflect FAB */
.post-reflection-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
}
.post-reflection-fab button {
    background: #111;
    color: #fff;
    border: none;
    padding: 11px 24px;
    border-radius: 2px;
    font-family: var(--font-serif);
    font-size: 0.9em;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: background 0.15s;
    font-style: italic;
}
.post-reflection-fab button:hover { background: #333; }

/* ---------- Mobile ---------- */
/* Audio bar — sits between image and card body */
.card-audio-bar {
    display: flex;
    justify-content: flex-end;
    padding: 4px 6px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

@media (max-width: 768px) {
    /* Hero height fix on mobile */
    .wall-hero-section { height: 120px; }
    .masonry-wall { columns: 2; column-gap: 12px; }
    .wall-controls { padding: 15px 15px 10px; }
    .wall-container { padding: 15px 15px 60px; }
    .wall-search input { width: 130px; }
    .wall-write-header { padding: 4px 16px 10px; }
    .wall-write-footer { padding: 10px 16px 24px; }
    .wall-write-handle { display: flex; }
    .wall-write-panel {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        transform: translateY(100%);
        width: 100%;
        max-height: 88vh;
        border-radius: 4px 4px 0 0;
        opacity: 1;
    }
    .wall-write-panel.open {
        transform: translateY(0);
        opacity: 1;
    }
    .post-poem-section,
    .reflections-section { padding-left: 24px; padding-right: 24px; }
    .post-artwork-caption { padding-left: 24px; padding-right: 24px; }
    .post-poem-title { font-size: 1.5em; }
    .post-reflection-fab { bottom: 20px; right: 20px; }
    .post-nav-btns { padding: 0 8px; }
    .post-nav-btn { width: 32px; height: 48px; font-size: 16px; }
}

/* ===== GALLERIES WORLD CROP MODAL ===== */
.wall-crop-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1200;
    align-items: center;
    justify-content: center;
}
.wall-crop-modal.active { display: flex; }
.wall-crop-box {
    background: #fff;
    border-radius: 4px;
    width: min(90vw, 540px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.wall-crop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-family: var(--font-sans);
    font-size: 0.85em;
    color: #555;
    flex-shrink: 0;
}
.wall-crop-tools { display: flex; gap: 8px; }
.wall-crop-tools button {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 5px 12px;
    font-size: 0.78em;
    cursor: pointer;
    color: #666;
    transition: all 0.15s;
}
.wall-crop-tools button:hover { border-color: var(--teal); color: var(--teal-dark); }
.wall-crop-container {
    flex: 1;
    min-height: 0;
    max-height: 55vh;
    overflow: hidden;
    background: #111;
}
.wall-crop-container img { max-width: 100%; display: block; }
.wall-crop-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.wall-crop-skip {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 8px 20px;
    font-size: 0.82em;
    cursor: pointer;
    color: #888;
    transition: all 0.15s;
}
.wall-crop-skip:hover { border-color: #aaa; color: #555; }
.wall-crop-confirm {
    background: var(--teal);
    border: none;
    border-radius: 3px;
    padding: 8px 20px;
    font-size: 0.82em;
    cursor: pointer;
    color: #fff;
    transition: background 0.15s;
}
.wall-crop-confirm:hover { background: var(--teal-dark); }


/* ===== WALL IMAGE CROP MODAL ===== */
.wall-crop-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1200;
    align-items: center;
    justify-content: center;
}
.wall-crop-modal.active {
    display: flex;
}
.wall-crop-box {
    background: #fff;
    border-radius: 4px;
    width: min(90vw, 540px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.wall-crop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-family: var(--font-sans);
    font-size: 0.85em;
    color: #555;
    flex-shrink: 0;
}
.wall-crop-tools {
    display: flex;
    gap: 8px;
}
.wall-crop-tools button {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 5px 12px;
    font-size: 0.78em;
    cursor: pointer;
    color: #666;
    transition: all 0.15s;
}
.wall-crop-tools button:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}
.wall-crop-container {
    flex: 1;
    min-height: 0;
    max-height: 55vh;
    overflow: hidden;
    background: #111;
}
.wall-crop-container img {
    max-width: 100%;
    display: block;
}
.wall-crop-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.wall-crop-skip {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 8px 20px;
    font-size: 0.82em;
    cursor: pointer;
    color: #888;
    transition: all 0.15s;
}
.wall-crop-skip:hover { border-color: #aaa; color: #555; }
.wall-crop-confirm {
    background: var(--teal);
    border: none;
    border-radius: 3px;
    padding: 8px 20px;
    font-size: 0.82em;
    cursor: pointer;
    color: #fff;
    transition: background 0.15s;
}
.wall-crop-confirm:hover { background: var(--teal-dark); }

/* Title row — title and audio button side by side */
.card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}
.card-title-row .card-title {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

/* Card edit button — owner only */
.card-edit-btn {
    font-size: 0.68em;
    color: #bbb;
    text-decoration: none;
    border: 0.5px solid #e0e0e0;
    border-radius: 2px;
    padding: 2px 7px;
    font-family: var(--font-sans);
    transition: all 0.15s;
    white-space: nowrap;
}
.card-edit-btn:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}

/* =====================================================
   Wall write panels safety lock
   -----------------------------------------------------
   Hidden write panels must never receive clicks.
   This prevents invisible form fields from covering
   Wall cards and opening selects accidentally.
===================================================== */

.wall-write-panel,
.wall-write-backdrop {
    pointer-events: none;
}

.wall-write-panel.open,
.wall-write-backdrop.open {
    pointer-events: auto;
}

/* ── Wall fullscreen clip-path overlay ── */
.gallery-fs {
    position: fixed;
    inset: 0;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.gallery-fs.active {
    opacity: 1;
}
.gallery-fs-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.gallery-fs-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 55%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px 48px;
}
.gallery-fs-close {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 0.7em;
    color: rgba(255,255,255,0.45);
    letter-spacing: 2px;
    cursor: pointer;
    transition: color 0.2s;
    font-family: var(--font-sans);
}
.gallery-fs-close:hover { color: white; }
.gallery-fs-title {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 2em;
    color: white;
    margin-bottom: 8px;
    line-height: 1.2;
}
.gallery-fs-meta {
    font-size: 0.78em;
    color: rgba(255,255,255,0.45);
    letter-spacing: 1px;
    margin-bottom: 24px;
}
.gallery-fs-link {
    font-size: 0.7em;
    color: white;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 8px 20px;
    letter-spacing: 1.5px;
    display: inline-block;
    transition: all 0.2s;
    font-family: var(--font-sans);
}
.gallery-fs-link:hover { background: white; color: #111; }

@media (max-width: 600px) {
    .gallery-fs-overlay { padding: 24px 20px; }
    .gallery-fs-title { font-size: 1.4em; }
}

#wallPreview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 80vw;
    height: 400px;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    background: #000 center/contain no-repeat;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
#wallPreview.active { opacity: 1; }

/* ── Multi-image slots (Wall write panel) ── */
.wall-img-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}
.wall-img-slot {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}
.wall-img-slot-ui {
    width: 80px;
    height: 80px;
    border: 1px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.72em;
    color: #bbb;
    transition: border-color 0.15s;
}
.wall-img-slot-ui:hover { border-color: var(--teal); color: var(--teal-dark); }
.wall-img-slot-preview {
    width: 80px;
    height: 80px;
    object-fit: cover;
    display: block;
}
.wall-img-slot-clear {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.6em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}
.wall-img-slot-num {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: rgba(0,0,0,0.45);
    color: white;
    font-size: 0.58em;
    padding: 1px 4px;
    border-radius: 2px;
    pointer-events: none;
}
/* Series badge on Wall card */
.card-series-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.3);
    color: rgba(255,255,255,0.85);
    font-size: 0.62em;
    padding: 2px 6px;
    border-radius: 2px;
    pointer-events: none;
    font-family: var(--font-sans);
    letter-spacing: 0.5px;
}
.card-image-wrap {
    position: relative;
    display: block;
}