/* ── Variables ── */
:root {
  color-scheme: light;
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1c1917;
  --text-muted: #78716c;
  --border: #e7e5e4;
  --accent: #292524;
  --accent-hover: #44403c;
  --sold-bg: rgba(0,0,0,0.55);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.1), 0 8px 32px rgba(0,0,0,.08);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── Base ── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Layout ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main.container {
  flex: 1;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .9rem;
  padding-bottom: .9rem;
}

.site-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.site-tagline {
  font-size: .85rem;
  color: var(--text-muted);
}
.header-contact-card {
  height: 36px;
  width: auto;
}
.detail-contact-card {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 1.25rem;
  height: auto;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: .85rem;
  color: var(--text-muted);
}

/* ── Page header ── */
.intro-banner {
  text-align: center;
  max-width: 600px;
  margin: 2.25rem auto 2.5rem;
  padding: 2rem 2rem 1.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
}
.intro-eyebrow {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #f97316;
  margin-bottom: .6rem;
}
.intro-headline {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: .9rem;
}
.intro-text {
  font-size: .925rem;
  line-height: 1.75;
  color: var(--text-muted);
}
.intro-phone {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.page-header {
  margin-bottom: 1.5rem;
}
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: .25rem;
}
.page-header .count {
  font-size: .85rem;
  color: var(--text-muted);
}

/* ── Filters ── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: .45rem 1.1rem;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
  display: inline-block;
}

.filter-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Article grid ── */
.articles-grid {
  columns: 3;
  column-gap: 1.25rem;
}

/* ── Article card ── */
.article-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
  display: block;
  break-inside: avoid;
  margin-bottom: 1.25rem;
}

.article-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-image {
  position: relative;
  background: #f1efed;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .3s;
}

.article-card:hover .card-image img {
  transform: scale(1.04);
}

.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #c7c3bf;
}

.badge-category {
  position: absolute;
  top: .6rem;
  left: .6rem;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(4px);
  color: var(--text);
  font-size: .72rem;
  font-weight: 600;
  padding: .25rem .65rem;
  border-radius: 999px;
}

.badge-sold {
  position: absolute;
  inset: 0;
  background: var(--sold-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-sold span {
  background: #fff;
  color: var(--text);
  font-size: .8rem;
  font-weight: 700;
  padding: .35rem .9rem;
  border-radius: 999px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.card-body {
  padding: .9rem 1rem;
}

.card-title {
  font-size: .95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .2rem;
}

.card-price {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
}

.pagination a,
.pagination span {
  padding: .5rem 1.25rem;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
}

.pagination a {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: background .15s, color .15s;
}

.pagination a:hover { background: var(--bg); color: var(--text); }

.pagination .current {
  color: var(--text-muted);
  font-size: .875rem;
}

/* ── Article detail ── */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  transition: color .15s;
}
.detail-back:hover { color: var(--text); }

.detail-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2.5rem;
  align-items: start;
}

.detail-mobile-img {
  border-radius: var(--radius);
  overflow: hidden;
  background: #f1efed;
  margin-bottom: .75rem;
}

.detail-mobile-img img {
  width: 100%;
  height: auto;
  display: block;
}

.detail-mobile-top-overlay,
.detail-mobile-bottom-overlay,
.detail-mobile-back { display: none; }

.detail-desktop-info { display: block; }

.detail-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
  margin-top: 1.75rem;
}

.detail-gallery-thumbs img {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: .75;
  transition: opacity .15s, outline .15s;
}

.detail-gallery-thumbs img:hover {
  opacity: 1;
}

.detail-gallery-thumbs img.active {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.detail-badge-category {
  display: inline-block;
  background: #f1efed;
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 600;
  padding: .3rem .8rem;
  border-radius: 999px;
  margin-bottom: .75rem;
}

.detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: .75rem;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

.detail-price {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: #f97316;
  color: #fff;
  padding: .4rem 1.1rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(249, 115, 22, .45);
  animation: float 2.5s ease-in-out infinite;
}

.detail-negociable {
  display: block;
  font-size: .38em;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .8;
  margin-top: .1em;
  line-height: 1;
}

.detail-sold-notice {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: .75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.detail-description-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .4rem;
}

.detail-description {
  color: var(--text-muted);
  line-height: 1.7;
  white-space: pre-line;
}


/* ── Upload page ── */
.upload-header {
  margin-bottom: 1.75rem;
}
.upload-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: .25rem; }
.upload-header p { font-size: .875rem; color: var(--text-muted); }

.upload-form {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  max-width: 680px;
}

.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: .4rem;
}

.form-label .optional {
  font-weight: 400;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .9rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(41,37,36,.1);
}

textarea { resize: vertical; min-height: 100px; }

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.drop-zone:hover, .drop-zone.drag-over {
  background: #f5f3f1;
  border-color: #a8a29e;
}

.drop-zone-icon { font-size: 2rem; margin-bottom: .5rem; }
.drop-zone-text { font-size: .875rem; color: var(--text-muted); }
.drop-zone-hint { font-size: .75rem; color: #a8a29e; margin-top: .25rem; }

.preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
  margin-top: .75rem;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f1efed;
}

.preview-item img { width: 100%; height: 100%; object-fit: cover; }

.preview-remove {
  position: absolute;
  top: .25rem;
  right: .25rem;
  background: rgba(0,0,0,.6);
  color: #fff;
  border-radius: 999px;
  width: 1.4rem;
  height: 1.4rem;
  font-size: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  cursor: pointer;
}

.preview-item:hover .preview-remove { opacity: 1; }

.upload-uploading {
  font-size: .875rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
}

.btn-submit {
  width: 100%;
  padding: .75rem;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background .15s;
  cursor: pointer;
  border: none;
}

.btn-submit:hover:not(:disabled) { background: var(--accent-hover); }
.btn-submit:disabled { opacity: .4; cursor: not-allowed; }

.form-success {
  background: #f0fdf4;
  color: #166534;
  font-weight: 500;
  font-size: .875rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

/* ── Admin ── */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.admin-header h1 { font-size: 1.75rem; font-weight: 700; }

.admin-table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  background: var(--bg);
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

.admin-thumb-empty {
  width: 56px;
  height: 56px;
  background: #f1efed;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.admin-actions { display: flex; gap: .5rem; align-items: center; }

.btn-edit {
  padding: .35rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background .15s;
  display: inline-block;
}
.btn-edit:hover { background: var(--bg); }

.btn-delete {
  padding: .35rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  border: 1px solid #fca5a5;
  background: #fff5f5;
  color: #dc2626;
  transition: background .15s;
  cursor: pointer;
  font: inherit;
}
.btn-delete:hover { background: #fee2e2; }

.nowrap { white-space: nowrap; }
.text-muted { color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .site-tagline { display: none; }
  .form-row { grid-template-columns: 1fr; }

  /* Detail page: TikTok full-screen mode */
  .detail-page .site-header,
  .detail-page .site-footer { display: none; }
  .detail-page main.container { padding: 0; max-width: 100%; }
  .detail-back { display: none; }

  .detail-grid {
    position: fixed;
    inset: 0;
    background: #000;
    overflow: hidden;
    display: block;
  }

  .detail-mobile-img {
    position: absolute;
    inset: 0;
    border-radius: 0;
    background: #000;
    margin-bottom: 0;
  }
  .detail-mobile-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .detail-no-img {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #c7c3bf;
  }

  .detail-mobile-top-overlay {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.78) 0%, transparent 100%);
    padding: 1.1rem 1rem 3rem;
    z-index: 2;
  }
  .detail-mobile-header-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .5rem;
  }
  .detail-mobile-back {
    display: inline-block;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 300;
    line-height: 1;
    flex-shrink: 0;
    opacity: .9;
  }
  .detail-mobile-top-overlay .detail-title {
    color: #fff;
    font-size: 1.15rem;
    margin: 0;
    flex: 1;
  }
  .detail-mobile-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
  }
  .detail-mobile-top-overlay .detail-price {
    font-size: 1.3rem;
    margin: 0;
    flex-shrink: 0;
  }
  .detail-description-mobile {
    color: rgba(255,255,255,.82);
    font-size: .875rem;
    line-height: 1.5;
    margin: 0;
    flex: 1;
  }
  .detail-mobile-top-overlay .detail-sold-notice {
    margin-top: .5rem;
    margin-bottom: 0;
  }

  .detail-mobile-bottom-overlay {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,.78) 0%, transparent 100%);
    padding: 3rem 1rem 1.25rem;
    z-index: 2;
  }
  .detail-mobile-bottom-overlay .detail-gallery-thumbs {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    margin-top: 0;
    padding: 4px 4px .5rem;
    scrollbar-width: none;
  }
  .detail-contact-card-mobile {
    height: 56px;
    width: auto;
    flex-shrink: 0;
  }
  .detail-mobile-bottom-overlay .detail-gallery-thumbs::-webkit-scrollbar { display: none; }
  .detail-mobile-bottom-overlay .detail-gallery-thumbs img {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    aspect-ratio: 1;
    border-radius: 8px;
  }
  .detail-mobile-bottom-overlay .detail-gallery-thumbs img.active {
    outline-color: #fff;
  }

  .detail-desktop-info { display: none; }
}

@media (max-width: 768px) {
  .articles-grid { columns: 1; }
}

@media (max-width: 480px) {
  .preview-grid { grid-template-columns: repeat(3, 1fr); }
}
