/* piece.css
   Styl spójny z pozostałymi podstronami sekcji mieszkańców.
*/

.page-root.piece-page {
  --piece-navy: #0d3566;
  --piece-blue: #2f79c8;
  --piece-line: #ccd9ea;
  --piece-line-soft: #e6edf5;
  --piece-orange: #e99912;
  --piece-text: #102f58;
  --piece-muted: #66798e;
  --piece-radius: 12px;

  max-width: 1200px;
  margin-inline: auto;
  padding: 34px 28px 52px;
  color: var(--piece-text);
}

.piece-page,
.piece-page *,
.piece-page *::before,
.piece-page *::after {
  box-sizing: border-box;
}

/* HERO */
.piece-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 390px);
  align-items: center;
  gap: 28px;
  margin-bottom: 24px;
}

.piece-title {
  margin: 0 !important;
  text-align: left !important;
  color: var(--piece-navy) !important;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.piece-title-accent {
  display: block;
  width: 66px;
  height: 3px;
  margin-top: 16px;
  border-radius: 999px;
  background: var(--piece-orange);
}

.piece-lead {
  max-width: 640px;
  margin: 25px 0 0;
  font-size: 1rem;
  line-height: 1.55;
}

.piece-hero-art {
  justify-self: end;
  width: min(100%, 340px);
  overflow: hidden;
}

.piece-hero-art-img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: -10px;
  clip-path: inset(10px 0 0 0);
}

/* INFORMACJA */
.piece-info {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 15px 18px;
  border: 1px solid #f0c66d;
  border-radius: var(--piece-radius);
  background: linear-gradient(90deg, #f7fbff, #fff);
}

.piece-info-icon {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.piece-info p {
  margin: 0;
  color: var(--piece-text);
  font-size: .94rem;
  line-height: 1.45;
}

.piece-info strong {
  color: var(--piece-navy);
}

/* SEKCJE */
.piece-section {
  width: 100%;
  padding: 20px 18px;
  border: 1px solid var(--piece-line);
  border-radius: var(--piece-radius);
  background: #fff;
  box-shadow: 0 8px 26px rgba(13, 53, 102, .035);
}

.piece-section + .piece-section {
  margin-top: 18px;
}

.piece-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.piece-section-mark {
  flex: 0 0 4px;
  width: 4px;
  height: 26px;
  border-radius: 999px;
  background: var(--piece-blue);
}

.piece-section-mark-logoterm {
  background: var(--piece-orange);
}

.piece-section-head h2 {
  margin: 0;
  color: var(--piece-navy);
  font-size: 1.18rem;
  line-height: 1.25;
}

/* KARTY */
.piece-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.piece-grid-logoterm {
  grid-template-columns: minmax(0, 1fr);
  max-width: 360px;
}

.piece-card {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--piece-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(13, 53, 102, .03);
}

.piece-brand {
  margin: -18px -20px 14px;
  padding: 12px 20px 11px;
  border-bottom: 1px solid var(--piece-line);
  border-radius: 10px 10px 0 0;
  background: #f7fbff;
}

.piece-brand-logoterm {
  background: #fffaf1;
}

.piece-brand span {
  display: block;
  margin-bottom: 2px;
  color: var(--piece-muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.piece-brand h3 {
  margin: 0;
  color: var(--piece-navy);
  font-size: 1.16rem;
  line-height: 1.15;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.piece-contact {
  min-width: 0;
}

.piece-contact strong {
  display: block;
  margin-bottom: 6px;
  color: var(--piece-text);
  font-weight: 600;
  line-height: 1.35;
}

.piece-contact p {
  margin: 4px 0 0;
}

.piece-address {
  color: var(--piece-text);
  line-height: 1.45;
}

.piece-phone {
  color: var(--piece-muted);
  line-height: 1.4;
}

.piece-phone span {
  margin-right: 4px;
  color: var(--piece-muted);
  font-size: .9rem;
}

.piece-phone a {
  color: var(--piece-navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.piece-contact-separated {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--piece-line-soft);
}

/* IKONY ADRESU I TELEFONU */
.piece-line {
  position: relative;
  padding-left: 22px;
}

.piece-line::before {
  content: '';
  position: absolute;
  left: 0;
  top: .16em;
  width: 15px;
  height: 15px;
  background-color: var(--piece-blue);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.piece-line-address::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7Zm0 9.5A2.5 2.5 0 1 1 12 6a2.5 2.5 0 0 1 0 5.5Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7Zm0 9.5A2.5 2.5 0 1 1 12 6a2.5 2.5 0 0 1 0 5.5Z'/%3E%3C/svg%3E");
}

.piece-line-phone::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6.6 10.8a15.5 15.5 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.24c1.1.36 2.26.54 3.43.54A1.17 1.17 0 0 1 21 16.67v3.66A1.17 1.17 0 0 1 19.83 21C10.53 21 3 13.47 3 4.17A1.17 1.17 0 0 1 4.17 3h3.66A1.17 1.17 0 0 1 9 4.17c0 1.17.18 2.33.54 3.43a1 1 0 0 1-.24 1l-2.7 2.2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6.6 10.8a15.5 15.5 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.24c1.1.36 2.26.54 3.43.54A1.17 1.17 0 0 1 21 16.67v3.66A1.17 1.17 0 0 1 19.83 21C10.53 21 3 13.47 3 4.17A1.17 1.17 0 0 1 4.17 3h3.66A1.17 1.17 0 0 1 9 4.17c0 1.17.18 2.33.54 3.43a1 1 0 0 1-.24 1l-2.7 2.2Z'/%3E%3C/svg%3E");
}

.piece-page a:focus-visible {
  outline: 3px solid rgba(233, 153, 18, .35);
  outline-offset: 2px;
}

/* TABLET */
@media (max-width: 1024px) {
  .page-root.piece-page {
    padding-inline: 20px;
  }

  .piece-hero {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .piece-hero-art {
    width: min(100%, 300px);
  }

  .piece-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .piece-grid-logoterm {
    grid-template-columns: minmax(0, 1fr);
    max-width: 360px;
  }
}

/* MOBILE */
@media (max-width: 768px) {
  .page-root.piece-page {
    padding: 22px 14px 36px;
  }

  .piece-hero {
    display: block;
    margin-bottom: 16px;
  }

  .piece-title {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  .piece-title-accent {
    width: 44px;
    margin-top: 11px;
  }

  .piece-lead {
    margin-top: 18px;
    font-size: .95rem;
  }

  .piece-hero-art {
    width: min(72vw, 230px);
    margin: 12px auto 0;
  }

  .piece-info {
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 13px 12px;
  }

  .piece-info-icon {
    width: 38px;
    height: 38px;
  }

  .piece-info p {
    font-size: .86rem;
  }

  .piece-section {
    padding: 15px 12px;
  }

  .piece-section-head {
    gap: 9px;
    margin-bottom: 12px;
  }

  .piece-section-mark {
    height: 22px;
  }

  .piece-section-head h2 {
    font-size: 1.05rem;
  }

  .piece-grid,
  .piece-grid-logoterm {
    grid-template-columns: 1fr;
    max-width: none;
    gap: 12px;
  }

  .piece-card {
    padding: 15px 14px;
  }

  .piece-brand {
    margin: -15px -14px 12px;
    padding: 10px 14px;
  }

  .piece-brand h3 {
    font-size: 1.06rem;
  }

  .piece-contact {
    font-size: .94rem;
  }

  .piece-phone a {
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  .piece-page *,
  .piece-page *::before,
  .piece-page *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* WYDRUK */

/* Telefon: aktywny tylko na telefonach */
.piece-page a.responsive-contact.is-static {
  color: var(--piece-text);
  text-decoration: none;
  cursor: text;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 9mm;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #102f58 !important;
    font-family: "Segoe UI", Calibri, Arial, sans-serif !important;
    font-size: 9.4pt !important;
    line-height: 1.22 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .header,
  .main-nav,
  .menu,
  .menu-toggle,
  .footer,
  .wcag-trigger,
  .wcag-panel,
  .manage-cookies,
  .piece-hero-art,
  .piece-title-accent {
    display: none !important;
  }

  .page-root.piece-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #102f58 !important;
  }

  .piece-hero {
    display: block !important;
    margin: 0 0 3.5mm !important;
    padding: 0 0 3mm !important;
    border-bottom: 1px solid #0d3566 !important;
  }

  .piece-hero-copy {
    width: 100% !important;
  }

  .piece-title {
    margin: 0 !important;
    color: #0d3566 !important;
    font-size: 16pt !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
  }

  .piece-title br {
    display: none !important;
  }

  .piece-lead {
    max-width: none !important;
    margin: 1.8mm 0 0 !important;
    color: #445d7a !important;
    font-size: 8.7pt !important;
    line-height: 1.25 !important;
  }

  .piece-info {
    grid-template-columns: 16px minmax(0, 1fr) !important;
    gap: 6px !important;
    margin: 0 0 3.5mm !important;
    padding: 2.2mm 3mm !important;
    border: 1px solid #f0c66d !important;
    border-radius: 2mm !important;
    background: #f7fbff !important;
  }

  .piece-info-icon {
    width: 16px !important;
    height: 16px !important;
  }

  .piece-info p {
    margin: 0 !important;
    font-size: 8.3pt !important;
    line-height: 1.2 !important;
  }

  .piece-section {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .piece-section + .piece-section {
    margin-top: 2.5mm !important;
  }

  .piece-section-head {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 0 2mm !important;
    padding: 0 0 1mm !important;
    border-bottom: 1px solid #dfe7f0 !important;
  }

  .piece-section-mark {
    flex-basis: 3px !important;
    width: 3px !important;
    height: 14px !important;
  }

  .piece-section-head h2 {
    margin: 0 !important;
    color: #0d3566 !important;
    font-size: 10.5pt !important;
    line-height: 1.15 !important;
  }

  .piece-page .piece-grid {
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
    justify-content: flex-start !important;
    gap: 2.2mm 3mm !important;
    width: 100% !important;
    max-width: none !important;
  }

  .piece-page .piece-grid > .piece-card {
    display: block !important;
    flex: 0 0 calc(50% - 1.5mm) !important;
    width: calc(50% - 1.5mm) !important;
    max-width: calc(50% - 1.5mm) !important;
    min-width: 0 !important;
    height: auto !important;
    align-self: flex-start !important;
  }

  .piece-card {
    margin: 0 !important;
    padding: 2.2mm 2.7mm !important;
    border: 1px solid #ccd9ea !important;
    border-radius: 2mm !important;
    background: #fff !important;
    box-shadow: none !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .piece-brand {
    margin: -2.2mm -2.7mm 1.8mm !important;
    padding: 1.5mm 2.7mm !important;
    border-bottom: 1px solid #dfe7f0 !important;
    border-radius: 2mm 2mm 0 0 !important;
    background: #f7fbff !important;
  }

  .piece-brand span {
    margin-bottom: .4mm !important;
    color: #66798e !important;
    font-size: 6.7pt !important;
    line-height: 1 !important;
  }

  .piece-brand h3 {
    margin: 0 !important;
    color: #0d3566 !important;
    font-size: 10.2pt !important;
    line-height: 1.05 !important;
  }

  .piece-contact {
    font-size: 8.4pt !important;
    line-height: 1.18 !important;
  }

  .piece-contact strong {
    margin: 0 0 .8mm !important;
    color: #102f58 !important;
    font-size: 8.5pt !important;
    line-height: 1.18 !important;
  }

  .piece-contact p {
    margin: .5mm 0 0 !important;
    line-height: 1.18 !important;
  }

  .piece-contact-separated {
    margin-top: 1.5mm !important;
    padding-top: 1.4mm !important;
    border-top: 1px solid #e6edf5 !important;
  }

  .piece-line {
    padding-left: 15px !important;
  }

  .piece-line::before {
    top: .1em !important;
    width: 11px !important;
    height: 11px !important;
  }

  .piece-phone span {
    font-size: 8pt !important;
  }

  .piece-phone a {
    color: #0d3566 !important;
    font-weight: 700 !important;
    text-decoration: none !important;
  }

  .piece-page a[href]::after {
    content: none !important;
  }

  .piece-section-logoterm {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .piece-page *,
  .piece-page *::before,
  .piece-page *::after {
    animation: none !important;
    transition: none !important;
    text-shadow: none !important;
  }
}
