/* The editorial photograph is Lav Varshney's CC0 camera image from scikit-image. */
.ph-page {
  --ink: #232320;
  --paper: #f7f6f2;
  --rule: #dcdcd3;
  --crimson: #a52136;
  --muted: #64645b;
  color: var(--ink);
  background: var(--paper);
}
.ph-page header, .ph-page main { max-width: 1100px; margin-inline: auto; }
.ph-page header {
  display: flex; align-items: center; gap: 1.5rem;
  background: transparent; border-bottom: 1px solid var(--rule); padding: 15px 0;
}
.ph-page header a { color: var(--ink); text-decoration: none; }
.ph-page header a:first-child { font-weight: 900; font-size: 1.35rem; border-inline-start: 5px solid var(--crimson); padding-inline-start: .6rem; }
.ph-page .ph-home { margin-inline-start: auto; font-size: .9rem; }
.ph-page header a:hover, .ph-page summary:hover { color: var(--crimson); }
.ph-page main { padding: clamp(22px, 5vw, 62px) 0 3rem; }
.ph-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: white; border: 1px solid var(--rule);
}
.ph-intro { grid-column: 2; grid-row: 1; position: relative; isolation: isolate; min-height: 510px; overflow: hidden; background: #302f2c; color: #fff; }
.ph-intro img { position: absolute; inset: 0; height: 100%; width: 100%; object-fit: cover; }
.ph-intro::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, #181815ed, transparent 67%); }
.ph-caption { position: absolute; bottom: 7%; inset-inline: 8%; z-index: 1; }
.ph-caption h1 { margin: 0; font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 900; line-height: 1.5; }
.ph-caption p { margin: 0; color: #fff; }
.ph-access { grid-column: 1; grid-row: 1; align-self: center; min-width: 0; padding: clamp(22px, 5vw, 66px); }
.ph-access h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); line-height: 1.55; margin: 0 0 1.35rem; }
.ph-access form { border: 0; padding: 0; margin: 0; max-width: none; }
.ph-page form label { font-size: .92rem; font-weight: 650; margin: 14px 0 5px; }
.ph-page input, .ph-page textarea, .ph-page select { border: 1px solid #a6a79e; border-radius: 5px; color: var(--ink); background: #fff; }
.ph-page button { min-height: 46px; padding-inline: 1.2rem; border: 0; border-radius: 5px; background: var(--crimson); font-weight: 650; }
.ph-access form button { width: 100%; margin-top: 18px; }
.ph-page :is(button,input,a,summary,textarea,select):focus-visible { outline: 3px solid #355e76; outline-offset: 2px; }
.ph-access details { border: 0; border-top: 1px solid var(--rule); border-radius: 0; padding: 0; margin: 0; }
.ph-access #login { padding-bottom: 20px; }
.ph-access summary { font-size: .9rem; color: var(--muted); padding: 2px 0; }
.ph-access details form { padding: 0 0 16px; }
.ph-page #status:empty { display: none; }
.ph-page #status:not(:empty) { margin: 0 0 16px; padding: 8px 12px; background: var(--paper); border-inline-start: 3px solid var(--crimson); }
.ph-page .field-error { display: block; color: #992038; padding-top: .2rem; }
.ph-page [aria-invalid=true] { border-color: var(--crimson); }
@media (max-width: 1150px) { .ph-page { padding-inline: clamp(12px, 4vw, 36px); } }
@media (max-width: 660px) {
  .ph-layout { grid-template-columns: 1fr; }
  .ph-intro, .ph-access { grid-column: 1; grid-row: auto; }
  .ph-intro { min-height: 145px; }
  .ph-intro img { object-position: 50% 36%; }
  .ph-caption { inset-inline: 20px; bottom: 12px; }
  .ph-caption h1 { font-size: 2.25rem; }
  .ph-caption p { font-size: .9rem; }
}

.ph-page .ph-file { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px dashed #92958d; border-radius: 5px; cursor: pointer; }
.ph-file span { flex: none; padding: 5px 12px; background: var(--paper); border-radius: 4px; }
.ph-file bdi { color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.ph-file input { position: absolute; inset: 0; height: 100%; opacity: 0; cursor: pointer; }
.ph-file:focus-within { outline: 3px solid #355e76; outline-offset: 2px; }

/* Signed-in photo desk */
.ph-page main:has(#login[hidden]) { display: flex; flex-direction: column; gap: clamp(18px, 3vw, 32px); padding-top: clamp(18px, 3vw, 40px); }
.ph-page main:has(#login[hidden]) .ph-layout { display: block; border: 0; background: transparent; }
.ph-page main:has(#login[hidden]) .ph-intro { display: flex; align-items: center; min-height: 115px; background: #262825; border-radius: 12px; }
.ph-page main:has(#login[hidden]) .ph-intro img { left: 0; right: auto; width: 35%; object-position: 46% 36%; }
.ph-page main:has(#login[hidden]) .ph-intro::after { background: linear-gradient(90deg, transparent 12%, #262825 36%); }
.ph-page main:has(#login[hidden]) .ph-caption { position: relative; inset: auto; padding: 24px clamp(20px, 4vw, 48px); }
.ph-page main:has(#login[hidden]) .ph-caption h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
.ph-page main:has(#login[hidden]) .ph-caption p { display: none; }
.ph-page main:has(#login[hidden]) .ph-access { padding: 0; }
.ph-page main:has(#login[hidden]) #account { order: 3; margin: 0; }
.ph-page #contributions { margin: 0; border: 0; padding: clamp(20px, 4vw, 48px); background: white; border-radius: 12px; box-shadow: 0 0 0 1px var(--rule); }
.ph-page #contribution-title { margin: 0; line-height: 1.5; font-size: clamp(1.4rem, 2.6vw, 2rem); }
.ph-page #contribution-title + p { margin: 6px 0 24px; color: var(--muted); }
.ph-page #submission-form { margin: 0; padding: 0; }
.ph-page #submission-fields { display: grid; gap: 12px; }
.ph-page .ph-picker { padding: clamp(16px, 3vw, 30px); border: 1px dashed #a0a49b; border-radius: 9px; background: #f7f8f4; }
.ph-page .ph-picker .ph-file { margin: 0; padding: 0; border: 0; gap: 16px; flex-wrap: wrap; }
.ph-page .ph-file span { background: #343a36; color: #fff; padding: 9px 24px; }
.ph-page #ph-file-help { display: block; margin-top: 12px; color: var(--muted); }
.ph-page #ph-edit-status { margin: 0; color: #92253b; }
.ph-page #ph-edit-status:empty, .ph-page #submission-message:empty { display: none; }
.ph-page #ph-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; margin-block: 8px 12px; }
.ph-stage { background: #252927; border-radius: 9px; padding: 16px; display: grid; grid-template-rows: minmax(180px, 1fr) auto; align-items: center; align-content: center; justify-items: center; min-width: 0; }
#ph-preview { max-width: 100%; max-height: 470px; width: auto; height: auto; display: block; background: repeating-conic-gradient(#d8d8d8 0% 25%, #fff 0% 50%) 0 0 / 12px 12px; }
#ph-preview.movable { cursor: grab; touch-action: none; }
#ph-preview.movable:active { cursor: grabbing; }
.ph-stage-footer { width: 100%; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 12px; color: #f1f2ee; font-size: .85rem; }
.ph-tools { min-width: 0; padding: 18px; border-radius: 9px; background: #f7f6f2; }
.ph-tools h3 { margin: 0 0 12px; font-size: 1.1rem; }
.ph-page .ph-tools label { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ph-tools output, .ph-tools p { color: var(--muted); font-size: .85rem; }
.ph-tools p { margin: 4px 0 12px; }
.ph-page .ph-tools input[type=range] { accent-color: var(--crimson); min-height: 34px; border: 0; padding: 0; background: transparent; }
.ph-tool-row, .ph-inbox { display: flex; flex-wrap: wrap; gap: 10px; }
.ph-page .ph-tools button, .ph-page .ph-inbox button { color: var(--ink); background: #fff; border: 1px solid var(--rule); border-radius: 6px; margin: 0; font-size: .88rem; padding-inline: 14px; }
.ph-page .ph-tool-row { margin-block: 12px 18px; }
.ph-page .ph-tool-row button[aria-pressed=true] { background: #38403b; color: white; }
.ph-page #ph-reset { margin-top: 12px; }
.ph-page .ph-caption-field { display: flex; gap: 8px; align-items: baseline; margin: 10px 0 0; }
.ph-caption-field span { color: var(--muted); font-weight: 400; font-size: .8rem; }
.ph-page #ph-caption-text { padding: 14px; }
.ph-page #send-submission, .ph-page #discard-submission { margin: 20px 0 0 10px; }
.ph-page .ph-inbox { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--rule); align-items: flex-start; gap: 16px; }
.ph-page .ph-inbox details { flex: 1 1 280px; min-width: 0; margin: 0; border-color: var(--rule); border-radius: 8px; }
.ph-inbox details[open] summary { margin-bottom: 12px; }
.ph-inbox button { margin-block: 4px !important; margin-inline-end: 6px !important; }
.ph-page #account form { padding: 16px; border: 1px solid var(--rule); margin: 18px 0; }
@media (min-width: 780px) {
  .ph-page #ph-editor { grid-template-columns: minmax(0, 1.8fr) minmax(248px, 1fr); }
}
@media (max-width: 540px) {
  .ph-page main:has(#login[hidden]) .ph-intro { min-height: 88px; }
  .ph-page #contributions { padding: 18px 14px; }
  .ph-page #send-submission { width: 100%; margin-inline: 0; }
  .ph-stage { padding: 10px; }
}
.ph-workspace { min-width: 0; align-self: start; }
.ph-image-wrap { position: relative; max-width: 100%; line-height: 0; }
#ph-preview { touch-action: none; cursor: crosshair; max-height: min(55vh,470px); }
#ph-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ph-page .ph-tools details { margin: 0; border: 0; border-bottom: 1px solid var(--rule); padding: 9px 0; background: transparent; }
.ph-tools summary { padding: 7px 0; font-weight: 650; cursor: pointer; }
.ph-tools select, .ph-tools input { width: 100%; }
.ph-tools input[type=color] { padding: 3px; }
.ph-tools input[type=checkbox] { width: 20px; min-height: 20px; accent-color: var(--crimson); }
.ph-page .ph-tools .ph-check { justify-content: start; }
.ph-page #ph-help { color: var(--muted); min-height: 1.8em; font-size: .88rem; }
.ph-page .ph-workspace button,.ph-page .ph-draft-row button { background: #fff; border: 1px solid var(--rule); color: var(--ink); padding: 5px 12px; }
.ph-swatches { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
.ph-page .ph-swatches button { padding: 3px; font-size:.7rem; }
.ph-swatches canvas { display: block; width:100%; }
.ph-page button[aria-pressed=true] { outline: 2px solid var(--crimson); }
#ph-dialog { border:1px solid var(--rule); border-radius:12px; width:min(94vw,720px); padding:18px; max-height:90vh; color:var(--ink); }
#ph-dialog::backdrop { background: rgb(18 20 19 / .65); }
#ph-dialog h3 { margin:0 0 12px; }
#ph-proof { overflow:auto; max-height:55vh; background:#262a28; text-align:center; }
#ph-proof img { max-height:54vh; width:auto; vertical-align:middle; }
#ph-proof.actual img { max-width:none; max-height:none; }
#ph-final-caption { white-space:pre-wrap; overflow-wrap:anywhere; }
#ph-spec { color:var(--muted); }
@media(min-width:780px){.ph-workspace { position:sticky; top:12px; }}
.ph-draft-row:not(:has(button:not([hidden]))) { display: none; }
.ph-record { border-top:1px solid var(--rule); padding-block:14px; }
.ph-record h3 { margin:0 0 12px; }
.ph-info-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,185px),1fr)); gap:4px 14px; }
.ph-page .ph-record input,.ph-page .ph-record textarea { width:100%; }
.ph-record small,.ph-record p { color:var(--muted); font-size:.88rem; margin:4px 0; }
.ph-record p:empty { display:none; }
#ph-review-details { white-space:pre-line; }
#ph-preview.grabbable { cursor:grab; }
#ph-preview.grabbable:active { cursor:grabbing; }

.ph-gallery { margin-block: 1.5rem 2rem; }
.ph-gallery-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit,minmax(min(100%,17rem),1fr)); }
.ph-gallery figure { margin: 0; overflow: hidden; border: 1px solid #dcd5cc; border-radius: .75rem; background: white; }
.ph-gallery img { display: block; width: 100%; max-height: 25rem; object-fit: contain; background: #151515; }
.ph-gallery figcaption { padding: .8rem 1rem 1rem; }
.ph-gallery figcaption p { margin: 0; overflow-wrap: anywhere; }
.ph-gallery ul, .ph-gallery nav { display: flex; flex-wrap: wrap; gap: .5rem; }
.ph-gallery ul { margin: .65rem 0 0; padding: 0; list-style: none; }
.ph-gallery li { background: #f1eeea; padding: .15rem .6rem; border-radius: .35rem; }

#ph-tracking { margin-block-start: 2rem; padding-block: 1rem; border-top: 1px solid var(--rule); }
#ph-track-form { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
#ph-track-id { width: min(100%, 23rem); min-width: 0; }
#ph-receipt { white-space: pre-line; overflow-wrap: anywhere; }

#ph-correction:not([hidden]) { display: grid; gap: .65rem; max-width: 38rem; margin-block: 1rem; }
#ph-corrected-text { width: 100%; resize: vertical; font: inherit; }
#ph-correction button { justify-self: start; }
