/* ============================================================
   Catalogue de patrons de broderie
   Palette: papier chaud + encre + accent cuivre
   ============================================================ */

:root {
  --paper:      #faf8f4;
  --paper-2:    #f2eee6;
  --card:       #ffffff;
  --ink:        #1f1b16;
  --ink-soft:   #5c544a;
  --ink-faint:  #9a9085;
  --line:       #e4ddd1;
  --accent:     #b1743a;
  --accent-2:   #8a5527;
  --accent-soft:#f0e2d4;
  --shadow:     0 1px 2px rgba(31,27,22,.04), 0 8px 24px rgba(31,27,22,.06);
  --shadow-lg:  0 2px 4px rgba(31,27,22,.05), 0 24px 60px rgba(31,27,22,.13);
  --radius:     14px;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --maxw: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern", "liga";
}

body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    radial-gradient(circle at 15% 12%, rgba(177,116,58,.05), transparent 45%),
    radial-gradient(circle at 85% 88%, rgba(177,116,58,.04), transparent 45%);
  pointer-events: none; z-index: 0;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }

/* ---------------- header ---------------- */

header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,248,244,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }

.brand-mark {
  width: 36px; height: 36px; flex: none;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  display: grid; place-items: center;
}
.brand-mark svg { width: 18px; height: 18px; }

.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-size: 1.22rem; font-weight: 600; letter-spacing: .01em; }
.brand-sub  { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }

nav { display: flex; align-items: center; gap: 6px; }

nav a {
  font-size: .86rem; color: var(--ink-soft); text-decoration: none;
  padding: 8px 14px; border-radius: 8px; transition: .18s;
}
nav a:hover { color: var(--ink); background: var(--paper-2); }

/* ---------------- hero ---------------- */

.hero { padding: 96px 0 72px; text-align: center; }

.eyebrow {
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 22px; font-weight: 600;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  font-weight: 300; line-height: 1.06; letter-spacing: -.02em;
  margin-bottom: 26px;
}
.hero h1 em {
  font-style: italic; color: var(--accent-2);
}

.hero p {
  font-size: 1.06rem; color: var(--ink-soft);
  max-width: 620px; margin: 0 auto 34px;
}

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: .9rem; font-weight: 500;
  padding: 13px 26px; border-radius: 100px;
  text-decoration: none; border: 1px solid transparent;
  cursor: pointer; transition: .2s;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-2); background: var(--card); }

/* ---------------- section ---------------- */

.section { padding: 60px 0; }

.section-head { margin-bottom: 40px; }
.section-head h2 {
  font-family: var(--serif); font-size: 2rem; font-weight: 400;
  letter-spacing: -.01em; margin-bottom: 8px;
}
.section-head p { color: var(--ink-soft); font-size: .95rem; }

.count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 22px; padding: 0 9px; margin-left: 10px;
  background: var(--accent-soft); color: var(--accent-2);
  border-radius: 100px; font-size: .74rem; font-weight: 600;
  vertical-align: middle;
}

/* ---------------- grille ---------------- */

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s, border-color .25s;
  display: flex; flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.card-thumb {
  aspect-ratio: 1/1;
  background: var(--paper-2);
  display: grid; place-items: center;
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.card-thumb img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  transition: transform .4s cubic-bezier(.2,.7,.3,1);
}
.card:hover .card-thumb img { transform: scale(1.06); }

.card-body { padding: 18px 20px 20px; border-top: 1px solid var(--line); }
.card-body h3 {
  font-family: var(--serif); font-size: 1.22rem; font-weight: 500;
  margin-bottom: 5px; letter-spacing: -.005em;
}
.card-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: .74rem; color: var(--ink-faint);
}

.tag {
  font-size: .66rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent-2);
}

/* ---------------- drag & drop ---------------- */

.drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 46px 28px;
  text-align: center;
  transition: .25s;
  cursor: pointer;
}
.drop:hover, .drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.drop.over { transform: scale(1.008); }

.drop-icon { width: 44px; height: 44px; margin: 0 auto 14px; color: var(--accent); }
.drop h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; margin-bottom: 6px; }
.drop p { color: var(--ink-soft); font-size: .9rem; margin-bottom: 18px; }

.drop input[type=file] { display: none; }

.fmt-list {
  display: flex; gap: 7px; justify-content: center; flex-wrap: wrap;
  margin-top: 20px;
}
.fmt {
  font-size: .68rem; letter-spacing: .05em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 5px; padding: 4px 9px;
}

#upload-status { margin-top: 18px; font-size: .88rem; min-height: 1.4em; }
.ok  { color: #2e7d32; }
.err { color: #c62828; }

/* ---------------- modale ---------------- */

.modal-bg {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(31,27,22,.55);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: 28px;
}
.modal-bg.show { display: flex; }

.modal {
  background: var(--paper);
  border-radius: 18px;
  max-width: 940px; width: 100%;
  max-height: 90vh; overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: pop .28s cubic-bezier(.2,.8,.3,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985); } }

.modal-grid { display: grid; grid-template-columns: 1.15fr 1fr; }

.modal-art {
  background: var(--card);
  display: grid; place-items: center;
  padding: 40px; min-height: 340px;
  border-right: 1px solid var(--line);
}
.modal-art img { max-width: 100%; max-height: 460px; object-fit: contain; }

.modal-info { padding: 34px 32px; }
.modal-info h2 { font-family: var(--serif); font-size: 1.9rem; font-weight: 400; margin-bottom: 6px; }
.modal-info .sub { color: var(--ink-faint); font-size: .82rem; margin-bottom: 22px; }

.modal-close {
  position: absolute; top: 14px; right: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  cursor: pointer; font-size: 1.1rem; line-height: 1;
  color: var(--ink-soft); transition: .18s;
}
.modal-close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.dl-title {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; margin-bottom: 12px;
}
.dl { display: flex; flex-direction: column; gap: 9px; margin-bottom: 22px; }

.dl-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 15px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; text-decoration: none; color: inherit;
  transition: .18s;
}
.dl-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.dl-item .lbl { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.dl-item .fmt { border-color: var(--accent); }
.dl-item .go { color: var(--ink-faint); font-size: 1.05rem; }
.dl-item:hover .go { color: var(--accent-2); }

.note {
  font-size: .82rem; color: var(--ink-soft);
  background: var(--accent-soft); border-left: 2px solid var(--accent);
  padding: 12px 15px; border-radius: 0 8px 8px 0; line-height: 1.55;
}

/* ---------------- suppression ---------------- */

.danger {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.danger p {
  font-size: .78rem; color: var(--ink-faint); margin-top: 9px;
}

.btn-danger {
  font-family: var(--sans); font-size: .84rem; font-weight: 500;
  padding: 9px 18px;
  background: transparent;
  color: #b23c3c;
  border: 1px solid #e8c4c4;
  border-radius: 100px;
  cursor: pointer;
  transition: .18s;
}
.btn-danger:hover {
  background: #b23c3c;
  border-color: #b23c3c;
  color: #fff;
}
.btn-danger.confirming {
  background: #b23c3c;
  border-color: #b23c3c;
  color: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .68; }
}

/* ---------------- etat vide ---------------- */

.empty { text-align: center; padding: 70px 20px; color: var(--ink-faint); }
.empty h3 { font-family: var(--serif); font-size: 1.4rem; color: var(--ink-soft); margin-bottom: 6px; }

.spinner {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- footer ---------------- */

footer {
  border-top: 1px solid var(--line);
  margin-top: 70px; padding: 40px 0;
  color: var(--ink-faint); font-size: .86rem;
}
footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }

/* ---------------- responsive ---------------- */

@media (max-width: 820px) {
  .modal-grid { grid-template-columns: 1fr; }
  .modal-art { border-right: none; border-bottom: 1px solid var(--line); padding: 28px; }
  .hero { padding: 62px 0 50px; }
  nav a { padding: 8px 10px; font-size: .82rem; }
  .brand-sub { display: none; }
}

@media (max-width: 520px) {
  .wrap { padding: 0 18px; }
  .grid { grid-template-columns: 1fr; gap: 18px; }
  footer .wrap { flex-direction: column; text-align: center; }
}
