/* Vue article : en-tête pleine largeur, colonne de lecture centrée, sans 3D. */

.post {
  padding-top: 4px;
}

/* En-tête : a la matière d'une face avant, il en est la continuation. */
.post__hero {
  position: relative;
  background: var(--surface-face);
  border: 1px solid var(--border);
  border-radius: var(--radius-tile);
  overflow: hidden;
  transform-origin: 0 0;
}

.post__hero-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 28px 28px;
}

.post__back {
  align-self: flex-start;
  font-size: var(--fs-s);
  color: var(--text-muted);
  text-decoration: none;
}

.post__back::before {
  content: "← ";
}

.post__back:hover,
.post__back:focus-visible {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: .15em;
}

.post__back:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

.post__cover {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  border-radius: calc(var(--radius-tile) - 2px);
}

.post__title {
  margin: 0;
  font-size: var(--fs-l);
  font-weight: var(--fw-medium);
  line-height: 1.2;
  outline: none;
}

.post__meta {
  margin: 0;
  font-size: var(--fs-s);
  color: var(--text-muted);
}

/* Colonne de lecture : 68 caractères, centrée. */
.post__body {
  max-width: 68ch;
  margin: 32px auto 0;
  font-size: var(--fs-m);
  line-height: 1.6;
}

.post__body > :first-child {
  margin-top: 0;
}

.post__body p,
.post__body ul,
.post__body ol,
.post__body figure {
  margin: 0 0 1.1em;
}

.post__body h1,
.post__body h2,
.post__body h3 {
  margin: 1.8em 0 .6em;
  font-weight: var(--fw-medium);
  line-height: 1.25;
}

.post__body h1,
.post__body h2 {
  font-size: var(--fs-l);
}

.post__body h3 {
  font-size: var(--fs-m);
}

.post__body a {
  color: var(--accent);
  text-underline-offset: .15em;
}

.post__body a:hover,
.post__body a:focus-visible {
  color: var(--text-primary);
}

.post__body code {
  font-family: var(--font-mono);
  font-size: var(--fs-s);
  background: var(--surface-code);
  padding: .1em .35em;
  border-radius: 4px;
}

.post__body pre {
  margin: 0 0 1.1em;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--surface-code);
  border-radius: var(--radius-tile);
  font-size: var(--fs-s);
  line-height: 1.5;
}

.post__body pre code {
  padding: 0;
  background: none;
}

.post__body blockquote {
  margin: 1.2em 0;
  padding: 0 0 0 16px;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
}

.post__body blockquote > :last-child {
  margin-bottom: 0;
}

.post__body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-tile);
}

.post__body figcaption {
  margin-top: 6px;
  font-size: var(--fs-s);
  color: var(--text-muted);
}

.post__error {
  color: var(--text-muted);
}

/* Pièces jointes (js/files.js) : sous le texte, dans la même colonne. Une
   ligne par fichier, trombone, nom, taille, qui se télécharge d'un clic ;
   une fois connecté, une croix corail pour retirer et un bouton pour ajouter. */
.post__files {
  max-width: 68ch;
  margin: 36px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Zone de dépôt (connecté) : la section entière accueille des fichiers
   glissés depuis l'explorateur. */
.post__files {
  border-radius: 8px;
  outline: 2px dashed transparent;
  outline-offset: 8px;
  transition: outline-color var(--dur-fade);
}

.post__files--drop {
  outline-color: var(--accent);
}

.post__files-title {
  margin: 0 0 10px;
  font: var(--fw-medium) var(--fs-s) / 1.2 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.post__files-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.file {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.file__link {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
}

.file__link:hover,
.file__link:focus-visible {
  background: var(--surface-face);
}

.file__link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.file__link svg,
.post__files-btn svg,
.file__remove svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.file__link svg {
  color: var(--accent);
}

.file__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-decoration: underline;
  text-underline-offset: .15em;
  text-decoration-color: var(--border);
}

.file__link:hover .file__name {
  text-decoration-color: currentColor;
}

.file__size {
  flex: 0 0 auto;
  font: var(--fw-regular) var(--fs-s) / 1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

/* Retirer : corail, comme tout ce qui supprime. */
.file__remove {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--danger);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.file__remove:hover,
.file__remove:focus-visible {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--text-on-danger);
}

.file__remove:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.file__remove:disabled {
  opacity: .6;
  cursor: default;
}

.post__files-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 12px;
}

.post__files-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text-primary);
  font: var(--fw-regular) var(--fs-s) / 1.2 var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.post__files-btn:hover,
.post__files-btn:focus-visible {
  border-color: var(--text-primary);
}

.post__files-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.post__files-btn:disabled {
  opacity: .6;
  cursor: default;
}

.post__files-status {
  margin: 0;
  font-size: var(--fs-s);
  color: var(--text-muted);
}

.post__files-status--error {
  color: var(--danger);
}

/* En-tête en transit dans la couche FLIP : dimensions figées par main.js. */
.post__hero--flip {
  position: absolute;
}

@media (max-width: 479.98px) {
  .post__hero-inner {
    padding: 16px 18px 20px;
  }
}
