:root {
  --paper: #ede6d6;
  --paper-dark: #e2d9c4;
  --card: #f7f3e8;
  --ink: #242320;
  --ink-soft: #55524a;
  --indigo: #2e3a6e;
  --indigo-dark: #202a52;
  --mustard: #d9a441;
  --rust: #b8481f;
  --line: rgba(36, 35, 32, 0.18);
  --shadow: rgba(36, 35, 32, 0.22);
  --radius-card: 6px;
  --focus: 3px solid var(--rust);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  background-image:
    radial-gradient(rgba(36,35,32,0.05) 1px, transparent 1px);
  background-size: 4px 4px;
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

a { color: var(--indigo); }

:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

button, input, textarea {
  font-family: inherit;
}

/* ---------- Header ---------- */
.site-head {
  padding: 48px 0 32px;
  border-bottom: 3px solid var(--ink);
}

.site-head__inner {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.stamp {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  transform: rotate(-8deg);
}
.stamp svg { width: 100%; height: 100%; }
.stamp circle {
  fill: none;
  stroke: var(--rust);
  stroke-width: 3;
}
.stamp text {
  font-family: 'Anton', sans-serif;
  font-size: 13px;
  fill: var(--rust);
  letter-spacing: 0.5px;
}

.site-title {
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 0.92;
  margin: 0 0 14px;
  color: var(--ink);
}

.site-sub {
  max-width: 46ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ---------- Layout ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 26px;
  box-shadow: 0 6px 0 var(--shadow);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.panel__head h2 {
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  font-size: 1.6rem;
  margin: 0;
}

/* ---------- Buttons ---------- */
.btn {
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 3px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover { transform: none; }
}

.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.btn--primary {
  width: 100%;
  background: var(--indigo);
  border-color: var(--indigo);
  color: var(--paper);
  padding: 12px 18px;
  font-size: 1.02rem;
}
.btn--primary:hover { background: var(--indigo-dark); border-color: var(--indigo-dark); }

.btn--interest {
  background: var(--mustard);
  border-color: var(--mustard);
  color: var(--ink);
  font-weight: 700;
  padding: 10px 20px;

}
.btn--interest:hover {
  background: #c59132;
  border-color: #c59132;
}

.btn--card-interest {
  margin-top: 6px;
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  padding: 6px 10px;
}

.btn--small {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-width: 1.5px;
}

/* ---------- Layout d'una sola columna ---------- */
.layout-single {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-top: 40px;
}

.upload-panel { max-width: 640px; }

.admin-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.unlock-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.unlock-form input[type="password"] {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9rem;
}

.upload-form { display: flex; flex-direction: column; gap: 18px; }

.upload-fields {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) {
  .upload-fields { grid-template-columns: 1fr; }
}

#dropzone {
  border: 2px dashed var(--line);
  border-radius: 4px;
  padding: 18px;
  text-align: center;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#dropzone.is-active {
  border-color: var(--indigo);
  background: rgba(46, 58, 110, 0.06);
}
#dropzone p { margin: 0; font-size: 0.95rem; }
#preview-img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
}

.upload-status {
  min-height: 1.2em;
  font-size: 0.88rem;
  margin: 0;
}
.upload-status.ok { color: #8ce196; }
.upload-status.err { color: #f88b88; }

.art-card__img-wrap { cursor: zoom-in; }

/* ---------- Visor (lightbox) millorat i corregit ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 17, 15, 0.92);
  z-index: 1001;
}

.lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  z-index: 1010;
  transition: background 0.15s ease, transform 0.15s ease;
}
.lightbox__close:hover {
  background: var(--rust);
  border-color: var(--rust);
  transform: scale(1.08);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border: none;
  background: rgba(247, 243, 232, 0.15);
  color: var(--paper);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  line-height: 1;
  z-index: 1008;
  transition: background 0.12s ease;
}
.lightbox__nav:hover { background: rgba(247, 243, 232, 0.35); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }

.lightbox__content {
  position: relative;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1000px;
  max-height: 92vh;
  width: 100%;
  overflow-y: auto;
  padding: 10px;
}

.lightbox__stage {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  margin-bottom: 12px;
}

.lightbox__stage img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.18s ease;
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 4px;
}
.lightbox__stage img.is-zoomed {
  cursor: grab;
  max-width: none;
  max-height: none;
}
.lightbox__stage img.is-dragging { cursor: grabbing; transition: none; }

.lightbox__caption {
  color: var(--paper);
  text-align: center;
  width: 100%;
  max-width: 600px;
}
.lightbox__name {
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  font-size: 1.6rem;
  margin: 0 0 8px;
  letter-spacing: 0.5px;
}
.lightbox__tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.lightbox__hint {
  margin: 0 0 16px;
  font-size: 0.8rem;
  opacity: 0.65;
}

/* ---------- Formulari de mostra d'interès en lightbox ---------- */
.inquire-section {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.inquire-form {
  background: var(--card);
  color: var(--ink);
  padding: 20px;
  border-radius: 8px;
  width: 100%;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inquire-form__head h4 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-family: 'Anton', sans-serif;
  color: var(--indigo);
}
.inquire-form__sub {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 540px) {
  .form-row { grid-template-columns: 1fr; }
}

.text-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.text-field input, .text-field textarea {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.9rem;
}

.inquire-form__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
}

.art-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 5px 0 var(--shadow);
  display: flex;
  flex-direction: column;
  position: relative;
}

.art-card__img-wrap {
  background: #fff;
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.art-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.art-card__name {
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.15;
}

.art-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--ink);
}
.tag--price { background: var(--mustard); border-color: var(--mustard); color: var(--ink); }
.tag--size { background: transparent; color: var(--ink-soft); border-color: var(--line); }

.art-card__del {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: rgba(36,35,32,0.75);
  color: var(--paper);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  line-height: 1;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.art-card:hover .art-card__del,
.art-card__del:focus-visible { opacity: 1; }
@media (hover: none) {
  .art-card__del { opacity: 1; }
}

/* ---------- Footer ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 22px 0 40px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.site-foot__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.signature {
  height: 34px;
  width: auto;
  opacity: 0.85;
}
