/* =====================================
   CPDIGGER - RESET & BASE STYLES
===================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #f4f0e8;
  color: #171717;
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
}

h1 {
  max-width: 650px;
  font-size: clamp(2rem, 3.5vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
}

h2 {
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.03em;
}

p {
  margin: 0 0 1rem;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}


/* =====================================
   HEADER
===================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 240, 232, 0.95);
  border-bottom: 1px solid #d8d2c7;
  backdrop-filter: blur(8px);
}

.header-inner {
  min-height: 72px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 30px;
}

.logo {
  color: #171717;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 0.82rem;
}


/* =====================================
   NAVIGATION
===================================== */

.main-nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

.main-nav a {
  color: #171717;
  text-decoration: none;
  font-size: 0.9rem;
}

.main-nav a:hover {
  text-decoration: underline;
}


/* =====================================
   LANGUAGE SWITCHER
===================================== */

.language-switcher {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.language-button {
  border: 0;
  background: transparent;
  padding: 2px;
  cursor: pointer;
  color: #777;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.language-button.active {
  color: #171717;
  font-weight: 700;
}


/* =====================================
   HERO
===================================== */

.hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 120px 32px 150px;
  border-bottom: 1px solid #d8d2c7;
}

.hero-grid {
  display: grid;
  grid-template-columns: 45% 55%;
  gap: 60px;
  align-items: center;
}

.hero-copy {
  max-width: none;
  border: none;
}

.hero-media {
  width: 100%;
  align-self: center;
}

.hero-media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, .08);
}

.eyebrow {
  margin-bottom: 18px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero p {
  max-width: 680px;
  margin: 34px 0;
  font-size: 1.1rem;
  color: #555;
}

.hero-types {
  margin: 0 0 2rem;
  color: #68645e;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}


/* =====================================
   BUTTONS
===================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #171717;
  padding: 11px 18px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-dark {
  background: #171717;
  color: #fff;
}

.button-dark:hover {
  background: #000;
}

.button-light {
  background: #fff;
  color: #171717;
}

.button-light:hover {
  background: #f0ece4;
}


/* =====================================
   SECTIONS
===================================== */

.section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 100px 32px;
}

.section-alt {
  max-width: none;
  background: #ebe6dc;
}

.section-alt > * {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 42px;
}


/* =====================================
   DASHBOARD
===================================== */

.dashboard-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.dashboard-links .button {
  min-width: 180px;
}


/* =====================================
   STATS
===================================== */

.stats {
  display: flex;
  gap: 40px;
  border-top: 1px solid #d8d2c7;
  border-bottom: 1px solid #d8d2c7;
  padding: 22px 0;
  margin-bottom: 28px;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.stat strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
  font-weight: 400;
}

.stat span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
}


/* =====================================
   FILTERS & FORMS
===================================== */

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  margin-bottom: 34px;
}

.filters input,
.filters select,
.item-form input,
.item-form textarea {
  width: 100%;
  border: 1px solid #c9c2b6;
  background: #faf8f3;
  padding: 12px 13px;
  color: #171717;
  outline: none;
}

.filters input:focus,
.filters select:focus,
.item-form input:focus,
.item-form textarea:focus {
  border-color: #171717;
}

.item-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.item-form label {
  display: grid;
  gap: 6px;
}

.item-form label > span,
.form-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.item-form textarea {
  resize: vertical;
}


/* =====================================
   COLLECTION
===================================== */

.collection-grid {
  display: grid;
  gap: 14px;
}

.item-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  border-top: 1px solid #d8d2c7;
  padding: 18px 0;
}

.item-image {
  width: 240px;
  height: 180px;
  object-fit: cover;
  background: #ddd7cc;
  border-radius: 6px;
}

.item-placeholder {
  width: 240px;
  height: 180px;
  background: #ddd7cc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  border-radius: 6px;
}

.item-card h3 {
  font-size: 1.65rem;
  margin-bottom: 8px;
}

.item-meta {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.item-notes {
  color: #444;
  font-size: 0.92rem;
  max-width: 720px;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.text-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  color: #171717;
}


/* =====================================
   WANTLIST
===================================== */

.wantlist-grid {
  display: grid;
  gap: 0;
}

.wantlist-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #d1cabf;
  padding: 18px 0;
}

.wantlist-item h3 {
  font-size: 1.35rem;
}


/* =====================================
   EXPLORE
===================================== */

.explore-copy {
  max-width: 760px;
  font-size: 1.15rem;
}

.muted {
  color: #68645e;
}


/* =====================================
   IMAGE UPLOAD & PREVIEWS
===================================== */

.image-upload {
  display: grid;
  gap: 10px;
}

.image-dropzone {
  position: relative;
  border: 2px dashed #c9c2b6;
  background: #faf8f3;
  padding: 28px;
  text-align: center;
  border-radius: 8px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.image-dropzone:hover {
  border-color: #171717;
}

.image-dropzone.drag-over {
  border-color: #171717;
  background: #f0ece4;
}

.image-upload-text {
  display: grid;
  gap: 6px;
}

.image-upload-text strong {
  font-size: 1rem;
}

.image-upload-text span {
  color: #666;
  font-size: 0.9rem;
}

.image-upload-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.preview-item {
  position: relative;
}

.preview-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #ddd7cc;
  cursor: pointer;
}

.preview-controls {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.preview-controls button {
  flex: 1;
  border: 1px solid #c9c2b6;
  background: #fff;
  cursor: pointer;
  padding: 4px;
  font-size: 0.75rem;
}

.preview-controls button:hover {
  border-color: #171717;
}

.preview-cover {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #171717;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
}


/* =====================================
   GALLERY OVERLAY
===================================== */

.gallery-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
}

.gallery-overlay.open {
  display: flex;
}

.gallery-content {
  position: relative;
  width: min(92vw, 1200px);
  height: min(90vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gallery-close {
  position: absolute;
  top: -50px;
  right: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 2rem;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
}

.gallery-prev {
  left: -70px;
}

.gallery-next {
  right: -70px;
}

.gallery-counter {
  position: absolute;
  bottom: -40px;
  color: #fff;
}


/* =====================================
   MODALS
===================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-dialog {
  position: relative;
  width: min(680px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  margin: 20px auto;
  padding: 34px;
  background: #f4f0e8;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
}

.modal-item-image {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #ddd7cc;
  margin: 20px 0;
}


/* =====================================
   EMPTY STATE
===================================== */

.empty-state {
  border-top: 1px solid #d8d2c7;
  padding-top: 20px;
  color: #777;
}


/* =====================================
   FOOTER
===================================== */

.site-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 32px 45px;
  color: #666;
  font-size: 0.8rem;
  border-top: 1px solid #d8d2c7;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.footer-links a {
  color: #666;
  text-decoration: none;
  font-size: .85rem;
}

.footer-links a:hover {
  text-decoration: underline;
}


/* =====================================
   RESPONSIVE / MOBILE
===================================== */

@media (max-width: 760px) {

  .header-inner {
    min-height: auto;
    padding: 18px 20px;
    flex-wrap: wrap;
  }

  .main-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 16px;
    overflow-x: auto;
  }

  .language-switcher {
    margin-left: auto;
  }

  .hero {
    padding: 80px 20px 100px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-copy {
    order: 1;
  }

  .hero-media {
    order: 2;
  }

  .hero p {
    font-size: 1rem;
    margin: 24px 0;
  }

  .button {
    width: 100%;
  }

  .section {
    padding: 70px 20px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .stats {
    gap: 24px;
    flex-wrap: wrap;
  }

  .item-card {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 15px;
  }

  .item-image,
  .item-placeholder {
    width: 100px;
    height: 100px;
  }

  .item-card h3 {
    font-size: 1.3rem;
  }

  .site-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .modal-dialog {
    padding: 28px 20px;
  }

  .gallery-prev {
    left: 10px;
  }

  .gallery-next {
    right: 10px;
  }

  .gallery-close {
    right: 10px;
    top: 10px;
  }

  .image-upload-actions {
    flex-direction: column;
  }

  .image-upload-actions .button {
    width: 100%;
  }

  .image-preview {
    grid-template-columns: repeat(2, 1fr);
  }
}