/* ==========================================================================
   Editorial Ledger: contact.css (E1, Contact: classifieds)
   The brief form on its bright panel (E2), form fields (DESIGN.md 5.9), the
   send error note, the placed notice (M7), and the boxed notices (E3).
   Page CSS only: tokens, .notice, .letter and reveal states live in base.css
   (see COMPONENTS.md). Budget: 5 KB gzip.
   Order: Sections, Media Queries.
   ========================================================================== */


/* --------------------------------------------------------------------------
   Sections: layout of the classified page
   -------------------------------------------------------------------------- */

.classified { padding-top: 0; }

.classified > .grid { row-gap: var(--space-2xl); }

.order,
.notices { grid-column: 1 / -1; }

.classified .section-head { margin-bottom: var(--space-l); }


/* The agenda in short, in the page head box (64rem and up). */
.steps {
  margin-top: .5rem;
  padding: 0;
  list-style: none;
}

.steps li,
.steps__more {
  display: flex;
  align-items: baseline;
  gap: .625rem;
  padding-block: .4375rem;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.25;
}

.steps__no,
.steps__folio {
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--accent);
}

.steps__more {
  gap: .375rem;
  padding-bottom: 0;
  border: 0;
  font-style: italic;
  font-weight: 400;
  text-decoration: none;
}


/* --------------------------------------------------------------------------
   Sections: the brief form (E2)
   -------------------------------------------------------------------------- */

/* Fields sit on paper-bright only (contrast pairs in DESIGN.md 2.2). */
.order__panel {
  padding: var(--space-m) var(--space-s);
  background: var(--paper-bright);
  border: 1px solid var(--ink);
}

/* display values below would beat the hidden attribute without this. */
.order__panel [hidden] { display: none; }

/* After a send the notice takes the panel's place: one frame, not a box in a box. */
.order__panel.is-placed {
  padding: 0;
  border: 0;
  background: none;
}

.form {
  display: grid;
  gap: var(--space-m) calc(var(--gutter) * 1.5);
}

.field {
  display: grid;
  align-content: start;
  gap: .375rem;
  min-width: 0;
}

.field__label {
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.field__hint {
  font-family: var(--font-sans);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-muted);
}

.field__input {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: .5rem 0;
  border: 0;
  border-bottom: 1.5px solid var(--rule);
  border-radius: 0;
  background: transparent;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.3;
  color: var(--ink);
  transition: border-color var(--dur-1);
}

.field__input:hover { border-bottom-color: var(--ink); }

select.field__input {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2rem;
  text-overflow: ellipsis;
  /* Chevron drawn in --ink (#16130F): a data URI cannot read a custom property. */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316130F' stroke-width='1.5' stroke-linecap='square'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E") no-repeat right .125rem center / 1.125rem;
}

/* The brief is written on ledger paper: a blue line under every row of text,
   with a small margin above the first row and below the last. */
textarea.field__input {
  min-height: calc(1.75rem * 6 + 1rem + 3px);
  margin-top: .25rem;
  padding: .5rem .75rem;
  border: 1.5px solid var(--rule);
  line-height: 1.75rem;
  resize: vertical;
  background: repeating-linear-gradient(to bottom, transparent 0 calc(1.75rem - 1px), var(--ledger-line) calc(1.75rem - 1px) 1.75rem) 0 .5rem no-repeat local;
}

textarea.field__input:hover { border-color: var(--ink); }

.field__input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.field__input[aria-invalid="true"] {
  border-bottom-width: 2px;
  border-color: var(--accent-deep);
}

/* Errors: icon, the word "Correction" and the message, never color alone. */
.field__error {
  font-size: var(--fs-small);
  line-height: 1.35;
  color: var(--error);
}

.field__error:empty { display: none; }

.field__error .icon { margin-right: .375rem; }

.field__flag {
  margin-right: .5rem;
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-m);
  padding-top: var(--space-2xs);
}

.form__send { min-width: 11.5rem; }

.form__send[aria-disabled="true"] { cursor: progress; }

.form__promise {
  font-size: var(--fs-small);
  font-style: italic;
  color: var(--ink-soft);
}

/* Send error: a boxed note in the error ink. */
.form__alert { border-color: var(--accent-deep); }

.form__alert:empty { display: none; }

.form__alert-text {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .5rem;
  font-size: var(--fs-small);
  line-height: 1.45;
  color: var(--error);
}

.form__alert-text .icon { margin-top: .2em; }
.form__alert-text .ext .icon { margin-top: 0; }

.form__alert-detail {
  margin: .375rem 0 0 1.5rem;
  font-size: var(--fs-small);
  font-style: italic;
  line-height: 1.4;
  color: var(--ink-soft);
}

/* The placed notice (M7): the visitor's own classified, set line by line.
   Each line sits in its paragraph, which is the mask it rises through. */
.notice--placed {
  --pad: var(--space-s);
  display: grid;
  gap: .375rem;
  padding: var(--pad);
}

.notice__frame {
  position: absolute;
  inset: 0;
  border: 1px solid var(--ink);
  pointer-events: none;
}

.notice--placed > .rule--heavy { margin: calc(var(--pad) * -1) calc(var(--pad) * -1) .375rem; }
.notice--placed > .rule--double { margin-block: .5rem .25rem; }

.notice--placed > p,
.notice--placed > h3 {
  overflow: clip;
  padding-block: .08em .16em;
  margin-block: -.08em -.16em;
}

.notice__line {
  display: inline-block;
  text-wrap: balance;
}

.notice--placed .notice__head { line-height: 1.15; }

.notice__by {
  font-size: var(--fs-body);
  overflow-wrap: anywhere; /* a long name without spaces stays in the box */
}

.notice__date {
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.notice__thanks {
  font-size: var(--fs-deck);
  font-style: italic;
  line-height: 1.32;
}

/* The receipt under the form (r017). */
.order__receipt {
  max-width: 40rem;
  margin-top: var(--space-l);
  padding-left: var(--space-s);
  border-left: 1px solid var(--ink);
}


/* --------------------------------------------------------------------------
   Sections: notices (E3)
   -------------------------------------------------------------------------- */

.notices__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-s);
}

.notices__wide { grid-column: 1 / -1; }

.notices .notice { padding: var(--space-s); }

.notices .notice__head {
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--hairline);
  color: var(--accent);
}

.notices .notice__text {
  margin-top: .625rem;
  font-size: var(--fs-body);
  font-style: normal;
  line-height: 1.45;
  color: var(--ink);
}

.elsewhere { margin-top: .25rem; }

.elsewhere li + li { border-top: 1px solid var(--hairline); }

.elsewhere a {
  display: flex;
  align-items: center;
  gap: .625rem;
  min-height: 2.75rem;
  text-decoration: none;
}

.elsewhere .icon--brand {
  width: 1.125rem;
  height: 1.125rem;
  color: var(--ink-muted);
}

.elsewhere__name { font-weight: 600; }

.elsewhere__note {
  font-size: var(--fs-small);
  font-style: italic;
  color: var(--ink-muted);
}

/* The arrow goes to the right edge and moves out on hover. */
.elsewhere a > .icon:not(.icon--brand) {
  margin-left: auto;
  width: .875rem;
  height: .875rem;
  transition: transform var(--dur-2) var(--ease-press);
}

.elsewhere a:hover > .icon:not(.icon--brand) { transform: translate(2px, -2px); }


/* --------------------------------------------------------------------------
   Media Queries
   -------------------------------------------------------------------------- */

@media (min-width: 48rem) {
  .order__panel { padding: var(--space-l); }
  .notice--placed { --pad: var(--space-l); }

  /* Name and email side by side; project type and timeline side by side. */
  .form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--full { grid-column: 1 / -1; }
}

@media (min-width: 64rem) {
  .classified > .grid { align-items: start; }
  .order { grid-column: 1 / span 7; }
  .notices { grid-column: 8 / span 5; padding-left: var(--gutter); }

  /* The agenda box sits on the notices column; the h1 and the deck keep 7 columns. */
  .page-head__aside {
    grid-column: 8 / -1;
    margin-left: var(--gutter);
  }
}

@media (forced-colors: active) {
  .field__input { border-color: CanvasText; }
  .notice__frame { border-color: CanvasText; }
}
