/* /funkce (Task #12932) — the soft-style mosaic in the original site tokens.
   Scoped under .funkce-page so Tailwind v4 utilities from public.css and the header/footer
   keep winning. The page tokens are the same as .hp: --teal, --blue, --green, --ink. */

.funkce-page {
  --teal: #51dacf;
  --teal-dark: #3db8af;
  --teal-deep: #1d7069;
  --blue: #51a1da;
  --blue-dark: #3684c0;
  --green: #51da8a;
  --ink: #10292c;
  --ink-2: #3d5558;
  --muted: #4f6568;
  --ground: #f9fafb;
  --paper: #ffffff;
  --line: #d3e6e5;
  --shadow: 0 20px 40px -8px rgba(0, 0, 0, .12);
  --shadow-lift: 0 28px 56px -12px rgba(16, 41, 44, .18);
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--ink);
}

.funkce-page *, .funkce-page *::before, .funkce-page *::after { box-sizing: border-box; }

/* — Headings: Alata. Lead/paragraph: Roboto Slab. UI: Poppins. — */
body .funkce-page h1, body .funkce-page h2, body .funkce-page h3 {
  font-family: 'Alata', 'Poppins', sans-serif;
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
  color: var(--ink);
}
.funkce-page .funkce-h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  max-width: 18ch;
  margin-top: 12px;
}
.funkce-page .funkce-h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  text-align: center;
}
body .funkce-page p {
  margin: 0;
  font-family: 'Roboto Slab', 'Poppins', serif;
}
.funkce-page .funkce-kicker {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--teal-deep);
}
.funkce-page .funkce-lead {
  margin-top: 12px;
  font-size: 1.12rem;
  color: var(--ink-2);
  max-width: 56ch;
}

/* — Hero — */
.funkce-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 9vw, 120px) 0 clamp(40px, 5vw, 64px);
}
.funkce-hero__glow {
  position: absolute;
  inset: -120px -10vw auto -10vw;
  height: 460px;
  background: radial-gradient(60% 100% at 50% 0%, rgba(81, 218, 207, .35) 0%, rgba(81, 218, 207, 0) 70%);
  z-index: 0;
  pointer-events: none;
}
.funkce-hero > .container { position: relative; z-index: 1; }

/* — Sticky filter bar — */
.funkce-mosaic__sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(249, 250, 251, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding-block: 12px;
  border-bottom: 1px solid rgba(211, 230, 229, .55);
}
/* Task #13079 — a stuck bar covering a phone screen is worse than none. */
@media (max-width: 767px) {
  .funkce-mosaic__sticky { position: static; }
}
.funkce-mosaic__filters { padding-bottom: 18px; }
.funkce-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.funkce-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.funkce-chip:hover { border-color: var(--teal-dark); color: var(--teal-deep); }
.funkce-chip:focus-visible { outline: 3px solid var(--teal-deep); outline-offset: 2px; }
.funkce-chip--active {
  background: linear-gradient(135deg, var(--teal) 0%, var(--blue) 100%);
  border-color: transparent;
  color: #ffffff;
}
.funkce-chip__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(16, 41, 44, .08);
  font-size: .75rem;
  font-weight: 600;
}
.funkce-chip--active .funkce-chip__count { background: rgba(255, 255, 255, .25); color: #ffffff; }
.funkce-chips__more { position: relative; }
.funkce-chips__more summary {
  list-style: none;
  cursor: pointer;
}
.funkce-chips__more summary::-webkit-details-marker { display: none; }
.funkce-chips__more-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--paper);
  border-radius: 14px;
  box-shadow: var(--shadow);
  min-width: 220px;
  z-index: 30;
}

/* — Pro koho segmented control — */
.funkce-roles {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-top: 12px;
}
.funkce-role {
  padding: 6px 14px;
  border-radius: 999px;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
}
.funkce-role:hover { color: var(--ink); }
.funkce-role--active {
  background: var(--ink);
  color: var(--paper);
}

/* — Search field — */
.funkce-search {
  margin-top: 14px;
}
.funkce-search__field {
  display: flex;
  gap: 8px;
  max-width: 520px;
}
.funkce-search__field input {
  flex: 1;
  padding: 10px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .95rem;
  background: var(--paper);
}
.funkce-search__field input:focus-visible {
  outline: 3px solid var(--teal-deep);
  outline-offset: 2px;
  border-color: var(--teal);
}
.funkce-search__submit {
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
}

/* — Reassurance row — */
.funkce-reassurance {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(211, 230, 229, .9);
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .82rem;
  color: var(--muted);
}
.funkce-reassurance__item::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  margin-right: 6px;
}
.funkce-reassurance__cta {
  margin-left: auto;
  color: var(--teal-deep);
  font-weight: 600;
  text-decoration: none;
}
.funkce-reassurance__cta:hover { text-decoration: underline; }

/* — Result count — */
.funkce-count {
  margin: 28px 0 18px;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .9rem;
  color: var(--muted);
}

/* — Empty state — */
.funkce-empty {
  background: var(--paper);
  border-radius: 18px;
  padding: 32px;
  text-align: center;
  font-family: 'Roboto Slab', serif;
  font-size: 1.05rem;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.funkce-empty__hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: .95rem;
}
.funkce-empty__suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.funkce-empty__cta {
  display: inline-block;
  margin-top: 18px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 600;
  font-size: .92rem;
}

/* — Mosaic grid — */
.funkce-mosaic__body { background: var(--ground); padding-block: 24px 80px; }
.funkce-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  grid-auto-flow: dense;
}
@media (min-width: 768px) {
  .funkce-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .funkce-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}

/* — Tile — Task #13078: the tile carries .funkce-tile and data-size, and the spans below
   are the only thing that lays the mosaic out. Mobile is one column and the tile takes
   the whole of it (never `span 3`, which would open two implicit columns and scroll the
   page sideways); from 768 px a tile takes three of the six columns, so exactly three
   sit in a row — that is what puts the three large featured tiles in the first row,
   before the pinned full-width answer band. */
.funkce-tile {
  grid-column: 1 / -1;
  background: var(--paper);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  display: block;
}
@media (min-width: 768px) {
  .funkce-tile,
  .funkce-tile[data-size="L"] { grid-column: span 3; }
  /* A pinned answer rendered as a tile (a filtered view) keeps the whole row. */
  .funkce-tile[data-size="W"] { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .funkce-tile[data-tilt="left"]  { transform: rotate(-2deg); }
  .funkce-tile[data-tilt="right"] { transform: rotate(2deg); }
}
.funkce-tile:hover {
  transform: translateY(-3px) rotate(0deg);
  box-shadow: var(--shadow-lift);
}
.funkce-tile__link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.funkce-tile__frame {
  background: var(--paper);
  border-radius: 12px;
  padding: 7px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(16, 41, 44, .08);
  overflow: hidden;
}
.funkce-tile__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.funkce-tile__push {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.funkce-tile__title {
  font-family: 'Alata', 'Poppins', sans-serif;
  font-size: 1.12rem;
  line-height: 1.25;
  color: var(--ink);
}
.funkce-tile__summary {
  margin-top: 8px;
  font-family: 'Roboto Slab', serif;
  font-size: .92rem;
  color: var(--ink-2);
}
.funkce-tile__youdo {
  margin-top: 10px;
  font-family: 'Roboto Slab', serif;
  font-size: .85rem;
  color: var(--muted);
}
.funkce-tile__youdo-label {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--teal-deep);
  margin-right: 6px;
}
.funkce-tile__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.funkce-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .72rem;
  font-weight: 600;
}
.funkce-badge--new { background: rgba(81, 218, 138, .18); color: #22784a; }
.funkce-badge--beta { background: rgba(245, 158, 11, .18); color: #92400e; }
.funkce-badge--optional { background: rgba(16, 41, 44, .08); color: var(--ink-2); }

/* — Pinned answer tile (default view, full-width) — */
.funkce-answer {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--teal) 0%, var(--blue) 100%);
  color: #ffffff;
  border-radius: 22px;
  padding: clamp(28px, 4vw, 44px);
  box-shadow: var(--shadow-lift);
}
.funkce-answer__link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.funkce-answer__kicker {
  display: block;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .9;
  margin-bottom: 12px;
}
.funkce-answer__title {
  font-family: 'Alata', sans-serif;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  color: #ffffff;
  max-width: 22ch;
}
.funkce-answer__body {
  margin-top: 12px;
  font-family: 'Roboto Slab', serif;
  font-size: 1.05rem;
  max-width: 56ch;
  opacity: .95;
}
.funkce-answer__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  padding: 12px 22px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--teal-deep);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

/* — "Drobnosti" list under a filter — */
.funkce-small {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.funkce-small__headline {
  font-family: 'Alata', sans-serif;
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.funkce-small__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .funkce-small__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.funkce-small__list li {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 14px;
  padding: 14px 18px;
}
.funkce-small__link {
  font-family: 'Alata', sans-serif;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.02rem;
}
.funkce-small__summary {
  margin-top: 4px;
  font-family: 'Roboto Slab', serif;
  font-size: .88rem;
  color: var(--muted);
}
.funkce-small__badge {
  margin-top: 8px;
  align-self: flex-start;
}

/* — Grouped "Vše" view — */
.funkce-groups { display: flex; flex-direction: column; gap: clamp(32px, 5vw, 48px); }
.funkce-group__headline {
  font-family: 'Alata', 'Poppins', sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  margin: 0 0 18px 0;
  color: var(--ink);
}

/* — "Zobrazit všech N funkcí" + Vyzkoušet — */
.funkce-more {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 36px;
}
.funkce-more__all {
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--line);
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}
.funkce-more__all:hover { border-color: var(--teal); }
.funkce-more__cta {
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--blue) 100%);
  color: #ffffff;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  box-shadow: 0 12px 24px -10px rgba(81, 218, 207, .55);
}
.funkce-more__demo {
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}
.funkce-more__demo:hover { background: var(--teal-deep); }

/* — References — */
.funkce-references {
  background: var(--paper);
  padding-block: clamp(56px, 7vw, 96px);
}
.funkce-references__quote {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  font-family: 'Roboto Slab', serif;
  font-size: 1.12rem;
  color: var(--ink);
}
.funkce-quote__pull { font-size: 1.4rem; line-height: 1.35; color: var(--ink); }
.funkce-quote__rest { margin-top: 14px; color: var(--ink-2); }
.funkce-references__quote footer {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: .92rem;
  color: var(--ink-2);
}
.funkce-quote__author { text-align: left; }
.funkce-quote__author b { display: block; color: var(--ink); }
.funkce-quote__role { display: block; }
.funkce-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--blue) 100%);
  color: #ffffff;
  font-weight: 700;
}
.funkce-references__numbers {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  max-width: 760px;
  margin: 36px auto 0;
  text-align: center;
  font-family: 'Poppins', sans-serif;
}
@media (min-width: 768px) {
  .funkce-references__numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.funkce-num__value {
  display: block;
  font-family: 'Alata', sans-serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  color: var(--teal-deep);
}
.funkce-num__label {
  display: block;
  margin-top: 4px;
  font-size: .88rem;
  color: var(--muted);
}

/* — Comparison table — */
.funkce-comparison {
  background: var(--ground);
  padding-block: clamp(56px, 7vw, 96px);
}
.funkce-comparison__date {
  margin-top: 10px;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  font-size: .85rem;
  color: var(--muted);
}
.funkce-comparison__scroll {
  margin-top: 32px;
  background: var(--paper);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.funkce-comparison__table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Poppins', sans-serif;
  font-size: .9rem;
}
.funkce-comparison__table th,
.funkce-comparison__table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.funkce-comparison__table thead th {
  font-family: 'Alata', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border-bottom: 2px solid var(--line);
}
.funkce-cmp__feature {
  font-family: 'Roboto Slab', serif;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.funkce-cmp__zub {
  background: linear-gradient(135deg, rgba(81, 218, 207, .12) 0%, rgba(81, 161, 218, .12) 100%);
  border-radius: 8px;
  font-weight: 600;
}
.funkce-cmp__win { color: #22784a; }
.funkce-cmp__loss { color: #92400e; }

/* — Feature dialog — */
html.funkce-dialog--open { overflow: hidden; }
.funkce-dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  margin: 0;
  inset: 0;
}
.funkce-dialog::backdrop {
  background: rgba(16, 41, 44, .55);
  backdrop-filter: blur(2px);
}
.funkce-dialog__sheet {
  position: relative;
  background: var(--paper);
  width: min(720px, 100%);
  height: 100%;
  margin-inline: auto;
  padding: clamp(20px, 3vw, 36px) clamp(20px, 4vw, 48px) clamp(40px, 5vw, 64px);
  overflow-y: auto;
  box-shadow: -20px 0 60px -20px rgba(16, 41, 44, .25);
}
@media (max-width: 767px) {
  .funkce-dialog__sheet {
    width: 100%;
    border-radius: 22px 22px 0 0;
    height: 92%;
    margin-top: 8%;
    box-shadow: 0 -20px 60px -20px rgba(16, 41, 44, .25);
    animation: funkce-sheet-up .25s ease;
  }
}
@keyframes funkce-sheet-up { from { transform: translateY(20%); } to { transform: translateY(0); } }
.funkce-dialog__close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(16, 41, 44, .06);
  color: var(--ink);
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: .9rem;
  cursor: pointer;
}
.funkce-dialog__close:hover { background: rgba(16, 41, 44, .12); }
.funkce-dialog__close:focus-visible { outline: 3px solid var(--teal-deep); outline-offset: 2px; }
.funkce-dialog__close span:first-child { font-size: 1.1rem; line-height: 1; }

/* — Window content (lives inside the dialog frame) — */
.funkce-window { font-family: 'Poppins', system-ui, sans-serif; color: var(--ink); }
body .funkce-window h1 { font-family: 'Alata', sans-serif; font-size: 1.8rem; margin-top: 16px; }
body .funkce-window h2 { font-family: 'Poppins', sans-serif; font-weight: 600; font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; color: var(--teal-deep); margin-top: 28px; }
.funkce-window__push { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.funkce-window__today { margin-top: 14px; font-family: 'Roboto Slab', serif; font-size: 1.05rem; color: var(--ink); }
.funkce-window__screen { margin-top: 24px; padding: 10px; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); }
.funkce-window__image { display: block; width: 100%; height: auto; border-radius: 8px; }
.funkce-window__steps { margin-top: 24px; }
.funkce-window__steps ol { padding-left: 22px; margin-top: 10px; font-family: 'Roboto Slab', serif; color: var(--ink-2); }
.funkce-window__steps li { margin-bottom: 8px; }
.funkce-window__legal { margin-top: 18px; font-family: 'Roboto Slab', serif; color: var(--ink); font-size: .92rem; }
.funkce-window__legal-date { display: block; margin-top: 6px; font-size: .75rem; color: var(--muted); }
.funkce-window__youdo { margin-top: 22px; padding: 16px; background: var(--ground); border-radius: 12px; }
.funkce-window__youdo p { font-family: 'Roboto Slab', serif; color: var(--ink); }
.funkce-window__faq { margin-top: 24px; }
.funkce-window__faq summary { cursor: pointer; font-weight: 600; }
.funkce-window__faq dl { margin-top: 14px; }
.funkce-window__faq div { margin-bottom: 12px; }
.funkce-window__faq dt { font-weight: 600; }
.funkce-window__faq dd { margin-top: 4px; font-family: 'Roboto Slab', serif; color: var(--ink-2); }
.funkce-window__related { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.funkce-window__related ul { list-style: none; padding: 0; margin-top: 8px; }
.funkce-window__related li { padding: 6px 0; }
.funkce-window__related-link { color: var(--teal-deep); text-decoration: none; font-family: 'Poppins', sans-serif; }
.funkce-window__related-link:hover { text-decoration: underline; }

/* — Reduced motion — */
@media (prefers-reduced-motion: reduce) {
  .funkce-tile, .funkce-tile[data-tilt], .funkce-dialog__sheet {
    transform: none !important;
    animation: none !important;
  }
}

/* — Mobile: horizontal chip scroll — */
@media (max-width: 639px) {
  .funkce-chips { flex-wrap: nowrap; overflow-x: auto; padding-block: 4px; scrollbar-width: thin; }
  .funkce-chip { flex-shrink: 0; }
}

/* — Page wrapper — */
.funkce-page main { background: transparent; }
