/*
 * Own CSS of rojaflex.com, loaded last by layout.php: styles for site.js and fixes for phones and tablets.
 * GeneratePress is responsive already: the desktop view stays as it was, phone rules only inside @media (max-width: …).
 */

/* ------------------------------------------------------------------ image slider (site.js, /akku-rollladenantrieb/) */
.micro-sp { max-width: 600px; width: 100%; }
.micro-sp .sp-slides { position: relative; aspect-ratio: 1 / 1; overflow: hidden; }
.micro-sp .sp-slide { position: absolute; inset: 0; display: none; }
.micro-sp .sp-slide.micro-current { display: block; animation: micro-fade .4s ease-out; }
.slider-pro.micro-sp img.sp-image { position: static; width: 100%; height: 100%; object-fit: contain; margin: 0; }
/* thumbnails: window without scrollbar, the row moves (site.js thumbStrip; arrows: slider-pro.css) */
.micro-sp .sp-thumbnails-container { margin-top: 4px; overflow: clip; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.micro-sp .sp-thumbnails { display: flex; gap: 10px; width: max-content; transition: transform .7s; }
.slider-pro.micro-sp img.sp-thumbnail { flex: 0 0 100px; width: 100px; height: 100px; object-fit: cover; cursor: pointer; box-sizing: border-box; border: 4px solid transparent !important; }
.slider-pro.micro-sp img.sp-thumbnail.sp-selected-thumbnail { border-color: #1e73be !important; }
.slider-pro.micro-sp .sp-grabbing img.sp-thumbnail { cursor: inherit; }
.micro-sp .sp-thumbnail-arrows { z-index: 2; }
.micro-sp .sp-thumbnail-arrows:focus-within { opacity: 1; }
.slider-pro.micro-sp .sp-thumbnail-arrow { padding: 0; border: 0; background: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.micro-sp .sp-thumbnail-arrow[hidden] { display: none; }
@media (hover: none) { .micro-sp .sp-fade-thumbnail-arrows { opacity: 1; } }  /* touch screens: no hover */
@media (prefers-reduced-motion: reduce) { .micro-sp .sp-thumbnails { transition: none; } }
.micro-sp-arrow { position: absolute; top: 50%; z-index: 2; width: 44px; height: 44px; margin-top: -22px; padding: 0; border: none; border-radius: 50%; cursor: pointer;
  background: transparent no-repeat 50% 50% / 36px 36px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.micro-sp-prev { left: 10px; background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBmaWxsPSJ3aGl0ZSIgZD0iTTEgMTIgQTExIDExIDAgMSAwIDIzIDEyIEExMSAxMSAwIDEgMCAxIDEyIFogTTE1LjQxIDcuNDFMMTQgNmwtNiA2IDYgNiAxLjQxLTEuNDFMMTAuODMgMTJ6Ii8+PC9zdmc+); }
.micro-sp-next { right: 10px; background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBmaWxsPSJ3aGl0ZSIgZD0iTTEgMTIgQTExIDExIDAgMSAwIDIzIDEyIEExMSAxMSAwIDEgMCAxIDEyIFogTTguNTkgMTYuNTlMMTAgMThsNi02LTYtNi0xLjQxIDEuNDFMMTMuMTcgMTJ6Ii8+PC9zdmc+); }
@keyframes micro-fade { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------------ store list (/wo-sie-unsere-produkte-kaufen-konnen/) */
.micro-stores-search { display: none; }
html.js .micro-stores-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.micro-stores-search input { flex: 1 1 220px; max-width: 360px; }
.micro-stores-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.micro-store { margin: 0; padding: 14px 16px; border-left: 3px solid var(--accent, #1e73be); background: rgba(255,255,255,.04); line-height: 1.5; }
.micro-store[hidden] { display: none; }
.micro-store-plz { font-weight: 700; }
.micro-store a { display: inline-block; padding: 6px 0; }

/* ------------------------------------------------------------------ phones and tablets */
@media (max-width: 768px) {
  /* iframe of the external store locator (/store-locator/): 100% wide plus 10px margin overflowed the page */
  .entry-content iframe[src*="locatestore.com"] { margin: 10px 0 !important; }
  /* grids of GenerateBlocks: items may be narrower than their longest word (also in WordPress the pages
     /bedienungsanleitungen/, /konformitaetserklaerungen/, /vorbaurollladen-45-…/ and /service-beratung/ scrolled sideways) */
  .entry-content [class*="gb-element-"] > :is(:has(ul.downloads), :has(table), :has(.infobox), .infobox) { min-width: 0; }
  .entry-content ul.downloads a, .entry-content .infobox a { overflow-wrap: anywhere; }
  /* narrow info boxes (3 columns on tablets): long German words ("Insektenschutzsysteme") are hyphenated */
  .entry-content .infobox { -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; }
  .entry-content .infobox p { max-width: 100%; }
  .entry-content h1 { -webkit-hyphens: auto; hyphens: auto; }  /* "Doppelführungsschiene" */
  .entry-content .infobox p > span.gb-text { min-width: 0; overflow-wrap: anywhere; }
  /* tables (sizes, technical data): words are not broken into single letters (WordPress squeezed the 15 columns of
     "Technische Daten" into 343px); the table scrolls sideways inside the page */
  .entry-content .wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .entry-content .wp-block-table table.has-fixed-layout { table-layout: auto; }
  .entry-content .wp-block-table td, .entry-content .wp-block-table th { word-break: normal; overflow-wrap: normal; }
  .entry-content :not(.wp-block-table) > table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
