/* =========================================================
   components.css — ekphra global UI components
   Loaded via navbar.php on every page
   Add shared UI patterns here (modals, toasts, tooltips...)
========================================================= */

/* =========================================================
   MODAL SYSTEM
========================================================= */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
}
.overlay.active { display: block; }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
}
.modal.active { display: flex; }

.modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 44px 40px 36px;
    box-shadow: 0 20px 80px rgba(0,0,0,0.22);
    position: relative;
    width: min(92vw, 520px);
    max-height: 88vh;
    overflow-y: auto;
}

.modal-large {
    width: min(94vw, 900px);
}
.modal-large .modal-box {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    padding: 30px;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #bbb;
    padding: 4px;
    line-height: 1;
}
.modal-close:hover { color: var(--black); }

.modal-eyebrow {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--teal);
    text-align: center;
    margin-bottom: 10px;
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 400;
    color: var(--gray-dark);
    text-align: center;
    margin-bottom: 0;
    line-height: 1.2;
}
.modal-title em {
    font-style: italic;
    color: var(--teal);
}

.modal-divider {
    border: none;
    border-top: 0.5px solid var(--border);
    margin: 20px 0 24px;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-label {
    display: block;
    font-family: var(--font-sans);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 6px;
}

.modal-input {
    width: 100%;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    font-size: 15px;
    font-family: var(--font-sans);
    color: var(--black);
    background: transparent;
    outline: none;
    transition: border-color 0.2s;
    display: block;
}
.modal-input:focus { border-bottom-color: var(--teal); }
.modal-input::placeholder { color: #ccc; font-size: 15px; }

.modal-textarea {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--black);
    background: transparent;
    outline: none;
    height: 150px;
    resize: vertical;
    transition: border-color 0.2s;
}
.modal-textarea:focus { border-bottom-color: var(--teal); }

.modal-eye-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    padding: 0;
    line-height: 1;
}
.modal-eye-btn:hover { color: #888; }

.modal-forgot {
    display: block;
    text-align: right;
    font-size: 11px;
    color: var(--teal);
    cursor: pointer;
    margin-top: -10px;
    margin-bottom: 22px;
    text-decoration: none;
}
.modal-forgot:hover { color: var(--teal-dark); }

.modal-resend {
    font-size: 11px;
    color: var(--teal);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn-modal-primary {
    width: 100%;
    background: var(--teal);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 14px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 8px;
    margin-bottom: 4px;
    transition: background 0.18s;
    display: block;
}
.btn-modal-primary:hover { background: var(--teal-dark); }

.btn-modal-teal {
    width: 100%;
    background: var(--teal);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 13px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s;
    display: block;
}
.btn-modal-teal:hover { background: var(--teal-dark); }

.btn-modal-outline {
    width: 100%;
    background: transparent;
    color: var(--gray-mid);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 13px;
    font-family: var(--font-sans);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s;
    display: block;
}
.btn-modal-outline:hover { border-color: #aaa; color: var(--gray-dark); }

.modal-section {
    border: 0.5px solid var(--border);
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 12px;
}
.modal-section--accent {
    border-left: 2px solid var(--teal);
}
.modal-section-tag {
    display: block;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 6px;
}
.modal-section:not(.modal-section--accent) .modal-section-tag {
    color: #bbb;
}
.modal-section-title {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 400;
    color: var(--gray-dark);
    margin-bottom: 6px;
}
.modal-section-desc {
    font-size: 13px;
    color: var(--gray-mid);
    line-height: 1.7;
    margin-bottom: 14px;
}
.modal-section-desc strong { color: var(--gray-dark); }

.modal-check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}
.modal-check-row input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    cursor: pointer;
}
.modal-check-row label {
    font-size: 11px;
    color: #aaa;
    line-height: 1.6;
    cursor: pointer;
}
.modal-check-row label a {
    color: var(--teal);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.modal-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: #aaa;
}
.modal-switch a {
    color: var(--gray-dark);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.error-msg {
    background: #fff0f0;
    color: #c0392b;
    padding: 10px 14px;
    border-left: 2px solid #c0392b;
    border-radius: 0 4px 4px 0;
    font-size: 0.85em;
    margin-bottom: 16px;
    display: none;
}
.success-msg {
    background: var(--teal-light);
    color: var(--teal-dark);
    padding: 10px 14px;
    border-left: 2px solid var(--teal);
    border-radius: 0 4px 4px 0;
    font-size: 0.85em;
    margin-bottom: 16px;
    display: none;
}
/* =========================================================
   MODAL SYSTEM — Mobile
========================================================= */
@media (max-width: 768px) {
    .modal {
        align-items: flex-end;
        padding: 0;
        backdrop-filter: none;
    }
    .modal-box {
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        padding: 32px 24px 28px;
        max-height: 92vh;
    }
    .modal-large {
        width: 100vw;
        height: 100vh;
    }
    .modal-large .modal-box {
        height: 100%;
        border-radius: 0;
        max-height: 100%;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }
}

/* =========================================================
   EKPHRA-EXPAND — reusable collapse/expand component
   Used for: artist statement, bio, philosophy description,
   guestbook replies. See app.js for the toggle logic.
========================================================= */
.ekphra-expand-wrap {
    margin-bottom: 4px;
}
.ekphra-expand-header {
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    text-align: left;
}
.ekphra-expand-chevron {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: #bbb;
    transition: color 0.15s, transform 0.3s ease;
}
.ekphra-expand-header:hover .ekphra-expand-chevron {
    color: #1a2e2c;
}
.ekphra-expand-header.is-open .ekphra-expand-chevron {
    transform: rotate(180deg);
}
.ekphra-expand-header[hidden] {
    display: none;
}
.ekphra-expand {
    position: relative;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.ekphra-expand-content {
    line-height: 1.75;
    font-size: 0.92em;
    color: var(--gray-dark, #333);
    white-space: pre-wrap;
    word-break: break-word;
    padding-top: 10px;
}
.ekphra-expand-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.ekphra-expand-wrap.is-open .ekphra-expand-fade {
    opacity: 0;
}

/* =========================================================
   ARTIST ABOUT TAB — statement/bio/philosophy sections
   and guestbook with single-level artist reply
========================================================= */
.artist-about-section {
    margin-bottom: 32px;
    max-width: 640px;
}
.ekphra-about-label { font-size: 0.85em; 
    letter-spacing: 1.5px; 
    text-transform: uppercase; 
    color: #888; margin-bottom: 10px; 
    font-family: var(--font-sans); 
    font-weight: 600; }
.ekphra-philosophy-name {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.15em;
    color: var(--teal-dark, #3da8a0);
    margin-bottom: 10px;
    line-height: 1.3;
}
.artist-about-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

/* Guestbook */
.ag-wrap {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #ebebeb;
    padding-bottom: 60px;
    max-width: 640px;
}
.ag-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
}
.ag-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f5;
}
.ag-item:last-child {
    border-bottom: none;
}
.ag-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gray-light, #f5f5f5);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ag-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ag-body {
    flex: 1;
    min-width: 0;
}
.ag-name {
    font-size: 0.8em;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}
.ag-msg {
    font-size: 0.87em;
    color: #333;
    line-height: 1.65;
    word-break: break-word;
    white-space: pre-wrap;
}
.ag-foot {
    font-size: 0.7em;
    color: #bbb;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ag-del-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 0.9em;
    padding: 0;
    transition: color 0.15s;
}
.ag-del-btn:hover {
    color: #e74c3c;
}

/* Artist reply — indented, tinted to signal "this is the artist" */
.ag-reply {
    margin-top: 12px;
    margin-left: 20px;
    padding: 10px 14px;
    background: var(--teal-light, #e8f8f7);
    border-left: 2px solid var(--teal, #5bc8c0);
    border-radius: 2px;
}
.ag-reply-name {
    font-size: 0.78em;
    font-weight: 600;
    color: var(--teal-dark, #3da8a0);
    margin-bottom: 3px;
}

/* Reply toggle + inline form (artist only) */
.ag-reply-toggle {
    background: none;
    border: none;
    color: #bbb;
    font-size: 0.75em;
    cursor: pointer;
    padding: 4px 0 0;
    font-family: var(--font-sans);
    transition: color 0.15s;
}
.ag-reply-toggle:hover {
    color: var(--teal-dark, #3da8a0);
}
.ag-reply-form {
    display: none;
    margin-top: 10px;
    margin-left: 20px;
}
.ag-reply-form.open {
    display: block;
}
.ag-reply-textarea {
    width: 100%;
    border: 1px solid #e8e8e8;
    border-radius: 2px;
    padding: 8px 11px;
    font-size: 0.84em;
    font-family: var(--font-sans);
    color: #333;
    resize: none;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.ag-reply-textarea:focus {
    border-color: var(--teal, #5bc8c0);
}
.ag-reply-send {
    background: var(--teal, #5bc8c0);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.78em;
    font-family: var(--font-sans);
    transition: opacity 0.2s;
}
.ag-reply-send:hover {
    opacity: 0.85;
}
.ag-reply-cancel {
    background: none;
    border: 1px solid #e8e8e8;
    color: #aaa;
    padding: 6px 14px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.78em;
    font-family: var(--font-sans);
}

/* New question compose */
.ag-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.ag-textarea {
    flex: 1;
    border: 1px solid #e8e8e8;
    border-radius: 2px;
    padding: 10px 13px;
    font-size: 0.87em;
    font-family: var(--font-sans);
    color: #333;
    resize: none;
    min-height: 56px;
    outline: none;
    transition: border-color 0.2s;
    line-height: 1.5;
    box-sizing: border-box;
}
.ag-textarea:focus {
    border-color: var(--teal, #5bc8c0);
}
.ag-submit {
    background: var(--teal, #5bc8c0);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 500;
    font-family: var(--font-sans);
    white-space: nowrap;
    align-self: flex-end;
    transition: opacity 0.2s;
}
.ag-submit:hover {
    opacity: 0.83;
}
.ag-empty {
    font-size: 0.84em;
    color: #ccc;
    font-style: italic;
    padding: 8px 0 16px;
}
.ag-login-hint {
    font-size: 0.84em;
    color: #888;
    font-style: italic;
    padding: 12px 0;
}
.ag-login-hint a {
    color: var(--teal, #5bc8c0);
    text-decoration: none;
}

.ekphra-dropzone {
    transition: background-color 0.15s, border-color 0.15s;
}
.ekphra-dropzone.is-dragover {
    background-color: var(--teal-light, #e8f8f7);
    outline: 2px dashed var(--teal, #5bc8c0);
    outline-offset: -2px;
}

/* ── Global Lightbox (2026-08-06) ──
   Shared by admin.php, artists.php, board_post.php, ekphrasis.php,
   shop_item.php. Caption is optional — pages that don't use it simply
   never populate #lightboxCaption, and an empty <span> renders nothing. */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    opacity: 0.7;
    padding: 0;
    cursor: pointer;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 2px;
    display: block;
}
.lightbox-caption {
    position: absolute;
    bottom: 24px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85em;
    font-style: italic;
}

/* Disable mobile tap-highlight flash on lightbox trigger images —
   purely cosmetic default, no functional purpose here */
.artist-thumb img,
.gallery-thumb img {
    -webkit-tap-highlight-color: transparent;
}

/* Generic spinner rotation — reusable for any loading-state button/icon. */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   Like count + Likers modal — shared by Wall & Ekphrasis
   ===================================================== */
.like-with-count {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 0.5px solid var(--border);
    padding: 6px 14px;
    border-radius: 2px;
    gap: 6px;
    color: #888;
    font-size: 0.78em;
    font-family: var(--font-sans);
}
.like-with-count .btn-like,
.like-with-count .ekphrasis-btn-like {
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
}
.like-with-count .btn-like:hover,
.like-with-count .btn-like.liked,
.like-with-count .ekphrasis-btn-like:hover,
.like-with-count .ekphrasis-btn-like.liked { color: #C9A99A; }
.like-count-clickable {
    cursor: pointer;
    padding: 2px 4px;
    margin: -2px -4px;
}
.like-count-clickable:hover { color: #C9A99A; text-decoration: underline; }

.likers-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}
.likers-modal-box {
    background: #fff;
    border-radius: 4px;
    max-width: 360px; width: 90%;
    max-height: 70vh;
    padding: 24px;
    position: relative;
    overflow-y: auto;
}
.likers-modal-close {
    position: absolute; top: 12px; right: 16px;
    background: none; border: none; font-size: 1.4em;
    cursor: pointer; color: #888;
}
.likers-modal-title {
    font-family: var(--font-serif, serif);
    font-size: 1.1em;
    margin-bottom: 16px;
}
.likers-modal-list { display: flex; flex-direction: column; gap: 12px; }
.likers-modal-row {
    display: flex; align-items: center; gap: 10px;
    color: inherit; text-decoration: none;
}
.likers-modal-row:hover { color: #C9A99A; }
.likers-modal-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    object-fit: cover; background: #eee;
}
.likers-modal-empty {
    text-align: center; color: #aaa; font-style: italic; padding: 20px 0;
}