/* Sosnowa Szpilka – Korepetycje: additions for the widget controls (icons, more tiles). The source stylesheets stay untouched. */

/* Elementor icon chosen in the graphite hero box: same box and colour as the original SVG icon. */
.ssk.ssk-page .ssk-subject-list .ssk-el-icon {
  display: inline-flex;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #FF8EC9;
  font-size: 20px;
  line-height: 1;
}

.ssk.ssk-page .ssk-subject-list .ssk-el-icon svg {
  width: 100%;
  height: 100%;
  flex: none;
  fill: currentColor;
}

.ssk.ssk-page .ssk-subject-list .ssk-el-icon i {
  font-size: inherit;
}

/* 1.6.2, Template 01 "Z czego potrzebujesz pomocy?": a regular grid replaces the Bento layout (the first tile no longer spans rows).
   Desktop: two columns, rows of equal height, so four tiles make a 2 x 2 grid and every added or reordered tile simply continues the grid.
   768-1023 px: two columns with the icon above the text (same card as on the phone); below 768 px the source stylesheet keeps one column. */
@media (min-width: 768px) {
  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: minmax(220px, 1fr);
  }

  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid > .ssk-subject-card,
  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid > .ssk-subject-card:first-child,
  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid > .ssk-subject-card:not(:first-child) {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
    justify-content: flex-start;
    padding: 28px;
  }

  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid > .ssk-subject-card .ssk-subject-mark,
  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid > .ssk-subject-card:first-child .ssk-subject-mark {
    position: static;
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
  }

  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid > .ssk-subject-card .ssk-subject-mark svg,
  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid > .ssk-subject-card:first-child .ssk-subject-mark svg {
    width: 42px;
    height: 42px;
  }

  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid > .ssk-subject-card:first-child p {
    max-width: none;
  }

  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid.ssk-count-1 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 1024px) {
  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid > .ssk-subject-card,
  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid > .ssk-subject-card:first-child,
  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid > .ssk-subject-card:not(:first-child) {
    justify-content: center;
    padding: 34px 158px 34px 34px;
  }

  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid > .ssk-subject-card .ssk-subject-mark,
  .ssk.ssk-page.ssk-source-01 .ssk-subject-grid > .ssk-subject-card:first-child .ssk-subject-mark {
    position: absolute;
    width: 108px;
    height: 108px;
    flex: none;
  }
}

/* Locations: the grid follows the number of visible locations (hidden ones leave no empty card).
   Three locations keep the original three columns; below 768 px the source stylesheet keeps one column. */
@media (min-width: 768px) {
  .ssk.ssk-page[class*="ssk-source-"] .ssk-location-list.ssk-location-list--count-1 {
    grid-template-columns: minmax(0, 1fr);
  }

  .ssk.ssk-page[class*="ssk-source-"] .ssk-location-list.ssk-location-list--count-2,
  .ssk.ssk-page[class*="ssk-source-"] .ssk-location-list.ssk-location-list--count-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ssk.ssk-page[class*="ssk-source-"] .ssk-location-list.ssk-location-list--count-3,
  .ssk.ssk-page[class*="ssk-source-"] .ssk-location-list.ssk-location-list--count-many {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Optional description of a location, between its name and its link. */
.ssk.ssk-page .ssk-location .ssk-location-desc {
  margin: 0;
  color: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* A location without a link is not clickable, so it does not change colour on hover. */
.ssk.ssk-page div.ssk-location:hover,
.ssk.ssk-page div.ssk-location:hover span {
  background: transparent;
  color: inherit;
}

/* Shown only in the Elementor editor when every location is switched off. */
.ssk.ssk-page .ssk-editor-notice {
  margin: 16px 0 0;
  padding: 16px 20px;
  border: 1px dashed #c9c9c9;
  border-radius: 12px;
  color: #545454;
  font-size: 0.9rem;
}

/* ------------------------------------------------------------------------------------------------
   Lists rendered from repeaters carry ssk-count-N (N = visible items; "many" above 5).
   0 items: the list is not rendered at all. The rules only change grids that would otherwise leave
   empty columns or a lone item on its own row; the original item count keeps the original layout.
   Phones (< 768 px) keep the single column of the source stylesheets.
   3-column grids (trust bar, prices, location tiles, specialists): 1 → 1 col, 2 → 2, 3 → 3, 4 → 2 × 2, 5+ → 3.
   Steps (4 columns): 1 → 1, 2 → 2, 3 → 3, 4 → 4, 5 → 3, 6+ → 4 (desktop).
   Service shortcuts (5 columns): 1–4 → as many columns (desktop).
   Two-column quotes: 1 → 1, odd numbers → the last quote takes the full row.
   Subject tiles (featured tile + column): 1 → 1 col, 2 → 2 equal tiles, 3 → original, 4+ → rule above.
   ------------------------------------------------------------------------------------------------ */
@media (min-width: 768px) {
  .ssk.ssk-page[class*="ssk-source-"] :is(.ssk-trust-grid, .ssk-en-prices, .ssk-location-list, .ssk-br-people, .ssk-steps, .ssk-br-jumps, .ssk-en-quotes).ssk-count-1 {
    grid-template-columns: minmax(0, 1fr);
  }

  .ssk.ssk-page[class*="ssk-source-"] :is(.ssk-trust-grid, .ssk-en-prices, .ssk-location-list, .ssk-br-people, .ssk-steps, .ssk-br-jumps).ssk-count-2,
  .ssk.ssk-page[class*="ssk-source-"] :is(.ssk-trust-grid, .ssk-en-prices, .ssk-location-list, .ssk-br-people).ssk-count-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (min-width: 1024px) {
  .ssk.ssk-page[class*="ssk-source-"] .ssk-steps.ssk-count-3,
  .ssk.ssk-page[class*="ssk-source-"] .ssk-steps:is(.ssk-count-5) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ssk.ssk-page[class*="ssk-source-"] .ssk-br-jumps.ssk-count-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ssk.ssk-page[class*="ssk-source-"] .ssk-br-jumps.ssk-count-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Elementor icon chosen for a list item: takes the place, size and colour of the original SVG. */
.ssk.ssk-page .ssk-el-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ssk.ssk-page .ssk-el-icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

/* Hidden section: no widget, no empty Elementor section/column/container (Elementor columns keep min-height: 1px). */
.elementor-widget.ssk-is-hidden,
.elementor-column:has(.ssk-is-hidden):not(:has(.elementor-widget:not(.ssk-is-hidden))),
.elementor-section:has(.ssk-is-hidden):not(:has(.elementor-widget:not(.ssk-is-hidden))),
.e-con:has(.ssk-is-hidden):not(:has(.elementor-widget:not(.ssk-is-hidden))) {
  display: none !important;
}

/* Editor only: hint shown in place of a hidden section. */
.ssk-editor-hidden {
  padding: 14px 18px;
  border: 1px dashed #c9c9c9;
  background: repeating-linear-gradient(135deg, #fafafa 0 10px, #f3f3f3 10px 20px);
  color: #545454;
  font: 500 13px/1.5 Montserrat, sans-serif;
}

/* A widget followed only by hidden SSK sections is the last visible one: no Elementor widget spacing after it. */
.elementor-widget-wrap > .elementor-element:has(~ .ssk-is-hidden):not(:has(~ .elementor-element:not(.ssk-is-hidden))) {
  margin-block-end: 0 !important;
}

/* A two-column block (text | map, text | photo, photo | bio) whose other column is switched off. */
.ssk.ssk-page .ssk-single {
  grid-template-columns: minmax(0, 1fr) !important;
}

/* Two-column quotes with an odd number of items: the last one takes the full row instead of half of it. */
@media (min-width: 768px) {
  .ssk.ssk-page .ssk-en-quotes:is(.ssk-count-3, .ssk-count-5) > :last-child {
    grid-column: 1 / -1;
  }
}

/*
 * 1.6.1 – "Znacznik HTML": a heading rendered with another tag carries ssk-as-hN (hN = its tag in the source HTML).
 * The twin selectors in the source stylesheets give it the look of hN. These rules only keep it from taking over
 * anything of the new tag: block display (SPAN), the max-width of h1/h2 rules (h3 has none), theme heading extras.
 */
.ssk-as-h1, .ssk-as-h2, .ssk-as-h3 {
  display: block;
}
.ssk.ssk-page .ssk-as-h1,
.ssk.ssk-page .ssk-as-h2,
.ssk.ssk-page .ssk-as-h3 {
  float: none;
  clear: none;
  text-transform: none;
  font-style: normal;
  text-decoration: none;
  text-shadow: none;
}
.ssk.ssk-page .ssk-as-h3 {
  max-width: none;
}

/* 1.6.2, Template 01: several Bookero widgets (one calendar each) in one Elementor container or column sit side by side.
   Four columns from 1200 px, two from 768 px, one on the phone. A single Bookero widget is not affected (the selectors need a second one).
   Every calendar keeps its own height: a step that grows (summary, client data, payment) only lengthens its own column. */
:is(.e-con, .e-con-inner, .elementor-widget-wrap):has(> .elementor-widget-ssk-ref-p01s07 ~ .elementor-widget-ssk-ref-p01s07) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

:is(.e-con, .e-con-inner, .elementor-widget-wrap):has(> .elementor-widget-ssk-ref-p01s07 ~ .elementor-widget-ssk-ref-p01s07) > .elementor-widget-ssk-ref-p01s07 {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
}

:is(.e-con, .e-con-inner, .elementor-widget-wrap):has(> .elementor-widget-ssk-ref-p01s07 ~ .elementor-widget-ssk-ref-p01s07) .elementor-widget-ssk-ref-p01s07 :is(.elementor-widget-container, .ssk-page, .ssk-page > section) {
  height: 100%;
}

:is(.e-con, .e-con-inner, .elementor-widget-wrap):has(> .elementor-widget-ssk-ref-p01s07 ~ .elementor-widget-ssk-ref-p01s07) .ssk-page > section {
  box-sizing: border-box;
}

:is(.e-con, .e-con-inner, .elementor-widget-wrap):has(> .elementor-widget-ssk-ref-p01s07 ~ .elementor-widget-ssk-ref-p01s07) .elementor-widget-ssk-ref-p01s07 .ssk-booking {
  width: 100%;
  min-height: 0;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: visible;
}

@media (min-width: 768px) {
  :is(.e-con, .e-con-inner, .elementor-widget-wrap):has(> .elementor-widget-ssk-ref-p01s07 ~ .elementor-widget-ssk-ref-p01s07) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  :is(.e-con, .e-con-inner, .elementor-widget-wrap):has(> .elementor-widget-ssk-ref-p01s07 ~ .elementor-widget-ssk-ref-p01s07 ~ .elementor-widget-ssk-ref-p01s07) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  :is(.e-con, .e-con-inner, .elementor-widget-wrap):has(> .elementor-widget-ssk-ref-p01s07 ~ .elementor-widget-ssk-ref-p01s07 ~ .elementor-widget-ssk-ref-p01s07 ~ .elementor-widget-ssk-ref-p01s07) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
