/* Le Print private gallery. One sans-serif, the client's colours, nothing decorative. */

@font-face { font-family: "Inter"; src: url(fonts/inter-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; src: url(fonts/inter-latin-ext-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+1EF2-1EFF,U+20A0-20AB,U+20AD-20C0,U+2C60-2C7F,U+A720-A7FF; }

/* Base colours. A gallery's own colours come from theme.php and override these in light mode. */
:root {
  --bg: #FAFAF9;
  --fg: #1C1C1C;
  --accent: #1C1C1C;
  --soft: #EFEFED;
  --gate-bg: #1C1C1C;
  --gate-fg: #FAFAF9;
  --muted: #6F6F6F;
  --faint: #A3A3A3;
  --line: #E3E3E1;
  --veil: rgba(250, 250, 249, .9);
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121212;
  --fg: #EBE9E4;
  --accent: #EBE9E4;
  --soft: #1C1C1C;
  --muted: #8E8C88;
  --faint: #5E5D5A;
  --line: #2A2A29;
  --veil: rgba(18, 18, 18, .9);
  color-scheme: dark;
}
@supports (color: color-mix(in srgb, red, blue)) {
  :root, :root[data-theme="dark"] {
    --muted: color-mix(in srgb, var(--fg) 60%, var(--bg));
    --faint: color-mix(in srgb, var(--fg) 38%, var(--bg));
    --line: color-mix(in srgb, var(--fg) 13%, var(--bg));
    --veil: color-mix(in srgb, var(--bg) 90%, transparent);
    --gate-muted: color-mix(in srgb, var(--gate-fg) 68%, var(--gate-bg));
    --gate-line: color-mix(in srgb, var(--gate-fg) 40%, var(--gate-bg));
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 14px/1.6 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.noscroll { overflow: hidden; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

/* type */
.caps, .wordmark, .kicker, .tabs a, .btn, .lbl-caps {
  text-transform: uppercase;
  font-weight: 500;
}
.wordmark { font-size: 10px; line-height: 1; letter-spacing: .32em; padding-left: .32em; color: var(--muted); }
.mark {
  margin: 0;
  font-size: clamp(22px, 4.2vw, 34px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: .3em;
  padding-left: .3em;
  text-transform: uppercase;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.kicker { margin: 18px 0 0; font-size: 10.5px; letter-spacing: .22em; color: var(--muted); }
.display { font-weight: 500; letter-spacing: .02em; }

/* buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 30px;
  border: 1px solid var(--accent); border-radius: 0;
  background: var(--accent); color: var(--bg);
  font-size: 10.5px; letter-spacing: .22em;
  transition: opacity .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease);
}
.btn:hover { opacity: .88; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn:disabled { opacity: .35; cursor: default; }
.link {
  display: inline-block; line-height: 1.4; border: 0; background: none; padding: 0;
  font-size: 11.5px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line);
}
.link:hover { color: var(--fg); text-decoration-color: currentColor; }
.field {
  width: 100%;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--fg);
  font: 400 16px/1.4 var(--sans);
  padding: 12px 0; text-align: center;
  outline: none; transition: border-color .25s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.field::placeholder { color: var(--faint); }
.field:focus { border-bottom-color: var(--fg); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; background: none; color: inherit; opacity: .6;
  transition: opacity .2s var(--ease), transform .5s var(--ease);
}
.theme-toggle:hover { opacity: 1; }
[data-theme="dark"] .theme-toggle { transform: rotate(180deg); }

/* gate: password and name, in the client's colours */
.gate-page {
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  background: var(--gate-bg); color: var(--gate-fg);
}
.gate-page .wordmark { color: var(--gate-muted, var(--gate-fg)); }
.gate-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 14px 0 22px;
}
.gate {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 24px 56px; text-align: center;
}
.gate .mark { color: var(--gate-fg); }
.gate .kicker, .gate-msg { color: var(--gate-muted, var(--gate-fg)); }
.gate-msg { margin: 22px 0 0; }
.gate-form { margin-top: 52px; width: min(300px, 100%); display: flex; flex-direction: column; gap: 22px; }
.gate .field { color: var(--gate-fg); border-bottom-color: var(--gate-line, var(--gate-fg)); }
.gate .field::placeholder { color: var(--gate-muted, var(--gate-fg)); }
.gate .field:focus { border-bottom-color: var(--gate-fg); }
.gate .btn { background: var(--gate-fg); color: var(--gate-bg); border-color: var(--gate-fg); }
.gate-hint { margin: -8px 0 4px; font-size: 12px; line-height: 1.5; color: var(--gate-muted, var(--gate-fg)); }
.gate-err { min-height: 1.4em; margin: 0; font-size: 12px; color: var(--gate-fg); }
.gate-foot { padding: 0 24px max(26px, env(safe-area-inset-bottom)); text-align: center; font-size: 11px; color: var(--gate-muted, var(--gate-fg)); }
.gate-corner { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 10px; }

/* header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; max-width: 1440px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px 14px 22px;
}
.top-right { display: flex; align-items: center; gap: 14px; }
.who { font-size: 12px; }
.inline { display: inline-flex; align-items: center; margin: 0; }
.preview-bar {
  text-align: center; font-size: 10px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); padding: 9px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}

/* hero */
.hero { text-align: center; padding: 44px 24px 4px; max-width: 760px; margin: 0 auto; }
.intro { margin: 28px auto 0; max-width: 520px; font-size: 14.5px; line-height: 1.7; color: var(--fg); }

/* highlights */
.hl {
  display: flex; gap: 20px; overflow-x: auto; overscroll-behavior-x: contain;
  padding: 40px 20px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.hl::-webkit-scrollbar { display: none; }
.hl > :first-child { margin-left: auto; }
.hl > :last-child { margin-right: auto; }
.hl a { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 11px; width: 92px; }
.hl .ring {
  width: 70px; height: 70px; border-radius: 50%; padding: 3px;
  border: 1px solid var(--line); transition: border-color .3s var(--ease);
}
.hl .ring span { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: var(--soft); }
.hl .ring img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.hl a:hover .ring img { transform: scale(1.05); }
.hl a.on .ring { border-color: var(--accent); }
.hl .lbl {
  font-size: 9.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  text-align: center; line-height: 1.5; max-width: 92px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.hl a.on .lbl { color: var(--accent); }

/* tabs */
.tabs {
  display: flex; justify-content: center; gap: 52px;
  max-width: 1440px; margin: 32px auto 0; border-top: 1px solid var(--line);
}
.tabs a {
  margin-top: -1px; padding: 16px 0 18px;
  border-top: 1px solid transparent;
  font-size: 10.5px; letter-spacing: .22em; color: var(--muted);
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.tabs a.on { color: var(--accent); border-top-color: var(--accent); }
.tabs .n { margin-left: 10px; font-weight: 400; letter-spacing: .08em; opacity: .7; }

/* grid */
.app { min-height: 50vh; }
.app:empty { min-height: 0; }
.group { max-width: 1440px; margin: 0 auto 36px; }
@media (min-width: 900px) { .group { padding: 0 20px; } }
.group-h { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 14px 14px; }
@media (min-width: 900px) { .group-h { padding: 8px 2px 14px; } }
.group-h h2 { margin: 0; font-size: 10.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.group-h span { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 4px; } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1700px) { .grid { grid-template-columns: repeat(6, 1fr); } }
.tile { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--soft); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .6s var(--ease), transform .8s var(--ease); }
.tile img.in { opacity: 1; }
@media (hover: hover) { .tile:hover img { transform: scale(1.02); } }
.mark-fav {
  position: absolute; right: 8px; bottom: 7px;
  display: flex; align-items: center; gap: 4px;
  color: #fff; font-size: 11px; font-weight: 500;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, .45)); pointer-events: none;
}
.mark-fav svg { width: 15px; height: 15px; }

/* selection */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 6px 16px 28px; }
.chip {
  border: 1px solid var(--line); border-radius: 0; background: none;
  padding: 8px 15px; font-size: 10px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  transition: border-color .25s var(--ease), color .25s var(--ease);
}
.chip.on { border-color: var(--accent); color: var(--accent); }
.chip .n { margin-left: 8px; opacity: .65; letter-spacing: .06em; }
.sel-wrap { max-width: 1440px; margin: 0 auto; }
.empty { text-align: center; padding: 64px 24px 30px; color: var(--muted); }
.empty p { margin: 0 0 8px; }
.empty .display { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--fg); }
.confirm { text-align: center; padding: 48px 20px 10px; }
.confirm p { margin: 0 0 18px; color: var(--muted); }
.confirm .q { color: var(--fg); font-size: 14.5px; }
.confirm .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.confirm .done { font-size: 10.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.hint { text-align: center; color: var(--faint); font-size: 11.5px; padding: 26px 16px 0; }

/* feed */
.feed {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 40;
  background: var(--bg); overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  animation: fadeIn .35s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.feed-top {
  position: sticky; top: 0; z-index: 3;
  display: grid; grid-template-columns: 48px 1fr 56px; align-items: center;
  height: calc(54px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 6px 0;
  background: var(--veil); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.feed-top .t { text-align: center; font-size: 10.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-top .c { text-align: right; padding-right: 10px; font-size: 11px; letter-spacing: .06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; background: none; color: var(--fg); padding: 0;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.heart[aria-pressed="true"] { color: var(--accent); }
.feed-list { padding: 6px 0 90px; }
.post { --r: .8; padding: 0 0 48px; scroll-margin-top: 60px; }
.post { --chrome: 170px; }
@media (max-height: 560px) { .post { --chrome: 70px; } }
.frame, .post-body { width: min(100%, calc((100vh - var(--chrome)) * var(--r))); margin: 0 auto; }
@supports (height: 100svh) { .frame, .post-body { width: min(100%, calc((100svh - var(--chrome)) * var(--r))); } }
@media (max-height: 560px) { .post-body { min-width: min(100%, 360px); } }
.frame {
  position: relative; aspect-ratio: var(--r); background: var(--soft);
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.frame img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s var(--ease); }
.frame img.in { opacity: 1; }
.burst {
  position: absolute; left: 50%; top: 50%; width: 88px; height: 88px; margin: -44px 0 0 -44px;
  color: #fff; opacity: 0; transform: scale(.5); pointer-events: none;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, .28));
}
.burst.go { animation: burst .95s var(--ease) forwards; }
@keyframes burst {
  0% { opacity: 0; transform: scale(.5); }
  18% { opacity: .96; transform: scale(1.1); }
  32% { transform: scale(.95); }
  46% { transform: scale(1); }
  78% { opacity: .96; }
  100% { opacity: 0; transform: scale(1.02); }
}
.post-body { padding: 0 14px; }
@media (min-width: 800px) { .post-body { padding: 0; } }
.post-bar { display: flex; align-items: center; margin: 6px -10px 0; }
.post-bar .meta { margin-left: auto; padding-right: 10px; text-align: right; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-bar .meta b { font-weight: 500; color: var(--fg); letter-spacing: .12em; }
.heart { transition: transform .3s var(--ease), color .3s var(--ease); }
.heart.pop { animation: pop .45s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.likes { margin: 2px 0 6px; font-size: 13px; }
.likes:empty { display: none; }
.likes b { font-weight: 600; }
.comments { list-style: none; margin: 4px 0 0; padding: 0; }
.comments li { margin: 0 0 7px; font-size: 13.5px; line-height: 1.5; word-wrap: break-word; }
.comments li b { font-weight: 600; margin-right: 7px; }
.comments li.adm b { color: var(--accent); }
.comments li.adm b::after { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 0 3px 6px; border-radius: 50%; background: var(--accent); }
.comments .cm { white-space: nowrap; }
.comments time, .comments .del { margin-left: 8px; font-size: 11px; color: var(--faint); }
.comments .del { border: 0; background: none; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.c-form { display: flex; align-items: center; gap: 12px; margin-top: 8px; border-top: 1px solid var(--line); }
.c-form input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg);
  font: 400 16px/1.4 var(--sans); padding: 13px 0; outline: none;
}
@media (min-width: 800px) { .c-form input { font-size: 14px; } }
.c-form input::placeholder { color: var(--faint); }
.c-form button {
  border: 0; background: none; padding: 8px 0;
  font-size: 10px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
  opacity: .3; transition: opacity .2s var(--ease);
}
.c-form button:not(:disabled) { opacity: 1; }
.c-form button:disabled { cursor: default; }

/* footer and toast */
.foot { text-align: center; padding: 72px 20px max(34px, env(safe-area-inset-bottom)); color: var(--faint); }
.foot p { margin: 0 0 16px; font-size: 11px; }
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60;
  transform: translateX(-50%);
  background: var(--fg); color: var(--bg);
  padding: 11px 18px; font-size: 12px;
  animation: fadeIn .3s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* narrow phones */
@media (max-width: 360px) {
  .top { padding-left: 16px; padding-right: 8px; gap: 8px; }
  .top-right { gap: 8px; }
  .who { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabs { gap: 32px; }
  .hl { gap: 12px; }
}
.who { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Browsers without aspect-ratio (Safari before 15): same boxes with the padding technique. */
@supports not (aspect-ratio: 1 / 1) {
  .tile { height: 0; padding-top: 125%; }
  .tile img { position: absolute; top: 0; left: 0; }
  .frame { height: min(calc(100vw / var(--r)), calc(100vh - var(--chrome))); }
}
