/* painttwits artist portfolio - minimalist style */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --black: #111;
    --white: #fafafa;
    --gray: #444;
    --light-gray: #ddd;
}

body {
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    line-height: 1.7;
    color: var(--black);
    background: var(--white);
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* typography */

h1 {
    font-size: 2rem;
    font-weight: normal;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

h2 {
    font-size: 1.1rem;
    font-weight: normal;
    text-transform: lowercase;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--black);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.location {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 0;
}

.empty {
    color: var(--gray);
}

.hint {
    font-size: 0.85rem;
    color: var(--gray);
    display: block;
}

/* navigation */

nav {
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--light-gray);
    border-bottom: 1px solid var(--light-gray);
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

nav a {
    color: var(--black);
}

/* sections */

.section {
    margin-bottom: 3rem;
    padding-top: 1rem;
}

/* artwork grid */

.artwork-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.artwork {
    cursor: pointer;
}

.artwork-frame {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 8px; /* space for dot that extends outside */
}

.artwork img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.2s;
}

.artwork:hover img {
    opacity: 0.9;
}

/* Status dot - positioned outside bottom-right of frame */
.status-dot {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 10;
}

.status-dot.status-available {
    background-color: #22c55e; /* green */
}

.status-dot.status-sold {
    background-color: #ef4444; /* red */
}

.status-dot.status-other {
    background-color: #f97316; /* orange */
}

/* Sprint 4: inline dot for the public visitor view of the gallery grid.
   Sits next to the artwork title — off the image, small, unobtrusive.
   Mirrors the central feed (.feed-status-dot) so collectors see the
   same visual vocabulary on subdomain and main site. */
.grid-status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-left: 0.4rem;
    vertical-align: 0.05em;
    border: 1px solid rgba(0,0,0,0.1);
}
.grid-status-dot.status-available { background-color: #22c55e; }
.grid-status-dot.status-sold      { background-color: #ef4444; }
.grid-status-dot.status-other     { background-color: #f97316; }

.artwork-info {
    padding: 0.5rem 0;
    font-size: 0.85rem;
}

.artwork-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.artwork-info .title {
    display: block;
}

.artwork-info .medium {
    color: var(--gray);
}

.artwork-subtitle {
    display: block;
    color: var(--gray);
    font-size: 0.75rem;
    margin-top: 2px;
}

.btn-delete {
    background: none;
    border: 1px solid var(--light-gray);
    color: var(--gray);
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}

.artwork:hover .btn-delete {
    opacity: 1;
}

.btn-delete:hover {
    color: #8B0000;
    border-color: #8B0000;
}

.artwork-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.artwork:hover .artwork-actions {
    opacity: 1;
}

.status-select {
    font-family: inherit;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--light-gray);
    background: var(--white);
    cursor: pointer;
}

.status-select:focus {
    outline: none;
    border-color: var(--gray);
}

/* Sprint 2.5c: dim the status dropdown when artwork is off-show.
   Artist can still flip status to mark intent, but the marketplace
   has no signal until the work is added to a published exhibit. */
.status-select-dim {
    opacity: 0.5;
    background: #fafafa;
}
.status-select-dim:hover,
.status-select-dim:focus {
    opacity: 0.9;
}
.status-offshow-hint {
    display: block;
    font-size: 0.7rem;
    color: #999;
    font-style: italic;
    margin-top: 2px;
}

/* dropzone */

.dropzone {
    border: 2px dashed var(--light-gray);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    margin: 1.5rem 0;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--gray);
}

.dropzone .hint {
    margin-top: 0.5rem;
}

/* footer */

footer {
    margin-top: 4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
    font-size: 0.85rem;
    color: var(--gray);
}

/* lightbox */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* responsive */

@media (max-width: 600px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .artwork-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    nav ul {
        gap: 1rem;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .artwork-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* upload progress */

.upload-progress {
    margin-top: 1rem;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--light-gray);
}

.upload-item .status {
    color: var(--gray);
}

.upload-item.success .status {
    color: #228B22;
}

.upload-item.error .status {
    color: #8B0000;
}

/* auth status */

.auth-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--gray);
}

.auth-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.btn-settings,
.btn-logout {
    color: var(--gray);
    border: 1px solid var(--light-gray);
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    transition: border-color 0.2s;
}

.btn-settings:hover,
.btn-logout:hover {
    border-color: var(--gray);
    text-decoration: none;
}

.btn-login-small {
    color: var(--gray);
    font-size: 0.85rem;
}

.btn-login-small:hover {
    color: var(--black);
}

/* error message */

.error-message {
    background: #fff0f0;
    border: 1px solid #ffcccc;
    color: #8B0000;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
}

/* login prompt */

.login-prompt {
    text-align: center;
    padding: 2rem;
    border: 1px solid var(--light-gray);
    margin: 1.5rem 0;
}

.login-prompt p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 280px;
    margin: 0 auto;
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
}

.btn-login:hover {
    opacity: 0.9;
    text-decoration: none;
}

.btn-login svg {
    flex-shrink: 0;
}

.btn-google {
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--light-gray);
}

.btn-google:hover {
    border-color: var(--gray);
}

/* Share button */
.btn-share {
    background: none;
    border: 1px solid var(--light-gray);
    color: var(--gray);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}

.artwork:hover .btn-share {
    opacity: 1;
}

.btn-share:hover {
    color: var(--black);
    border-color: var(--black);
}

/* On touch devices, always show share button since there's no hover */
@media (hover: none) {
    .btn-share {
        opacity: 1;
    }
}

/* Also make it bigger on mobile for easier tapping */
@media (max-width: 600px) {
    .btn-share {
        width: 36px;
        height: 36px;
        opacity: 1;
    }
}

/* Inline share menu - expands below artwork when share button clicked */
.share-inline {
    display: none;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    margin-top: 0.25rem;
    font-size: 0; /* Remove whitespace between inline elements */
}

.share-inline.active {
    display: flex;
}

.share-inline a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--light-gray);
    color: var(--gray);
    transition: color 0.2s, border-color 0.2s;
    font-size: 1rem; /* Reset font size */
}

.share-inline a:hover {
    color: var(--black);
    border-color: var(--black);
    text-decoration: none;
}

@media (max-width: 600px) {
    .auth-status {
        flex-wrap: wrap;
    }

    .login-buttons {
        max-width: 100%;
    }
}

/* Editable location (header) */
.editable-location {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    text-align: center;
    width: auto;
    min-width: 150px;
    transition: border-color 0.2s, background 0.2s;
}

.editable-location:hover {
    border-color: var(--light-gray);
    background: #fafafa;
}

.editable-location:focus {
    outline: none;
    border-color: var(--black);
    background: #fff;
}

/* Editable artwork titles */
.editable-title {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
}

.editable-title:hover {
    border-color: var(--light-gray);
    background: #fafafa;
}

.editable-title:focus {
    outline: none;
    border-color: var(--black);
    background: #fff;
}

/* Editable bio */
.editable-bio {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.editable-bio:focus {
    outline: none;
    border-color: var(--black);
}

.btn-save-bio {
    margin-top: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: var(--black);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-save-bio:hover {
    opacity: 0.8;
}

.btn-save-bio:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

/* System preference (when no data-theme is set) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --black: #e8e8e8;
        --white: #111;
        --gray: #aaa;
        --light-gray: #333;
    }
}

/* Explicit dark mode */
:root[data-theme="dark"] {
    --black: #e8e8e8;
    --white: #111;
    --gray: #aaa;
    --light-gray: #333;
}

/* Additional dark mode adjustments */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) img {
        opacity: 0.95;
    }
    
    :root:not([data-theme="light"]) .btn-login,
    :root:not([data-theme="light"]) .btn-save-bio {
        background: #222;
        border-color: #444;
    }
    
    :root:not([data-theme="light"]) .dropzone {
        background: #1a1a1a;
    }
    
    :root:not([data-theme="light"]) input,
    :root:not([data-theme="light"]) textarea {
        background: #1a1a1a;
        color: #e8e8e8;
        border-color: #333;
    }
}

[data-theme="dark"] img {
    opacity: 0.95;
}

[data-theme="dark"] .btn-login,
[data-theme="dark"] .btn-save-bio {
    background: #222;
    border-color: #444;
}

[data-theme="dark"] .dropzone {
    background: #1a1a1a;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea {
    background: #1a1a1a;
    color: #e8e8e8;
    border-color: #333;
}

/* Theme toggle button styling */
.theme-btn {
    background: none;
    border: 1px solid var(--light-gray);
    color: var(--gray);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.theme-btn:hover {
    border-color: var(--gray);
    color: var(--black);
}

/* ============================================
   EXHIBITS
   ============================================ */

.exhibit-group-label {
    font-size: 0.85rem;
    font-weight: normal;
    text-transform: lowercase;
    color: var(--gray);
    margin: 1.5rem 0 0.75rem;
    letter-spacing: 0.05em;
}

.exhibit-group-label:first-of-type {
    margin-top: 0.5rem;
}

.exhibits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.exhibit-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--light-gray);
    transition: border-color 0.2s, transform 0.2s;
}

.exhibit-card:hover {
    border-color: var(--gray);
    transform: translateY(-2px);
    text-decoration: none;
}

.exhibit-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.exhibit-card-empty {
    width: 100%;
    height: 160px;
    background: var(--light-gray);
}

.exhibit-card-info {
    padding: 0.75rem;
}

.exhibit-card-title {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.exhibit-card-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--gray);
}

@media (max-width: 600px) {
    .exhibits-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    .exhibit-card img {
        height: 120px;
    }
}
