/* =============================================================================
   THEME WIDGETS
   ============================================================================= */

/* =============================================================================
   THEME ICON BOX
   ============================================================================= */

.elementor-icon-box-icon .elementor-icon {
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: rgba(227, 69, 15, 0.08);
  display: inline-flex;
  place-items: center;
  color: var(--orange-500) !important;
  fill: var(--orange-500) !important;
  padding: 1.5rem !important;
}

/* =============================================================================
   THEME CARD
   ============================================================================= */

.cards {
  flex-wrap: wrap !important;
  gap: var(--space-lg) !important;
}

.card,
.card-light {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-on-dark) !important;
  border-radius: var(--radius-md) !important;
  padding: var(--space-lg) !important;
  transition:
    border-color var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out) !important;
}

.card-light {
  background: #fff !important;
  border-color: var(--line-on-light) !important;
  box-shadow: var(--shadow-card) !important;
}

.card__label,
.card__label .elementor-heading-title {
  font-size: 0.66rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase !important;
  color: var(--orange-500) !important;
}

.card__title,
.card__title .elementor-heading-title {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  font-style: italic !important;
  font-size: var(--step-2) !important;
  line-height: 1.05 !important;
}

.card__link .elementor-button {
  padding: 0 !important;
  font-weight: 600 !important;
  color: var(--orange-500) !important;
}

.card:hover,
.card-light:hover {
  border-color: var(--orange-500) !important;
  transform: translateY(-2px) !important;
}

.card-light:hover {
  box-shadow: var(--shadow-card-h) !important;
}

@media (max-width: 980px) {
  .cards {
    display: flex !important;
  }

  .card,
  .card-light {
    width: 100% !important;
  }
}

/* =============================================================================
   THEME FORM
   ============================================================================= */

.theme-form-dark {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-on-dark);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.theme-form-dark .elementor-field-group {
  padding-right: calc(30px / 2) !important;
  padding-left: calc(30px / 2) !important;
  margin-bottom: 20px !important;
}

.theme-form-dark .elementor-field-group > label {
  padding-bottom: 10px !important;
  color: var(--text-on-dark) !important;
}

.theme-form-dark .elementor-mark-required .elementor-field-label:after {
  color: var(--text-on-dark) !important;
  content: "*";
  padding-inline-start: 0.2em;
}

/* The consent line is not a field label, so it misses the label colour above
   and falls back to the page's dark body text — invisible on the dark card.
   The crane form only escaped this because an Elementor colour global happened
   to sit on that widget; tying the colour to the class instead keeps both
   forms right and survives the next cleanup of Elementor settings.

   The flex row keeps the box beside the first line instead of letting a
   wrapped second line run underneath it, which is what happens in the narrow
   single-column card on the contact page. */
.theme-form-dark .elementor-field-type-acceptance .elementor-field-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
}

.theme-form-dark .elementor-field-type-acceptance .elementor-field-option label,
.theme-form-dark .elementor-field-subgroup label {
  color: var(--text-on-dark) !important;
}

.theme-form-dark .elementor-field-type-acceptance input[type="checkbox"] {
  flex: none;
  margin: 0.3em 0 0;
}

.theme-form-dark .elementor-field-group input,
.theme-form-dark .elementor-field-group textarea,
.theme-form-dark .elementor-field-group select {
  font-family: var(--font-body);
  font-size: var(--step-0);
  padding: 0.75rem 1rem;
  border: 1px solid var(--line-on-dark-str);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-on-dark) !important;
  transition: border-color var(--dur) var(--ease-out);
}

/* Two-column row that folds by itself.

   A fixed breakpoint always guesses wrong somewhere: the contact row is fine
   at 1440 and cramped at 1050, and the next such row will have different
   content. Letting the columns carry a minimum width and the row wrap means
   the fold happens exactly when the content runs out of room — side by side
   while both columns fit, stacked full width below that, on any screen. */
.theme-row-wrap {
  flex-wrap: wrap;
}

/* The selector has to outweigh Elementor's own `.e-con.e-flex > .e-con`,
   which pins every child to width:100% and flex-basis:auto — otherwise the
   row folds at every width. */
.e-con.theme-row-wrap > .e-con,
.e-con.theme-row-wrap > .elementor-widget {
  flex-basis: 500px;
  flex-grow: 1;
  flex-shrink: 1;
  width: auto;
  min-width: 0;
}

/* The same card on a light section.

   .theme-form-dark tints whatever sits behind it by 3% white, which only reads
   as a card when the section is already dark. The contact page is white, so
   there the card has to bring its own dark surface. Add this class next to
   .theme-form-dark; the values reproduce exactly what the Mobilkran page
   renders (surface #282828 on its #212121 section, border #393939), so the two
   forms stay identical without hard-coding either number. */
.theme-form-panel {
  background: color-mix(in srgb, #fff 3%, var(--surface-dark));
  border: 1px solid color-mix(in srgb, #fff 8%, var(--surface-dark));
}

@media (max-width: 767px) {
  .theme-form-dark {
    padding: var(--space-md);
  }
}

@media (max-width: 424px) {
  .theme-form-dark {
    padding: var(--space-sm);
  }
}

.aspect-3-1 {
  aspect-ratio: 3 / 1 !important;
}

.aspect-3-2 {
  aspect-ratio: 3 / 2 !important;
}

.aspect-16-9 {
  aspect-ratio: 16 / 9 !important;
}

.aspect-3-1 img,
.aspect-3-2 img,
.aspect-16-9 img {
  object-fit: cover !important;
  width: 100% !important;
  height: 100% !important;
}

/* ---------------------------------------------------------------------------
   Service tiles
   --------------------------------------------------------------------------- */

/* The tiles are already flex columns; only the button needs pushing down so
   the row lines up whatever length the headings are. */
/* Four across only where four fit. On a tablet each tile gets narrower than the
   words in its heading, so the titles run into the neighbouring tile. Grid
   instead of Elementor's flex row because minmax(0, 1fr) keeps a long word from
   pushing its column wider than its share.

   `:not(.e-grid)` everywhere below: the services page builds the same tiles from
   an Elementor grid container that brings its own column count and a column-wise
   flow. Overriding only its columns left the tiles flowing down two of four, with
   half the row empty — so leave those containers to Elementor. */
.theme-service-tiles.e-con:not(.e-grid) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .theme-service-tiles.e-con:not(.e-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .theme-service-tiles.e-con:not(.e-grid) {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Long German compounds have no break opportunity, so in a narrow column they
   simply run past its edge: "Ölspurbeseitigung" in a service tile,
   "Veranstaltungen" in the crane tiles at 1024px. `anywhere` lets such a word
   break rather than overflow, and it only ever applies when the word does not
   fit — ordinary headings wrap at their spaces exactly as before.

   Scoped to headings on purpose. The page-level net (`overflow-x: clip` on
   html and body, see theme-reset.css) catches anything wider that slips
   through, but clipping hides text instead of wrapping it, so it is the last
   line of defence, not the first. */
.elementor-heading-title {
  overflow-wrap: anywhere;
}

.theme-service-tiles > .e-con > .elementor-widget-button {
  margin-top: auto;
}

/* The aspect box sits on the widget, not on the img: sizing the image itself
   leaves the widget at the file's intrinsic height and the image spills over
   the heading below it.

   Height comes from padding rather than aspect-ratio, which a flex item ignores
   here — the tiles are flex columns, so the widget kept taking its height from
   the image and a not-yet-loaded one collapsed the tile to nothing. Padding
   holds the box open in every layout context and before the image arrives. */
.theme-service-tiles:not(.e-grid) > .e-con .elementor-widget-image {
  position: relative;
  padding-top: 57.1429%;
}

.theme-service-tiles:not(.e-grid) > .e-con .elementor-widget-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The accent bar is drawn here rather than baked into the files. The three
   original images carry one in three different oranges, none of them the brand
   colour, and an image the client uploads later carries none at all. Slightly
   wider than the 2% baked in, so it covers them. */
.theme-service-tiles:not(.e-grid) > .e-con .elementor-widget-image::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3%;
  background: var(--orange-500);
  pointer-events: none;
}
