/*
 * Home page — set as a French letter: address block and dateline on the
 * right, "Objet :" with its label in the margin, the salutation hanging into
 * the margin, then the body, the closing formula and the seal. The weekly
 * picks and the newsletter P.-S. follow on the same sheet grid (site.css).
 */

/* ==========================================
 * THE LETTER
 * ========================================== */

.letter {
  padding-top: var(--space-12);
}

.letter-head {
  grid-column: margin-start / full-end;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-6) var(--space-12);
  font-size: var(--cj-small);
  line-height: var(--line-height-normal);
  color: var(--ink-secondary);
}

.letter-addressee {
  display: grid;
  gap: var(--space-5);
  padding-top: var(--space-8);
}

.letter-recipient {
  font-style: italic;
}

.letter-subject {
  grid-column: margin-start / text-end;
  display: grid;
  grid-template-columns: subgrid;
  align-items: baseline;
  margin-top: var(--space-10);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-snug);
  text-wrap: balance;
}

.letter-subject-label {
  grid-column: margin;
  justify-self: end;
  font-size: var(--cj-small);
  color: var(--ink-muted);
}

.letter-salutation {
  grid-column: margin-start / full-end;
  margin-top: var(--space-10);
  margin-bottom: var(--space-8);
  margin-left: -0.04em;
  font-size: var(--cj-salutation);
  font-style: italic;
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* English edition: the French salutation glossed once, like a translator's note. */
.letter-gloss {
  margin-top: calc(-1 * var(--space-4));
  margin-bottom: var(--space-8);
  font-size: var(--cj-small);
  font-style: italic;
  line-height: var(--line-height-normal);
  color: var(--ink-muted);
  text-wrap: pretty;
}

.letter-body {
  text-wrap: pretty;
}
.letter-body p {
  text-indent: 2em;
}

.letter-closing {
  margin-top: var(--space-6);
}

.letter-signature {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
  font-style: italic;
  color: var(--ink-secondary);
}

/* The wax seal: the mark knocked out of a gules disc, pressed slightly askew. */
.seal {
  display: grid;
  place-items: center;
  width: var(--cj-seal);
  aspect-ratio: 1;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--paper);
  box-shadow:
    0 0 0 var(--border-width-3) var(--paper),
    0 0 0 calc(var(--border-width-3) + var(--border-width-1)) var(--accent);
  rotate: -9deg;
}
.seal-mark {
  width: 58%;
  height: auto;
}

@media (max-width: 47.99em) {
  .letter { padding-top: var(--space-8); }
  .letter-body { hyphens: auto; }
  .letter-head {
    flex-direction: column;
    gap: var(--space-4);
    font-size: var(--font-size-sm);
  }
  .letter-sender { display: none; }
  .letter-addressee { padding-top: 0; gap: var(--space-3); }
  .letter-subject {
    display: block;
    margin-top: var(--space-8);
    font-size: var(--font-size-lg);
  }
  .letter-subject-label { font-size: inherit; }
  .letter-salutation { margin-top: var(--space-6); margin-bottom: var(--space-6); }
}

/* ==========================================
 * CETTE SEMAINE — five ruled lines waiting for five picks
 * ========================================== */

.sheet-heading {
  font-size: var(--cj-heading);
  margin-bottom: var(--space-6);
}

.week-empty {
  grid-column: margin-start / text-end;
  display: grid;
  grid-template-columns: subgrid;
}

.week-empty-message {
  grid-column: text;
  font-style: italic;
  color: var(--ink-secondary);
  text-wrap: pretty;
}

.week-slots {
  grid-column: margin-start / text-end;
  display: grid;
  grid-template-columns: subgrid;
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.week-slot {
  grid-column: margin-start / text-end;
  display: grid;
  grid-template-columns: subgrid;
  align-items: end;
  height: var(--space-12);
}
.week-slot::after {
  content: "";
  grid-column: text;
  grid-row: 1;
  border-bottom: var(--border-width-1) solid var(--line);
}

.week-slot-number {
  grid-column: margin;
  grid-row: 1;
  justify-self: end;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--cj-display-sm);
  line-height: 1;
  color: var(--accent);
  translate: 0 0.12em;
}

@media (max-width: 47.99em) {
  .week-slot {
    grid-template-columns: var(--cj-display-sm) minmax(0, 1fr);
    column-gap: var(--space-3);
    height: var(--space-10);
  }
  .week-slot-number { grid-column: 1; justify-self: start; font-size: var(--font-size-2xl); }
  .week-slot::after { grid-column: 2; }
}

/* The picks write on those lines: number and title share a baseline, the
   rule stays at the foot of each entry, and spares or empty slots continue
   the same ruling below. */

.week-picks {
  grid-column: margin-start / text-end;
  display: grid;
  grid-template-columns: subgrid;
}

.week-dek,
.week-spare-note,
.week-more {
  grid-column: text;
  text-wrap: pretty;
}

.week-dek {
  font-style: italic;
  color: var(--ink-secondary);
}

.week-slots + .week-slots { margin-top: 0; }

.week-pick {
  height: auto;
  min-height: var(--space-12);
  padding-top: var(--space-5);
}
.week-pick .week-slot-number {
  align-self: baseline;
  translate: none;
}
.week-pick::after { align-self: end; }

.week-pick-body {
  grid-column: text;
  grid-row: 1;
  align-self: baseline;
  padding-bottom: var(--space-3);
}

.week-pick-title {
  font-family: var(--font-display);
  font-size: var(--cj-entry-title);
  line-height: var(--line-height-snug);
  text-decoration-color: var(--line-strong);
  text-wrap: pretty;
}
.week-pick-title:hover { text-decoration-color: var(--accent); }

.week-pick-meta {
  margin-top: var(--space-1);
  font-size: var(--cj-small);
  line-height: var(--line-height-normal);
  color: var(--ink-muted);
}

.week-spare-note {
  margin-top: var(--space-8);
  font-style: italic;
  color: var(--ink-secondary);
}

.week-more {
  margin-top: var(--space-6);
  font-size: var(--cj-small);
  font-style: italic;
  color: var(--ink-muted);
}
.week-more-link {
  font-style: normal;
  color: var(--ink);
  white-space: nowrap;
}

@media (max-width: 47.99em) {
  .week-pick { height: auto; min-height: var(--space-10); padding-top: var(--space-4); }
  .week-pick-body { grid-column: 2; }
  .week-more-link { display: inline-block; margin-top: var(--space-2); }
}

/* ==========================================
 * P.-S. — the newsletter signup
 * ========================================== */

.postscript-mark {
  grid-column: margin;
  justify-self: end;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--cj-heading);
  line-height: var(--line-height-tight);
  color: var(--accent);
}

.postscript-body {
  grid-column: text;
}

.postscript-title {
  font-size: var(--cj-heading);
  margin-bottom: var(--space-4);
}

.postscript-lede {
  text-wrap: pretty;
  margin-bottom: var(--space-8);
}

/* English edition: the French letter, owned up to before the French form. */
.postscript-in-french {
  margin-top: calc(-1 * var(--space-5));
  margin-bottom: var(--space-6);
  font-style: italic;
  color: var(--ink-secondary);
  text-wrap: pretty;
}

.postscript-archive {
  margin-top: var(--space-6);
  font-size: var(--cj-small);
  font-style: italic;
  color: var(--ink-muted);
}
.postscript-archive a {
  color: var(--ink-secondary);
  text-decoration-color: var(--line-strong);
}
.postscript-archive a:hover {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

@media (min-width: 48em) {
  .postscript-mark,
  .postscript-body { grid-row: 2; }
}

@media (max-width: 47.99em) {
  .postscript-mark {
    justify-self: start;
    font-size: var(--cj-display-sm);
    margin-bottom: var(--space-1);
  }
}

/* ==========================================
 * SIGNUP FORM
 * ========================================== */

.signup {
  display: grid;
  gap: var(--space-2);
}

.signup-fieldset {
  display: grid;
  gap: var(--space-2);
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.signup-label {
  font-size: var(--cj-small);
  color: var(--ink-secondary);
}

.signup-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.signup-input {
  flex: 1 1 16rem;
  min-height: var(--space-12);
  font-size: var(--cj-body-size);
}

.signup-button {
  flex: none;
  min-height: var(--space-12);
  padding-inline: var(--space-6);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

/* Closed until NewsletterSettings opens: field and button share one quiet ink
   wash so the whole row reads "pas encore" in both colour schemes, never as a
   faded or outlined call to action. */
.signup-fieldset:disabled .signup-input,
.signup-fieldset:disabled .signup-button {
  opacity: 1;
  background: var(--cj-closed-bg);
  border-color: var(--cj-closed-line);
  color: var(--ink-faint);
}
.signup-fieldset:disabled .signup-input::placeholder {
  color: var(--ink-faint);
}

.signup-input[aria-invalid="true"] {
  border-color: var(--negative);
}

.signup-error {
  font-size: var(--cj-small);
  color: var(--negative);
}

.signup-note {
  font-size: var(--cj-small);
  font-style: italic;
  color: var(--ink-muted);
}

.signup-sent {
  padding-left: var(--space-4);
  border-left: var(--border-width-2) solid var(--accent);
  font-size: var(--font-size-lg);
  font-style: italic;
  line-height: var(--line-height-snug);
  text-wrap: pretty;
}

/* /abonnement: the P.-S. on a sheet of its own, under one line of the letter
   saying where the rest of it is. */
.postscript-page {
  padding-top: var(--space-16);
}

.postscript-salutation {
  margin-bottom: var(--space-10);
  font-style: italic;
  color: var(--ink-secondary);
  text-wrap: pretty;
}

.postscript-salutation-name {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-snug);
  color: var(--ink);
}

@media (max-width: 30em) {
  .signup-button { flex: 1 1 100%; }
}
