/* ============================================================
   STOLMAR BLOCKS — Frontend CSS
   Używa CSS zmiennych z infology_pro (--color-primary itd.)
   Fallbacki zapewniają działanie bez wtyczki infology.
   ============================================================ */

:root {
  --stlm-primary:    var(--color-primary,   #82B635);
  --stlm-secondary:  var(--color-secondary, #F2F7EA);
  --stlm-dark:       var(--color-accent,    #2A2622);
  --stlm-text:       var(--color-text,      #2A2622);
  --stlm-heading:    var(--color-heading,   #2A2622);
  --stlm-border:     var(--color-border,    #E5EDD5);
  --stlm-bg:         var(--color-bg,        #FFFFFF);
  --stlm-success:    var(--color-success,   #10B981);
  --stlm-font-body:  var(--font-body,       system-ui, sans-serif);
  --stlm-font-head:  var(--font-heading,    system-ui, sans-serif);
  --stlm-radius:     var(--radius-button,   8px);
  --stlm-block-gap:  48px;
}

/* ─── WSPÓLNE ─────────────────────────────────────────────── */
.stlm-block {
  margin-bottom: var(--stlm-block-gap);
  font-family: var(--stlm-font-body);
  color: var(--stlm-text);
  line-height: 1.7;
}

.stlm-block:last-child { margin-bottom: 0; }

.stlm-col__title {
  font-family: var(--stlm-font-head);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--stlm-heading);
  margin: 0 0 .75rem 0;
}

.stlm-col__body p   { margin: 0 0 .85em; }
.stlm-col__body p:last-child { margin-bottom: 0; }
.stlm-col__body ul  { padding-left: 1.4em; margin: 0 0 .85em; }
.stlm-col__body li  { margin-bottom: .35em; }

.stlm-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.stlm-block-img--rounded {
  border-radius: calc(var(--stlm-radius) * 1.5);
}

/* ─── HERO ────────────────────────────────────────────────── */
.stlm-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--stlm-dark);
  background-size: cover;
  background-position: center;
  min-height: 480px;
  border-radius: var(--stlm-radius);
  overflow: hidden;
}

.stlm-hero__overlay {
  position: absolute;
  inset: 0;
  background: var(--stlm-dark);
  pointer-events: none;
}

.stlm-hero__inner {
  position: relative;
  z-index: 1;
  padding: 3rem 2rem;
  max-width: 720px;
  width: 100%;
}

.stlm-hero--align-center .stlm-hero__inner { text-align: center; margin: 0 auto; }
.stlm-hero--align-right  .stlm-hero__inner { text-align: right;  margin-left: auto; }
.stlm-hero--align-left   .stlm-hero__inner { text-align: left; }

.stlm-hero__title {
  font-family: var(--stlm-font-head);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 .5rem;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.stlm-hero__subtitle {
  font-size: clamp(.95rem, 2vw, 1.2rem);
  color: rgba(255,255,255,.88);
  margin: 0 0 1.5rem;
}

.stlm-hero__cta {
  display: inline-block;
  padding: .75rem 2rem;
  background: var(--stlm-primary);
  color: #fff;
  border-radius: var(--stlm-radius);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  transition: background .2s, transform .15s;
  letter-spacing: .02em;
}
.stlm-hero__cta:hover {
  background: color-mix(in srgb, var(--stlm-primary) 85%, #000);
  transform: translateY(-1px);
  color: #fff;
}

/* ─── NAGŁÓWKI ────────────────────────────────────────────── */
.stlm-heading {
  font-family: var(--stlm-font-head);
  font-weight: 700;
  color: var(--stlm-heading);
  margin: 0 0 1rem;
  line-height: 1.25;
}
.stlm-heading--h1 { font-size: clamp(2rem,   5vw, 3.25rem); }
.stlm-heading--h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
.stlm-heading--h3 { font-size: clamp(1.3rem, 3vw, 2rem);   }
.stlm-heading--h4 { font-size: clamp(1.1rem, 2vw, 1.5rem); }
.stlm-heading--h5 { font-size: 1.15rem; }
.stlm-heading--h6 { font-size: 1rem;    }
.stlm-heading--center { text-align: center; }
.stlm-heading--right  { text-align: right; }

/* ─── LAYOUT 2-KOLUMNOWY (baza dla tf, ft, tt) ───────────── */
.stlm-tf, .stlm-ft, .stlm-tt {
  display: grid;
  gap: var(--stlm-col-gap, 40px);
  align-items: start;
}
.stlm-tf--valign-center,
.stlm-ft--valign-center,
.stlm-tt--valign-center { align-items: center; }
.stlm-tf--valign-bottom,
.stlm-ft--valign-bottom,
.stlm-tt--valign-bottom { align-items: end; }

/* TF — tekst lewa, foto prawa */
.stlm-tf {
  grid-template-columns: 1fr var(--stlm-img-ratio, 55%);
}
/* FT — foto lewa, tekst prawa */
.stlm-ft {
  grid-template-columns: var(--stlm-img-ratio, 55%) 1fr;
}
/* TT — dwie kolumny tekstu */
.stlm-tt {
  grid-template-columns: 1fr 1fr;
}

/* ─── FOTO | FOTO ─────────────────────────────────────────── */
.stlm-ff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--stlm-col-gap, 20px);
}
.stlm-ff__item {
  margin: 0;
}
.stlm-ff__caption {
  font-size: .875rem;
  color: #666;
  text-align: center;
  margin: .5rem 0 0;
}

/* ─── CECHY ───────────────────────────────────────────────── */
.stlm-features { }
.stlm-features__title {
  font-family: var(--stlm-font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--stlm-heading);
  margin: 0 0 1.25rem;
}
.stlm-features__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .75rem;
}
.stlm-features--cols-2 .stlm-features__list { grid-template-columns: 1fr 1fr; }
.stlm-features--cols-3 .stlm-features__list { grid-template-columns: 1fr 1fr 1fr; }

/* Styl: karta */
.stlm-features__item--card {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 1rem 1.25rem;
  background: var(--stlm-secondary);
  border-radius: var(--stlm-radius);
  border: 1px solid var(--stlm-border);
  transition: box-shadow .2s, transform .15s;
}
.stlm-features__item--card:hover {
  box-shadow: 0 4px 16px rgba(130,182,53,.18);
  transform: translateY(-2px);
}

/* Styl: lista */
.stlm-features__item--list {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--stlm-border);
}
.stlm-features__item--list:last-child { border-bottom: none; }

/* Styl: minimal */
.stlm-features__item--minimal {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}

.stlm-features__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1.2;
}
.stlm-features__text {
  font-size: .97rem;
  color: var(--stlm-text);
  font-weight: 500;
  line-height: 1.4;
}

/* ─── TABELA ──────────────────────────────────────────────── */
.stlm-table__title {
  font-family: var(--stlm-font-head);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--stlm-heading);
  margin: 0 0 1rem;
}
.stlm-table__wrap {
  overflow-x: auto;
  border-radius: var(--stlm-radius);
  border: 1px solid var(--stlm-border);
}
.stlm-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
.stlm-table thead th {
  padding: .75rem 1rem;
  background: var(--stlm-primary);
  color: #fff;
  font-weight: 700;
  text-align: left;
  font-size: .875rem;
  letter-spacing: .03em;
}
.stlm-table__key {
  padding: .65rem 1rem;
  font-weight: 600;
  color: var(--stlm-dark);
  width: 40%;
}
.stlm-table__val {
  padding: .65rem 1rem;
  color: var(--stlm-text);
}
.stlm-table--striped .stlm-table__row--even td { background: var(--stlm-secondary); }
.stlm-table--bordered td,
.stlm-table--bordered th { border-bottom: 1px solid var(--stlm-border); }
.stlm-table--bordered tbody tr:last-child td { border-bottom: none; }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .stlm-tf,
  .stlm-ft  { grid-template-columns: 1fr !important; }
  .stlm-tt  { grid-template-columns: 1fr !important; }
  .stlm-ff  { grid-template-columns: 1fr !important; }

  .stlm-ft > .stlm-ft__img { order: -1; }

  .stlm-features--cols-2 .stlm-features__list,
  .stlm-features--cols-3 .stlm-features__list { grid-template-columns: 1fr; }

  .stlm-hero { min-height: 300px !important; }
  .stlm-hero__inner { padding: 2rem 1.25rem; }

  :root { --stlm-block-gap: 32px; }
}
