/* =========================================================
   PS Accordion Kontakt (BOX GRID refined + modal popup)
   - max 3 kolumny
   - mniej toporne: mniejszy font, chudszy, więcej oddechu
   - ikonka kontaktu w kaflu (CSS)
   - ramka subtelniejsza, radius o połowę
   - hover: animowany gradient na ramce + szybki połysk (shine)
   ========================================================= */

.ps-acc{
  --ps-acc-text: #171718;
  --ps-acc-muted: rgba(0,0,0,.60);
  --ps-acc-accent: var(--polsteam-primary, #00357d);

  --ps-acc-bg: #ffffff;
  --ps-acc-border: rgba(0,0,0,.14);

  --ps-acc-radius: 6px;            /* było 12 -> połowa */
  --ps-acc-speed: 260ms;
  --ps-acc-ease: cubic-bezier(.2,.9,.2,1);

  --ps-acc-hover-shadow: 0 18px 28px -24px rgba(0,0,0,.40);

  color: var(--ps-acc-text);
}

.ps-acc *{ box-sizing: border-box; }

/* =========================================================
   LISTING: GRID BOXES (MAX 3)
   ========================================================= */

.ps-acc{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

@media (max-width: 980px){
  .ps-acc{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 520px){
  .ps-acc{ grid-template-columns: 1fr; }
}

.ps-acc__item{
  margin: 0;
  background: transparent;
  border: 0;
}

/* KAFEL jako button (gradient border trick) */
.ps-acc__btn{
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 110px;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;

  /* ramka “większa” = więcej oddechu w środku */
  padding: 18px 56px 18px 56px;

  border-radius: var(--ps-acc-radius);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--ps-acc-bg), var(--ps-acc-bg)) padding-box,
    linear-gradient(90deg, rgba(0,0,0,.10), rgba(0,0,0,.16), rgba(0,0,0,.10)) border-box;

  cursor: pointer;
  text-align: left;

  font-family: inherit;
  color: var(--ps-acc-text);

  position: relative;
  overflow: hidden;

  transition:
    transform var(--ps-acc-speed) var(--ps-acc-ease),
    box-shadow var(--ps-acc-speed) var(--ps-acc-ease),
    color var(--ps-acc-speed) var(--ps-acc-ease),
    background var(--ps-acc-speed) var(--ps-acc-ease);
}

/* Ikonka kontaktu (grupa użytkowników) */
.ps-acc__btn::before{
  content: "500";
  position: absolute;
  top: 16px;
  left: 16px;

  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 26px;
  line-height: 1;

  color: var(--ps-acc-accent);
  opacity: .95;

  width: auto;
  height: auto;
}


/* Jeśli w HTML pojawi się FontAwesome (np. <i class="fa-solid fa-user-group">),
   to po prostu ustawiamy mu pozycję i kolor (bez psucia layoutu). */
.ps-acc__btn > i.fa-solid.fa-user-group{
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 26px;
  line-height: 1;
  color: var(--ps-acc-accent);
  opacity: .95;
}

/* połysk (shine) – pojawia się na hover, raz przeleci */
.ps-acc__btn::after{
  content: "";
  position: absolute;
  inset: -30% -60%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.55) 45%, transparent 60%);
  transform: translateX(-35%);
  opacity: 0;
  pointer-events: none;
}

/* tytuł: chudszy i mniejszy, i “niżej” */
.ps-acc__title{
  font-family: "Teko", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 500;        /* chudszy */
  letter-spacing: .25px;
  font-size: 22px;         /* mniejszy */
  line-height: 1.05;
  margin: 0;

  /* żeby tekst był niżej: podbijamy top padding poprzez przestrzeń */
  padding-top: 28px;       /* robi miejsce na ikonę */
  color: inherit;
  max-width: 100%;
}

/* chevron (strzałka) jak na kafelkach */
.ps-acc__chev{
  display:block;
  position:absolute;
  right:18px;
  top:50%;
  transform: translateY(-50%);
  width:20px;
  height:20px;
  opacity: .9;
  background: rgba(0,0,0,.35);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Hover: border gradient przechodzi + cień od dołu + delikatny lift */
.ps-acc__btn:hover{
  box-shadow: var(--ps-acc-hover-shadow);
  transform: translateY(-3px);

  background:
    linear-gradient(var(--ps-acc-bg), var(--ps-acc-bg)) padding-box,
    linear-gradient(90deg, rgba(0,53,125,.20), rgba(0,53,125,.75), rgba(0,53,125,.20)) border-box;
}

/* połysk na hover (szybko, raz) */
.ps-acc__btn:hover::after{
  opacity: 1;
  animation: psAccShine 520ms var(--ps-acc-ease) 1;
}

@keyframes psAccShine{
  0%   { transform: translateX(-35%); opacity: 0; }
  15%  { opacity: .75; }
  100% { transform: translateX(35%); opacity: 0; }
}

/* Active */
.ps-acc__btn:active{
  transform: translateY(-1px);
}

/* Focus WCAG */
.ps-acc__btn:focus{ outline: none; }
.ps-acc__btn:focus-visible{
  outline: 3px solid rgba(57,169,255,.35);
  outline-offset: 3px;
}

/* expanded na listingu: delikatnie “aktywny” (bez toporności) */
.ps-acc__btn[aria-expanded="true"]{
  background:
    linear-gradient(var(--ps-acc-bg), var(--ps-acc-bg)) padding-box,
    linear-gradient(90deg, rgba(0,53,125,.25), rgba(0,53,125,.85), rgba(0,53,125,.25)) border-box;
}

/* ikonka na hover/active może być ciut mocniejsza */
.ps-acc__btn:hover::before,
.ps-acc__btn[aria-expanded="true"]::before{
  opacity: 1;
}

/* panel inline nieużywany (trzyma treść do modala) */
.ps-acc__panel{ display: none; }

/* =========================================================
   MODAL (popup) + blur
   ========================================================= */

html.ps-acc-modal-open,
body.ps-acc-modal-open{
  overflow: hidden !important;
}

.ps-acc-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: flex-start;
  justify-content: center;

  padding: 72px 24px 24px;

  background: rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ps-acc-ease);
}

.ps-acc-modal.is-open{
  opacity: 1;
  pointer-events: auto;
}

/* 2/3 szerokości ekranu */
.ps-acc-modal__dialog{
  width: min(66vw, 980px);
  max-width: 980px;
  background: #fff;

  border: 0;
  border-radius: 12px;
  overflow: hidden;

  transform: translateY(6px) scale(.985);
  opacity: 0;
  transition: transform 260ms var(--ps-acc-ease),
              opacity 260ms var(--ps-acc-ease);
}

.ps-acc-modal.is-open .ps-acc-modal__dialog{
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Sticky header w modalu (LIGHT) */
.ps-acc-modal__head{
  position: sticky;
  top: 0;
  z-index: 2;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 16px 16px;

  background: #fff !important;
  color: var(--ps-acc-text) !important;

  border: 0;
  border-bottom: 1px solid rgba(0,0,0,.10);

  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.ps-acc-modal__head:focus{ outline: none; }
.ps-acc-modal__head:focus-visible{
  outline: 3px solid rgba(57,169,255,.35);
  outline-offset: 2px;
}

.ps-acc-modal__title{
  font-family: "Teko", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: .25px;
  font-size: 26px;
  line-height: 1.0;
  margin: 0;

  color: var(--ps-acc-text) !important;
}

/* X button – ciemny na białym */
.ps-acc-modal__xbtn{
  width: 42px;
  height: 42px;
  border-radius: 999px;

  border: 1px solid rgba(0,0,0,.16) !important;
  background: rgba(0,0,0,.03) !important;

  display: grid;
  place-items: center;

  cursor: pointer;
  flex: 0 0 42px;

  padding: 0;
  line-height: 1;
}

.ps-acc-modal__xbtn:hover{
  background: rgba(0,0,0,.06) !important;
}

.ps-acc-modal__xbtn:focus{ outline: none; }
.ps-acc-modal__xbtn:focus-visible{
  outline: 3px solid rgba(57,169,255,.35);
  outline-offset: 2px;
}

.ps-acc-modal__xicon{
  font-size: 26px;
  transform: translateY(-1px);
  color: var(--ps-acc-text) !important;
}

/* cienka niebieska kreska pod headerem */
.ps-acc-modal__head::after{
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 2px;
  background: var(--ps-acc-accent);
  opacity: .9;
}

/* Body modalu */
.ps-acc-modal__body{
  padding: 18px 18px 20px;
  max-height: calc(100vh - 72px - 24px - 24px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  color: var(--ps-acc-text);
}

.ps-acc-modal__body p{ margin: 0 0 10px; }
.ps-acc-modal__body p:last-child{ margin-bottom: 0; }

.ps-acc-modal__body a{
  color: var(--ps-acc-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.ps-acc-modal__body a:hover{ text-decoration-thickness: 2px; }

/* Mobile: full width/height */
@media (max-width: 980px){
  .ps-acc-modal{
    padding: 0;
    align-items: stretch;
  }
  .ps-acc-modal__dialog{
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  .ps-acc-modal__body{
    max-height: calc(100vh - 72px);
    padding: 16px 16px 18px;
  }
  .ps-acc__title{ font-size: 21px; }
  .ps-acc-modal__title{ font-size: 24px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .ps-acc__btn,
  .ps-acc-modal,
  .ps-acc-modal__dialog{
    transition: none !important;
  }
  .ps-acc__btn:hover{
    box-shadow: none !important;
    transform: none !important;
  }
  .ps-acc__btn:hover::after{
    animation: none !important;
    opacity: 0 !important;
  }
}


/* ==================================
   PS ACC – ikona w kafelkach (pewne SVG, bez zależności od FA-font)
   ================================== */

/* zostawiamy miejsce na ikonę */
.ps-acc__btn{
  position: relative;
  padding-left: 58px !important;
}

/* ikona "user-group" jak na screenie */
.ps-acc__btn::before{
  content:"";
  position:absolute;
  left:18px;
  top:50%;
  transform:translateY(-50%);
  width:24px;
  height:24px;
  background-repeat:no-repeat;
  background-size:contain;
  background-position:center;

  /* prosta, czytelna ikona grupy (kolor Polsteam) */
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2300357d' d='M16 11c1.66 0 3-1.34 3-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3Zm-8 0c1.66 0 3-1.34 3-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3Zm0 2c-2.33 0-7 1.17-7 3.5V20h14v-3.5C15 14.17 10.33 13 8 13Zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.92 1.97 3.45V20h7v-3.5c0-2.33-4.67-3.5-7-3.5Z'/%3E%3C/svg%3E");
}

/* żeby tytuł nie wpadał pod ikonę */
.ps-acc__title{
  display:block;
}
