/* Własne układy tematów gramatycznych (partials/grammar-custom/*.ejs). */
.ff { --ff-accent: var(--teal); --ff-ok: #2F8F5B; --ff-bad: var(--error); }
.ff mark { background: var(--teal-lt); color: var(--teal-text-strong); padding: 0 .2em; border-radius: 4px; font-weight: 700; }

.ff-toc { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; margin: -8px 0 1.5rem; scrollbar-width: none; }
.ff-toc::-webkit-scrollbar { display: none; }
.ff-toc a {
  flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--fg); font-size: .88rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: border-color .2s, color .2s;
}
.ff-toc a:hover { border-color: var(--teal); color: var(--teal-text); }

.ff-kicker { margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-text); }
.ff-h2 { font-family: var(--serif); font-size: clamp(1.7rem, 4.6vw, 2.4rem); line-height: 1.12; margin: 0 0 .75rem; }
.ff-intro { color: var(--fg-muted); line-height: 1.65; margin: 0 0 1.5rem; max-width: 62ch; }
.ff-section { margin: 0 0 4rem; scroll-margin-top: 90px; }

/* PDF */
.ff-pdf {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; margin: 0 0 3.5rem; border-radius: var(--radius-card);
  background: var(--teal-lt); border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent);
}
.ff-pdf-text { flex: 1 1 260px; }
.ff-pdf-lead { margin: 0; line-height: 1.5; }
.ff-pdf-links { display: flex; flex-wrap: wrap; gap: 10px; }
.ff-pdf-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  background: var(--teal-dk); color: var(--on-accent); text-decoration: none; font-weight: 600; font-size: .9rem; line-height: 1.2;
  transition: transform .15s, background .2s;
}
.ff-pdf-link small { opacity: .75; font-weight: 500; }
.ff-pdf-link:hover { background: var(--teal); transform: translateY(-1px); }

/* Ściąga */
.ff-quick { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; counter-reset: ffq; }
.ff-quick a {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border); text-decoration: none; color: var(--fg);
  transition: border-color .2s, transform .15s;
}
.ff-quick a:hover { border-color: var(--teal); transform: translateY(-2px); }
.ff-quick-tag { font-size: .82rem; color: var(--fg-muted); }
.ff-quick-name { font-weight: 700; color: var(--teal-text); }

/* Karty form */
.ff-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ff-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--radius-card);
  background: var(--card); border: 1px solid var(--border); scroll-margin-top: 90px; overflow: hidden;
}
.ff-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--teal); opacity: calc(.35 + var(--i) * .09); }
.ff-card:target { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-lt); }
.ff-card-head { display: flex; align-items: baseline; gap: 10px; }
.ff-card-num { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--teal-text); line-height: 1; }
.ff-card-name { margin: 0; font-size: 1.12rem; }
.ff-card-formula {
  margin: 0; align-self: flex-start; padding: 4px 10px; border-radius: 8px; font-weight: 600; font-size: .9rem;
  background: var(--teal-lt); color: var(--teal-text-strong);
}
.ff-card-use { margin: 0; color: var(--fg-muted); line-height: 1.55; font-size: .95rem; flex: 1; }
.ff-card-example { margin: 0; padding-top: 10px; border-top: 1px dashed var(--border); font-style: italic; }
.ff-card-example::before { content: '→ '; font-style: normal; color: var(--teal-text); }

/* Oś czasu */
.ff-timeline {
  padding: 22px 20px 12px; margin: 0 0 1.25rem; border-radius: var(--radius-card);
  background: var(--card); border: 1px solid var(--border);
}
.ff-tl-row { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 12px; height: 48px; }
.ff-tl-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted); }
.ff-tl-track { position: relative; height: 100%; }
.ff-tl-track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--border); }
.ff-tl-bar { position: absolute; left: 25%; width: 50%; top: calc(50% - 6px); height: 12px; border-radius: 6px; background: var(--teal); }
.ff-tl-bar--soft { background: repeating-linear-gradient(90deg, var(--teal) 0 8px, transparent 8px 12px); opacity: .55; }
.ff-tl-bar--brace { background: color-mix(in srgb, var(--teal) 30%, transparent); border: 2px solid var(--teal); }
.ff-tl-bar--brace b { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); font-size: .78rem; white-space: nowrap; color: var(--teal-text); }
.ff-tl-pin, .ff-tl-flag { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--fg); }
.ff-tl-pin b, .ff-tl-flag b {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%); padding: 1px 7px; border-radius: 6px;
  font-size: .75rem; white-space: nowrap; background: var(--fg); color: var(--bg);
}
.ff-tl-flag { background: var(--ff-ok); }
.ff-tl-flag b { background: var(--ff-ok); color: #fff; transform: translateX(-80%); }
.ff-tl-axis { position: relative; margin-left: 104px; height: 22px; border-top: 1px solid var(--border); }
.ff-tl-axis span { position: absolute; top: 4px; transform: translateX(-50%); font-size: .75rem; color: var(--fg-muted); }
.ff-tl-axis span::after { content: ':00'; }

.ff-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 1.25rem; }
.ff-compare-col { padding: 18px 20px; border-radius: var(--radius-card); background: var(--card); border: 1px solid var(--border); border-top: 4px solid var(--teal); }
.ff-compare-col--1 { border-top-style: dashed; }
.ff-compare-col--2 { border-top-color: var(--ff-ok); }
.ff-compare-label { margin: 0 0 10px; font-size: 1.1rem; color: var(--teal-text); }
.ff-compare-col .gb-prose { font-size: .95rem; }

/* Notatki */
.ff-note { padding: 18px 20px; border-radius: var(--radius-card); background: var(--bg-alt); border-left: 4px solid var(--teal); }
.ff-note--warn { border-left-color: #D99A2B; }
.ff-note-title { margin: 0 0 8px; font-weight: 700; }
.ff-note hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

/* Time clauses */
.ff-rule { display: grid; gap: 8px; margin: 0 0 1.5rem; font-size: clamp(1.05rem, 3.4vw, 1.3rem); font-weight: 600; }
.ff-rule p { margin: 0; padding: 14px 18px; border-radius: 14px; }
.ff-rule p > span { margin-right: 10px; }
.ff-rule-bad { background: color-mix(in srgb, var(--ff-bad) 10%, transparent); }
.ff-rule-bad span, .ff-rule-bad s { color: var(--ff-bad); }
.ff-rule-good { background: color-mix(in srgb, var(--ff-ok) 12%, transparent); }
.ff-rule-good span { color: var(--ff-ok); }

.ff-conj { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ff-conj-item { padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }
.ff-conj-word { margin: 0; font-weight: 700; font-size: 1.05rem; color: var(--teal-text); }
.ff-conj-pl { margin: 0 0 8px; font-size: .85rem; color: var(--fg-muted); }
.ff-conj-ex { margin: 0; font-size: .95rem; line-height: 1.5; }

/* Praktyka */
.ff-practice .gb-faq-item { margin: 0 0 10px !important; padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.ff-practice .gb-faq-item summary { padding: 14px 18px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.ff-practice .gb-faq-item summary::-webkit-details-marker { display: none; }
.ff-practice .gb-faq-item summary::after { content: '+'; font-size: 1.3rem; line-height: 1; color: var(--teal-text); transition: transform .2s; }
.ff-practice .gb-faq-item[open] summary::after { transform: rotate(45deg); }
.ff-practice .gb-faq-item > .gb-prose { padding: 0 18px 16px; margin: 0; }

@media (max-width: 560px) {
  .ff-tl-row { grid-template-columns: 70px 1fr; gap: 8px; }
  .ff-tl-label { font-size: .68rem; }
  .ff-tl-axis { margin-left: 78px; }
  .ff-timeline { padding: 22px 14px 10px; }
  .ff-quick { grid-template-columns: 1fr 1fr; }
}

/* Wspólne klocki tematów A0–A2 (gl-*) */
.gl-step { scroll-margin-top: 90px; }
.gl-bullets { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 8px; }
.gl-bullets li { position: relative; padding: 12px 16px 12px 40px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); line-height: 1.55; }
.gl-bullets li::before { content: ''; position: absolute; left: 17px; top: 21px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.gl-bullets code, .gl-eq code { font-family: inherit; font-weight: 600; background: var(--teal-lt); color: var(--teal-text-strong); padding: .05em .35em; border-radius: 4px; }

.gl-examples { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.gl-examples li { display: grid; gap: 2px; padding: 12px 16px; border-left: 3px solid var(--teal); background: var(--bg-alt); border-radius: 0 12px 12px 0; }
.gl-en { font-weight: 600; }
.gl-pl { font-size: .9rem; color: var(--fg-muted); }

.gl-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 1.25rem; }
.gl-split-col { padding: 20px 18px; border-radius: var(--radius-card); background: var(--card); border: 1px solid var(--border); border-top: 4px solid var(--teal); text-align: center; }
.gl-split-col--alt { border-top-color: #D99A2B; }
.gl-split-col p { margin: 0; }
.gl-split-who { font-size: .85rem; color: var(--fg-muted); font-weight: 600; }
.gl-split-word { font-family: var(--serif); font-size: clamp(2rem, 8vw, 3rem); font-weight: 600; line-height: 1.2; color: var(--teal-text); }
.gl-split-col--alt .gl-split-word { color: #D99A2B; }
.gl-split-ex { font-size: .95rem; }

.gl-move { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; padding: 16px; border-radius: var(--radius-card); border: 1px dashed var(--border); font-size: clamp(1.05rem, 3.6vw, 1.35rem); font-weight: 600; }
.gl-move p { margin: 0; }
.gl-move-arrow { color: var(--teal-text); }
.gl-s { color: #D99A2B; background: color-mix(in srgb, #D99A2B 18%, transparent); border-radius: 4px; padding: 0 2px; }
.gl-move-from .gl-s { text-decoration: line-through; }
.gl-move-note { margin: 10px 0 1.5rem; text-align: center; font-size: .92rem; color: var(--fg-muted); }

.gl-eq { display: grid; gap: 10px; margin: 0 0 .5rem; }
.gl-eq-row { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }
.gl-eq-verb, .gl-eq-part { padding: 4px 12px; border-radius: 8px; font-weight: 700; }
.gl-eq-verb { background: var(--bg-alt); }
.gl-eq-part { background: var(--teal-lt); color: var(--teal-text-strong); }
.gl-eq-op { color: var(--fg-muted); font-weight: 700; }
.gl-eq-res { font-weight: 700; color: var(--teal-text); }

.gl-flash { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.gl-flash-card { border-radius: 14px; background: var(--card); border: 1px solid var(--border); transition: border-color .2s; }
.gl-flash-card[open] { border-color: var(--teal); background: var(--teal-lt); }
.gl-flash-card summary { list-style: none; cursor: pointer; padding: 22px 16px; text-align: center; font-weight: 700; font-size: 1.15rem; }
.gl-flash-card summary::-webkit-details-marker { display: none; }
.gl-flash-card:not([open]) summary::after { content: 'pokaż znaczenie'; display: block; margin-top: 4px; font-size: .75rem; font-weight: 500; color: var(--fg-muted); }
.gl-flash-card[open] summary { padding-bottom: 6px; }
.gl-flash-pl { margin: 0; padding: 0 16px; text-align: center; font-weight: 700; color: var(--teal-text-strong); }
.gl-flash-ex { margin: 8px 16px 16px; text-align: center; font-style: italic; font-size: .92rem; }

.gl-mistakes { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.gl-mistakes .ff-rule { margin: 0; font-size: 1.05rem; }
.gl-mistake-why { padding: 0 4px !important; font-weight: 400; font-size: .92rem; color: var(--fg-muted); }

.gl-cheat { padding: 22px 24px; border-radius: var(--radius-card); background: var(--teal-lt); border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent); }
.gl-cheat ol { margin: 0; padding-left: 1.3rem; display: grid; gap: 8px; line-height: 1.55; }

@media (max-width: 560px) {
  .gl-split { gap: 8px; }
  .gl-split-col { padding: 16px 10px; }
  .gl-flash { grid-template-columns: 1fr 1fr; }
}
