/* Espace Pro — Denis Dubourdieu Domaines */
:root {
  --bg: #f7f3ec;
  --surface: #ffffff;
  --ink: #2f2925;
  --ink-2: #6e655d;
  --line: #e4dbcf;
  --brand: #3c342e;
  --gold: #a9804f;
  --gold-soft: #f1e7d8;
  --ok: #2f7a4a;
  --warn: #a8661b;
  --err: #a63a32;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(60, 52, 46, .06), 0 4px 16px rgba(60, 52, 46, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--brand); }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 .4em; }
h2 { font-size: 1.25rem; margin: 0 0 .6em; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
[hidden] { display: none !important; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.big { font-size: 2.5rem; margin: 0; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--gold); margin: 0 0 .4em; font-weight: 600; }
.lead { color: var(--ink-2); font-size: 1.05rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: .25em 0; border-bottom: 1px solid var(--line); }

/* ---------- En-tête ---------- */
.topbar { background: var(--brand); color: #efe6d8; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand-logo { height: 46px; width: auto; }
.brand-sub { font-family: var(--serif); font-size: 1rem; letter-spacing: .04em; opacity: .85; border-left: 1px solid rgba(255,255,255,.25); padding-left: 14px; }
.topnav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topnav a, .topnav .linklike { color: #efe6d8; text-decoration: none; font-size: .95rem; opacity: .85; }
.topnav a:hover, .topnav a.on, .topnav .linklike:hover { opacity: 1; color: #fff; }
.topnav a.on { box-shadow: inset 0 -2px 0 var(--gold); }
.langs { display: flex; gap: 6px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.2); }
.langs a { font-size: .8rem; padding: 2px 6px; border-radius: 4px; }
.langs a.on { background: rgba(255,255,255,.14); box-shadow: none; }
.linklike { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--gold); }

.main { padding-top: 32px; padding-bottom: 56px; min-height: 60vh; }
.footer { border-top: 1px solid var(--line); color: var(--ink-2); font-size: .82rem; padding: 18px 0 28px; }

/* ---------- Composants ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.alert { padding: 12px 16px; border-radius: 8px; margin: 0 0 18px; border: 1px solid; font-size: .95rem; }
.alert-success { background: #edf6f0; border-color: #b9dcc6; color: #1f5434; }
.alert-error { background: #fbeeec; border-color: #ecc4bf; color: #7d2a24; }
.alert-info { background: var(--gold-soft); border-color: #e2cfb2; color: #5b4527; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .95rem/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--gold); color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #2a241f; color: #fff; border-color: #2a241f; }
.btn-outline { background: transparent; border-color: var(--gold); color: var(--brand); }
.btn-outline:hover { background: var(--gold-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--gold-soft); border-color: transparent; }
.btn-danger { background: transparent; border-color: #ecc4bf; color: var(--err); }
.btn-danger:hover { background: #fbeeec; border-color: var(--err); color: var(--err); }
.btn-sm { padding: 6px 11px; font-size: .84rem; }
.btn-block { width: 100%; }

.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--ink); }
.form label.check, label.check { display: flex; align-items: center; gap: 9px; font-weight: 400; cursor: pointer; }
input, select, textarea { width: 100%; font: 400 1rem/1.4 var(--sans); color: var(--ink); background: #fff; border: 1px solid #d6cbbd; border-radius: 8px; padding: 10px 12px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--brand); flex: none; padding: 0; }
input[type=file] { padding: 7px; font-size: .85rem; }
input:focus, select:focus, textarea:focus, .rich-area:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
input:disabled { background: #f3efe9; color: var(--ink-2); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.span-2 { grid-column: span 2; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 14px; margin: 0; display: grid; gap: 8px; }
legend { font-weight: 600; font-size: .9rem; padding: 0 6px; }

.pill { display: inline-block; font-size: .78rem; padding: 2px 9px; border-radius: 99px; background: #eee8e0; color: var(--ink-2); font-weight: 600; }
.pill-ok { background: #e3f1e8; color: var(--ok); }
.pill-wait { background: #fbefdc; color: var(--warn); }
.pill-off { background: #f3e1df; color: var(--err); }
.tag { font-size: .7rem; background: var(--gold-soft); color: var(--warn); padding: 1px 6px; border-radius: 4px; vertical-align: 1px; }

/* ---------- Authentification ---------- */
.auth { max-width: 440px; margin: 4vh auto; }
.auth-wide { max-width: 760px; }
.auth h1 { text-align: center; }
.auth .lead { text-align: center; margin-bottom: 24px; }
.auth .form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.auth-alt { margin-top: 26px; text-align: center; color: var(--ink-2); }
.auth-alt p { margin: 0 0 8px; }

/* ---------- Catalogue ---------- */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title { margin: 0; }
.search { max-width: 320px; }
.domaine { margin-top: 30px; }
.domaine-title { font-size: 1.15rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.wine-card { display: grid; gap: 4px; text-decoration: none; color: var(--ink); padding: 18px; transition: transform .15s, border-color .15s; }
.wine-card:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--ink); }
.wine-name { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; color: var(--brand); }
.wine-app { font-size: .88rem; color: var(--ink-2); font-style: italic; }
.wine-meta { font-size: .8rem; color: var(--gold); margin-top: 6px; font-weight: 600; }

.crumbs { font-size: .9rem; margin: 0 0 16px; color: var(--ink-2); }
.wine-head { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 26px; }
.wine-head h1 { margin-bottom: .15em; }
.year { color: var(--gold); }
.h-sec { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); margin: 0 0 14px; }
.h-sub { font-family: var(--sans); font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); margin: 22px 0 10px; }
.vintages { display: flex; flex-wrap: wrap; gap: 10px; }
.vintage { display: grid; place-items: center; min-width: 84px; padding: 14px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--brand); font: 600 1.15rem var(--serif); }
.vintage small { font: 400 .7rem var(--sans); color: var(--ink-2); }
.vintage:hover, .vintage.on { border-color: var(--gold); background: var(--gold-soft); }
.vintage.is-out { opacity: .7; }
.vintages-sm { margin-top: 14px; gap: 6px; }
.vintages-sm .vintage { min-width: 0; padding: 4px 11px; font-size: .9rem; border-radius: 6px; }

.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.side { position: sticky; top: 20px; display: grid; gap: 18px; }
.block { margin-bottom: 34px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 0 0 16px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 1.05rem; }

.pack { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.pack-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.pack-name { font-size: 1rem; min-width: 160px; }
.ean { display: inline-flex; align-items: center; gap: 8px; }
.ean code { font-size: 1.02rem; font-weight: 700; letter-spacing: .04em; background: #f6f1ea; padding: 3px 8px; border-radius: 6px; }
.copy { font: 600 .75rem var(--sans); border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 8px; cursor: pointer; color: var(--ink-2); }
.copy:hover { border-color: var(--gold); color: var(--brand); }
.copy.done { background: #e3f1e8; color: var(--ok); border-color: #b9dcc6; }
.pack-dims { display: flex; gap: 16px; font-size: .88rem; color: var(--ink-2); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.thumb { margin: 0; text-align: center; font-size: .8rem; }
.thumb img { display: block; margin: 0 auto 6px; max-height: 150px; width: auto; border-radius: 6px; background: #faf8f5; border: 1px solid var(--line); padding: 4px; }
.file-ext { display: grid; place-items: center; height: 110px; border: 1px dashed var(--line); border-radius: 6px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }

.acc { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.acc summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--brand); list-style: none; display: flex; justify-content: space-between; }
.acc summary::after { content: "+"; color: var(--gold); font-weight: 700; }
.acc[open] summary::after { content: "–"; }
.acc .rich { padding: 0 16px 14px; }
.rich p:first-child { margin-top: 0; }
.rich p:last-child { margin-bottom: 0; }
.quote { margin: 0 0 14px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; padding: 14px 18px; font-style: italic; }
.quote footer { font-style: normal; font-size: .85rem; color: var(--ink-2); margin-top: 8px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.note { font-weight: 700; color: var(--brand); }
.pdf-card { display: grid; gap: 10px; }
.pdf-card h2 { margin: 0; }
.pdf-card p { margin: 0; }

.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout-side { grid-template-columns: 1fr; }
  .side { position: static; }
  .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .brand-sub { display: none; }
  .brand-logo { height: 38px; }
  .topnav { gap: 12px; }
  .search { max-width: none; width: 100%; }
  .main { padding-top: 22px; }
}
@media print {
  .topbar, .footer, .side, .copy { display: none; }
  body { background: #fff; }
}
