/* ── Content Tabs ── */
.content-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #daa520 0%, #b8860b 50%, #daa520 100%);
    color: #2c1810;
    border: 2px solid #b8860b;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.tab-btn.active {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 50%, #8b4513 100%);
    color: #ffd700;
    border-color: #b8860b;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ── Content Cards ── */
.content-card {
    background: linear-gradient(135deg,
        rgba(139, 69, 19, 0.95) 0%,
        rgba(160, 82, 45, 0.95) 50%,
        rgba(139, 69, 19, 0.95) 100%);
    color: #ffd700;
    padding: 2.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    border: 3px solid #b8860b;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.content-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.about-card {
    background: linear-gradient(135deg, #f5e6d3 0%, #faf0e6 50%, #f5e6d3 100%);
    padding: 3rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    border: 3px solid #b8860b;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.about-card .card-title {
    color: #8b4513;
    text-shadow: none;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
}

.about-card .card-description {
    color: #2c1810;
    font-size: 1.15rem;
    line-height: 1.8;
}

.about-card .card-photo {
    width: 300px;
    height: 300px;
    flex-shrink: 0;
    color: #8b4513;
}

.about-logo {
    width: 500px;
    height: 500px;
    object-fit: contain;
    border: none !important;
}

.about-card .card-tags {
    margin-top: 1.5rem;
}

.about-card .tag {
    background: linear-gradient(135deg, #daa520 0%, #b8860b 100%);
    color: #2c1810;
}

.card-photo.nsfw-photo {
    position: relative;
}

.card-photo:has(.media-stack-wrapper) {
    overflow: visible;
}
.media-stack-wrapper {
    position: relative;
    display: inline-block;
}
.media-stack-wrapper::before,
.media-stack-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    border: 2px solid #b8860b;
    background: #1a1008;
    pointer-events: none;
}
.media-stack-wrapper::before {
    transform: rotate(-3deg) translate(-4px, 4px);
    z-index: 0;
    opacity: 0.6;
}
.media-stack-wrapper::after {
    transform: rotate(-1.5deg) translate(-2px, 2px);
    z-index: 1;
    opacity: 0.8;
}
.media-stack-wrapper img,
.media-stack-wrapper video {
    position: relative;
    z-index: 2;
    display: block;
}
/* Count badge */
.media-count-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    border: 1px solid #b8860b;
    pointer-events: none;
    letter-spacing: 0.03em;
}

.card-photo.nsfw-photo img,
.card-photo.nsfw-photo video {
    filter: blur(20px);
    transition: filter 0.3s ease;
}

.card-photo.nsfw-photo:hover img,
.card-photo.nsfw-photo:hover video {
    filter: blur(15px);
}

.nsfw-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    z-index: 10;
    pointer-events: none;
    font-size: 0.9rem;
}

.admin-controls {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.content-card:hover .admin-controls {
    opacity: 1;
}

.admin-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #b8860b;
    background: linear-gradient(135deg, #daa520 0%, #b8860b 100%);
    color: #2c1810;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.admin-btn:hover {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 100%);
    color: #ffd700;
    transform: scale(1.1);
}

.admin-btn.active {
    background: linear-gradient(135deg, #ffd700 0%, #daa520 100%);
    color: #2c1810;
    border-color: #ffd700;
}

.sticky-indicator {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700 0%, #daa520 100%);
    color: #2c1810;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 2px solid #b8860b;
}

.sticky-indicator i {
    transform: rotate(45deg);
}

.content-card.sticky-post {
    border: 3px solid #ffd700;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.3);
}

.card-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card-text {
    flex: 1;
}

.card-photo {
    background: transparent;
    color: rgba(255, 215, 0, 0.7);
    width: 100%;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    overflow: hidden;
    position: relative;
}

.card-photo img,
.card-photo video {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    border-radius: 10px;
    border: 2px solid #b8860b;
    display: block;
    margin: 0 auto;
}

.card-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: #ffd700;
    margin-bottom: 1rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.card-description {
    font-size: 1.2rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Cosplay info */
.cosplay-info {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.cosplay-info .series {
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.8) 0%, rgba(184, 134, 11, 0.8) 100%);
    color: #2c1810;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 0.5rem;
    display: inline-block;
}

.cosplay-info .character {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8) 0%, rgba(160, 82, 45, 0.8) 100%);
    color: #ffd700;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 0.5rem;
    display: inline-block;
}

.cosplay-info .event {
    background: linear-gradient(135deg, rgba(75, 0, 130, 0.8) 0%, rgba(106, 90, 205, 0.8) 100%);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
}

/* Genre/Category labels */
.genre-info,
.category-info {
    margin-bottom: 0.8rem;
    padding: 0.3rem 0;
}

.genre-label,
.category-label {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.7) 0%, rgba(160, 82, 45, 0.7) 100%);
    color: #ffd700;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Tags */
.card-tags {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.tag {
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.9) 0%, rgba(184, 134, 11, 0.9) 100%);
    color: #2c1810;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Cinzel', serif;
    border: 1px solid rgba(184, 134, 11, 0.3);
}

.tag.nsfw-tag {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.9) 0%, rgba(139, 0, 0, 0.9) 100%);
    color: #fff;
    border-color: #8b0000;
}

.tag.scheduled-tag {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.9) 0%, rgba(255, 152, 0, 0.9) 100%);
    color: #000;
    border-color: #ff9800;
    font-weight: 500;
}

/* Clickable cards */
.clickable-card {
    cursor: pointer;
    transition: all 0.4s ease;
}

.clickable-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 70px rgba(0,0,0,0.35);
}

.clickable-card .card-cta {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    color: #ffd700;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.clickable-card:hover .card-cta {
    opacity: 1;
    animation: pulseOpacity 1.5s ease-in-out infinite;
}

@keyframes pulseOpacity {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ── Modals ── */
.modal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 24, 16, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #f8f4e6 0%, #e8dcc0 100%);
    padding: 2.5rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 3px solid #daa520;
}

.content-modal-large {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #b8860b;
    padding-bottom: 1rem;
}

.modal-title {
    color: #2c1810;
    font-size: 1.8rem;
    font-family: 'Cinzel', serif;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #8b4513;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: #8b4513;
    color: #ffd700;
    transform: rotate(90deg);
}

/* ── Forms ── */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: #2c1810;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #b8860b;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Crimson Text', serif;
    background: linear-gradient(135deg, #fff 0%, #f8f4e6 100%);
    color: #2c1810;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #daa520;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-full {
    grid-column: 1 / -1;
}

/* ── Rich Text Editor ── */
.rich-editor {
    border: 2px solid #b8860b;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff 0%, #f8f4e6 100%);
    min-height: 200px;
}

.editor-toolbar {
    background: linear-gradient(135deg, #daa520 0%, #b8860b 100%);
    padding: 0.5rem;
    border-bottom: 1px solid #b8860b;
    border-radius: 10px 10px 0 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.editor-btn {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: #2c1810;
}

.editor-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.editor-btn.active {
    background: rgba(139, 69, 19, 0.8);
    color: #ffd700;
}

.editor-content {
    padding: 1rem;
    min-height: 150px;
    outline: none;
}

/* ── Media Upload ── */
.media-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.media-upload-item {
    position: relative;
    border: 2px dashed #b8860b;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(248, 244, 230, 0.5);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.media-upload-item:hover {
    border-color: #daa520;
    background: rgba(218, 165, 32, 0.1);
}

.media-preview {
    max-width: 100%;
    max-height: 100px;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.media-filename {
    font-size: 0.8rem;
    color: #666;
    word-break: break-word;
    text-align: center;
}

.media-alt-text-input,
.existing-media-alt-text-input,
.edit-media-alt-text-input {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid #b8860b;
    border-radius: 4px;
    background: white;
    color: #333;
}

.media-alt-text-input:focus,
.existing-media-alt-text-input:focus,
.edit-media-alt-text-input:focus {
    outline: none;
    border-color: #daa520;
    box-shadow: 0 0 0 2px rgba(218, 165, 32, 0.2);
}

.media-remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Links Container ── */
.links-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.link-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(248, 244, 230, 0.3);
    border-radius: 8px;
    border: 1px solid #b8860b;
}

.link-item .link-url-input {
    grid-column: 1;
}

.link-item .link-text-fields {
    grid-column: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.link-item .link-remove-btn {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
}

.link-item input {
    padding: 0.5rem;
    border: 1px solid #b8860b;
    border-radius: 4px;
    font-size: 0.9rem;
}

.link-item input:focus {
    outline: none;
    border-color: #daa520;
    box-shadow: 0 0 0 2px rgba(218, 165, 32, 0.2);
}

.link-remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.link-remove-btn:hover {
    background: #c82333;
}

/* ── Dynamic Form Fields ── */
.dynamic-fields {
    display: none;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(248, 244, 230, 0.3);
    border-radius: 12px;
    border: 1px solid #b8860b;
}

.dynamic-fields.active {
    display: block;
}

/* ── Tag Suggestions & Browser ── */
.tag-suggestions {
    max-height: 160px;
    overflow-y: auto;
    background: #3a2a1a;
    border: 1px solid rgba(184, 134, 11, 0.4);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.tag-suggestions:empty {
    display: none;
}

.tag-suggestion-item {
    padding: 0.45rem 0.8rem;
    color: #ffd700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tag-suggestion-item:hover {
    background: rgba(218, 165, 32, 0.25);
}

.tag-browser-section {
    margin-top: 0.75rem;
    border-top: 1px solid rgba(184, 134, 11, 0.2);
    padding-top: 0.75rem;
}

.tag-browser-label {
    display: block;
    font-size: 0.8rem;
    color: #b8860b;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.tag-browser-search {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(184, 134, 11, 0.3);
    border-radius: 6px;
    background: rgba(44, 24, 16, 0.3);
    color: #faebd7;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.tag-browser-search::placeholder {
    color: rgba(250, 235, 215, 0.4);
}

.tag-browser {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    max-height: 180px;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.tag-browser-item {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.2) 0%, rgba(184, 134, 11, 0.15) 100%);
    color: #daa520;
    border: 1px solid rgba(184, 134, 11, 0.4);
    padding: 0.3rem 0.7rem;
    border-radius: 14px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.3;
}

.tag-browser-item:hover {
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.5) 0%, rgba(184, 134, 11, 0.4) 100%);
    color: #fff;
    border-color: #daa520;
    transform: translateY(-1px);
}

.tag-browser-expand,
.filter-expand-btn.filter-btn {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.78rem;
    color: #b8860b;
    border: 1px dashed rgba(184, 134, 11, 0.5);
    background: transparent;
    padding: 0.3rem 0.7rem;
    border-radius: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.3;
}

.filter-expand-btn.filter-btn {
    font-size: 0.8rem;
    padding: 0.6rem 1.2rem;
    border-width: 2px;
}

.tag-browser-expand:hover,
.filter-expand-btn.filter-btn:hover {
    background: rgba(218, 165, 32, 0.15);
    color: #daa520;
    transform: none;
}

.tag-browser-empty {
    color: rgba(250, 235, 215, 0.4);
    font-size: 0.8rem;
    font-style: italic;
}

/* ── Loading & Pagination ── */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: #8b4513;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 1rem 1rem;
    width: 100%;
}

.pagination-info {
    font-family: 'Cinzel', serif;
    color: #8b4513;
    font-size: 0.95rem;
    min-width: 4rem;
    text-align: center;
}

.pagination-btn {
    background: linear-gradient(135deg, #b8860b, #8b6914);
    color: #fff8e7;
    border: 1px solid #8b6914;
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.pagination-btn:hover:not([disabled]) {
    background: linear-gradient(135deg, #d4a017, #b8860b);
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(184, 134, 11, 0.2);
    border-top: 4px solid #b8860b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── NSFW Blur ── */
.nsfw-blur {
    filter: blur(20px);
    transition: filter 0.3s ease;
}

.nsfw-blur:hover {
    filter: blur(5px);
}

.detail-media-grid.nsfw-blur {
    position: relative;
    filter: blur(20px);
    transition: filter 0.3s ease;
}

.detail-media-grid.nsfw-blur:hover {
    filter: blur(15px);
}

.nsfw-warning-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
}

.media-gallery.nsfw-blur-gallery {
    position: relative;
    display: inline-block;
}

.media-gallery.nsfw-blur-gallery img,
.media-gallery.nsfw-blur-gallery video {
    filter: blur(20px) !important;
    transition: filter 0.3s ease;
}

.media-gallery.nsfw-blur-gallery:hover img,
.media-gallery.nsfw-blur-gallery:hover video {
    filter: blur(15px) !important;
}

.media-gallery.nsfw-blur-gallery .nsfw-warning-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ── Full Content Page ── */
.content-full-page {
    animation: fadeIn 0.5s ease-in;
}

.back-btn {
    margin-bottom: 2rem;
}

.content-card-full {
    background: linear-gradient(135deg, #f8f4e6 0%, #e8dcc0 100%);
    padding: 3rem;
    border-radius: 20px;
    border: 3px solid #b8860b;
}

.content-title-full {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: #8b4513;
    margin-bottom: 2rem;
    text-align: center;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.gallery-item {
    position: relative;
}

.gallery-item.nsfw-photo img,
.gallery-item.nsfw-photo video {
    filter: blur(20px);
    transition: filter 0.3s ease;
}

.gallery-item.nsfw-photo:hover img,
.gallery-item.nsfw-photo:hover video {
    filter: blur(15px);
}

.gallery-image, .gallery-video {
    max-width: 100%;
    max-height: 1200px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid #b8860b;
    display: block;
    margin: 0 auto;
}

.gallery-image {
    cursor: zoom-in;
}

/* ── Lightbox ── */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay img,
.lightbox-overlay video {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.8);
    cursor: default;
}

.lightbox-close {
    position: fixed;
    top: 1.2rem;
    right: 1.5rem;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    opacity: 0.85;
    transition: opacity 0.2s;
    z-index: 10000;
    background: none;
    border: none;
    padding: 0;
}

.lightbox-close:hover {
    opacity: 1;
}

.content-body-full {
    font-size: 1.2rem;
    line-height: 1.8;
}

.content-description-full {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
}

.content-description-full b,
.content-description-full strong {
    font-weight: bold;
}

.content-description-full i,
.content-description-full em {
    font-style: italic;
}

.content-description-full u {
    text-decoration: underline;
}

.content-description-full h1,
.content-description-full h2,
.content-description-full h3,
.content-description-full h4 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    margin: 0.75em 0 0.4em;
}

.content-description-full ul,
.content-description-full ol {
    margin: 0.5em 0 0.5em 1.5em;
}

.content-description-full p {
    margin-bottom: 0.75em;
}

.content-description-full a {
    color: #8b4513;
    text-decoration: underline;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.content-meta-full {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.3) 0%, rgba(160, 82, 45, 0.3) 100%);
    border: 1px solid #b8860b;
    border-radius: 20px;
    padding: 0.3rem 0.9rem;
    font-size: 0.85rem;
    font-family: 'Cinzel', serif;
}

.meta-pill-label {
    color: #5a2d0c;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.meta-pill-sep {
    color: #b8860b;
    font-size: 0.7rem;
}

.meta-pill-value {
    color: #2c1810;
    font-weight: 600;
}

.meta-pill.nsfw {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.15) 0%, rgba(139, 0, 0, 0.2) 100%);
    border-color: #8b0000;
}

.meta-pill.nsfw .meta-pill-value {
    color: #8b0000;
}

.content-links-full {
    margin-top: 1.5rem;
}

.content-tags-full h3, .content-links-full h3 {
    font-family: 'Cinzel', serif;
    color: #8b4513;
    margin-bottom: 1rem;
}

.tags-list, .links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.external-link {
    display: inline-block;
    padding: 0.8rem 1.2rem;
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 100%);
    color: #ffd700;
    text-decoration: none;
    border-radius: 12px;
    border: 2px solid #b8860b;
    transition: all 0.3s ease;
}

.external-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.detail-tags h4 {
    margin-bottom: 0.35rem;
}

.detail-links {
    margin-top: 1.25rem;
}

/* ── Avatar & Genre Inputs ── */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.avatar-option {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #b8860b;
    cursor: pointer;
    transition: all 0.3s ease;
    object-fit: cover;
}

.avatar-option:hover {
    transform: scale(1.1);
    border-color: #daa520;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.avatar-option.selected {
    border-color: #8b4513;
    border-width: 4px;
    box-shadow: 0 0 0 3px #ffd700;
}

.genre-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.genre-input-group select,
.genre-input-group input {
    flex: 1;
}

.genre-input-group button {
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

.translation-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.translation-fields input {
    padding: 0.5rem;
    border: 1px solid #3d2914;
    border-radius: 6px;
    background: #1a0f05;
    color: #fff;
}

.translation-fields input:focus {
    border-color: #b8860b;
    outline: none;
}

.edit-field-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.edit-field-group input {
    flex: 1;
}

/* ── Rating ── */
.rating-input {
    display: flex;
    gap: 0.5rem;
    font-size: 2rem;
    cursor: pointer;
}

.rating-heart {
    transition: all 0.2s ease;
    color: #ccc;
}

.rating-heart:hover,
.rating-heart.filled {
    color: #ff4458;
}

.rating-heart:hover {
    transform: scale(1.2);
}

.content-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 1rem;
    color: #ff4458;
    margin-top: 0.5rem;
}

.content-rating i {
    font-size: 1rem;
}

/* ── YouTube Embed ── */
.youtube-embed {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 1rem 0;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* ── Post Prev/Next Navigation ── */
.post-nav {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: space-between;
}

.post-nav-spacer {
    flex: 1;
}

.post-nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #f8f4e6 0%, #e8dcc0 100%);
    border: 2px solid #b8860b;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    max-width: 48%;
}

.post-nav-btn:hover {
    background: linear-gradient(135deg, #e8dcc0 0%, #daa520 30%, #e8dcc0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(184, 134, 11, 0.3);
}

.post-nav-next {
    justify-content: flex-end;
    text-align: right;
}

.post-nav-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #b8860b;
    flex-shrink: 0;
}

.post-nav-thumb-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    border: 2px dashed #b8860b;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8860b;
    flex-shrink: 0;
}

.post-nav-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.post-nav-info-right {
    align-items: flex-end;
}

.post-nav-label {
    font-size: 0.75rem;
    color: #8b4513;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-nav-title {
    font-size: 0.9rem;
    color: #5d4037;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

/* ── Related Posts ── */
.related-posts {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(184, 134, 11, 0.3);
}

.related-posts h3 {
    font-family: 'Cinzel', serif;
    color: #8b4513;
    margin-bottom: 1rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.related-post-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8f4e6 0%, #e8dcc0 100%);
    border: 2px solid #b8860b;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.related-post-card:hover {
    background: linear-gradient(135deg, #e8dcc0 0%, #daa520 30%, #e8dcc0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(184, 134, 11, 0.3);
}

.related-post-thumb {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #b8860b;
}

.related-post-thumb-placeholder {
    width: 100%;
    height: 90px;
    border-radius: 8px;
    border: 2px dashed #b8860b;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8860b;
    font-size: 1.5rem;
}

.related-post-title {
    font-size: 0.85rem;
    color: #5d4037;
    font-weight: 500;
    line-height: 1.3;
}

/* ── Related Posts Picker (admin modal) ── */
.rpp-browser {
    border: 2px solid #daa520;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.rpp-section {
    border-bottom: 1px solid rgba(184, 134, 11, 0.25);
}

.rpp-section:last-child {
    border-bottom: none;
}

.rpp-section-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.9rem;
    background: linear-gradient(135deg, #f8f4e6 0%, #efe6cc 100%);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #5d4037;
    text-align: left;
    transition: background 0.2s;
}

.rpp-section-header:hover {
    background: linear-gradient(135deg, #efe6cc 0%, #daa520 50%, #efe6cc 100%);
}

.rpp-chevron {
    transition: transform 0.2s;
    color: #b8860b;
    font-size: 0.75rem;
}

.rpp-section-body {
    background: #fff;
    max-height: 180px;
    overflow-y: auto;
}

.rpp-item {
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #3d2b1f;
    border-bottom: 1px solid rgba(184, 134, 11, 0.1);
    transition: background 0.15s;
}

.rpp-item:last-child {
    border-bottom: none;
}

.rpp-item:hover {
    background: #f8f4e6;
}

.rpp-item-selected {
    background: rgba(218, 165, 32, 0.15);
    color: #8b4513;
    font-weight: 600;
}

.rpp-item-selected::before {
    content: '✓ ';
}

.rpp-loading, .rpp-empty, .rpp-error {
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    color: #888;
}

.selected-related-posts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.related-post-chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    background: linear-gradient(135deg, #f8f4e6 0%, #e8dcc0 100%);
    border: 2px solid #b8860b;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #5d4037;
}

.related-post-chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #8b4513;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    font-weight: bold;
}

.related-post-chip-remove:hover {
    color: #c0392b;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .card-photo img,
    .card-photo video {
        max-height: 400px;
    }

    .modal-content {
        width: 95%;
        padding: 0.5rem;
    }

    .content-modal-large {
        max-width: 95%;
        padding: 0.5rem;
    }

    .modal-header {
        margin-bottom: 0.8rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .media-upload-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .post-nav {
        flex-direction: column;
    }

    .post-nav-btn {
        max-width: 100%;
    }

    .post-nav-title {
        max-width: 100%;
    }

    .related-posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}
