/* ============================================================
   LIVE LIFE WRONG — Worn Wrong (worn.html, js/worn.js)
   The owners' wall: photographs edge to edge on hairline gaps,
   each at its own proportions (reserved before it loads), a typed
   caption beneath. Then the form to add yours.
   ============================================================ */
.worn { padding: calc(var(--nav-h) + var(--space-block)) 0 0; }
.worn .rtw__head h1 { font-family: var(--font-title); font-size: clamp(2.2rem, 1.4rem + 3.4vw, 4.4rem); font-weight: 400; color: var(--red); text-transform: uppercase; letter-spacing: 0.01em; line-height: 0.95; }
.worn__intro { padding: 1.2rem var(--gutter) var(--space-block); max-width: calc(52ch + 2 * var(--gutter)); color: var(--mute-dark); }

/* the wall */
.worn__wall { columns: 3 18rem; column-gap: 2px; padding: 0 0 var(--space-section); }
.worn__item { break-inside: avoid; margin: 0 0 2px; }
.worn__open { display: block; width: 100%; padding: 0; background: var(--greige); cursor: zoom-in; overflow: hidden; }
.worn__open img { width: 100%; height: auto; transition: transform 1.4s var(--ease-luxe); }
.worn__open:hover img { transform: scale(1.02); }
.worn__open:focus-visible { outline-offset: -3px; outline-color: var(--ivory); }
.worn__cap { padding: 0.7rem var(--gutter) 1.4rem 1rem; font-family: var(--font-mono); font-size: var(--text-small); letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute-dark); }
.worn__wall.is-empty { columns: auto; padding: 0 var(--gutter) var(--space-section); }
.worn__empty { display: grid; justify-items: start; gap: 1.2rem; padding: clamp(2.5rem, 6vw, 5rem) 0; border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
.worn__empty p { font-family: var(--font-title); font-size: clamp(1.5rem, 1rem + 2vw, 2.6rem); text-transform: uppercase; letter-spacing: 0.01em; line-height: 1; color: var(--onyx); }

/* add yours */
.worn-add { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 7rem); align-items: start; padding: var(--space-section) var(--gutter); background: var(--ivory-2); border-top: 1px solid var(--color-line); }
.worn-add__title { font-family: var(--font-title); font-weight: 400; font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3.3rem); text-transform: uppercase; letter-spacing: 0.01em; line-height: 0.95; color: var(--red); margin-bottom: 1.4rem; }
.worn-add__intro p { color: var(--mute-dark); max-width: 42ch; margin-bottom: 1rem; }
.worn-add__intro .worn-add__fine { font-size: var(--text-small); color: var(--mute); }
.worn-form { display: grid; gap: 1.6rem; max-width: 36rem; }
.worn-f { display: grid; gap: 0.4rem; }
.worn-f > label:not(.worn-check), .worn-f__label { font-size: var(--text-micro); font-weight: 500; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--mute-dark); }
.worn-f > label:not(.worn-check) span { color: var(--mute); letter-spacing: var(--track-mid); }
.worn-f input:not([type="checkbox"]):not([type="file"]), .worn-f select { width: 100%; min-height: 44px; font: inherit; font-size: var(--text-base); color: var(--onyx); background: transparent; border: 0; border-bottom: 1px solid var(--onyx); border-radius: 0; padding: 0.5rem 0; outline: none; }
.worn-f input:focus, .worn-f select:focus { border-color: var(--red); }
.worn-f input:disabled { color: var(--mute); border-bottom-style: dashed; }
.worn-f input[aria-invalid="true"], .worn-f select[aria-invalid="true"] { border-color: var(--red); }
#worn-serial { font-family: var(--font-mono); letter-spacing: 0.12em; max-width: 8rem; }
.worn-f__hint { font-size: var(--text-small); color: var(--mute); }
.worn-f__err { font-style: normal; font-size: var(--text-small); color: var(--red); }
.worn-f__err:empty { display: none; }
.worn-photo { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1.2rem; align-items: end; }
.worn-photo__frame { aspect-ratio: 4 / 5; background: var(--greige); display: grid; place-items: center; overflow: hidden; }
.worn-photo__frame span { padding: 0.8rem; text-align: center; font-family: var(--font-mono); font-size: var(--text-small); letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute-dark); }
.worn-photo__frame img { width: 100%; height: 100%; object-fit: contain; }
.worn-photo__pick { display: grid; gap: 0.6rem; justify-items: start; }
.worn-photo__input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.worn-photo__pick .btn { cursor: pointer; min-height: 44px; padding-inline: 1.6em; }
.worn-photo__input:focus-visible + .btn { outline: 1px solid var(--onyx); outline-offset: 3px; }
.worn-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.worn-check { display: flex; gap: 0.8rem; align-items: flex-start; cursor: pointer; color: var(--onyx); font-size: var(--text-base); line-height: 1.5; min-height: 44px; }
.worn-check input { flex: none; width: 1.15rem; height: 1.15rem; margin: 0.2rem 0 0; accent-color: var(--onyx); }
.worn-form__status { min-height: 1.4em; font-size: var(--text-small); color: var(--red); }
.worn-form__status:empty { min-height: 0; }
.worn-form__send { justify-self: start; min-width: 12rem; min-height: 48px; }
.worn-form__send:disabled { opacity: 0.6; cursor: progress; }
.worn-done { font-family: var(--font-display); font-size: var(--text-h3); font-weight: 300; line-height: 1.3; max-width: 26ch; padding-top: 1.2rem; border-top: 1px solid var(--onyx); outline: none; }

/* the larger view */
.worn-box { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--black); color: var(--ivory); }
.worn-box::backdrop { background: rgba(0, 0, 0, 0.9); }
.worn-box__in { position: relative; height: 100%; display: grid; place-items: center; padding: 4.2rem var(--gutter) 1.4rem; }
.worn-box__fig { display: grid; justify-items: center; gap: 1rem; max-width: 100%; }
.worn-box__fig img { max-width: min(100%, 72rem); max-height: calc(100dvh - 10rem); width: auto; height: auto; object-fit: contain; }
.worn-box__cap { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.6rem 1.6rem; font-family: var(--font-mono); font-size: var(--text-small); letter-spacing: 0.06em; text-transform: uppercase; color: rgba(242, 240, 234, 0.8); text-align: center; }
.worn-box__cap .u-line { color: var(--ivory); padding-block: 0.8rem 0.35em; }
.worn-box__close { position: absolute; top: 0.8rem; right: var(--gutter); min-height: 44px; padding: 0 0.2rem; border-bottom: 1px solid currentColor; color: var(--ivory); }
.worn-box__nav { position: absolute; top: 50%; width: 2.75rem; height: 2.75rem; transform: translateY(-50%); display: grid; place-items: center; border: 1px solid rgba(242, 240, 234, 0.4); border-radius: 50%; color: var(--ivory); background: rgba(0, 0, 0, 0.4); }
.worn-box__nav:hover { background: var(--ivory); color: var(--onyx); }
.worn-box__nav--prev { left: var(--gutter); } .worn-box__nav--next { right: var(--gutter); }
.worn-box__nav[hidden] { display: none; }
.worn-box button:focus-visible, .worn-box a:focus-visible { outline-color: var(--ivory); }

@media (max-width: 900px) {
  .worn-add { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .worn__wall { columns: 2; }
  .worn__cap { padding: 0.55rem 0.7rem 1rem; }
  .worn-f input:not([type="checkbox"]):not([type="file"]), .worn-f select { font-size: 16px; }
  .worn-photo { grid-template-columns: 7.5rem minmax(0, 1fr); }
  .worn-box__nav { top: auto; bottom: 1rem; transform: none; }
  .worn-box__in { padding-bottom: 4.6rem; }
}
@media (prefers-reduced-motion: reduce) { .worn__open img { transition: none; } }
