/* ==========================================================================
   PODSTRONA: FAQ - NAJCZĘŚCIEJ ZADAWANE PYTANIA (A&K WAWRO)
   Zgodność 1:1 z Design System: design_system_typography_rules.md
   ========================================================================== */

/* Kontener główny podstrony */
.ak-subpage-container {
  width: 100%;
  max-width: 1150px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Okruszki chleba (Breadcrumbs) */
.ak-breadcrumbs {
  font-family: 'Inter', 'Inter Fallback', sans-serif;
  font-size: 13.5px;
  color: var(--ak-text-gray);
  margin-bottom: 24px;
  text-align: left;
}

.ak-breadcrumbs a {
  color: var(--ak-teal-ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.ak-breadcrumbs a:hover {
  text-decoration: underline;
}

.ak-breadcrumbs span {
  margin: 0 6px;
  opacity: 0.6;
}

/* Sekcja Wprowadzająca (Hero & Intro) */
.ak-faq-hero-section {
  padding: 40px 0 25px;
  background-color: var(--ak-bg-white, var(--ak-bg-white));
}

.ak-subpage-h1 {
  font-family: 'Outfit', 'Outfit Fallback', sans-serif;
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 700;
  color: var(--ak-text-dark);
  text-align: left;
  text-wrap: normal;
  -webkit-text-wrap: normal;
  line-height: 1.25;
  margin: 0 0 20px 0;
  width: 100%;
  max-width: 100%;
}

.ak-subpage-h1 .ak-teal-highlight {
  color: var(--ak-teal-ink);
}

.ak-subpage-h2 {
  font-family: 'Outfit', 'Outfit Fallback', sans-serif;
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 700;
  color: var(--ak-navy-dark);
  text-align: left;
  text-wrap: normal;
  -webkit-text-wrap: normal;
  line-height: 1.35;
  margin: 28px 0 14px 0;
  width: 100%;
  max-width: 100%;
}

.ak-subpage-intro-p {
  font-family: 'Inter', 'Inter Fallback', sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.65;
  color: var(--ak-text-gray);
  margin: 0 0 20px 0;
  width: 90%;
  max-width: 90%;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .ak-subpage-intro-p {
    margin-left: 20px;
  }
}

/* Sekcja Akordeonu FAQ */
.ak-faq-main-section {
  padding: 20px 0 60px;
  background-color: var(--ak-bg-white, var(--ak-bg-white));
}

.ak-faq-category {
  margin-bottom: 35px;
}

.ak-faq-category-title {
  font-family: 'Outfit', 'Outfit Fallback', sans-serif;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 700;
  color: var(--ak-navy-dark);
  margin: 0 0 18px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(31, 95, 104, 0.2);
}

/* Sekcja FAQ na stronie głównej (index.html) */
.ak-faq-section {
  padding: 65px 0 75px;
  background-color: var(--ak-bg-light);
  border-top: 1px solid rgba(86, 168, 168, 0.15);
  border-bottom: 1px solid rgba(86, 168, 168, 0.15);
}

#ak-wawro-faq-container {
  width: 100%;
  max-width: 1150px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

#ak-wawro-faq-container h2,
.ak-faq-header h2 {
  font-family: 'Outfit', 'Outfit Fallback', sans-serif;
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 700;
  color: var(--ak-navy-dark);
  text-align: left;
  line-height: 1.3;
  margin: 0 0 28px 0;
  width: 100%;
  max-width: 100%;
  text-wrap: normal;
  -webkit-text-wrap: normal;
}

.ak-faq-header {
  margin-bottom: 0;
}

.ak-faq-accordion {
  width: 100%;
  box-sizing: border-box;
}

/* Kafelki FAQ (Karty Bento / Card Accordion - identyczne z ubezpieczenia-nieruchomosci-wroclaw.html) */
.ak-faq-item,
.faq-item {
  border-bottom: 1px solid rgba(86, 168, 168, 0.2);
  margin-bottom: 12px;
  background: var(--ak-bg-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(28, 59, 74, 0.04);
  border: 1px solid rgba(86, 168, 168, 0.18);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  box-sizing: border-box;
}

.ak-faq-item:hover,
.faq-item:hover {
  border-color: rgba(31, 95, 104, 0.35);
  box-shadow: 0 6px 18px rgba(28, 59, 74, 0.08);
}

.ak-faq-item.active,
.faq-item.active {
  border-color: rgba(31, 95, 104, 0.45);
  box-shadow: 0 6px 20px rgba(31, 95, 104, 0.1);
}

.ak-faq-question,
.faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 22px 26px;
  font-size: 18.5px;
  font-weight: 600;
  color: var(--ak-navy-dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.3s ease, background-color 0.3s ease;
  font-family: 'Outfit', 'Outfit Fallback', sans-serif;
  box-sizing: border-box;
  line-height: 1.35;
  appearance: none;
  outline: none;
}

.ak-faq-question:hover,
.faq-question:hover {
  color: var(--ak-teal-ink);
}

.ak-faq-item.active .ak-faq-question,
.faq-item.active .faq-question {
  color: var(--ak-teal-ink);
  font-weight: 700;
}

.ak-faq-icon,
.faq-icon {
  font-size: 26px;
  font-weight: 400;
  color: var(--ak-teal-ink);
  transition: transform 0.4s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 16px;
  line-height: 1;
  display: inline-block;
}

.ak-faq-item.active .ak-faq-icon,
.faq-item.active .faq-icon {
  transform: rotate(45deg);
  color: var(--ak-navy-dark);
}

.ak-faq-answer,
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Fokus z klawiatury (outline:none w przycisku ukrywał go całkowicie) */
.ak-faq-question:focus-visible,
.faq-question:focus-visible {
  outline: 3px solid var(--ak-navy-dark);
  outline-offset: -3px;
  border-radius: 12px;
}

/* Podstrony (2026-10-01, etap B): zwinięta odpowiedź wypada z kolejności Tab i z czytników ekranu.
   Widoczność wraca od razu przy rozwinięciu, a znika dopiero po animacji zwijania (0,4 s). */
.ak-faq-item:not(.active) .ak-faq-answer {
  visibility: hidden;
  transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0s linear 0.4s;
}

@media (prefers-reduced-motion: reduce) {
  .ak-faq-answer,
  .ak-faq-item:not(.active) .ak-faq-answer {
    transition: none;
  }
}

/* Strona główna (2026-10-01): rozwijanie przez grid-template-rows 0fr → 1fr zamiast max-height.
   Wysokość liczy przeglądarka, bez skryptu i bez animowania właściwości układu w pętli.
   Zwinięta odpowiedź wypada z kolejności Tab i z czytników ekranu; zwijanie jest szybsze niż rozwijanie. */
#ak-wawro-faq-container .faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  max-height: none;
  overflow: hidden;
  visibility: hidden;
  transition: grid-template-rows 0.25s cubic-bezier(0.4, 0, 1, 1), visibility 0s linear 0.25s;
}

#ak-wawro-faq-container .faq-item.active .faq-answer {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s;
}

#ak-wawro-faq-container .faq-answer-inner {
  min-height: 0;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  #ak-wawro-faq-container .faq-answer,
  #ak-wawro-faq-container .faq-item.active .faq-answer {
    transition: none;
  }
  .ak-faq-icon,
  .faq-icon {
    transition: color 0.3s ease;
  }
}

.ak-faq-answer p,
.faq-answer p {
  padding: 0 26px 24px;
  font-family: 'Inter', 'Inter Fallback', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.65;
  color: #52525b;
  margin: 0;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.ak-faq-answer p strong,
.faq-answer p strong {
  font-weight: 700;
  color: var(--ak-navy-dark);
}

/* Sekcja CTA z przyciskami */
.ak-cta-wrapper-section {
  padding: 50px 0 65px;
  background-color: var(--ak-bg-white, var(--ak-bg-white));
  border-top: 1px solid rgba(86, 168, 168, 0.15);
}

.ak-cta-wrapper-section h2 {
  font-family: 'Outfit', 'Outfit Fallback', sans-serif;
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 700;
  color: var(--ak-navy-dark);
  text-align: left;
  width: 100%;
  max-width: 100%;
  margin: 0 0 28px 0;
  text-wrap: normal;
  -webkit-text-wrap: normal;
  line-height: 1.3;
}

.wawro-wrapper-x9 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin: 0 auto;
}

.wawro-btn-x9 {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 420px;
  background: var(--ak-teal-action-gradient);
  color: var(--ak-text-inverse) !important;
  text-decoration: none;
  padding: 13px 22px 13px 15px;
  border-radius: 50px;
  box-shadow: 0 8px 20px -6px rgba(31, 95, 104, 0.45);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
  cursor: pointer;
  text-align: left;
}

.wawro-btn-x9::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-200%) skewX(-25deg);
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.wawro-btn-x9:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 28px -6px rgba(31, 95, 104, 0.55);
  color: var(--ak-text-inverse) !important;
}

.wawro-btn-x9:hover::before {
  transform: translateX(400%) skewX(-25deg);
}

.wawro-icon-x9 {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  margin-right: 18px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.wawro-icon-x9 svg {
  width: 22px;
  height: 22px;
  fill: var(--ak-text-inverse);
}

.wawro-text-x9,
.wawro-content-x9 {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.wawro-title-x9 {
  font-family: 'Outfit', 'Outfit Fallback', sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ak-text-inverse);
}

.wawro-sub-x9 {
  font-family: 'Inter', 'Inter Fallback', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0.95;
  color: var(--ak-text-inverse);
  margin-top: 2px;
}

/* Responsywność dla Mobile */
@media (max-width: 768px) {
  .ak-subpage-h1,
  .ak-subpage-h2,
  .ak-faq-category-title,
  .ak-cta-wrapper-section h2,
  .ak-faq-header h2,
  #ak-wawro-faq-container h2 {
    text-align: center !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .ak-subpage-intro-p {
    text-align: center;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .faq-question,
  .ak-faq-question {
    font-size: 15.5px;
    padding: 16px 42px 16px 20px;
    text-align: center !important;
    justify-content: center !important;
    position: relative;
    width: 100%;
  }

  .faq-icon,
  .ak-faq-icon {
    font-size: 22px;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
  }

  .faq-item.active .faq-icon,
  .ak-faq-item.active .ak-faq-icon {
    transform: translateY(-50%) rotate(45deg);
  }

  .faq-answer p,
  .ak-faq-answer p {
    font-size: 15px;
    padding: 0 16px 18px;
    text-align: center !important;
  }
}
