/* Figtree (SIL OFL, public/fonts/OFL.txt): darmowy krój zbliżony do Tangent ze sklepu Nutridome. */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin.woff2") format("woff2");
  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: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #ffffff;
  --card: #f5f5f5;
  --card-active: #ebebeb;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e2e2e2;
  --mark: #e6e6e6;
  --radius: 22px;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a, button { touch-action: manipulation; }

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.intro { padding-top: max(20px, env(safe-area-inset-top)); }

.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 2px 0 12px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Wyszukiwarka i filtry przyklejone do góry, żeby były zawsze pod ręką. */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: max(10px, env(safe-area-inset-top));
}

.search { position: relative; }

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

#q {
  width: 100%;
  height: 52px;
  padding: 0 52px 0 46px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* 16px zapobiega powiększaniu strony na iOS */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

#q::placeholder { color: #9a9a9a; }
#q:focus-visible { box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.15); }
#q::-webkit-search-cancel-button { display: none; }

.clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

/* Filtry marek przewijane w poziomie, ze strzałkami przy krawędziach, gdy jest ich więcej. */
.filters {
  position: relative;
  margin: 12px calc(-1 * max(var(--gutter), env(safe-area-inset-right))) 0 calc(-1 * max(var(--gutter), env(safe-area-inset-left)));
}

.chips {
  display: flex;
  gap: 8px;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 12px max(var(--gutter), env(safe-area-inset-left));
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 56px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.scroll-btn {
  position: absolute;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 64px;
  height: 44px;
  padding: 0 10px;
  border: 0;
  color: var(--ink);
  cursor: pointer;
}
.scroll-btn[hidden] { display: none; }
.scroll-btn.prev {
  left: 0;
  justify-content: flex-start;
  background: linear-gradient(to right, #fff 45%, rgba(255, 255, 255, 0));
}
.scroll-btn.next {
  right: 0;
  justify-content: flex-end;
  background: linear-gradient(to left, #fff 45%, rgba(255, 255, 255, 0));
}
.scroll-btn span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.scroll-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.chip-logo {
  display: block;
  filter: brightness(0); /* jednolita czerń niezależnie od koloru logo */
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed="true"] .chip-logo { filter: brightness(0) invert(1); }
.chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.count {
  margin: 16px 4px 10px;
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0 0 max(32px, env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
}

/* Pigułka briefu, nawiązanie do zasobów w panelu Cruva. */
.brief a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--radius);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s, transform 0.1s;
}
.brief a:active { background: var(--card-active); transform: scale(0.985); }
.brief a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (hover: hover) {
  .brief a:hover { background: var(--card-active); }
  .chip:hover { border-color: var(--ink); }
}

.thumb {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--bg);
  object-fit: cover; /* packshoty mają jednolite tło, więc lekkie przycięcie boków jest niewidoczne */
}
.thumb-empty {
  display: grid;
  place-items: center;
  color: #b5b5b5;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
}

.brief-body { flex: 1; min-width: 0; }

.brief-brand {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.brief-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.snippet {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

mark {
  background: var(--mark);
  color: var(--ink);
  border-radius: 3px;
  padding: 0 1px;
}

.arrow {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  font-size: 18px;
  line-height: 1;
}

.skeleton {
  height: 76px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--card) 25%, #ececec 50%, var(--card) 75%) 0 0 / 200% 100%;
  animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.state {
  margin: 24px 4px;
  text-align: center;
  color: var(--muted);
}
.state p { margin: 0 0 16px; }

.btn {
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Bardzo wąskie ekrany (np. iPhone SE 1. gen.). */
@media (max-width: 359px) {
  :root { --gutter: 12px; }
  h1 { font-size: 22px; }
  .thumb { width: 48px; height: 48px; border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  .brief a, .chip { transition: none; }
}
