/* ==========================================================================
   OSSA — team list and agent profile pages (measured against the original)
   ========================================================================== */

/* ---------- Team page ---------- */
.team-page {
  padding: 160px 50px 120px;
  display: flex; flex-direction: column; align-items: center;
}
.tp-badge {
  font-family: var(--f-ui); font-size: 12px; line-height: 14px;
  text-transform: uppercase; color: var(--c-orange); font-weight: 400;
  background: rgba(0, 0, 0, 0.05); border-radius: 50px; padding: 6px 10px;
}
.tp-title {
  margin-top: 10px;
  font-family: var(--f-display); font-weight: 400; font-size: 54px; line-height: 1.2;
  color: var(--c-dark); text-align: center;
}
.agents-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 311px);
  justify-content: center;
  column-gap: 140px; row-gap: 47px;
  width: 100%;
}
.agent-tile { display: flex; flex-direction: column; align-items: center; text-align: center; }
/* the original grid keeps a fixed row pitch; an extra licence line just overflows */
@media (min-width: 1440px) { .agent-tile { height: 577px; } }
.agent-tile .at-photo { width: 311px; height: 481px; display: block; flex: none; }
.agent-tile .at-photo img {
  width: 100%; height: 100%; object-fit: contain; object-position: bottom center;
  transition: transform 0.6s cubic-bezier(0.44, 0, 0.56, 1);
}
.agent-tile:hover .at-photo img { transform: scale(1.03); }
/* the original lightens the portrait slightly on hover */
.agent-tile .at-photo { position: relative; }
.agent-tile .at-photo::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(255, 255, 255, 0.18);
  opacity: 0; transition: opacity 0.3s ease;
  pointer-events: none;
}
.agent-tile:hover .at-photo::after { opacity: 1; }
.agent-tile .at-name {
  order: 2; margin-top: 10px;
  font-family: var(--f-display); font-weight: 400; font-size: 22px; line-height: 1.2; color: var(--c-dark);
}
.agent-tile .at-role {
  order: 3; margin-top: 4px;
  font-family: var(--f-display); font-size: 16px; line-height: 1.3; color: rgba(0, 0, 0, 0.6);
}
.agent-tile .at-role--extra { order: 3; margin-top: 5px; }
.agent-tile .at-links {
  order: 4; width: 100%; margin-top: 17px; padding: 0 36px 0 45px;
  display: flex; justify-content: space-between;
  font-family: var(--f-ui); font-size: 15px; line-height: 18px; text-transform: uppercase;
}
.agent-tile .at-links a { color: rgba(82, 82, 82, 0.7); transition: color 0.2s ease; }
.agent-tile .at-links a i { font-style: normal; margin-left: 4px; }
.agent-tile .at-links a:hover { color: var(--c-orange); }

/* 1200–1439: the original switches to two wide columns, 34px names, no role */
@media (max-width: 1439px) and (min-width: 1200px) {
  .team-page { padding-top: 143px; }
  .tp-title { font-size: 46px; }
  .agents-grid { grid-template-columns: repeat(2, 311px); column-gap: 365px; row-gap: 48px; margin-top: 21px; }
  .agent-tile .at-name { font-size: 34px; line-height: 1; }
  .agent-tile .at-role { display: none; }
  .agent-tile { height: 588px; }
  .agent-tile .at-links { margin-top: 45px; }
}
@media (max-width: 1199px) and (min-width: 810px) {
  .team-page { padding-top: 140px; }
  .tp-title { font-size: 46px; }
  .agents-grid { grid-template-columns: repeat(2, 311px); column-gap: 80px; }
}
/* mobile original: no badge, 23px title at y140, rounded portraits, a 295px rule
   under each tile and 47px to the next one */
@media (max-width: 809px) {
  .team-page { padding: 140px 20px 80px; }
  .tp-badge { display: none; }
  .tp-title { margin-top: 0; font-size: 23px; line-height: 32.2px; }
  .agents-grid { grid-template-columns: minmax(0, 311px); row-gap: 47px; margin-top: 20px; }
  .agent-tile .at-photo { width: 100%; height: auto; aspect-ratio: 311 / 481; border-radius: 8px; overflow: hidden; }
  .agent-tile .at-name { margin-top: 10px; font-size: 22px; line-height: 28.6px; }
  .agent-tile .at-role { margin-top: 10px; font-size: 16px; line-height: 25.6px; }
  .agent-tile .at-role--extra { margin-top: 0; }
  .agent-tile .at-links { margin-top: 9px; padding: 0 36px; }
  .agent-tile::after { content: ""; order: 5; width: 295px; max-width: 100%; height: 1px; margin-top: 12px; background: rgba(82, 82, 82, 0.45); }
}

/* ---------- Agent profile ---------- */
.agent-profile { padding: 123px 0 80px; }
.ap-top {
  /* the original stays fluid on wide screens: 50px gutters, a 10px gap and a text
     column exactly 100px wider than the photo column */
  display: grid;
  grid-template-columns: calc(50% + 45px) minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  padding: 0 50px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.ap-top .ap-info { padding: 0 50px; }
.ap-top .ap-photo { justify-self: stretch; }
.ap-photo { height: 711px; }
.ap-photo img { width: 100%; height: 100%; object-fit: contain; object-position: bottom center; }
.ap-info { display: flex; flex-direction: column; align-items: flex-start; }
.ap-role { font-family: var(--f-display); font-size: 20px; line-height: 1.3; color: rgba(0, 0, 0, 0.8); }
.ap-name {
  max-width: 600px;
  margin-top: 6px;
  font-family: var(--f-display); font-weight: 400; font-size: 54px; line-height: 1.1;
  text-transform: capitalize; color: #000;
}
.ap-license { margin-top: 6px; font-family: var(--f-ui); font-size: 18px; line-height: 1.4; color: rgba(0, 0, 0, 0.5); }
.ap-license:first-of-type { margin-top: 14px; }
.ap-social { display: flex; gap: 6px; margin-top: 36px; margin-left: -8px; }
.ap-social a {
  width: 50px; height: 40px; display: grid; place-items: center;
  color: rgba(82, 82, 82, 0.7); transition: color 0.2s ease;
}
.ap-social a:hover { color: var(--c-orange); }
.ap-social svg { width: 30px; height: 30px; }
.ap-contact { display: flex; flex-direction: column; gap: 6px; margin-top: 36px; }
.ap-contact a {
  font-family: var(--f-ui); font-size: 14px; line-height: 18px; text-transform: uppercase;
  color: rgba(82, 82, 82, 0.7); transition: color 0.2s ease;
}
.ap-contact a:hover { color: var(--c-orange); }

.ap-tabs {
  display: flex; justify-content: center; gap: 30px;
  margin-top: 56px;
  font-family: var(--f-ui); font-size: 15px; line-height: 18px; text-transform: uppercase;
}
.ap-tabs a { color: rgba(82, 82, 82, 0.7); transition: color 0.2s ease; }
.ap-tabs a:hover, .ap-tabs a.active { color: var(--c-dark); }

.ap-bio {
  margin: 58px 50px 0;
  background: rgba(203, 196, 188, 0.2);
  padding: 40px 50px;
  display: flex; flex-direction: column; gap: 16px;
}
.ap-bio h5 {
  margin-top: 18px;
  font-family: var(--f-display); font-weight: 400; font-size: 22px; line-height: 1.3; color: var(--c-dark);
}
.ap-bio h5:first-child { margin-top: 0; font-size: 32px; line-height: 38.4px; }
.ap-bio p {
  font-family: var(--f-copy); font-size: 16px; line-height: 1.55;
  color: rgba(0, 0, 0, 0.5); white-space: pre-line;
}
.ap-bio p strong { font-weight: 700; color: rgba(0, 0, 0, 0.5); }

/* tab content under the bio box */
.ap-panel { margin: 60px 50px 0; padding-top: 50px; border-top: 1px solid rgba(0, 0, 0, 0.1); }
.ap-panel-title {
  margin-bottom: 30px;
  font-family: var(--f-display); font-weight: 400; font-size: 32px; color: var(--c-dark);
}
.ap-certs { margin: 60px 50px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--grid-gap); }
.ap-certs[hidden] { display: none; }
.ap-certs img { width: 100%; height: auto; }
.ap-cert-img { display: block; }
/* credential cards: beige like the bio box, badge icon, title + detail */
.ap-cred {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 24px 22px;
  background: rgba(203, 196, 188, 0.2);
  border-top: 2px solid var(--c-orange);
}
.ap-cred-ic { flex: none; width: 36px; height: 36px; color: var(--c-orange); }
.ap-cred-ic svg { width: 100%; height: 100%; }
.ap-cred-t { font-family: var(--f-display); font-size: 19px; line-height: 1.3; color: var(--c-dark); }
.ap-cred-d { margin-top: 6px; font-family: var(--f-ui); font-size: 13px; line-height: 1.4; color: var(--c-text-70); }
.ap-certs-empty { grid-column: 1 / -1; color: var(--c-text-70); }
/* tab pages (Nieruchomości / Certyfikaty / Opinie): the tab's content comes straight
   under the tabs and the long bio follows it, instead of the other way round */
.agent-profile:has(.ap-tabs a.active) { display: flex; flex-direction: column; }
.agent-profile:has(.ap-tabs a.active) > :not(.ap-top):not(.ap-tabs):not(.ap-bio) { order: 2; }
.agent-profile:has(.ap-tabs a.active) > .ap-bio { order: 3; }
.ap-testimonials { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--grid-gap); }
.ap-testimonials > .t-copy { grid-column: 1 / -1; color: var(--c-text-70); }
.testimonial {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  padding: 26px;
  display: flex; flex-direction: column; gap: 14px;
}
.testimonial .tq { font-family: var(--f-copy); font-size: 15px; line-height: 1.5; color: var(--c-text); }
.testimonial .ta { font-family: var(--f-ui); font-size: 12px; color: var(--c-text-70); }

/* 1200–1439: the original collapses the header into a short banner — 546x285
   photo crop, no role line or social icons, bio box inset 40px */
@media (max-width: 1439px) and (min-width: 1200px) {
  .agent-profile { padding-top: 113px; }
  .ap-top { grid-template-columns: minmax(0, 1fr) 546px; align-items: start; padding: 0 43px 0 90px; }
  .ap-top .ap-info { padding: 0; }
  .ap-photo { height: 285px; }
  .ap-photo img { object-fit: cover; object-position: top center; }
  .ap-info { padding-top: 32px; }
  .ap-role, .ap-social { display: none; }
  .ap-name { margin-top: 0; }
  .ap-contact { margin-top: 28px; }
  .ap-tabs { margin-top: 53px; }
  .ap-bio { margin: 59px 40px 0; }
  .ap-bio h5 { font-size: 34px; line-height: 1; }
  .ap-bio h5:first-child { font-size: 27px; }
}
@media (max-width: 1199px) and (min-width: 810px) {
  .agent-profile { padding-top: 110px; }
  .ap-top { grid-template-columns: minmax(0, 1fr) 400px; padding: 0 40px 0 50px; }
  .ap-photo { height: 480px; }
  .ap-name { font-size: 42px; }
  .ap-license { font-size: 16px; }
  .ap-testimonials { grid-template-columns: repeat(2, 1fr); }
}
/* mobile (original at 375): photo first 316x400, text block inset 50px,
   no social icons, tabs stacked and centred, bio box inset 20px */
@media (max-width: 809px) {
  .agent-profile { padding: 140px 0 60px; }
  .ap-top { display: flex; flex-direction: column; align-items: stretch; padding: 0 0 50px; }
  .ap-bio { margin-left: 20px; margin-right: 20px; }
  .ap-photo { order: -1; height: 400px; margin: 0 20px; }
  .ap-top .ap-info { padding: 0 50px; margin-top: 40px; }
  .ap-name { font-size: 30px; margin-top: 4px; }
  .ap-license { font-size: 12px; }
  .ap-license:first-of-type { margin-top: 0; }
  .ap-social { display: none; }
  .ap-contact { margin-top: 24px; }
  .ap-tabs { flex-direction: column; align-items: center; gap: 8px; margin-top: 22px; }
  .ap-bio { margin: 46px 20px 0; padding: 30px 22px; gap: 14px; }
  .ap-bio h5 { margin-top: 14px; }
  .ap-bio p { font-size: 15px; line-height: 1.55; }
  .ap-bio h5 { font-size: 22px; }
  .ap-bio h5:first-child { font-size: 26px; }
  .ap-panel, .ap-certs { margin-left: 20px; margin-right: 20px; }
  .ap-certs, .ap-testimonials { grid-template-columns: 1fr; }
}
