/* ============================================
   ART PORTFOLIO — V3 Styles (Gridstack)
   ============================================ */

:root {
    --bg: #0a0a0a;
    --bg-card: #111111;
    --text: #ffffff;
    --text-muted: #888888;
    --border: #222222;
    --accent: #ffffff;
    --danger: #ff4d4d;
    --success: #2ecc71;
    --font-head: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

/* ─── Reset ─────────────────────────────────── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* ─── Buttons ───────────────────────────────── */
.btn {
    padding: 8px 18px;
    cursor: pointer;
    border: none;
    font-size: 13px;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    border-radius: 3px;
}

.btn-primary {
    background: var(--accent);
    color: black;
    font-weight: 600;
}

.btn-primary:hover {
    opacity: 0.85;
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    color: white;
    border-color: #555;
}

.btn-save {
    background: var(--success);
    color: white;
}

.btn-save:hover {
    background: #27ae60;
}

.btn-cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-cancel:hover {
    color: white;
}

.btn-delete {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-delete:hover {
    background: var(--danger);
    color: white;
}

.btn-upload {
    background: transparent;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    padding: 10px 30px;
}

.btn-upload:hover {
    color: white;
    border-color: #555;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
}

.btn-text:hover {
    color: white;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
}

.icon-btn:hover {
    color: white;
}

/* About button — more prominent */
.btn-nav {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 16px;
    border-radius: 3px;
    transition: all 0.2s;
}

.btn-nav:hover {
    border-color: white;
    color: white;
}

/* ─── Header ────────────────────────────────── */
.header {
    border-bottom: 1px solid var(--border);
    padding: 25px 40px;
    position: sticky;
    top: 0;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 3px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.socials {
    display: flex;
    gap: 15px;
}

.social-link {
    color: var(--text-muted);
    font-size: 16px;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}

.social-link:hover {
    color: white;
}

.social-link:hover img {
    filter: invert(1);
}

/* ─── Feed ──────────────────────────────────── */
.feed {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px;
}

/* ─── Post ──────────────────────────────────── */
.post {
    margin-bottom: 80px;
    padding-bottom: 60px;
    border-bottom: 1px solid var(--border);
}

.post:last-child {
    border-bottom: none;
}

.post-header {
    text-align: center;
    margin-bottom: 30px;
}

.post-title {
    font-family: var(--font-head);
    font-size: 32px;
    font-weight: 400;
}

.title-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: white;
    font-family: var(--font-head);
    font-size: 32px;
    text-align: center;
    width: 100%;
    padding: 10px;
    outline: none;
}

.title-input:focus {
    border-color: #555;
}

/* ─── Gridstack Overrides ───────────────────── */
.grid-stack {
    background: transparent;
    min-height: 100px;
}

/* Image cell inside grid */
.img-cell {
    background: #000;
    overflow: hidden;
    border-radius: 3px;
}

.img-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.img-cell img.fit-contain {
    object-fit: contain;
}

.img-cell video.grid-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.img-cell video.grid-video.fit-contain {
    object-fit: contain;
}

/* Gridstack item borders in edit mode */
.grid-stack>.grid-stack-item>.grid-stack-item-content {
    inset: 3px;
    /* Small gap between cells */
}

/* Image Overlay (Edit Mode) */
.img-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.grid-stack-item:hover .img-overlay {
    opacity: 1;
}

.img-overlay button {
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
}

.img-overlay button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.img-overlay button.del {
    border-color: var(--danger);
    color: var(--danger);
}

.img-overlay button.del:hover {
    background: var(--danger);
    color: white;
}

/* Resize handles styling */
.grid-stack>.grid-stack-item>.ui-resizable-se {
    background: rgba(255, 255, 255, 0.2);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    right: 5px;
    bottom: 5px;
}

/* ─── Upload ────────────────────────────────── */
.upload-area {
    text-align: center;
    margin-top: 20px;
}

/* ─── Post Footer ───────────────────────────── */
.post-footer {
    max-width: 700px;
    margin: 30px auto 0;
    text-align: center;
}

.post-desc {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-line;
}

.post-tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
}

.edit-trigger {
    margin-top: 20px;
}

/* ─── Tag Editor ────────────────────────────── */
.tag-editor {
    margin-top: 15px;
}

.current-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.tag-chip {
    background: #1a1a1a;
    border: 1px solid #444;
    color: #ccc;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tag-chip button {
    background: none;
    border: none;
    color: #ff6666;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.tag-chip button:hover {
    color: #ff0000;
}

.tag-placeholder {
    color: #555;
    font-size: 12px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 10px;
}

.cloud-label {
    width: 100%;
    text-align: center;
    font-size: 10px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.cloud-tag {
    background: #222;
    color: #888;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    transition: 0.2s;
}

.cloud-tag:hover {
    background: #444;
    color: white;
}

.tag-new-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: #ccc;
    padding: 8px;
    font-size: 13px;
    outline: none;
    text-align: center;
    margin-top: 5px;
}

.tag-new-input:focus {
    border-color: #555;
}

/* ─── Admin Inputs ──────────────────────────── */
.desc-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: #ccc;
    font-family: var(--font-body);
    font-size: 15px;
    padding: 12px;
    min-height: 100px;
    outline: none;
    resize: vertical;
}

.desc-input:focus {
    border-color: #555;
}

.post-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ─── Footer ────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px;
    text-align: center;
}

.copyright {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 20px;
}

/* ─── Modal ─────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 40px;
    width: 320px;
    text-align: center;
    border-radius: 4px;
}

.modal h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.modal input[type="password"] {
    width: 100%;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: white;
    margin-bottom: 15px;
    outline: none;
}

.modal input:focus {
    border-color: #555;
}

/* ─── Toast ─────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: white;
    padding: 10px 25px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-error {
    background: var(--danger);
}

/* ─── Mobile ────────────────────────────────── */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }

    .logo {
        font-size: 16px;
    }

    .nav {
        gap: 10px;
    }

    .socials {
        gap: 10px;
    }

    .feed {
        padding: 30px 10px;
    }

    .post {
        margin-bottom: 50px;
        padding-bottom: 40px;
    }
}

/* ─── Lightbox ──────────────────────────────── */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.lightbox.show {
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 40px;
    cursor: pointer;
    z-index: 2001;
    line-height: 1;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: white;
}

.lightbox-media {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-media img,
.lightbox-media video {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 22px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox img,
.lightbox video {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 4px;
}