/*
 * This stylesheet is loaded only on the page that contains the IFS tool.
 * Hide the surrounding Joomla article chrome so the tool starts cleanly.
 */
.article-details > .article-header,
.article-details > .article-info,
.article-details > .article-can-edit,
.article-details > .icons,
.item-page > .page-header,
.item-page > .article-info,
.item-page > .article-can-edit,
.item-page > .icons,
.item-page > .btn-group,
.item-page > .float-end,
.item-page > .article-info-term {
  display: none !important;
}

.ifs-luftfeuchte-tool {
  --ifs-navy: #14253a;
  --ifs-blue: #b9cde5;
  --ifs-red: #c52221;
  --ifs-border: #111111;
  --ifs-surface: #ffffff;
  --ifs-muted: #f3f5f7;
  max-width: 1120px;
  margin: 2rem auto;
  color: #111;
  background: var(--ifs-surface);
  border: 1px solid #d5dbe1;
  box-shadow: 0 8px 28px rgba(20, 37, 58, 0.09);
  font-family: inherit;
}

.ifs-tool-header {
  padding: 1.15rem 1.5rem;
  text-align: center;
  background: var(--ifs-navy);
  color: #fff;
}

.ifs-tool-header h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.25;
}

.ifs-tool-header h2 span,
.ifs-tool-intro span {
  display: block;
}

.ifs-tool-content {
  padding: clamp(1rem, 3vw, 2rem);
}

.ifs-tool-intro {
  max-width: 900px;
  margin: 0 auto 1.5rem;
  text-align: center;
  font-size: 1.05rem;
}

.ifs-tool-form {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--ifs-muted);
  border: 1px solid #d5dbe1;
}

.ifs-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
}

.ifs-input-grid label > span:first-child {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.ifs-input-grid input {
  width: 100%;
  min-height: 46px;
  padding: 0.55rem 0.7rem;
  color: var(--ifs-red);
  background: #fff;
  border: 2px solid #9da8b3;
  border-radius: 3px;
  font-size: 1.1rem;
  font-weight: 700;
}

.ifs-input-grid input:focus {
  border-color: var(--ifs-navy);
  outline: 3px solid rgba(20, 37, 58, 0.15);
}

.ifs-input-unit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.55rem;
}

.ifs-input-unit > span {
  font-weight: 700;
}

.ifs-calculate-button,
.ifs-contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 1rem;
  padding: 0.65rem 1.15rem;
  border: 0;
  border-radius: 3px;
  background: var(--ifs-red);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.ifs-calculate-button:hover,
.ifs-contact-button:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
}

.ifs-calculate-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.ifs-tool-error {
  margin: 0.8rem 0 0;
  padding: 0.75rem;
  color: #8a1111;
  background: #ffe3e3;
  border-left: 4px solid var(--ifs-red);
}

.ifs-table-scroll {
  overflow-x: auto;
  border: 2px solid var(--ifs-border);
}

.ifs-result-table {
  width: 100%;
  min-width: 650px;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.ifs-result-table th,
.ifs-result-table td {
  padding: 0.55rem 0.65rem;
  text-align: center;
  border: 1px solid var(--ifs-border);
}

.ifs-result-table th {
  background: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.ifs-result-table td {
  font-size: 1.05rem;
}

.ifs-result-table tbody td:first-child,
.ifs-result-table tbody td:last-child {
  background: var(--ifs-blue);
}

.ifs-tool-note {
  margin: 0.65rem 0 2rem;
  color: #4a4f55;
  font-size: 0.92rem;
}

.ifs-preview-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d5dbe1;
}

.ifs-preview-section h3,
.ifs-purchase-box h3 {
  margin-top: 0;
  color: var(--ifs-navy);
}

.ifs-preview-section figure {
  margin: 1rem 0 0;
}

.ifs-preview-section img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #b9c0c7;
  background: #fff;
}

.ifs-preview-section figcaption {
  margin-top: 0.45rem;
  color: #555;
  font-size: 0.9rem;
  text-align: center;
}

.ifs-purchase-box {
  margin-top: 2rem;
  padding: 1.35rem;
  background: #eef3f8;
  border-left: 6px solid var(--ifs-navy);
}

.ifs-purchase-box p {
  margin: 0 0 0.85rem;
}

.ifs-purchase-box .ifs-purchase-price {
  margin-top: 1.1rem;
  color: var(--ifs-navy);
  font-size: 1.08rem;
}

.ifs-purchase-box .ifs-contact-button {
  margin-top: 0.35rem;
}

@media (max-width: 700px) {
  .ifs-luftfeuchte-tool {
    margin: 1rem 0;
  }

  .ifs-input-grid {
    grid-template-columns: 1fr;
  }

  .ifs-tool-content {
    padding: 1rem;
  }

  /* Mobile result cards: no horizontal scrolling is needed. */
  .ifs-table-scroll {
    overflow: visible;
    border: 0;
  }

  .ifs-result-table {
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
  }

  .ifs-result-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .ifs-result-table tbody,
  .ifs-result-table tr,
  .ifs-result-table td {
    display: block;
    width: 100%;
  }

  .ifs-result-table tr {
    margin: 0 0 0.85rem;
    overflow: hidden;
    border: 2px solid var(--ifs-border);
    border-radius: 4px;
    background: #fff;
  }

  .ifs-result-table td {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    min-height: 48px;
    padding: 0.65rem 0.75rem;
    text-align: right;
    border: 0;
    border-bottom: 1px solid var(--ifs-border);
    font-size: 1rem;
    font-weight: 700;
  }

  .ifs-result-table td:last-child {
    border-bottom: 0;
  }

  .ifs-result-table td::before {
    content: attr(data-label);
    min-width: 0;
    text-align: left;
    font-weight: 700;
    overflow-wrap: anywhere;
  }
}
