/* Public photo sharing pages. The palette follows the shared theme. */
.photo-host {
  --photo-radius: 18px;
  padding-top: clamp(26px, 4.8vw, 62px);
}

.photo-host.upload-main { max-width: 1140px; }
.photo-host.gallery-main { max-width: 1240px; }

.photo-host .photo-host-heading {
  margin-bottom: clamp(22px, 3.1vw, 38px);
}

.photo-host .photo-host-heading h1,
.photo-host .gallery-title-row h1 {
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -.052em;
  font-weight: 650;
}

.photo-host .photo-host-heading p {
  margin-top: 12px;
  font-size: clamp(.9rem, 2.1vw, 1.0625rem);
}

.photo-host .upload-form {
  padding: 0;
  border: 0;
  background: none;
}

.photo-host .upload-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 330px);
  gap: clamp(16px, 2.4vw, 28px);
  align-items: start;
}

.photo-host .upload-photos,
.photo-host .upload-settings {
  min-width: 0;
}

.photo-host .upload-form:not(.has-files) .dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 376px;
  padding: 30px 18px;
  text-align: center;
  border: 1px dashed color-mix(in srgb, var(--border), var(--accent) 35%);
  border-radius: var(--photo-radius);
  background: radial-gradient(ellipse at 50% 0%, var(--selected), transparent 72%), var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.photo-host .dropzone.dragover,
.photo-host .dropzone:focus-within {
  border-color: var(--focus);
  box-shadow: inset 0 0 0 1px var(--focus);
}

.photo-host .dropzone .upload-icon {
  display: inline-grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0 0 7px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--accent);
}

.photo-host .dropzone .upload-icon svg { width: 28px; height: 28px; }
.photo-host .dropzone .file-picker { min-height: 49px; padding-inline: 24px; }
.photo-host .dropzone .file-input { margin: 0; }
.photo-host .dropzone .file-input:not(:focus-visible) { outline: none; }
.photo-host .dropzone .file-limits { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.photo-host .drop-instruction { display: none; color: var(--muted); font-size: 14px; }

@media (pointer: fine) {
  .js-ready .photo-host .drop-instruction { display: block; }
}

.photo-host .upload-settings,
.photo-host .selection {
  padding: clamp(16px, 2.25vw, 24px);
  border: 1px solid var(--border);
  border-radius: var(--photo-radius);
  background: var(--surface);
}

.photo-host .upload-settings h2,
.photo-host .selection h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.025em;
}

.photo-host .retention {
  margin-top: 19px;
}

.photo-host .retention legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.photo-host .segmented {
  border-radius: 10px;
  grid-template-columns: 1.18fr 1fr 1fr;
}

.photo-host .segmented span {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 7px 2px;
  border-radius: 7px;
  font-size: 13px;
}

.photo-host .segmented input:checked + span {
  color: var(--text);
  background: var(--selected);
  border-color: var(--border);
  font-weight: 600;
}

.photo-host .password-option,
.photo-host .collection-description {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.photo-host .password-option { margin-top: 20px; }
.photo-host .password-option summary,
.photo-host .collection-description summary {
  min-height: 49px;
  font-weight: 550;
  flex-wrap: nowrap;
}

.photo-host .password-option .optional { font-size: 12px; }
.photo-host .password-fields { padding: 0 0 12px; }
.photo-host .upload-settings textarea { min-height: 82px; }
.photo-host .description-fields { padding-bottom: 12px; }
.photo-host .submit-actions {
  display: grid;
  gap: 8px;
  padding-top: 17px;
  border-top: 1px solid var(--border);
}

.photo-host .submit-actions .primary { justify-content: space-between; }
.photo-host .submit-actions .secondary { background: var(--surface); }
.photo-host .button { border-radius: 10px; min-height: 44px; }
.photo-host .primary:hover { background: var(--accent-hover); filter: none; }
.photo-host .primary:active { filter: brightness(.94); }
.photo-host .selection .section-heading { flex-wrap: wrap; }
.photo-host .selection #file-count { white-space: nowrap; }
.photo-host .file-list { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
.photo-host .file-card { border-radius: 12px; }
.photo-host .file-visual { aspect-ratio: 4 / 3; }
.photo-host .file-visual .remove-file { min-width: 44px; height: 44px; }
.photo-host .file-name { font-weight: 550; }
.photo-host .file-card textarea { min-height: 65px; }
.photo-host .upload-progress { padding: 18px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; }
.photo-host .preview-dialog { border-radius: var(--photo-radius); }
.photo-host .dialog-heading { align-items: center; margin-bottom: 12px; }
.photo-host .preview-dialog::backdrop { background: var(--overlay); }

/* The gallery keeps complete frames and puts sharing controls by their link. */
.photo-host .result-panel {
  max-width: 850px;
  margin: 0 0 clamp(24px, 4vw, 46px);
  padding: clamp(16px, 3vw, 28px);
  border-radius: var(--photo-radius);
  border-top: 3px solid var(--accent);
}

.photo-host .result-panel h2 { font-size: clamp(1.18rem, 2.7vw, 1.55rem); font-weight: 650; letter-spacing: -.025em; }
.photo-host .result-panel .link-section { padding: 20px 0 0; }
.photo-host .result-panel .direct-links { margin-top: 16px; }
.photo-host .result-panel .copy-row { margin-top: 8px; }
.photo-host .gallery-heading { padding: 0 0 22px; margin: 0 0 24px; }
.photo-host .gallery-title-row { justify-content: flex-start; align-items: baseline; gap: 13px; flex-wrap: wrap; }
.photo-host .gallery-title-row .collection-count { border: 0; padding: 0; font-size: 14px; }
.photo-host .gallery-heading .collection-copy { color: var(--text); margin-top: 14px; }
.photo-host .gallery-heading .collection-meta { margin-top: 9px; color: var(--muted); }
.photo-host .gallery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2.4vw, 24px);
}

.photo-host .gallery-grid.gallery-single { grid-template-columns: minmax(0, 1fr); max-width: 830px; }
.photo-host .gallery-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--photo-radius); }
.photo-host .gallery-item .image-link { position: relative; overflow: hidden; border: 0; border-radius: 17px 17px 0 0; background: var(--raised); }
.photo-host .gallery-item .image-link:focus-visible { outline-offset: -4px; }
.photo-host .gallery-item img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; }
.photo-host .gallery-single .gallery-item img { max-height: min(67vh, 640px); aspect-ratio: auto; }
.photo-host .gallery-item figcaption { align-items: center; gap: 12px; min-height: 61px; padding: 8px 12px; }
.photo-host .gallery-item .photo-caption { font-size: 14px; }
.photo-host .gallery-item .photo-index { padding: 0; color: var(--muted); font-size: 13px; }
.photo-host .gallery-item .download-button { min-width: 44px; height: 44px; background: var(--surface); }
.photo-host .gallery-item .download-button:hover { background: var(--raised); }
.photo-host .gallery-end { justify-content: flex-start; margin-top: clamp(24px, 4vw, 42px); }
.photo-host .photo-dialog { border-radius: var(--photo-radius); }
.photo-host .photo-dialog::backdrop { background: var(--overlay); }

body[data-page='draft'] .inner-main,
body[data-page='access'] .access-main { padding-top: clamp(26px, 4.8vw, 62px); }
body[data-page='draft'] .inner-main { max-width: 1140px; }
body[data-page='draft'] .upload-form,
body[data-page='access'] .access-form { border-radius: 18px; }
body[data-page='draft'] .page-heading h1,
body[data-page='access'] .page-heading h1 { font-size: clamp(1.8rem, 4vw, 2.45rem); letter-spacing: -.04em; }
body[data-page='draft'] .file-card { border-radius: 12px; }
body[data-page='draft'] #draft-description { margin-top: 7px; }

@media (max-width: 820px) {
  .photo-host .upload-workspace { grid-template-columns: minmax(0, 1fr) minmax(250px, 290px); }
  .photo-host .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .photo-host .upload-workspace,
  .photo-host .gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .photo-host .upload-form:not(.has-files) .dropzone { min-height: 218px; padding-block: 22px; }
  .photo-host .dropzone .upload-icon { width: 50px; height: 50px; border-radius: 15px; margin: 0; }
  .photo-host .dropzone .upload-icon svg { width: 23px; height: 23px; }
  .photo-host .upload-settings { padding: 17px; }
  .photo-host .file-list { gap: 12px; }
  .photo-host .file-card textarea,
  .photo-host .password-fields input,
  .photo-host .upload-settings textarea { font-size: 16px; }
  .photo-host .gallery-heading { padding-bottom: 16px; margin-bottom: 16px; }
  .photo-host .gallery-item figcaption { padding: 8px 10px; }
  .photo-host .photo-dialog { border-radius: 0; }
}

@media (max-width: 430px) {
  .photo-host .file-list { grid-template-columns: minmax(0, 1fr); }
  .photo-host .result-panel .copy-row { flex-wrap: wrap; }
  .photo-host .result-panel .copy-row > .button { width: 100%; }
  .photo-host .result-panel .direct-link-item { gap: 9px; }
  .photo-host .result-panel .direct-link-thumbnail { width: 46px; height: 46px; }
}
