/*
Theme Name:    Testyjęzykowe Child
Theme URI:     https://testyjezykowe.pl
Description:   Child theme dla Divi 5 — portal z testami językowymi. Zawiera własny system tokenów (kolory, typografia, spacing), komponenty (przyciski, plakietki, chipy poziomów CEFR, karty testów) oraz dark mode.
Author:        Testyjęzykowe.pl
Author URI:    https://testyjezykowe.pl
Template:      Divi
Version:       1.0.0
License:       GNU General Public License v2 or later
License URI:   http://www.gnu.org/licenses/gpl-2.0.html
Tags:          education, custom-colors, custom-menu, dark-mode, responsive-layout, threaded-comments
Text Domain:   tj-child
*/

/* =========================================================================
   1. GOOGLE FONTS
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* =========================================================================
   2. DESIGN TOKENS — CSS Custom Properties
   Zmień wartości tutaj, by przemalować cały portal.
   ========================================================================= */
:root {
  /* — Fonts — */
  --tj-font-sans: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --tj-font-display: 'Instrument Serif', Georgia, serif;
  --tj-font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* — Radius — */
  --tj-radius: 14px;
  --tj-radius-sm: 7px;
  --tj-radius-lg: 20px;
  --tj-radius-pill: 999px;

  /* — Spacing scale — */
  --tj-density: 1;
  --tj-s-1: calc(4px * var(--tj-density));
  --tj-s-2: calc(8px * var(--tj-density));
  --tj-s-3: calc(12px * var(--tj-density));
  --tj-s-4: calc(16px * var(--tj-density));
  --tj-s-5: calc(20px * var(--tj-density));
  --tj-s-6: calc(24px * var(--tj-density));
  --tj-s-8: calc(32px * var(--tj-density));
  --tj-s-10: calc(40px * var(--tj-density));
  --tj-s-12: calc(48px * var(--tj-density));
  --tj-s-16: calc(64px * var(--tj-density));
  --tj-s-20: calc(80px * var(--tj-density));

  /* — Brand color (zmień, by przemalować) — */
  --tj-primary: #2447ee;
  --tj-primary-ink: #1d3aba;
  --tj-primary-bg: #eaeefd;
  --tj-primary-fg: #ffffff;

  /* — Neutrals (light theme) — */
  --tj-bg: #fafaf7;
  --tj-surface: #ffffff;
  --tj-surface-2: #f4f3ef;
  --tj-surface-3: #e9e7e1;
  --tj-ink: #1a1d2e;
  --tj-ink-2: #4b4e60;
  --tj-muted: #7a7d8c;
  --tj-faint: #a6a8b3;
  --tj-border: #e6e3dd;
  --tj-border-2: #d3cfc6;

  /* — Semantic — */
  --tj-success: #16a34a;
  --tj-success-bg: #dcfce7;
  --tj-warning: #f59e0b;
  --tj-warning-bg: #fef3c7;
  --tj-danger: #dc2626;
  --tj-danger-bg: #fee2e2;

  /* — CEFR levels — */
  --tj-a1: #1ec4b8;
  --tj-a2: #2dba6c;
  --tj-b1: #2f87e6;
  --tj-b2: #5566e8;
  --tj-c1: #8645d6;
  --tj-c2: #5a248f;

  /* — Shadows — */
  --tj-shadow-1: 0 1px 2px rgba(15,18,42,0.04), 0 1px 1px rgba(15,18,42,0.03);
  --tj-shadow-2: 0 2px 4px rgba(15,18,42,0.04), 0 8px 24px rgba(15,18,42,0.06);
  --tj-shadow-3: 0 4px 8px rgba(15,18,42,0.05), 0 16px 40px rgba(15,18,42,0.08);
  --tj-shadow-glow: 0 0 0 4px rgba(36, 71, 238, 0.18);

  /* — Transitions — */
  --tj-trans: 150ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* =========================================================================
   3. DARK MODE
   Aktywne przez data-theme="dark" na <html> lub <body>
   ========================================================================= */
[data-theme="dark"],
.tj-dark {
  --tj-bg: #16182a;
  --tj-surface: #1d2036;
  --tj-surface-2: #252946;
  --tj-surface-3: #2e3253;
  --tj-ink: #f5f3ee;
  --tj-ink-2: #cdc9c1;
  --tj-muted: #9a98a8;
  --tj-faint: #696877;
  --tj-border: #34374f;
  --tj-border-2: #444870;

  --tj-primary-bg: #1f2960;
  --tj-success-bg: #0d3825;
  --tj-warning-bg: #3d2a08;
  --tj-danger-bg: #3d1212;

  --tj-shadow-1: 0 1px 2px rgba(0,0,0,0.3);
  --tj-shadow-2: 0 2px 4px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
  --tj-shadow-3: 0 4px 8px rgba(0,0,0,0.35), 0 16px 40px rgba(0,0,0,0.5);
}

/* Auto dark mode (jeżeli OS używa ciemnego motywu i nie ma override) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* automatyczne wartości dark — kopia powyższych */
  }
}

/* =========================================================================
   4. BASE — typography & resets dla całego body
   ========================================================================= */
body {
  font-family: var(--tj-font-sans) !important;
  color: var(--tj-ink);
  background: var(--tj-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--tj-font-sans);
  color: var(--tj-ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h1 { font-size: clamp(2.5rem, 5vw, 5.5rem); font-weight: 600; }
h2 { font-size: clamp(2rem, 3.5vw, 2.75rem); font-weight: 600; }
h3 { font-size: clamp(1.5rem, 2.2vw, 1.75rem); font-weight: 600; }
h4 { font-size: clamp(1.25rem, 1.6vw, 1.375rem); font-weight: 600; }
h5 { font-size: 1rem; font-weight: 600; }

p { line-height: 1.6; color: var(--tj-ink-2); }

a { color: var(--tj-primary); text-decoration: none; transition: color var(--tj-trans); }
a:hover { color: var(--tj-primary-ink); }

::selection { background: var(--tj-primary); color: var(--tj-primary-fg); }

/* =========================================================================
   5. UTILITY CLASSES
   ========================================================================= */
.tj-display { font-family: var(--tj-font-display); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.tj-mono    { font-family: var(--tj-font-mono); font-feature-settings: "tnum"; }
.tj-tabular { font-variant-numeric: tabular-nums; }
.tj-text-wrap-pretty { text-wrap: pretty; }

.tj-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tj-primary);
}

.tj-muted { color: var(--tj-muted); }
.tj-faint { color: var(--tj-faint); }
.tj-ink   { color: var(--tj-ink); }

.tj-mt-1 { margin-top: var(--tj-s-1); } .tj-mt-2 { margin-top: var(--tj-s-2); }
.tj-mt-3 { margin-top: var(--tj-s-3); } .tj-mt-4 { margin-top: var(--tj-s-4); }
.tj-mt-5 { margin-top: var(--tj-s-5); } .tj-mt-6 { margin-top: var(--tj-s-6); }
.tj-mt-8 { margin-top: var(--tj-s-8); } .tj-mt-10 { margin-top: var(--tj-s-10); }
.tj-mt-12 { margin-top: var(--tj-s-12); } .tj-mt-16 { margin-top: var(--tj-s-16); }

.tj-stack { display: flex; flex-direction: column; gap: var(--tj-s-4); }
.tj-row   { display: flex; flex-wrap: wrap; gap: var(--tj-s-4); align-items: center; }
.tj-grid  { display: grid; gap: var(--tj-s-5); }
.tj-grid-2 { grid-template-columns: repeat(2, 1fr); }
.tj-grid-3 { grid-template-columns: repeat(3, 1fr); }
.tj-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 980px) {
  .tj-grid-3, .tj-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .tj-grid-2, .tj-grid-3, .tj-grid-4 { grid-template-columns: 1fr; }
}

/* =========================================================================
   6. BUTTONS — używaj klasy .tj-btn z modyfikatorami
   ========================================================================= */
.tj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  font-family: var(--tj-font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: var(--tj-radius);
  border: 1px solid transparent;
  background: var(--tj-primary);
  color: var(--tj-primary-fg);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform var(--tj-trans), box-shadow var(--tj-trans), background var(--tj-trans);
}
.tj-btn:hover { transform: translateY(-1px); box-shadow: var(--tj-shadow-2); color: var(--tj-primary-fg); }
.tj-btn:active { transform: translateY(0); }
.tj-btn:focus-visible { outline: none; box-shadow: var(--tj-shadow-glow); }

.tj-btn--secondary { background: var(--tj-surface); color: var(--tj-ink); border-color: var(--tj-border-2); }
.tj-btn--secondary:hover { color: var(--tj-ink); background: var(--tj-surface-2); }
.tj-btn--ghost { background: transparent; color: var(--tj-ink); }
.tj-btn--ghost:hover { background: var(--tj-surface-2); color: var(--tj-ink); }
.tj-btn--dark { background: var(--tj-ink); color: var(--tj-bg); }
.tj-btn--dark:hover { color: var(--tj-bg); }
.tj-btn--soft { background: var(--tj-primary-bg); color: var(--tj-primary-ink); }
.tj-btn--soft:hover { color: var(--tj-primary-ink); }

.tj-btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.tj-btn--lg { height: 52px; padding: 0 22px; font-size: 16px; }
.tj-btn--xl { height: 60px; padding: 0 28px; font-size: 17px; }
.tj-btn--full { width: 100%; }

/* Divi domyślny .et_pb_button — restylujemy go też naszym tokenem */
.et_pb_button.tj-btn-themed,
.et_pb_module .et_pb_button.tj-btn-themed {
  background: var(--tj-primary) !important;
  color: var(--tj-primary-fg) !important;
  border: 0 !important;
  border-radius: var(--tj-radius) !important;
  padding: 0.7em 1.4em !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  font-family: var(--tj-font-sans) !important;
}
.et_pb_button.tj-btn-themed:after { display: none !important; }

/* =========================================================================
   7. BADGES & CHIPS
   ========================================================================= */
.tj-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--tj-radius-pill);
  background: var(--tj-surface-2);
  color: var(--tj-ink-2);
  border: 1px solid var(--tj-border);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.tj-badge--primary { background: var(--tj-primary-bg); color: var(--tj-primary-ink); border-color: transparent; }
.tj-badge--success { background: var(--tj-success-bg); color: var(--tj-success); border-color: transparent; }
.tj-badge--warning { background: var(--tj-warning-bg); color: var(--tj-warning); border-color: transparent; }
.tj-badge--danger  { background: var(--tj-danger-bg); color: var(--tj-danger); border-color: transparent; }
.tj-badge--dark    { background: var(--tj-ink); color: var(--tj-bg); border-color: transparent; }
.tj-badge--sm { height: 20px; padding: 0 8px; font-size: 11px; }
.tj-badge--lg { height: 32px; padding: 0 14px; font-size: 13px; }

/* CEFR Level chips — kolor odpowiada poziomowi */
.tj-level {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px;
  font-family: var(--tj-font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  border-radius: var(--tj-radius-sm);
}
.tj-level--A1 { background: var(--tj-a1); }
.tj-level--A2 { background: var(--tj-a2); }
.tj-level--B1 { background: var(--tj-b1); }
.tj-level--B2 { background: var(--tj-b2); }
.tj-level--C1 { background: var(--tj-c1); }
.tj-level--C2 { background: var(--tj-c2); }

/* Soft variant — kolor jako tint */
.tj-level--soft.tj-level--A1 { background: color-mix(in oklab, var(--tj-a1) 16%, transparent); color: var(--tj-a1); }
.tj-level--soft.tj-level--A2 { background: color-mix(in oklab, var(--tj-a2) 16%, transparent); color: var(--tj-a2); }
.tj-level--soft.tj-level--B1 { background: color-mix(in oklab, var(--tj-b1) 16%, transparent); color: var(--tj-b1); }
.tj-level--soft.tj-level--B2 { background: color-mix(in oklab, var(--tj-b2) 16%, transparent); color: var(--tj-b2); }
.tj-level--soft.tj-level--C1 { background: color-mix(in oklab, var(--tj-c1) 16%, transparent); color: var(--tj-c1); }
.tj-level--soft.tj-level--C2 { background: color-mix(in oklab, var(--tj-c2) 16%, transparent); color: var(--tj-c2); }
.tj-level--soft { border-radius: var(--tj-radius-pill); }

.tj-level__label { font-family: var(--tj-font-sans); font-weight: 500; letter-spacing: 0; }

/* Flag block — emoji flagi języków (bez tła, czyste emoji) */
.tj-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji", sans-serif;
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.tj-flag--sm { font-size: 20px; }
.tj-flag--lg { font-size: 44px; }

/* =========================================================================
   8. CARDS
   ========================================================================= */
.tj-card {
  background: var(--tj-surface);
  border: 1px solid var(--tj-border);
  border-radius: var(--tj-radius-lg);
  padding: var(--tj-s-6);
  box-shadow: var(--tj-shadow-1);
  transition: transform var(--tj-trans), box-shadow var(--tj-trans);
}
.tj-card--hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--tj-shadow-2);
  border-color: var(--tj-border-2);
}
.tj-card--outline { box-shadow: none; }
.tj-card--glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}
.tj-card--dark {
  background: var(--tj-ink);
  color: var(--tj-bg);
  border-color: transparent;
}
.tj-card__pad-sm { padding: var(--tj-s-4); }
.tj-card__pad-lg { padding: var(--tj-s-8); }
.tj-card__pad-none { padding: 0; }

/* =========================================================================
   9. PROGRESS BAR
   ========================================================================= */
.tj-progress {
  height: 8px;
  background: var(--tj-surface-3);
  border-radius: var(--tj-radius-pill);
  overflow: hidden;
}
.tj-progress__bar {
  height: 100%;
  background: var(--tj-primary);
  border-radius: inherit;
  transition: width 400ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* =========================================================================
   10. FORMS
   ========================================================================= */
.tj-input,
input.tj-input,
textarea.tj-input,
select.tj-input {
  display: flex;
  align-items: center;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-family: var(--tj-font-sans);
  font-size: 15px;
  color: var(--tj-ink);
  background: var(--tj-surface);
  border: 1px solid var(--tj-border-2);
  border-radius: var(--tj-radius);
  outline: none;
  transition: border-color var(--tj-trans), box-shadow var(--tj-trans);
}
.tj-input:focus { border-color: var(--tj-primary); box-shadow: var(--tj-shadow-glow); }
textarea.tj-input { height: auto; padding: 12px 16px; min-height: 96px; resize: vertical; }

.tj-label { display: block; font-size: 12px; font-weight: 600; color: var(--tj-ink-2); margin-bottom: 6px; }

/* =========================================================================
   11. TEST CARD — gotowy komponent karty pojedynczego testu
   ========================================================================= */
.tj-test-card {
  display: flex;
  flex-direction: column;
  gap: var(--tj-s-4);
  padding: var(--tj-s-6);
  background: var(--tj-surface);
  border: 1px solid var(--tj-border);
  border-radius: var(--tj-radius-lg);
  box-shadow: var(--tj-shadow-1);
  transition: transform var(--tj-trans), box-shadow var(--tj-trans);
  position: relative;
}
.tj-test-card:hover { transform: translateY(-2px); box-shadow: var(--tj-shadow-2); }

.tj-test-card__head { display: flex; justify-content: space-between; align-items: flex-start; }
.tj-test-card__title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.tj-test-card__meta { display: flex; gap: 8px; flex-wrap: wrap; }
.tj-test-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--tj-s-3); border-top: 1px solid var(--tj-border);
  margin-top: auto;
}

/* =========================================================================
   12. SECTION HELPERS — kontenery sekcji w stylu portalu
   ========================================================================= */
.tj-section { padding: var(--tj-s-16) 0; }
.tj-section--tight { padding: var(--tj-s-10) 0; }
.tj-section--alt { background: var(--tj-surface-2); }

.tj-container { max-width: 1280px; margin: 0 auto; padding: 0 var(--tj-s-6); }
.tj-container--narrow { max-width: 820px; }
.tj-container--wide { max-width: 1440px; }

/* =========================================================================
   13. HERO BLOCK — wzorzec na nagłówek strony
   ========================================================================= */
.tj-hero {
  padding: var(--tj-s-20) 0 var(--tj-s-16);
  position: relative;
  overflow: hidden;
}
.tj-hero__title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-wrap: balance;
}
.tj-hero__sub {
  margin-top: var(--tj-s-5);
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  color: var(--tj-ink-2);
  line-height: 1.55;
  text-wrap: pretty;
  max-width: 560px;
}

/* =========================================================================
   14. DIVI MODULE OVERRIDES
   Te reguły naprawiają najczęstsze wyglądy modułów Divi 5 tak,
   by współgrały z naszym design systemem.
   ========================================================================= */

/* Section paddingi domyślne — bardziej hojne */
.et_pb_section { padding: var(--tj-s-16) 0; }
.et_pb_section.et_pb_section_first_child { padding-top: var(--tj-s-10); }

/* Row max-width matches nasz container wide */
.et_pb_row { max-width: 1280px; }
.et_pb_row.et_pb_row_wide { max-width: 1440px; }

/* H1-H6 inside Text/Heading modules używają naszej typografii */
.et_pb_text h1,
.et_pb_text h2,
.et_pb_text h3,
.et_pb_text h4,
.et_pb_heading_0 {
  font-family: var(--tj-font-sans);
  letter-spacing: -0.025em;
}

/* Display style — dodaj klasę .tj-display-h do dowolnego nagłówka w Divi */
.et_pb_text .tj-display-h,
h1.tj-display-h, h2.tj-display-h, h3.tj-display-h {
  font-family: var(--tj-font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--tj-primary);
}

/* Blurb — restyling */
.et_pb_blurb.tj-blurb .et_pb_main_blurb_image { margin-bottom: var(--tj-s-4); }
.et_pb_blurb.tj-blurb h4.et_pb_module_header { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }

/* Pricing tables / CTA */
.et_pb_promo.tj-promo {
  background: var(--tj-ink) !important;
  color: var(--tj-bg) !important;
  border-radius: var(--tj-radius-lg) !important;
  padding: var(--tj-s-12) !important;
}

/* =========================================================================
   15. NAV / FOOTER (Theme Builder Header + Footer)
   ========================================================================= */

/* — Divi Theme Builder: usuń max-width z row i padding z section — */
.et-l--header .et_pb_row,
.et-l--footer .et_pb_row {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.et-l--header .et_pb_section,
.et-l--footer .et_pb_section {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.et-l--header .et_pb_code_inner,
.et-l--header .et_pb_code,
.et-l--footer .et_pb_code_inner,
.et-l--footer .et_pb_code {
  padding: 0 !important;
  margin: 0 !important;
}
/* Divi 5 block class names */
.et-l--header .wp-block-divi-row,
.et-l--footer .wp-block-divi-row {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
}

/* — Nawigacja — */
.tj-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--tj-s-4) var(--tj-s-10);
  border-bottom: 1px solid var(--tj-border);
  background: var(--tj-bg);
  position: relative;
  width: 100%;
  box-sizing: border-box;
}
.tj-nav__items { display: flex; gap: var(--tj-s-5); align-items: center; }
.tj-nav__items a {
  font-size: 14px;
  font-weight: 500;
  color: var(--tj-muted);
  transition: color var(--tj-trans);
  text-decoration: none;
}
.tj-nav__items a:hover,
.tj-nav__items a[aria-current="page"] { color: var(--tj-ink); }
.tj-nav__items a[aria-current="page"] { font-weight: 600; }

/* — Hamburger — */
.tj-nav__actions { display: flex; gap: 8px; align-items: center; }
.tj-nav__actions .tj-btn:not(.tj-nav__toggle) { /* action buttons visible desktop */ }

.tj-nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--tj-border);
  border-radius: var(--tj-radius-sm);
  cursor: pointer;
  padding: 6px 8px;
  color: var(--tj-ink);
  align-items: center;
  justify-content: center;
}
.tj-nav__mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--tj-bg);
  border-bottom: 1px solid var(--tj-border);
  padding: 12px 16px 16px;
  flex-direction: column;
  gap: 2px;
  z-index: 9999;
  box-shadow: var(--tj-shadow-2);
}
.tj-nav__mobile a {
  display: block;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--tj-ink-2);
  border-radius: var(--tj-radius-sm);
  text-decoration: none;
  transition: background var(--tj-trans), color var(--tj-trans);
}
.tj-nav__mobile a:hover { background: var(--tj-surface-2); color: var(--tj-ink); }
.tj-nav__mobile hr { border: none; border-top: 1px solid var(--tj-border); margin: 8px 0; }
.tj-nav__mobile--open { display: flex; }

/* — Logo — */
.tj-logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 700; letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--tj-ink);
}
.tj-logo:hover { color: var(--tj-ink); }
.tj-logo__mark {
  width: 28px; height: 28px;
  background: var(--tj-ink); color: var(--tj-bg);
  border-radius: calc(var(--tj-radius) * 0.6);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--tj-font-display); font-style: italic;
  font-size: 18px; line-height: 1;
}
.tj-logo__dot { color: var(--tj-primary); }

/* — Footer grid — */
.tj-footer { padding: 48px 40px 24px; border-top: 1px solid var(--tj-border); background: var(--tj-surface-2); width: 100%; box-sizing: border-box; }
.tj-footer__inner { max-width: 1400px; margin: 0 auto; }
.tj-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.tj-footer__col-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--tj-faint); margin-bottom: 16px;
}
.tj-footer__links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tj-footer__links a { font-size: 14px; color: var(--tj-ink-2); text-decoration: none; transition: color var(--tj-trans); }
.tj-footer__links a:hover { color: var(--tj-ink); }
.tj-footer__bottom {
  padding-top: 20px; border-top: 1px solid var(--tj-border);
  display: flex; justify-content: space-between; font-size: 12px; color: var(--tj-faint);
}
.tj-footer__social { display: flex; gap: 8px; }
.tj-footer__social a {
  width: 36px; height: 36px; border-radius: var(--tj-radius);
  border: 1px solid var(--tj-border); color: var(--tj-muted);
  display: flex; align-items: center; justify-content: center;
  transition: color var(--tj-trans), border-color var(--tj-trans);
}
.tj-footer__social a:hover { color: var(--tj-ink); border-color: var(--tj-border-2); }

/* =========================================================================
   16. ACCESSIBILITY
   ========================================================================= */
:focus-visible { outline: 2px solid var(--tj-primary); outline-offset: 2px; border-radius: var(--tj-radius-sm); }

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

/* =========================================================================
   17. RESPONSIVE (Divi default breakpoints: 980 / 768 / 480)
   ========================================================================= */
@media (max-width: 980px) {
  :root { --tj-density: 0.92; }
  .et_pb_section { padding: var(--tj-s-10) 0; }
  .tj-nav { padding: var(--tj-s-3) var(--tj-s-5); }
  .tj-nav__items { display: none; }
  .tj-nav__toggle { display: flex; }
  .tj-nav__actions .tj-btn:not(.tj-nav__toggle) { display: none; }
  .tj-hero { padding: var(--tj-s-12) 0; }
  .tj-footer { padding: 40px 24px 20px; }
  .tj-footer__grid { grid-template-columns: 1fr 1fr 1fr; }
  .tj-footer__bottom { flex-direction: column; gap: 8px; text-align: center; }
  /* Languages sekcja */
  .tj-langs-section { padding: 48px 24px; }
  .tj-langs-inner { grid-template-columns: 1fr; gap: 32px; }
  /* Featured grid */
  .tj-featured-grid { grid-template-columns: repeat(2,1fr); }
  /* Dashboard stats */
  .tj-dash-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tj-konto-wrap { grid-template-columns: 1fr; padding: 24px 20px 60px; }
  .tj-konto-nav { position: static; flex-direction: row; overflow-x: auto; }
  /* Language archive */
  .tj-lang-hero { padding: 48px 24px 64px; }
  .tj-lang-filters { padding: 16px 24px; top: 56px; }
  .tj-lang-grid-wrap { padding: 32px 24px; }
  /* CEFR levels grid */
  .tj-levels-cefr-grid { grid-template-columns: repeat(3,1fr); }
  /* Hero */
  .tj-hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .tj-hero-left { text-align: center; }
  .tj-hero-badges { justify-content: center; }
}
@media (max-width: 640px) {
  :root { --tj-density: 0.88; }
  .tj-btn--lg { height: 48px; padding: 0 18px; font-size: 15px; }
  h1, .tj-hero__title { letter-spacing: -0.025em; }
  .tj-footer__grid { grid-template-columns: 1fr 1fr; }
  /* CTA section */
  .tj-cta-wrap { padding: 48px 20px; }
  .tj-cta-btns { flex-direction: column; align-items: stretch; padding: 0 16px; }
  .tj-cta-btns a { text-align: center; justify-content: center; }
  /* Languages */
  .tj-langs-section { padding: 36px 16px; }
  .tj-langs-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .tj-lang-flag { font-size: 28px; }
  .tj-lang-card { padding: 12px; gap: 10px; }
  /* Featured grid */
  .tj-featured-grid { grid-template-columns: 1fr; }
  /* Dashboard */
  .tj-dash-stats { grid-template-columns: 1fr; }
  /* Language archive */
  .tj-lang-hero { padding: 36px 16px 48px; }
  .tj-lang-filters { padding: 12px 16px; position: relative; top: auto; }
  .tj-lang-grid-wrap { padding: 24px 16px; }
  /* CEFR levels */
  .tj-levels-cefr-grid { grid-template-columns: repeat(2,1fr); }
  /* Test cards */
  .tj-test-card { padding: 16px; }
  .tj-test-card__title { font-size: 17px; }
  /* Hero */
  .tj-hero-grid { gap: 24px; padding: 48px 20px 40px; }
}
@media (max-width: 480px) {
  .tj-footer { padding: 32px 16px 16px; }
  .tj-footer__grid { grid-template-columns: 1fr; }
  .tj-nav { padding: var(--tj-s-3) var(--tj-s-4); }
  .tj-dash-stats { grid-template-columns: 1fr; }
  .tj-levels-cefr-grid { grid-template-columns: repeat(2,1fr); }
  .tj-stat-card-row, .tj-stats-row { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .tj-langs-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   18. PRINT — certyfikat powinien się drukować ładnie
   ========================================================================= */
@media print {
  body { background: #fff; }
  .tj-nav, .tj-footer, .et_pb_button, .tj-btn { display: none !important; }
  .tj-card { border: 1px solid #ccc !important; box-shadow: none !important; }
}
