/* FOR’U Atelier — Today photo picker
   Load alongside the Atelier foundation stylesheet. */

html[data-atelier] .atelier-today-print > .tp-photo-error {
  color: var(--atelier-soft);
  font: 400 12px/1.5 var(--font-ui), sans-serif;
}
html[data-atelier] .atelier-today-print > .tp-photo-error[hidden] { display: none; }
html[data-atelier] .atelier-today-print .tp-photo-error button {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--atelier-olive);
  font: inherit;
  text-decoration: underline;
}

html[data-atelier] .atelier-today-print img {
  filter: saturate(.82);
}

html[data-atelier] .atelier-today-print > .tp-change {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--atelier-olive);
  font: 500 10px/1.2 var(--font-ui), sans-serif;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

html[data-atelier] .atelier-today-print > .tp-change:hover {
  background: color-mix(in srgb, var(--atelier-olive) 9%, transparent);
}

html[data-atelier] .atelier-today-print > .tp-change:focus-visible,
html[data-atelier] .tp-settings .tp-open:focus-visible {
  outline: 2px solid var(--atelier-olive);
  outline-offset: 2px;
}

html[data-atelier] .tp-settings .tp-open {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid var(--atelier-line);
  border-radius: 999px;
  background: transparent;
  color: var(--atelier-ink);
  font: 500 12px/1.2 var(--font-ui), sans-serif;
  letter-spacing: .035em;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

html[data-atelier] .tp-settings .tp-open:hover {
  border-color: var(--atelier-olive);
  background: color-mix(in srgb, var(--atelier-olive) 6%, transparent);
}

#todayPhotoDialog.tp-dialog {
  --tp-gutter: 30px;
  box-sizing: border-box;
  width: min(720px, calc(100vw - 40px));
  max-width: 720px;
  max-height: min(860px, calc(100dvh - 40px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--atelier-line);
  border-radius: 2px;
  background: var(--atelier-paper);
  color: var(--atelier-ink);
  box-shadow: none;
}

#todayPhotoDialog.tp-dialog::backdrop {
  background: color-mix(in srgb, var(--atelier-ink) 38%, transparent);
  backdrop-filter: none;
}

#todayPhotoDialog .tp-sheet {
  box-sizing: border-box;
  max-height: min(860px, calc(100dvh - 40px));
  padding: var(--tp-gutter);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--atelier-line) transparent;
  scrollbar-width: thin;
}

#todayPhotoDialog .tp-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: start;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--atelier-line);
}

#todayPhotoDialog .tp-header .tp-eyebrow,
#todayPhotoDialog .tp-header > .tp-eyebrow {
  grid-column: 1;
  margin: 0 0 8px;
  color: var(--atelier-brass);
  font: 500 10px/1.3 var(--font-ui), sans-serif;
  letter-spacing: .19em;
  text-transform: uppercase;
}

#todayPhotoDialog .tp-header h2 {
  grid-column: 1;
  margin: 0;
  color: var(--atelier-ink);
  font: 400 clamp(25px, 4vw, 34px)/1.08 var(--font-display), Georgia, serif;
  letter-spacing: -.025em;
}

#todayPhotoDialog .tp-close {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--atelier-line);
  border-radius: 50%;
  background: transparent;
  color: var(--atelier-ink);
  font: 400 21px/1 var(--font-ui), sans-serif;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

#todayPhotoDialog .tp-close:hover {
  border-color: var(--atelier-olive);
  background: color-mix(in srgb, var(--atelier-olive) 7%, transparent);
}

#todayPhotoDialog :where(button, input, canvas):focus-visible {
  outline: 2px solid var(--atelier-olive);
  outline-offset: 3px;
}

#todayPhotoDialog .tp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 22px 0 24px;
}

#todayPhotoDialog .tp-option {
  display: flex;
  min-width: 0;
  min-height: 44px;
  flex-direction: column;
  gap: 9px;
  padding: 7px;
  border: 1px solid var(--atelier-line);
  border-radius: 3px;
  background: transparent;
  color: var(--atelier-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

#todayPhotoDialog .tp-option:hover {
  border-color: color-mix(in srgb, var(--atelier-olive) 65%, var(--atelier-line));
  transform: translateY(-2px);
}

#todayPhotoDialog .tp-option[aria-pressed="true"] {
  border-color: var(--atelier-olive);
  background: color-mix(in srgb, var(--atelier-olive) 6%, transparent);
}

#todayPhotoDialog .tp-option img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 4.4;
  border-radius: 2px;
  object-fit: cover;
  filter: saturate(.82);
}

#todayPhotoDialog .tp-option span {
  display: block;
  min-height: 30px;
  padding: 0 3px 2px;
  color: var(--atelier-soft);
  font: 500 11px/1.35 var(--font-ui), sans-serif;
  letter-spacing: .025em;
}

#todayPhotoDialog .tp-option[aria-pressed="true"] span {
  color: var(--atelier-ink);
}

#todayPhotoDialog .tp-upload {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid var(--atelier-line);
  border-radius: 999px;
  background: transparent;
  color: var(--atelier-ink);
  font: 500 12px/1.2 var(--font-ui), sans-serif;
  letter-spacing: .035em;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

#todayPhotoDialog .tp-upload:hover {
  border-color: var(--atelier-olive);
  background: color-mix(in srgb, var(--atelier-olive) 6%, transparent);
}

#todayPhotoDialog #tpUpload {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

#todayPhotoDialog .tp-crop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .72fr);
  align-items: center;
  gap: 22px;
  margin-top: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--atelier-line);
  border-bottom: 1px solid var(--atelier-line);
}
#todayPhotoDialog .tp-crop[hidden] {
  display: none;
}

#todayPhotoDialog #tpCropCanvas {
  display: block;
  width: min(100%, 220px);
  aspect-ratio: 4 / 4.4;
  border-radius: 2px;
  background: color-mix(in srgb, var(--atelier-soft) 10%, var(--atelier-paper));
  object-fit: contain;
}

#todayPhotoDialog .tp-controls {
  display: grid;
  gap: 15px;
  min-width: 0;
}

#todayPhotoDialog .tp-controls label,
#todayPhotoDialog label[for="tpCaption"] {
  display: grid;
  gap: 8px;
  color: var(--atelier-soft);
  font: 500 10px/1.4 var(--font-ui), sans-serif;
  letter-spacing: .13em;
  text-transform: uppercase;
}

#todayPhotoDialog .tp-controls input[type="range"] {
  width: 100%;
  min-height: 26px;
  margin: 0;
  accent-color: var(--atelier-olive);
  cursor: pointer;
}

#todayPhotoDialog label[for="tpCaption"] {
  margin-top: 21px;
}

#todayPhotoDialog #tpCaption {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--atelier-line);
  border-radius: 2px;
  background: transparent;
  color: var(--atelier-ink);
  font: 400 14px/1.4 var(--font-ui), sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

#todayPhotoDialog #tpCaption::placeholder {
  color: var(--atelier-soft);
  opacity: .72;
}

#todayPhotoDialog .tp-status {
  min-height: 20px;
  margin: 13px 0 0;
  color: var(--atelier-soft);
  font: 400 12px/1.5 var(--font-ui), sans-serif;
}

#todayPhotoDialog .tp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 17px;
}

#todayPhotoDialog .tp-footer :where(.tp-cancel, .tp-save) {
  display: inline-flex;
  min-width: 96px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 19px;
  border: 1px solid var(--atelier-line);
  border-radius: 999px;
  font: 500 12px/1.2 var(--font-ui), sans-serif;
  letter-spacing: .035em;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

#todayPhotoDialog .tp-footer .tp-cancel {
  background: transparent;
  color: var(--atelier-ink);
}

#todayPhotoDialog .tp-footer .tp-cancel:hover {
  border-color: var(--atelier-olive);
  background: color-mix(in srgb, var(--atelier-olive) 6%, transparent);
}

#todayPhotoDialog .tp-footer .tp-save {
  border-color: var(--atelier-olive);
  background: var(--atelier-olive);
  color: var(--atelier-paper);
}

#todayPhotoDialog .tp-footer .tp-save:hover {
  opacity: .88;
}

#todayPhotoDialog .tp-footer .tp-save:disabled {
  opacity: .5;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  #todayPhotoDialog.tp-dialog {
    --tp-gutter: 20px;
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  #todayPhotoDialog .tp-sheet {
    max-height: calc(100dvh - 24px);
  }

  #todayPhotoDialog .tp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }

  #todayPhotoDialog .tp-crop {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
  }

  #todayPhotoDialog #tpCropCanvas {
    width: min(100%, 190px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-atelier] .atelier-today-print figcaption .tp-change,
  html[data-atelier] .tp-settings .tp-open,
  #todayPhotoDialog :where(button, .tp-option) {
    transition: none;
  }
}

/* Expanded library: grouped choices, personal photos, and quiet controls. */
#todayPhotoDialog .tp-group-title {
  grid-column: 1 / -1;
  margin: 26px 0 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--atelier-line);
  color: var(--atelier-brass);
  font: 500 10px/1.4 var(--font-ui), sans-serif;
  letter-spacing: .17em;
  text-transform: uppercase;
}

#todayPhotoDialog .tp-group-title:first-child {
  margin-top: 0;
}

#todayPhotoDialog .tp-photo-card {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
}

#todayPhotoDialog .tp-photo-card > .tp-option {
  width: 100%;
  min-width: 0;
}

#todayPhotoDialog .tp-photo-card[hidden] {
  display: none;
}

#todayPhotoDialog .tp-photo-card .tp-hide,
#todayPhotoDialog .tp-photo-card .tp-remove {
  display: inline-flex;
  width: 100%;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--atelier-soft);
  font: 500 10px/1.3 var(--font-ui), sans-serif;
  letter-spacing: .09em;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

#todayPhotoDialog .tp-photo-card .tp-hide:hover,
#todayPhotoDialog .tp-photo-card .tp-remove:hover {
  border-color: var(--atelier-line);
  background: color-mix(in srgb, var(--atelier-olive) 5%, transparent);
  color: var(--atelier-olive);
}

#todayPhotoDialog .tp-photo-card .tp-remove:hover {
  color: var(--atelier-brass);
}

#todayPhotoDialog #tpYourPhotos {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 0 24px;
}

#todayPhotoDialog .tp-photo-caption {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--atelier-line);
  border-radius: 2px;
  background: color-mix(in srgb, var(--atelier-paper) 88%, var(--atelier-olive));
  color: var(--atelier-ink);
  font: 400 12px/1.4 var(--font-ui), sans-serif;
}

#todayPhotoDialog .tp-photo-caption::placeholder {
  color: var(--atelier-soft);
  opacity: .72;
}

#todayPhotoDialog .tp-rotation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, .8fr);
  align-items: center;
  gap: 16px 24px;
  min-width: 0;
  margin: 24px 0 0;
  padding: 18px 0;
  border: 0;
  border-top: 1px solid var(--atelier-line);
  border-bottom: 1px solid var(--atelier-line);
}

#todayPhotoDialog .tp-rotation legend {
  padding: 0 10px 0 0;
  color: var(--atelier-brass);
  font: 500 10px/1.4 var(--font-ui), sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
}

#todayPhotoDialog #tpRotate {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--atelier-line);
  border-radius: 2px;
  background-color: var(--atelier-paper);
  color: var(--atelier-ink);
  font: 400 12px/1.4 var(--font-ui), sans-serif;
}

#todayPhotoDialog .tp-rotation label {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--atelier-soft);
  font: 400 12px/1.4 var(--font-ui), sans-serif;
  cursor: pointer;
}

#todayPhotoDialog .tp-rotation input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--atelier-olive);
}

#todayPhotoDialog .tp-hidden-toggle {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin: 10px 0 0;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--atelier-olive);
  font: 500 10px/1.35 var(--font-ui), sans-serif;
  letter-spacing: .12em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

#todayPhotoDialog :where(.tp-hide, .tp-remove, .tp-hidden-toggle, .tp-photo-caption, #tpRotate):focus-visible {
  outline: 2px solid var(--atelier-olive);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  #todayPhotoDialog #tpYourPhotos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }

  #todayPhotoDialog .tp-rotation {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
}

@media (max-width: 420px) {
  #todayPhotoDialog.tp-dialog {
    --tp-gutter: 14px;
  }

  #todayPhotoDialog .tp-grid,
  #todayPhotoDialog #tpYourPhotos {
    gap: 9px;
  }

  #todayPhotoDialog .tp-option {
    padding: 6px;
  }

  #todayPhotoDialog .tp-option span {
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  #todayPhotoDialog .tp-photo-card :where(.tp-hide, .tp-remove) {
    transition: none;
  }
}

/* The Today portrait anchors the desktop column and becomes a quiet landscape
   print after the mobile needs-you line. */
html[data-atelier] #appShell:has(#today.active-page) .capture-canonical-greeting {
  display: none !important;
}

@media (min-width: 768px) {
  html[data-atelier] #appShell:has(#today.active-page) .today-editorial {
    align-items: start !important;
  }

  html[data-atelier] #appShell:has(#today.active-page) .atelier-today-print {
    align-self: start;
    margin-top: var(--today-photo-top, 0px) !important;
  }
}

@media (max-width: 767px) {
  html[data-atelier] #appShell:has(#today.active-page) #today .today-section--attention {
    display: none !important;
    width: 100%;
    padding: 0;
  }

  html[data-atelier] #appShell:has(#today.active-page) #today .today-section--attention[data-needs-open="true"] {
    display: block !important;
  }

  html[data-atelier] #appShell:has(#today.active-page) #today .today-section--attention > .today-section-head {
    display: none !important;
  }

  html[data-atelier] #appShell:has(#today.active-page) #today .today-section--attention .today-list {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  html[data-atelier] #appShell:has(#today.active-page) #today .atelier-today-print {
    box-sizing: border-box;
    position: relative;
    display: block;
    width: 100% !important;
    max-width: none !important;
    margin: 5px 0 14px !important;
    overflow: hidden;
    border-radius: 4px;
  }

  html[data-atelier] #appShell:has(#today.active-page) #today .atelier-today-print > img {
    display: block;
    width: 100% !important;
    height: 120px !important;
    max-height: 120px !important;
    aspect-ratio: auto !important;
    object-fit: cover;
    object-position: center 52%;
    border-radius: 4px !important;
  }

  html[data-atelier] #appShell:has(#today.active-page) #today .atelier-today-print figcaption {
    justify-content: space-between;
    gap: 8px;
    margin: 4px 0 0;
    font-size: 8px;
    letter-spacing: .12em;
  }

  html[data-atelier] #appShell:has(#today.active-page) #today .atelier-today-print > .tp-change {
    position: absolute;
    right: 6px;
    bottom: 30px;
    min-height: 32px;
    padding: 0 9px;
    border: 1px solid rgba(255,255,255,.72);
    background: rgba(37,39,34,.32);
    color: #fbfaf6;
    font-size: 9px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }

  html[data-atelier] #appShell:has(#today.active-page) #today .foru-needs-count {
    display: inline-flex;
    min-height: 40px;
    margin: 5px 0 2px;
    color: var(--atelier-soft);
    font: 400 12px/1.4 var(--font-ui), sans-serif;
    letter-spacing: .02em;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-atelier] .atelier-today-print > .tp-change {
    transition: none;
  }
}
