* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #FBF5EA;
  --bg-2: #F5EBD8;
  --surface: #FFFFFF;
  --surface-2: #FBF5EA;
  --border: #E7D9BE;
  --border-strong: #C8A24B;
  --text: #24170F;
  --text-2: #46352A;
  --muted: #8A7259;
  --faint: #B4A38A;
  --primary: #A6202B;
  --primary-hover: #8B1B24;
  --gold: #C8973E;
  --danger: #C0392B;
  --success: #2E7D4F;
}
html, body { background: var(--bg); color: var(--text); font-family: "Manrope", ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 80rem; margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 768px) { .container { padding: 0 2.5rem; } }

.display { font-family: "Playfair Display", serif; font-weight: 900; letter-spacing: -0.01em; line-height: 1.05; font-size: 2.5rem; color: var(--text); }
@media (min-width: 768px) { .display { font-size: 3.5rem; } }
@media (min-width: 1024px) { .display { font-size: 4.25rem; } }
.display-md { font-family: "Playfair Display", serif; font-weight: 900; letter-spacing: -0.01em; font-size: 2rem; color: var(--text); }
.display-sm { font-family: "Playfair Display", serif; font-weight: 800; letter-spacing: -0.01em; font-size: 1.15rem; color: var(--text); }
.mono { font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }
.overline { font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--primary); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.chip { display: inline-flex; align-items: center; gap: 0.375rem; border: 1px solid var(--border); background: var(--surface); padding: 0.35rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; color: var(--text-2); }
.chip-abs { position: absolute; top: 0.75rem; left: 0.75rem; font-size: 0.65rem; }
.chip-primary { border-color: rgba(166,32,43,0.35); color: var(--primary); background: rgba(166,32,43,0.06); cursor: pointer; }
.chip-gold { border-color: rgba(200,151,62,0.5); color: #7c5b1e; background: rgba(200,151,62,0.12); }
.chip-success { border-color: rgba(46,125,79,0.4); color: var(--success); background: rgba(46,125,79,0.08); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border-radius: 9999px; font-weight: 600; transition: all 200ms ease; cursor: pointer; border: none; font: inherit; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px -4px rgba(166,32,43,0.4); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost:hover { background: rgba(166,32,43,0.06); }
.btn-neutral { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-neutral:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 1rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: #fff; }

.site-header { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(12px); background: rgba(251,245,234,0.85); border-bottom: 1px solid var(--border); }
.header-inner { height: 4rem; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 0.5rem; font-family: "Playfair Display", serif; font-weight: 900; font-size: 1.05rem; color: var(--text); }
.brand-dot { display: inline-flex; height: 2.25rem; width: 2.25rem; align-items: center; justify-content: center; border-radius: 9999px; background: var(--primary); color: #fff; font-size: 0.95rem; }
.nav { display: none; gap: 2rem; }
.nav a { color: var(--text-2); font-size: 0.9rem; transition: color 150ms; }
.nav a:hover { color: var(--primary); }
@media (min-width: 768px) { .nav { display: flex; } }

.hero { position: relative; overflow: hidden; padding: 5rem 0 4rem; }
@media (min-width: 768px) { .hero { padding: 7rem 0 6rem; } }
.hero-glow { position: absolute; inset: -20%; background: radial-gradient(55% 40% at 15% 20%, rgba(200,151,62,0.20), transparent 60%), radial-gradient(45% 40% at 90% 30%, rgba(166,32,43,0.12), transparent 60%); filter: blur(35px); pointer-events: none; }
.hero-inner { position: relative; display: grid; gap: 3rem; align-items: center; }
@media (min-width: 1024px) { .hero-inner { grid-template-columns: 7fr 5fr; } }
.hero-left .chip { margin-bottom: 1.5rem; }
.hero-left .display { margin-bottom: 1.5rem; }
.hero-left .muted { max-width: 32rem; font-size: 1rem; color: var(--text-2); }
.hero-ctas { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-card { position: relative; aspect-ratio: 4/5; border-radius: 1.5rem; overflow: hidden; border: 1px solid var(--border-strong); box-shadow: 0 20px 40px -20px rgba(166,32,43,0.25); }
.hero-card img { height: 100%; width: 100%; object-fit: cover; }
.hero-card-overlay { position: absolute; inset: auto 1.5rem 1.5rem 1.5rem; color: #fff; }
.hero-card-overlay .display-sm { color: #fff; }
.hero-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(36,23,15,0.75), transparent 60%); pointer-events: none; }

.section { padding: 3rem 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2.5rem; flex-wrap: wrap; }
.section-head .overline { margin-bottom: 0.5rem; }

.grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card { border: 1px solid var(--border); border-radius: 1.25rem; overflow: hidden; background: var(--surface); transition: transform 300ms, border-color 200ms, box-shadow 200ms; box-shadow: 0 1px 2px rgba(36,23,15,0.03); display: flex; flex-direction: column; }
.card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: 0 12px 28px -12px rgba(166,32,43,0.18); }
.card-media { position: relative; display: block; aspect-ratio: 4/3; overflow: hidden; background: var(--surface-2); }
.card-media img { height: 100%; width: 100%; object-fit: cover; transition: transform 500ms; }
.card:hover .card-media img { transform: scale(1.05); }

/* Dark title ribbon */
.card-title-band { display: block; background: linear-gradient(135deg, #1E1410 0%, #3A2418 100%); border-bottom: 2px solid var(--gold); padding: 0.9rem 1.25rem; }
.card-title { font-family: "Playfair Display", serif; font-weight: 800; font-size: 1.05rem; line-height: 1.28; color: #ffffff; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }

.card-body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.card-price-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.card-price-label { font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.card-price { font-size: 2rem; font-weight: 700; color: var(--primary); margin-top: 0.25rem; line-height: 1; }
@media (min-width: 768px) { .card-price { font-size: 2.35rem; } }
.card-price-sub { font-size: 0.65rem; color: var(--muted); margin-top: 0.4rem; }

.card-row { display: flex; align-items: center; justify-content: space-between; margin: 1rem 0 1rem; font-size: 0.9rem; }
.card-row .mono { font-weight: 600; color: var(--text); }
.link-arrow { color: var(--primary); font-size: 0.85rem; font-weight: 600; white-space: nowrap; padding-bottom: 0.25rem; }
.link-arrow:hover { color: var(--primary-hover); }

.empty { text-align: center; padding: 4rem; border: 1px solid var(--border); border-radius: 1.25rem; color: var(--muted); background: var(--surface); }

.detail-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-top: 2rem; }
@media (min-width: 1024px) { .detail-grid { grid-template-columns: 7fr 5fr; } }
.detail-cover { aspect-ratio: 16/11; border-radius: 1.5rem; overflow: hidden; border: 1px solid var(--border-strong); box-shadow: 0 20px 40px -20px rgba(166,32,43,0.25); }
.detail-cover img { height: 100%; width: 100%; object-fit: cover; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1rem; }
@media (min-width: 768px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery.compact { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 768px) { .gallery.compact { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1024px) { .gallery.compact { grid-template-columns: repeat(6, 1fr); } }
.gallery-item { aspect-ratio: 4/3; border: 1px solid var(--border); border-radius: 0.75rem; overflow: hidden; display: block; background: var(--surface-2); transition: border-color 180ms; }
.gallery.compact .gallery-item { aspect-ratio: 1/1; }
.gallery-item img { height: 100%; width: 100%; object-fit: cover; transition: transform 400ms; }
.gallery-item:hover { border-color: var(--border-strong); }
.gallery-item:hover img { transform: scale(1.05); }

.detail-side { position: sticky; top: 5rem; }
.detail-side .chip { margin-bottom: 1rem; }
.detail-side .display { margin-bottom: 0.75rem; }
.price { font-size: 2.25rem; font-weight: 700; margin: 1.5rem 0 1rem; color: var(--primary); }
.block { margin-top: 2rem; }
.block .overline { margin-bottom: 0.75rem; }
.check-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.check-list li { color: var(--text-2); }

.site-footer { border-top: 1px solid var(--border); margin-top: 5rem; background: var(--surface-2); }
.footer-inner { padding: 2.5rem 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Admin */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-side { width: 16rem; border-right: 1px solid var(--border); display: none; flex-direction: column; background: var(--surface); }
@media (min-width: 768px) { .admin-side { display: flex; } }
.admin-side-head { padding: 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.5rem; font-family: "Playfair Display", serif; font-weight: 900; color: var(--text); }
.admin-nav { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; }
.admin-nav a { padding: 0.6rem 0.85rem; border-radius: 0.5rem; color: var(--text-2); font-size: 0.9rem; }
.admin-nav a:hover { background: var(--surface-2); color: var(--primary); }
.admin-nav a.active { background: var(--surface-2); color: var(--primary); border: 1px solid var(--border); }
.admin-main { flex: 1; padding: 2rem; }
@media (min-width: 768px) { .admin-main { padding: 2.5rem; } }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap; }
.admin-topbar-mobile { display: flex; gap: 1rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
@media (min-width: 768px) { .admin-topbar-mobile { display: none; } }
.admin-topbar-mobile a { color: var(--text-2); font-size: 0.85rem; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 1.25rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); }
.stat .label { color: var(--muted); font-size: 0.75rem; }
.stat .num { font-family: "JetBrains Mono"; font-size: 1.75rem; font-weight: 700; margin-top: 0.75rem; color: var(--text); }
.field { display: block; margin-bottom: 1rem; }
.field label { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 0.35rem; }
.input, textarea.input, select.input { width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 0.6rem; padding: 0.65rem 0.85rem; font: inherit; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(166,32,43,0.12); }
textarea.input { min-height: 110px; }
.input-inline { width: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.tbl th { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.card-panel { border: 1px solid var(--border); border-radius: 1rem; padding: 1.25rem; background: var(--surface); }
.flash { padding: 0.75rem 1rem; border-radius: 0.6rem; margin-bottom: 1rem; font-size: 0.9rem; }
.flash-success { background: rgba(46,125,79,0.1); color: var(--success); border: 1px solid rgba(46,125,79,0.3); }
.flash-error { background: rgba(192,57,43,0.1); color: var(--danger); border: 1px solid rgba(192,57,43,0.3); }
.img-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (min-width: 768px) { .img-grid { grid-template-columns: repeat(4, 1fr); } }
.img-grid.compact { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 640px) { .img-grid.compact { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 768px) { .img-grid.compact { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1024px) { .img-grid.compact { grid-template-columns: repeat(8, 1fr); } }
.img-tile { position: relative; aspect-ratio: 4/3; border: 1px solid var(--border); border-radius: 0.75rem; overflow: hidden; background: var(--surface-2); }
.img-grid.compact .img-tile { aspect-ratio: 1/1; }
.img-tile img { width: 100%; height: 100%; object-fit: cover; }
.img-tile-bar { position: absolute; inset: auto 0 0 0; padding: 0.35rem 0.5rem; display: flex; align-items: center; justify-content: space-between; gap: 0.3rem; background: linear-gradient(to top, rgba(0,0,0,0.75), transparent); }
.img-tile-bar select { background: transparent; border: none; color: #fff; font-size: 0.7rem; max-width: 70%; }
.img-tile-bar select option { color: #000; }
.img-tile-bar button { background: transparent; border: none; color: #fff; cursor: pointer; font-size: 1rem; line-height: 1; }
.img-tile-bar button:hover { color: #ffb3ae; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.25rem; position: relative; overflow: hidden; }
.login-card { max-width: 26rem; width: 100%; border: 1px solid var(--border); border-radius: 1rem; padding: 2rem; background: var(--surface); position: relative; z-index: 2; box-shadow: 0 10px 30px -12px rgba(36,23,15,0.15); }

/* Upload queue (JS) */
.upload-queue { border: 1px solid var(--border); background: var(--surface-2); border-radius: 1rem; overflow: hidden; margin-bottom: 1.5rem; }
.upload-queue-head { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0.9rem; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.upload-queue-body { max-height: 18rem; overflow-y: auto; }
.upload-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.9rem; border-top: 1px solid var(--border); font-size: 0.85rem; }
.upload-item:first-child { border-top: none; }
.upload-status { flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--border); }
.upload-status.uploading { background: var(--primary); animation: pulse 1s ease-in-out infinite; }
.upload-status.done { background: var(--success); }
.upload-status.error { background: var(--danger); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.upload-progress { position: relative; flex: 1; height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.upload-progress-bar { position: absolute; inset: 0 auto 0 0; background: var(--primary); border-radius: 999px; transition: width 120ms linear; width: 0%; }
.upload-progress-bar.done { background: var(--gold); }
.upload-progress-bar.error { background: var(--danger); }
.upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); max-width: 16rem; }
.upload-meta { color: var(--muted); font-size: 0.75rem; font-family: "JetBrains Mono", monospace; }

/* Announcement Banner */
.announcement-banner {
    background: linear-gradient(135deg, #A6202B 0%, #8B1B24 100%);
    color: #ffffff;
    padding: 12px 0;
    position: relative;
    border-bottom: 3px solid #C8973E;
    box-shadow: 0 2px 10px rgba(166, 32, 43, 0.3);
    z-index: 10;
}

.announcement-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 0;
    flex-wrap: wrap;
}

.announcement-icon {
    font-size: 24px;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.announcement-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.6;
}

.announcement-text strong {
    color: #FFD700;
    font-weight: 700;
}

.announcement-old-number {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: line-through;
    color: #FFB3AE;
}

.announcement-new-number {
    background: #FFD700;
    color: #1E1410;
    padding: 2px 12px;
    border-radius: 4px;
    font-weight: 700;
    display: inline-block;
    animation: highlight 1s ease-in-out;
}

@keyframes highlight {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.announcement-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.announcement-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .announcement-banner {
        padding: 10px 0;
    }
    
    .announcement-content {
        gap: 10px;
        padding: 5px 0;
    }
    
    .announcement-icon {
        font-size: 20px;
    }
    
    .announcement-text {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .announcement-old-number,
    .announcement-new-number {
        display: inline-block;
        padding: 1px 8px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .announcement-text {
        font-size: 0.78rem;
    }
    
    .announcement-icon {
        font-size: 18px;
    }
    
    .announcement-close {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
}
