@import url('../shared/life-data.css');

.photo-tool {
  --photo-night: #35435c;
  --photo-day: #e2e6d9;
  --photo-gold: #df8e20;
  --photo-blue: #66a2e4;
  --photo-gold-wash: #fbefd9;
  --photo-blue-wash: #e7f2ff;
}

@media (prefers-color-scheme: dark) {
  .photo-tool {
    --photo-night: #242b3d;
    --photo-day: #9da68f;
    --photo-gold: #f2ad4f;
    --photo-blue: #81b5f0;
    --photo-gold-wash: #352d20;
    --photo-blue-wash: #1c2f42;
  }
}

.photo-form { margin-bottom: 14px; }
.photo-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}
.photo-controls .kt-field { min-height: 44px; min-width: 0; }
.photo-controls input[type="date"] { display: block; }
.photo-actions { display: flex; gap: 8px; }
.photo-actions .kt-button { min-height: 44px; white-space: nowrap; }
.photo-status { margin: 6px 0 0; }
.photo-status:empty { margin: 0; min-height: 0; }
.photo-share-field { margin-top: 8px; }

.photo-results { padding: 18px; }
.photo-heading { display: flex; flex-wrap: wrap; column-gap: 16px; align-items: baseline; justify-content: space-between; margin-bottom: 13px; }
.photo-heading h2 { margin: 0; font-size: 20px; line-height: 1.4; }
.photo-heading p { margin: 0; font-size: .875rem; color: var(--kt-muted); }
.photo-heading time { font-variant-numeric: tabular-nums; }
.photo-separator { color: var(--kt-muted); }

.photo-results .photo-featured {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.photo-featured > div { min-width: 0; border-radius: 6px; padding: 8px 12px; }
.photo-sunset { background: var(--kt-tint); }
.photo-window { display: flex; flex-direction: column; justify-content: center; }
.photo-gold { background: var(--photo-gold-wash); }
.photo-blue { background: var(--photo-blue-wash); }
.photo-featured dd:first-of-type { font-size: 25px; line-height: 1.4; white-space: nowrap; }
.photo-featured .photo-sunset dd:first-of-type { font-size: 32px; }
.photo-bearing { display: flex; align-items: center; gap: 5px; min-height: 24px; font-size: .875rem; }
.photo-arrow {
  display: inline-grid;
  flex: 0 0 1.2em;
  place-items: center;
  transform: rotate(var(--bearing, 0deg));
  width: 1.2em;
  line-height: 1;
}

.photo-timeline { margin-top: 16px; }
.photo-track {
  position: relative;
  height: 25px;
  border: 1px solid var(--kt-line);
  border-radius: 5px;
  overflow: hidden;
  background: var(--photo-night);
}
.photo-band { position: absolute; top: 34%; bottom: 0; left: var(--lo); width: calc(var(--hi) - var(--lo)); }
.photo-band[data-band="day"] { top: 0; background: var(--photo-day); }
.photo-band[data-band$="-gold"], .photo-swatch[data-swatch="gold"] { background: var(--photo-gold); }
.photo-band[data-band$="-blue"], .photo-swatch[data-swatch="blue"] { background: var(--photo-blue); }
.photo-cursor {
  position: absolute;
  inset-block: 0;
  left: var(--cursor);
  width: 2px;
  background: #171b1f;
  box-shadow: 0 0 0 1px #fff;
}
.photo-ticks { display: flex; justify-content: space-between; margin-top: 3px; font-size: .75rem; font-variant-numeric: tabular-nums; color: var(--kt-muted); }
.photo-legend { display: flex; flex-wrap: wrap; gap: 4px 15px; list-style: none; margin: 8px 0 0; padding: 0; color: var(--kt-muted); font-size: .8125rem; }
.photo-legend li { display: inline-flex; gap: 5px; align-items: center; }
.photo-swatch { width: 11px; height: 11px; flex: none; border: 1px solid var(--kt-line); border-radius: 2px; }
.photo-swatch[data-swatch="day"] { background: var(--photo-day); }
.photo-swatch[data-swatch="down"] { background: var(--photo-night); }

.photo-scrub { display: grid; grid-template-columns: auto minmax(0, 1fr) 12.5rem; align-items: center; gap: 10px; margin-top: 12px; }
.photo-scrub .kt-label { margin: 0; font-size: .875rem; }
.photo-scrub input { width: 100%; min-width: 0; min-height: 32px; margin: 0; accent-color: var(--kt-accent); }
.photo-scrub-value { display: flex; align-items: center; justify-content: end; gap: 4px; color: var(--kt-text); font-size: .875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.photo-morning { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--kt-line); }
.photo-morning .photo-rise-dir { font-size: .8125rem; color: var(--kt-muted); }

.photo-section { margin-top: 24px; }
.photo-section h2 { font-size: 1.125rem; margin: 0 0 4px; }
.photo-section p { margin: 0 0 9px; color: var(--kt-muted); }
.photo-table { border: 1px solid var(--kt-line); border-radius: 6px; }
.photo-table .life-table { min-width: 430px; background: var(--kt-panel); }
.photo-table .life-table tr:last-child th, .photo-table .life-table tr:last-child td { border-bottom: 0; }
.photo-table .life-table td { white-space: nowrap; }
.photo-table .life-table time { font-weight: 650; }
.photo-table .life-table small { display: block; color: var(--kt-muted); }

@media (max-width: 640px) {
  .photo-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-actions { grid-column: 1 / -1; }
  .photo-results { padding: 12px; }
  .photo-results .photo-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .photo-sunset { display: grid; grid-template-columns: 1fr auto; align-items: center; grid-column: 1 / -1; }
  .photo-sunset dt { grid-column: 1 / -1; }
  .photo-featured dd:first-of-type { font-size: 18px; }
  .photo-scrub { grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; }
  .photo-scrub input { grid-column: 1 / -1; grid-row: 2; min-height: 38px; }
  .photo-scrub-value { grid-column: 2; }
  .photo-results .photo-morning { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .photo-featured > div { padding-inline: 8px; }
  .photo-scrub { grid-template-columns: 1fr; }
  .photo-scrub-value { grid-column: 1; justify-content: start; }
}
