/* =========================================================================
   ART PORTFOLIO — stylesheet
   Order matters: every responsive override lives at the BOTTOM of this file.
   ========================================================================= */

:root {
    --bg: #ffffff;
    --text-main: #18181b;
    --text-muted: #71717a;
    --border: #e4e4e7;
    --accent: #09090b;
    --card-bg: #fafafa;
    --danger: #ef4444;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: "Georgia", "Times New Roman", serif;
    --transition: all 0.25s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}
img { max-width: 100%; }

.container { width: 90%; max-width: 1100px; margin: 0 auto; padding: 3rem 0; flex: 1; }

/* Keyboard users get a visible focus ring; mouse users don't. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 999;
    background: var(--accent); color: #fff; padding: 0.75rem 1.25rem; font-size: 0.85rem;
}
.skip-link:focus { left: 0; }

/* ---------- Header & navigation ---------- */
header {
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 50;
}
.header-wrap { width: 90%; max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; text-decoration: none; color: var(--text-main); }
nav ul { display: flex; list-style: none; align-items: center; gap: 2rem; }
nav a { text-decoration: none; color: var(--text-muted); font-size: 0.9rem; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 500; transition: var(--transition); display: inline-flex; align-items: center; cursor: pointer; }
nav a:hover, nav a.active { color: var(--text-main); }
.icon-link { display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); transition: var(--transition); }
.icon-link:hover { color: var(--text-main); }
.icon-link svg { width: 19px; height: 19px; fill: currentColor; }

.mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px 5px; flex-direction: column; gap: 5px; }
.mobile-toggle span { display: block; width: 22px; height: 2px; background-color: var(--text-main); transition: transform 0.25s ease, opacity 0.2s ease; }
.mobile-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Section visibility ---------- */
.page-section { display: none; animation: fadeIn 0.3s ease; }
.page-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Typography ---------- */
.section-header { margin-bottom: 2rem; text-align: center; }
.section-header h1 { font-family: var(--font-heading); font-size: 2.25rem; font-weight: 400; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
.section-header p { color: var(--text-muted); font-size: 0.95rem; max-width: 500px; margin: 0 auto; }

.empty-note { color: var(--text-muted); font-size: 0.9rem; font-style: italic; padding: 1rem 0; }
.empty-note.center { text-align: center; padding: 3rem 0; }

.flash { padding: 1rem; margin-bottom: 1.25rem; font-weight: 600; font-size: 0.9rem; border-left: 4px solid; }
.flash.ok  { background: #dcfce7; color: #166534; border-color: #166534; }
.flash.bad { background: #fee2e2; color: #b91c1c; border-color: #b91c1c; }

/* ---------- Home intro ---------- */
.home-bio-quote { display: grid; grid-template-columns: 200px 1fr; gap: 3rem; align-items: center; padding: 2.5rem 0; margin-bottom: 3.5rem; border-bottom: 1px solid var(--border); }
.home-bio-quote.no-portrait { grid-template-columns: 1fr; }
.bio-portrait-placeholder { width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; background: linear-gradient(135deg, #f4f4f5 0%, #d4d4d8 100%); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.8rem; text-align: center; overflow: hidden; flex-shrink: 0; }
.bio-portrait-placeholder img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.bio-quote-content blockquote { font-family: var(--font-heading); font-size: 1.4rem; line-height: 1.5; font-style: italic; margin-bottom: 1rem; }
.bio-quote-content .description-content p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1rem; }
.bio-read-more { display: inline-block; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-main); text-decoration: none; border-bottom: 1px solid var(--text-main); padding-bottom: 2px; transition: var(--transition); }
.bio-read-more:hover { color: var(--text-muted); border-color: var(--text-muted); }

/* ---------- Category filter ---------- */
.category-filter { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2rem; }
.filter-wrap { position: relative; display: inline-flex; }
.filter-delete { position: absolute; top: -9px; right: -9px; }
.filter-btn { background: transparent; border: 1px solid var(--border); padding: 0.55rem 1.15rem; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.filter-btn.active { background-color: var(--accent); color: #ffffff; border-color: var(--accent); }

/* ---------- Gallery ---------- */
.gallery-category-group { margin-bottom: 3.5rem; }
.gallery-category-group:last-child { margin-bottom: 0; }
.category-title-bar { display: flex; align-items: baseline; gap: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.category-title-bar h2 { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 400; }
.category-title-bar span { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

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

.show-more-btn { display: block; width: 100%; max-width: 400px; margin: 2rem auto 0; padding: 1rem; background: transparent; border: 1px solid var(--border); text-align: center; text-transform: uppercase; font-weight: 600; letter-spacing: 0.1em; cursor: pointer; transition: var(--transition); color: var(--text-muted); }
.show-more-btn:hover { background: var(--card-bg); color: var(--text-main); }
.back-btn { background: transparent; border: none; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; cursor: pointer; color: var(--text-muted); display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 2rem; transition: var(--transition); letter-spacing: 0.05em; padding: 0.5rem 0; }
.back-btn:hover { color: var(--text-main); }

/* ---------- Artwork cards ---------- */
.artwork-card { background-color: var(--card-bg); border: 1px solid var(--border); overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; position: relative; display: flex; flex-direction: column; }
.artwork-card.unavailable { border: 2px solid var(--danger); }
.artwork-open { flex: 1; display: flex; flex-direction: column; cursor: pointer; }

.image-wrapper { position: relative; overflow: hidden; background: #f4f4f5; aspect-ratio: 4 / 5; display: flex; align-items: center; justify-content: center; }
.image-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease, opacity 0.4s ease; pointer-events: none; opacity: 0; }
.image-wrapper img.loaded { opacity: 1; }
.artwork-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, #f4f4f5 0%, #e4e4e7 100%); display: flex; align-items: center; justify-content: center; color: #a1a1aa; font-size: 0.9rem; letter-spacing: 0.05em; text-align: center; padding: 1rem; transition: transform 0.4s ease; }
.artwork-placeholder.tall { min-height: 400px; position: relative; }

.badge-unavailable { position: absolute; top: 12px; left: 12px; background: var(--danger); color: #fff; padding: 4px 10px; font-size: 0.7rem; font-weight: 700; border-radius: 4px; text-transform: uppercase; z-index: 15; box-shadow: 0 2px 5px rgba(0,0,0,0.2); letter-spacing: 0.05em; }
.image-count { position: absolute; bottom: 10px; right: 10px; z-index: 15; background: rgba(9,9,11,0.7); color: #fff; font-size: 0.7rem; font-weight: 700; min-width: 22px; height: 22px; border-radius: 11px; display: flex; align-items: center; justify-content: center; padding: 0 7px; backdrop-filter: blur(4px); }

.hover-overlay { position: absolute; inset: 0; background: rgba(9, 9, 11, 0.4); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.25s ease; z-index: 10; pointer-events: none; }
.hover-badge { background: #fff; color: var(--accent); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.6rem 1rem; border-radius: 20px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); }

.artwork-meta { padding: 1rem 1.25rem; background: #fff; display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; border-top: 1px solid var(--border); flex: 1; pointer-events: none; }
.artwork-meta h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.2rem; }
.artwork-meta p { font-size: 0.85rem; color: var(--text-muted); }
.artwork-meta .price-tag { font-size: 0.95rem; font-weight: 600; white-space: nowrap; }
.artwork-meta .price-tag.muted { color: var(--danger); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.artwork-meta .hint-icon { color: var(--text-muted); font-size: 1.1rem; transition: transform 0.2s ease, color 0.2s ease; }

/* Hover effects only where hovering is actually possible. On a phone these
   used to stick after a tap. */
@media (hover: hover) and (pointer: fine) {
    .artwork-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.12); }
    .artwork-card:hover .hover-overlay { opacity: 1; }
    .artwork-card:hover .artwork-placeholder,
    .artwork-card:hover .image-wrapper img.loaded { transform: scale(1.03); }
    .artwork-card.unavailable:hover { border-color: #dc2626; box-shadow: 0 12px 24px -10px rgba(239, 68, 68, 0.3); }
    .artwork-card:hover .artwork-meta .hint-icon { transform: translateX(3px); color: var(--accent); }
    .filter-btn:hover { background-color: var(--accent); color: #ffffff; border-color: var(--accent); }
}

/* ---------- Instagram embed ---------- */
.instagram-section { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--border); text-align: center; }
.instagram-section h2 { font-family: var(--font-heading); font-size: 2rem; font-weight: 400; margin-bottom: 0.5rem; }
.instagram-section p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 2rem; }
.instagram-embed-container { width: 100%; overflow: hidden; border-radius: 8px; }

/* ---------- Shared buttons ---------- */
.submit-btn { background-color: var(--accent); color: #fff; border: 1px solid var(--accent); padding: 1rem 1.75rem; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; cursor: pointer; transition: var(--transition); display: block; width: 100%; }
.submit-btn:hover { background-color: #27272a; border-color: #27272a; }
.secondary-btn { background: transparent; border: 1px solid var(--border); color: var(--text-main); padding: 1rem 1.75rem; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; cursor: pointer; transition: var(--transition); display: block; text-align: center; width: 100%; margin-top: 0.75rem; }
.secondary-btn:hover { border-color: var(--text-main); }

/* ---------- About ---------- */
.about-layout { display: grid; grid-template-columns: 1fr 1.25fr; gap: 3.5rem; align-items: start; }
.about-portrait-placeholder {
    width: 100%; max-width: 100%; min-width: 0;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #f4f4f5 0%, #d4d4d8 100%);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.95rem;
    overflow: hidden; border-radius: 4px;
}
.about-portrait-placeholder img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.about-text h2 { font-family: var(--font-heading); font-size: 2rem; font-weight: 400; margin-bottom: 1.25rem; }
.about-text .description-content p { color: #3f3f46; margin-bottom: 1.25rem; font-size: 0.95rem; max-width: 68ch; }
.about-text .description-content p:first-child { font-size: 1.1rem; color: var(--text-main); }
.about-actions { margin-top: 1.75rem; }

.resume-btn { background-color: transparent; color: var(--text-main); border: 1px solid var(--text-main); padding: 0.85rem 1.5rem; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; gap: 0.5rem; }
.resume-btn:hover { background-color: var(--accent); color: #fff; }
.resume-container { display: none; margin-top: 2rem; padding: 2rem; background: var(--card-bg); border: 1px solid var(--border); animation: fadeIn 0.3s ease; }
.resume-container.open { display: block; }
.resume-header { border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; }
.resume-header h3 { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 400; }
.resume-updated { font-size: 0.85rem; color: var(--text-muted); }
.resume-section { margin-bottom: 1.5rem; }
.resume-section:last-child { margin-bottom: 0; }
.resume-section h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.6rem; }
.resume-list { list-style: none; }
.resume-list li { font-size: 0.9rem; margin-bottom: 0.5rem; display: flex; justify-content: space-between; gap: 1rem; }
.resume-list li span.year { color: var(--text-muted); font-size: 0.85rem; flex-shrink: 0; }

/* ---------- Contact ---------- */
.contact-box { max-width: 550px; margin: 0 auto; }
.contact-form { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 2rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input, .form-group textarea { padding: 0.85rem; border: 1px solid var(--border); background-color: #fafafa; font-family: inherit; font-size: 1rem; border-radius: 0; outline: none; transition: var(--transition); }
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); background-color: #fff; }
/* Honeypot: invisible to people, tempting to bots. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 2rem 0; margin-top: auto; background-color: #fff; }
.footer-wrap { width: 90%; max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Quick-view modal ---------- */
.modal { display: none; position: fixed; inset: 0; background-color: rgba(9, 9, 11, 0.85); backdrop-filter: blur(4px); z-index: 1000; justify-content: center; align-items: center; padding: 1.5rem; }
.modal.active { display: flex; animation: modalFadeIn 0.2s ease; }
@keyframes modalFadeIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

.modal-box { background: #fff; max-width: 900px; width: 100%; height: 80vh; max-height: 600px; position: relative; display: grid; grid-template-columns: 1.2fr 1fr; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); overflow: hidden; }
.modal-image-col { background: #e4e4e7; position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.modal-info-col { padding: 3rem 2.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; position: relative; overflow-y: auto; }
/* The action buttons stay pinned to the bottom of the info panel, so a long
   description scrolls behind them instead of pushing them out of reach.
   The negative margins let the bar bleed to the panel edges. */
.modal-actions {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #fff;
    margin: auto -2.5rem -3rem;
    padding: 1rem 2.5rem 3rem;
}
.modal-info-col.has-more .modal-actions { border-top: 1px solid var(--border); }

/* Fade + chevron: only drawn while there is more text above the fold. */
.modal-info-col.has-more .modal-actions::before {
    content: '';
    position: absolute; left: 0; right: 0; bottom: 100%; height: 48px;
    background: linear-gradient(to top, #fff 15%, rgba(255,255,255,0));
    pointer-events: none;
}
.scroll-cue { display: none; }
.modal-info-col.has-more .scroll-cue {
    display: block;
    position: absolute; left: 50%; bottom: 100%;
    width: 11px; height: 11px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    pointer-events: none;
    animation: scrollCue 1.6s ease-in-out infinite;
}
@keyframes scrollCue {
    0%, 100% { transform: translate(-50%, -16px) rotate(45deg); }
    50%      { transform: translate(-50%, -8px)  rotate(45deg); }
}

.modal-close-btn { position: absolute; top: 1.25rem; right: 1.25rem; background: transparent; border: none; font-size: 1.75rem; font-weight: 300; cursor: pointer; color: var(--text-muted); z-index: 50; transition: var(--transition); line-height: 1; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.modal-close-btn:hover { color: var(--text-main); }

.carousel-container { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.carousel-img { position: absolute !important; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; padding: 1.5rem; display: none !important; margin: auto; }
.carousel-img.active { display: block !important; z-index: 10; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.9); border: 1px solid var(--border); font-size: 1.2rem; cursor: pointer; border-radius: 50%; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.15); z-index: 20; color: var(--text-main); transition: var(--transition); }
.carousel-btn:hover { background: var(--text-main); color: #fff; }
.carousel-btn.prev { left: 1rem; }
.carousel-btn.next { right: 1rem; }
.carousel-indicator { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); background: rgba(9, 9, 11, 0.75); color: #fff; padding: 4px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; z-index: 20; pointer-events: none; backdrop-filter: blur(4px); }

.modal-art-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #a1a1aa; font-size: 0.85rem; letter-spacing: 0.05em; padding: 2rem; text-align: center; }

.modal-header h2 { font-family: var(--font-heading); font-size: 2.2rem; font-weight: 400; margin-bottom: 0.25rem; line-height: 1.2; }
.modal-subtitle { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 2rem; }
.modal-specs { margin-bottom: 2rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1.25rem 0; }
.spec-item { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: 0.9rem; margin-bottom: 0.6rem; }
.spec-item:last-child { margin-bottom: 0; }
.spec-item .label { color: var(--text-muted); text-transform: uppercase; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; flex-shrink: 0; }
.spec-strong { font-weight: 600; text-align: right; }
.spec-strong.is-unavailable { color: var(--danger); }
.modal-desc { font-size: 0.95rem; color: #3f3f46; line-height: 1.6; margin-bottom: 2rem; }
/* No dimensions, price or status to show: keep one rule, drop the empty frame. */
.modal-specs.is-empty { border-bottom: none; padding: 0; margin-bottom: 1.75rem; }

/* ---------- Inline admin ---------- */
.admin-bar { background: #18181b; color: #fafafa; font-size: 0.8rem; padding: 0.5rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.admin-bar-link { background: none; border: none; color: #fde047; font: inherit; cursor: pointer; text-decoration: underline; padding: 0 0.4rem; }
.admin-bar-link.danger { color: #fca5a5; }

.admin-edit-btn { background: #eab308; color: #000; border: none; padding: 5px 10px; font-size: 0.75rem; font-weight: 700; cursor: pointer; border-radius: 4px; z-index: 40; position: absolute; top: 10px; right: 10px; text-transform: uppercase; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.admin-edit-btn:hover { background: #ca8a04; }
.admin-inline-btn { position: static; }
.admin-inline-btn.blue { background: #3b82f6; color: #fff; }
.admin-add-btn { background: #22c55e; color: #fff; border: none; padding: 0.55rem 0.9rem; font-size: 0.75rem; font-weight: 700; cursor: pointer; border-radius: 4px; text-transform: uppercase; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.admin-add-btn.blue { background: #3b82f6; }
.admin-add-btn.top-left { position: absolute; top: 10px; left: 10px; }
.admin-move-btn { background: #f4f4f5; color: #18181b; border: 1px solid #ccc; padding: 4px 8px; font-size: 0.8rem; font-weight: 700; cursor: pointer; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.admin-move-btn:hover { background: #e4e4e7; }
.admin-delete-btn { background: var(--danger); color: #fff; border: none; padding: 5px 10px; font-size: 0.75rem; font-weight: 700; cursor: pointer; border-radius: 4px; text-transform: uppercase; }
.admin-delete-btn.tiny { padding: 1px 6px; font-size: 0.7rem; line-height: 1.4; }
.admin-card-tools { position: absolute; top: 10px; right: 10px; z-index: 30; display: flex; gap: 5px; align-items: flex-start; }
.admin-card-tools form { display: inline; }
.admin-wrap { position: relative; border: 2px dashed transparent; transition: border-color 0.3s ease; }
.admin-wrap:hover { border-color: #eab308; }
.admin-wrap.padded { padding: 10px; }

.admin-sortable .artwork-card { cursor: grab; }
.admin-sortable .artwork-card:active { cursor: grabbing; }
.artwork-card.dragging { opacity: 0.4; transform: scale(0.95); border: 2px dashed var(--accent); box-shadow: none; }
.drag-instructions { text-align: center; color: #3f3f46; background: #f1f5f9; padding: 0.75rem; border-radius: 4px; margin-bottom: 2rem; font-size: 0.85rem; font-weight: 600; border: 1px solid var(--border); }

/* Admin modal forms */
.admin-form-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2000; justify-content: center; align-items: flex-start; padding: 2rem 1rem; overflow-y: auto; }
.admin-form-modal.active { display: flex; }
.admin-form-box { background: #fff; padding: 2rem; max-width: 520px; width: 100%; border-radius: 8px; margin: auto; }
.admin-form-box h3 { margin-bottom: 1rem; border-bottom: 1px solid #eee; padding-bottom: 0.5rem; }
.admin-form-box h4 { margin-top: 1.5rem; }
.admin-form-box label { display: block; font-size: 0.8rem; font-weight: 700; margin-top: 1rem; margin-bottom: 0.3rem; text-transform: uppercase; }
.admin-form-box label.check { text-transform: none; font-weight: 500; font-size: 0.9rem; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.admin-form-box label.check.danger { color: var(--danger); }
.admin-form-box input[type="text"], .admin-form-box input[type="email"], .admin-form-box input[type="number"],
.admin-form-box input[type="password"], .admin-form-box input[type="file"], .admin-form-box textarea,
.admin-form-box select { width: 100%; padding: 0.6rem; border: 1px solid #ccc; font-family: inherit; font-size: 1rem; }
.admin-form-box button[type="submit"] { background: var(--accent); color: #fff; padding: 0.85rem; border: none; width: 100%; margin-top: 1.5rem; cursor: pointer; font-weight: 700; text-transform: uppercase; }
.admin-form-box button.cancel-btn { background: transparent; color: var(--text-muted); border: 1px solid #ccc; padding: 0.85rem; width: 100%; margin-top: 0.5rem; cursor: pointer; font-weight: 700; text-transform: uppercase; }
.field-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; }
.field-row { display: flex; gap: 0.75rem; }
.field-row > div { flex: 1; min-width: 0; }
.check-row { display: flex; align-items: center; margin-top: 0.6rem; }

.cv-admin-list { list-style: none; margin-bottom: 1rem; }
.cv-admin-list li { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; font-size: 0.85rem; background: #f4f4f5; padding: 0.5rem; }

/* Image manager inside the artwork form */
.img-thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.6rem; margin-top: 0.4rem; }
.img-thumb { position: relative; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: #f4f4f5; }
.img-thumb img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.thumb-del { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(239,68,68,0.92); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.thumb-tag { display: block; width: 100%; border: none; border-top: 1px solid var(--border); background: #fff; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 2px; cursor: pointer; }
.thumb-tag.is-cover { background: var(--accent); color: #fff; cursor: default; }

/* ---------- Full-resolution lightbox ---------- */
.carousel-img { cursor: zoom-in; }

.lightbox { display: none; position: fixed; inset: 0; z-index: 1500; background: #0a0a0b; flex-direction: column; }
.lightbox.active { display: flex; }

.lightbox-bar {
    flex-shrink: 0; display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; padding: 0.65rem 1rem; color: #d4d4d8; font-size: 0.8rem;
    background: rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.08);
}
.lightbox-meta { display: flex; align-items: baseline; gap: 0.9rem; min-width: 0; }
.lightbox-title { color: #fafafa; font-family: var(--font-heading); font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox-numbers { display: flex; gap: 0.9rem; letter-spacing: 0.08em; flex-shrink: 0; }
.lightbox-tools { display: flex; align-items: center; gap: 0.5rem; }
.lightbox-tools button,
.lightbox-tools a {
    background: transparent; border: 1px solid rgba(255,255,255,0.25); color: #e4e4e7;
    font: inherit; text-decoration: none; padding: 0.35rem 0.8rem; border-radius: 3px;
    cursor: pointer; letter-spacing: 0.05em; transition: var(--transition);
}
.lightbox-tools button:hover:not(:disabled),
.lightbox-tools a:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.5); }
.lightbox-tools button:disabled { opacity: 0.35; cursor: default; }
.lightbox-close { font-size: 1.35rem !important; line-height: 1; padding: 0.1rem 0.6rem !important; }

/* Fit mode centres the image; zoom mode lets the stage scroll around it. */
.lightbox-stage {
    flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding: 1rem;
}
.lightbox-stage.zoomed { overflow: auto; display: block; padding: 0; cursor: grab; -webkit-overflow-scrolling: touch; }
.lightbox-stage.zoomed:active { cursor: grabbing; }

.lightbox-stage img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.lightbox-stage img.zoomed {
    max-width: none; max-height: none;
    width: auto; height: auto;          /* true 1:1 pixels */
    margin: auto; cursor: zoom-out;
}

.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 46px; height: 46px; border-radius: 50%;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
    color: #fff; font-size: 1.3rem; cursor: pointer; z-index: 5;
    display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.28); }
.lightbox-nav.prev { left: 1.25rem; }
.lightbox-nav.next { right: 1.25rem; }
.lightbox.is-zoomed .lightbox-nav,
.lightbox.grid-mode .lightbox-nav { display: none !important; }

/* Thumbnail strip: jump between images without leaving the viewer. */
.lightbox-strip {
    flex-shrink: 0; display: none; gap: 0.5rem; padding: 0.6rem 0.75rem;
    overflow-x: auto; justify-content: center;
    background: rgba(255,255,255,0.04); border-top: 1px solid rgba(255,255,255,0.08);
    -webkit-overflow-scrolling: touch;
}
.lightbox.is-zoomed .lightbox-strip,
.lightbox.grid-mode .lightbox-strip { display: none !important; }
.strip-thumb { flex-shrink: 0; width: 58px; height: 58px; padding: 0; border: 2px solid transparent; border-radius: 3px; background: none; cursor: pointer; overflow: hidden; opacity: 0.5; transition: var(--transition); }
.strip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip-thumb:hover { opacity: 0.85; }
.strip-thumb.active { opacity: 1; border-color: #fafafa; }

/* Grid mode: every image at once, replacing the single-image stage. */
.lightbox-grid { display: none; flex: 1; min-height: 0; overflow-y: auto; padding: 1.25rem; align-content: start; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.lightbox.grid-mode .lightbox-grid { display: grid; }
.lightbox.grid-mode .lightbox-stage { display: none; }
.grid-thumb { padding: 0; border: 1px solid rgba(255,255,255,0.15); border-radius: 3px; background: rgba(255,255,255,0.04); cursor: zoom-in; overflow: hidden; transition: var(--transition); }
.grid-thumb:hover { border-color: rgba(255,255,255,0.55); }
.grid-thumb img { width: 100%; height: auto; display: block; }

/* =========================================================================
   RESPONSIVE — must stay last so these rules win
   ========================================================================= */
@media (max-width: 900px) {
    .modal-box { grid-template-columns: 1fr 1fr; }
    .modal-info-col { padding: 2.5rem 1.75rem; }
    .modal-header h2 { font-size: 1.8rem; }
}

@media (max-width: 768px) {
    .container { padding: 2rem 0; }

    .mobile-toggle { display: flex; }
    nav { position: absolute; top: 70px; left: 0; width: 100%; background: #fff; border-bottom: 1px solid var(--border); display: none; padding: 1.5rem 0; }
    nav.open { display: block; }
    nav ul { flex-direction: column; gap: 1.25rem; }

    .home-bio-quote { grid-template-columns: 1fr; text-align: center; gap: 1.5rem; }
    .bio-portrait-placeholder { width: 150px; margin: 0 auto; }
    .bio-quote-content blockquote { font-size: 1.2rem; }

    .section-header h1 { font-size: 1.9rem; }
    .about-layout { grid-template-columns: 1fr; gap: 2rem; }
    .about-portrait-placeholder { max-width: 350px; margin: 0 auto; }
    .about-text .description-content p { max-width: none; }

    .gallery-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-wrap { flex-direction: column; gap: 1.25rem; text-align: center; }

    /* Modal becomes a single scrolling column. These overrides were previously
       written ABOVE the desktop rules, so they never applied. */
    .modal { padding: 0; }
    .modal-box { display: flex; flex-direction: column; grid-template-columns: none; height: 100dvh; max-height: none; border-radius: 0; }
    .modal-image-col { height: 46vh; min-height: 260px; flex-shrink: 0; }
    .modal-info-col { padding: 1.75rem 1.5rem 2rem; flex: 1; overflow-y: auto; justify-content: flex-start; }
    .modal-header h2 { font-size: 1.65rem; }
    .modal-subtitle { margin-bottom: 1.25rem; }
    .modal-specs { margin-bottom: 1.25rem; }
    .modal-desc { margin-bottom: 1.5rem; }
    .modal-actions {
        margin: auto -1.5rem -2rem;
        padding: 0.85rem 1.5rem calc(2rem + env(safe-area-inset-bottom, 0px));
    }
    .modal-actions .secondary-btn { margin-top: 0.5rem; }
    .modal-close-btn { background: rgba(255,255,255,0.92); border-radius: 50%; width: 38px; height: 38px; top: 0.75rem; right: 0.75rem; box-shadow: 0 2px 10px rgba(0,0,0,0.15); border: 1px solid var(--border); }
    .carousel-img { padding: 0.75rem; }
    .carousel-btn { width: 38px; height: 38px; }
    .carousel-btn.prev { left: 0.5rem; }
    .carousel-btn.next { right: 0.5rem; }

    .lightbox-bar { padding: 0.5rem 0.65rem; font-size: 0.72rem; gap: 0.5rem; }
    .lightbox-meta { flex-direction: column; gap: 0; line-height: 1.35; }
    .lightbox-tools { gap: 0.35rem; }
    .lightbox-tools button, .lightbox-tools a { padding: 0.3rem 0.55rem; }
    .lightbox-stage { padding: 0.25rem; }
    .lightbox-nav { width: 40px; height: 40px; }
    .lightbox-title { max-width: 42vw; font-size: 0.85rem; }
    .lightbox-meta { flex-direction: column; align-items: flex-start; gap: 0; }
    .strip-thumb { width: 46px; height: 46px; }
    .lightbox-strip { justify-content: flex-start; padding: 0.5rem; }
    .lightbox-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.6rem; padding: 0.75rem; }
    .lightbox-nav.prev { left: 0.4rem; }
    .lightbox-nav.next { right: 0.4rem; }

    /* Comfortable tap targets for the inline admin controls. */
    .admin-card-tools { gap: 8px; }
    .admin-move-btn, .admin-delete-btn, .admin-inline-btn { padding: 8px 11px; font-size: 0.85rem; }
    .admin-form-modal { padding: 1rem 0.75rem; }
    .admin-form-box { padding: 1.5rem 1.25rem; }
}

@media (max-width: 420px) {
    .header-wrap, .footer-wrap { width: 92%; }
    .container { width: 92%; }
    .logo { font-size: 1rem; letter-spacing: 0.1em; }
    .filter-btn { padding: 0.5rem 0.9rem; font-size: 0.72rem; }
    .modal-image-col { height: 40vh; min-height: 220px; }
    .field-row { flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
