/* ================================================================
   Photo aléatoire · charte Parcs actus
   ================================================================ */

:root {
  --pa-red: #de0740;
  --pa-red-dark: #b8052f;
  --pa-grad: linear-gradient(135deg, #de0740 0%, #ff4b5c 100%);
  --pa-black: #111;
  --pa-text: #1a1a1a;
  --pa-gray: #666;
  --pa-line: #e8e8e8;
  --pa-bg: #f8f8f8;
  --pa-radius: 10px;
  --pa-radius-btn: 8px;
  --pa-shadow: 0 12px 30px -10px rgba(222, 7, 64, .35);
  --pa-container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--pa-text);
  background: var(--pa-bg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }

.pa-container {
  width: 100%;
  max-width: var(--pa-container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.pa-head {
  background: #fff;
  border-bottom: 1px solid var(--pa-line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.pa-head__inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pa-brand {
  text-decoration: none;
  color: var(--pa-black);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -.03em;
  display: flex;
  align-items: center;
}
.pa-brand img { max-height: 40px; width: auto; }
.pa-head__nav { display: flex; align-items: center; gap: 10px; }

/* ---------- Boutons ---------- */
.pa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  padding: 13px 20px;
  border-radius: var(--pa-radius-btn);
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.pa-btn svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}
.pa-btn--primary { background: var(--pa-grad); color: #fff; }
.pa-btn--primary:hover { transform: translateY(-2px); box-shadow: var(--pa-shadow); }
.pa-btn--primary:active { transform: translateY(0); }
.pa-btn--ghost { background: #fff; color: var(--pa-red); box-shadow: inset 0 0 0 1.5px var(--pa-red); }
.pa-btn--ghost:hover { background: var(--pa-red); color: #fff; transform: translateY(-2px); box-shadow: var(--pa-shadow); }
.pa-btn--lg { font-size: 16px; padding: 17px 28px; }
.pa-btn:focus-visible { outline: 3px solid rgba(222, 7, 64, .35); outline-offset: 3px; }

/* ---------- Titres ---------- */
.pa-viewer, .pa-upload { flex: 1; padding-top: 40px; padding-bottom: 56px; }

.pa-viewer__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.pa-eyebrow {
  margin: 0 0 6px;
  color: var(--pa-red);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.pa-title {
  margin: 0;
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.05;
  color: var(--pa-black);
}
.pa-count {
  margin: 0;
  font-size: 14px;
  color: var(--pa-gray);
  background: #fff;
  border: 1px solid var(--pa-line);
  border-radius: 999px;
  padding: 8px 16px;
}
.pa-count strong { color: var(--pa-red); font-weight: 800; }

/* ---------- Visionneuse ---------- */
.pa-frame {
  position: relative;
  margin: 0;
  background: #fff;
  border-radius: var(--pa-radius);
  border: 1px solid var(--pa-line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  height: min(70vh, 760px);
  padding: 12px;
}
.pa-frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  transition: opacity .22s ease, transform .22s ease;
}
.pa-frame img.is-out { opacity: 0; transform: scale(.985); }

.pa-frame__loader {
  position: absolute;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--pa-grad);
  opacity: 0;
}
.pa-frame.is-loading .pa-frame__loader { opacity: 1; animation: pa-load 1s ease-in-out infinite; }
@keyframes pa-load {
  0% { width: 0; left: 0; }
  50% { width: 60%; left: 20%; }
  100% { width: 0; left: 100%; }
}

.pa-viewer__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.pa-hint { margin: 0; color: var(--pa-gray); font-size: 13px; }
kbd {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--pa-line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--pa-black);
}

/* ---------- État vide ---------- */
.pa-empty {
  background: #fff;
  border: 1px solid var(--pa-line);
  border-radius: var(--pa-radius);
  text-align: center;
  padding: 72px 24px;
}
.pa-empty__icon, .pa-drop__icon {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(222, 7, 64, .08);
  color: var(--pa-red);
  display: flex; align-items: center; justify-content: center;
}
.pa-empty__icon svg, .pa-drop__icon svg {
  width: 28px; height: 28px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.pa-empty h2 { margin: 0 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.pa-empty p { margin: 0; color: var(--pa-gray); }

/* ---------- Zone d'envoi ---------- */
.pa-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #fff;
  border: 2px dashed #d9d9d9;
  border-radius: var(--pa-radius);
  padding: 56px 24px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.pa-drop:hover, .pa-drop.is-over {
  border-color: var(--pa-red);
  transform: translateY(-3px);
  box-shadow: var(--pa-shadow);
}
.pa-drop.is-over { background: #fff5f7; }
.pa-drop__title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--pa-black); }
.pa-drop__sub { margin-top: 6px; font-size: 14px; color: var(--pa-gray); }
.pa-drop__sub u { color: var(--pa-red); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

/* ---------- File d'envoi ---------- */
.pa-queue {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.pa-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--pa-line);
  border-radius: var(--pa-radius);
  padding: 10px;
}
.pa-item__thumb {
  width: 56px; height: 56px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 6px;
  background: var(--pa-bg);
}
.pa-item__body { flex: 1; min-width: 0; }
.pa-item__name {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pa-item__bar { height: 6px; background: #f0f0f0; border-radius: 999px; overflow: hidden; }
.pa-item__bar span { display: block; height: 100%; width: 0; background: var(--pa-grad); border-radius: 999px; transition: width .2s ease; }
.pa-item__status { margin: 6px 0 0; font-size: 12px; color: var(--pa-gray); }
.pa-item.is-done .pa-item__status { color: #13854e; font-weight: 600; }
.pa-item.is-error .pa-item__status { color: var(--pa-red); font-weight: 600; }
.pa-item.is-error .pa-item__bar span { width: 100% !important; background: #f3c2cf; }

/* ---------- Footer ---------- */
.pa-foot {
  background: #fff;
  border-top: 1px solid var(--pa-line);
  padding: 20px 0;
  font-size: 13px;
  color: var(--pa-gray);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .pa-container { padding: 0 16px; }
  .pa-head__inner { height: 60px; }
  .pa-brand { font-size: 19px; }
  .pa-only-desktop { display: none !important; }
  .pa-viewer, .pa-upload { padding-top: 28px; }
  .pa-frame { height: 62vh; padding: 8px; }
  .pa-viewer__actions .pa-btn { width: 100%; }
  .pa-drop { padding: 40px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
