/* The fake social features: panels, pictures, the bin, the cookie banner. */

/* Photos exist only in relax mode; the bin shows up once a photo has been shared. */
:root:not([data-mode="relax"]) .relax-only { display: none !important; }

/* Panels under the top bar */
.panel {
  position: absolute;
  z-index: 2;
  width: min(24em, 80vw);
  padding: 1.2em 1.3em 1.3em;
  border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  text-shadow: none;
  animation: panel-in 0.35s var(--ease);
}
@keyframes panel-in { from { opacity: 0; transform: translateY(-0.4em); } }

.panel h2 { margin: 0 0 1em; font-weight: 400; }
.panel-body { display: grid; gap: 0.9em; justify-items: start; }
.panel-body p { margin: 0; }
.panel-note { min-height: 1.5em; color: var(--muted); }
.panel-row { display: flex; flex-wrap: wrap; gap: 0.8em; }
.panel-slider { display: flex; align-items: center; gap: 0.9em; }
.panel-slider .panel-range { width: 10em; font-size: var(--fs-body); }
.panel-slider output { min-width: 3.2em; color: var(--fg); }
/* Offline mode's settings: the caution first, in the warm accent. */
.panel-offline { padding-top: 0.2em; }
.panel-offline .panel-slider { flex-wrap: wrap; }
.panel-caution { margin: 0; color: var(--accent-2); }

.panel-btn,
.photo-actions button,
.cookies button {
  padding: 0.6em 1em;
  border: 1px solid color-mix(in srgb, var(--fg) 25%, transparent);
  background: none;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s, border-color 0.3s;
}
.panel-btn:hover:enabled,
.photo-actions button:hover,
.cookies button:hover { color: var(--fg); border-color: var(--accent); }
/* The option in use, among the choices a profile button offers: colours swapped. */
.panel-btn.on,
.panel-btn.on:hover:enabled { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.panel-options[hidden] { display: none; }
.panel-options { gap: 0.5em; }
/* What an option means, when that needs saying (a season's sunrise and sunset). */
.panel-btn[data-tip] { position: relative; }
.panel-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.7em);
  transform: translateX(-50%);
  padding: 0.5em 0.8em;
  border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
  background: var(--surface);
  white-space: nowrap;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--fg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.panel-btn[data-tip]:hover::after { opacity: 1; transition-delay: 0.4s; }
.panel-options .panel-btn { padding: 0.6em 0.7em; }

.nav [aria-expanded="true"] { color: var(--fg); }

/* The heart that leaves when you like a photo */
.ghost { position: fixed; z-index: 5; pointer-events: none; color: var(--fg); }

/* Pictures (relax mode) */
.stage { display: grid; place-items: center; min-height: 0; }

/* While one is up, it is the only thing in focus: the scene stops (scenes/journey.js) and blurs,
   and so does the rest of the interface, which takes no clicks: a click anywhere but the photo
   closes it (photos.js). */
body.viewing .scene { filter: blur(14px) brightness(0.8); transform: scale(1.04); }
body.viewing .scene.drift { animation-play-state: paused; }
.topbar { transition: filter var(--fade) var(--ease); }
.bottombar > *, .cookies { transition: opacity var(--fade) var(--ease), filter var(--fade) var(--ease); }
body.viewing .topbar,
body.viewing .cookies,
body.viewing .bottombar > :not(.bin),
body.viewing .help { filter: blur(5px); pointer-events: none; }

.photo { display: grid; justify-items: center; gap: 1.2em; animation: panel-in 0.5s var(--ease); }
.photo-frame {
  margin: 0;
  box-shadow: 0 1.2em 3.5em rgb(0 0 0 / 0.35);
}
.photo-img { display: block; max-width: min(44vw, 80vh); max-height: 54vh; transition: opacity 0.5s; }
.photo-img.gone { opacity: 0; transition: none; }
.photo-actions { display: flex; gap: 0.8em; }
.photo-like b { font-weight: 400; }

.photo-ghost { position: fixed; z-index: 5; pointer-events: none; transform-origin: center; }

.bin { display: flex; align-items: center; gap: 0.7em; margin: 0 auto 0.2em; color: var(--muted); animation: panel-in 0.4s var(--ease); }
.bin .icon { width: 1.6em; height: 1.6em; }
.bin.wobble .icon { animation: wobble 0.7s ease-in-out; }
@keyframes wobble {
  20% { transform: rotate(-14deg) scale(1.15); }
  45% { transform: rotate(10deg); }
  70% { transform: rotate(-5deg); }
}

/* Cookie banner */
.cookies {
  position: absolute;
  left: 50%;
  bottom: calc(var(--gutter) * 2.2);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 0.8em 1em 0.8em 1.3em;
  border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  text-shadow: none;
  transform: translateX(-50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .panel, .photo, .bin.wobble .icon { animation: none; }
}

/* Help: a dim "?" in the corner, and the labels it scatters over the interface */
.help {
  position: absolute;
  right: max(4px, calc(var(--gutter) * 0.22));
  bottom: max(4px, calc(var(--gutter) * 0.22));
  width: 1.7em;
  height: 1.7em;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--fg) 22%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  font-family: var(--font-mono);
  font-size: calc(var(--fs-label) * 0.9);
  color: var(--muted);
  opacity: 0.72;
  transition: opacity 0.3s, color 0.3s, border-color 0.3s, filter var(--fade) var(--ease);
}
.help:hover,
body.helping .help { opacity: 1; color: var(--fg); border-color: var(--accent); }
/* On a first visit it glows and sends out rings for five seconds (help.js). */
.help.hint { opacity: 1; color: var(--fg); border-color: var(--accent); box-shadow: 0 0 1em color-mix(in srgb, var(--accent) 75%, transparent); }
.help.hint::before,
.help.hint::after { content: ""; position: absolute; inset: -1px; border: 1px solid var(--accent); border-radius: 50%; pointer-events: none; animation: help-ring 1.7s ease-out infinite; }
.help.hint::after { animation-delay: 0.85s; }
@keyframes help-ring { from { transform: scale(1); opacity: 0.85; } to { transform: scale(3.4); opacity: 0; } }

.tips { position: fixed; inset: 0; z-index: 10; pointer-events: none; animation: panel-in 0.35s var(--ease); }
.tip {
  position: absolute;
  max-width: 17em;
  margin: 0;
  padding: 0.55em 0.8em;
  border: 1px solid color-mix(in srgb, var(--fg) 16%, transparent);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  font-size: calc(var(--fs-body) * 0.82);
  line-height: 1.4;
  color: var(--fg);
}
.tip b { font: 400 0.85em var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; }
.tip-fake { color: var(--accent-2); }
.tip-real { color: var(--accent); }
.tip-line { position: absolute; width: 1px; background: color-mix(in srgb, var(--fg) 30%, transparent); }

/* Phones (see the same query in ui.css): no help, no pictures, so no bin; panels and the cookie
   banner span the screen. */
@media (max-width: 720px), (pointer: coarse) and (max-height: 520px) {
  .help, .bin { display: none !important; }
  .panel { width: calc(100vw - 2 * var(--gutter)); }
  .panel-btn[data-tip]::after { display: none; }
  .cookies {
    left: var(--gutter);
    right: var(--gutter);
    bottom: calc(var(--gutter) + 12em);
    flex-wrap: wrap;
    white-space: normal;
    transform: none;
  }
  .cookies span { flex: 1 1 100%; } /* the text on its own line, both buttons together under it */
}
