/*
 * profile styles.
 * Keep rule order intact: later rules refine earlier layouts and responsive states.
 */

.profile-heading {
  padding: 55px 0 45px;
}
.profile-heading > p {
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--body);
  margin: 0 0 18px;
}
.profile-heading h1 {
  font-size: clamp(38px, 4.3vw, 64px);
  line-height: 1.15;
  max-width: 1000px;
}
.profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: start;
}
.profile-sidebar figure {
  margin: 0 0 34px;
  background: #eee;
  aspect-ratio: 4/5;
}
.profile-sidebar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.profile-sidebar section {
  padding: 23px 0;
  border-top: 1px solid var(--line);
}
.profile-sidebar h2 {
  font-family: var(--font-heading);
  font-size: 23px;
  margin: 0 0 16px;
}
.profile-sidebar p,
.profile-sidebar a {
  font-size: 15px;
  line-height: 1.8;
  color: var(--body);
  overflow-wrap: anywhere;
}
.profile-sidebar p {
  margin: 0;
}
.profile-sidebar a {
  display: block;
  margin: 5px 0;
}
.profile-sidebar a:hover {
  text-decoration: underline;
}
.profile-content {
  padding-top: 0;
}
.profile-content h2 {
  font-family: var(--font-heading);
  font-size: 34px;
  line-height: 1.25;
  margin: 0 0 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.profile-content p {
  font-size: 17px;
  line-height: 1.9;
  margin: 0 0 25px;
  color: var(--body);
}
.profile-back {
  margin-top: 25px;
}
.profile-pagination {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid var(--line);
  padding: 28px 0 15px;
  margin-top: 60px;
}
.profile-pagination > a {
  max-width: 45%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-pagination > a:last-child {
  text-align: right;
}
.profile-pagination span {
  font-size: 12px;
  color: var(--body);
}
.profile-pagination strong {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 400;
}
.profile-pagination a:hover strong {
  text-decoration: underline;
}
@media (max-width: 800px) {
  .profile-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .profile-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
  }
  .profile-sidebar figure {
    grid-row: span 3;
    margin: 0;
    align-self: start;
  }
  .profile-sidebar section {
    padding: 18px 0;
  }
  .profile-heading {
    padding: 40px 0 30px;
  }
  .profile-content h2 {
    font-size: 30px;
  }
}
@media (max-width: 500px) {
  .profile-sidebar {
    display: block;
  }
  .profile-sidebar figure {
    margin-bottom: 25px;
  }
  .profile-content p {
    font-size: 16px;
  }
  .profile-heading > p {
    font-size: 15px;
  }
  .profile-pagination strong {
    font-size: 19px;
  }
}

/* Editorial biography composition inspired by the supplied QF story. */
.profile-editorial-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(35px, 5vw, 85px);
  align-items: stretch;
  margin: 45px 0 80px;
}
.profile-editorial-hero .profile-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 35px 0;
}
.profile-editorial-hero .profile-heading > p {
  order: 2;
  margin: 28px 0 0;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.07em;
}
.profile-editorial-hero h1 {
  font-size: clamp(44px, 5.5vw, 84px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 400;
  text-wrap: balance;
}
.profile-editorial-portrait {
  margin: 0;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: #e6e6e6;
}
.profile-editorial-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.profile-layout {
  grid-template-columns: minmax(220px, 300px) minmax(0, 760px);
  justify-content: space-between;
  gap: clamp(40px, 7vw, 110px);
}
.profile-content h2 {
  font-size: 28px;
  margin-bottom: 30px;
  padding-bottom: 20px;
}
.profile-content > p {
  font-size: 19px;
  line-height: 1.85;
  margin-bottom: 30px;
}
.profile-content > p:first-of-type {
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.65;
  color: var(--ink);
}
.profile-sidebar section:first-child {
  padding-top: 0;
  border-top: 0;
}
.profile-pagination {
  margin-top: 80px;
  padding-top: 30px;
}
@media (max-width: 800px) {
  .profile-editorial-hero {
    gap: 30px;
    margin: 35px 0 50px;
  }
  .profile-editorial-hero h1 {
    font-size: clamp(36px, 5.8vw, 52px);
  }
  .profile-editorial-hero .profile-heading > p {
    font-size: 13px;
    margin-top: 20px;
  }
  .profile-layout {
    grid-template-columns: 1fr;
  }
  .profile-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 25px;
  }
  .profile-sidebar section {
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }
  .profile-sidebar section:first-child {
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }
  .profile-content {
    grid-row: 1;
  }
  .profile-content > p {
    font-size: 17px;
  }
}
@media (max-width: 550px) {
  .profile-editorial-hero {
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 28px;
  }
  .profile-editorial-hero .profile-heading {
    padding: 0;
  }
  .profile-editorial-hero h1 {
    font-size: 44px;
  }
  .profile-editorial-portrait {
    aspect-ratio: 1;
  }
  .profile-sidebar {
    grid-template-columns: 1fr;
  }
  .profile-pagination {
    margin-top: 45px;
  }
}

/* Rounded editorial summary above each full biography. */
.profile-summary {
  border: 1px solid #d5d5d2;
  border-radius: 28px;
  background: #f1f0ed;
  padding: 38px 44px;
  margin: 0 0 65px;
  color: #444;
}
.profile-summary .profile-summary-label {
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.17em;
  color: #757572;
  margin: 0 0 25px;
}
.profile-summary .profile-summary-text {
  font-size: clamp(19px, 1.8vw, 25px);
  line-height: 1.7;
  margin: 0 0 25px;
  max-width: 1150px;
}
.profile-summary > a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #666;
}
.profile-summary > a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
#profile-details {
  scroll-margin-top: 35px;
}
body.dark .profile-summary {
  background: #292929;
  border-color: #555;
  color: #eee;
}
body.dark .profile-summary .profile-summary-label,
body.dark .profile-summary > a {
  color: #bbb;
}
@media (max-width: 650px) {
  .profile-summary {
    border-radius: 20px;
    padding: 26px;
    margin-bottom: 40px;
  }
  .profile-summary .profile-summary-label {
    font-size: 11px;
    margin-bottom: 18px;
  }
  .profile-summary .profile-summary-text {
    font-size: 18px;
    margin-bottom: 20px;
  }
}

/* Gentle, staggered biography entrance without shifting the page layout. */
@keyframes profile-enter {
  from {
    opacity: 0;
    translate: 0 18px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .profile-page > .about-breadcrumb {
    animation: profile-enter 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .profile-editorial-hero .profile-heading {
    animation: profile-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
  }
  .profile-editorial-portrait {
    animation: profile-enter 1s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
  }
  .profile-summary {
    animation: profile-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
  }
  .profile-layout {
    animation: profile-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.38s both;
  }
}

/* Smartphone biography layout. */
@media (max-width: 650px) {
  .profile-page {
    width: calc(100% - 36px);
  }
  .profile-page .about-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 11px;
    line-height: 1.6;
    padding-top: 20px;
    overflow-wrap: anywhere;
  }
  .profile-editorial-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 28px 0 30px;
  }
  .profile-editorial-hero .profile-heading {
    padding: 0;
    min-width: 0;
  }
  .profile-editorial-hero h1 {
    font-size: clamp(34px, 9vw, 48px);
    line-height: 1.12;
    letter-spacing: -0.025em;
    overflow-wrap: break-word;
  }
  .profile-editorial-hero .profile-heading > p {
    font-size: 12px;
    line-height: 1.6;
    letter-spacing: 0.08em;
    margin: 16px 0 0;
  }
  .profile-editorial-portrait {
    width: 100%;
    max-width: 440px;
    justify-self: center;
    aspect-ratio: 4/5;
  }
  .profile-summary {
    padding: 24px 22px;
    margin-bottom: 35px;
    border-radius: 20px;
  }
  .profile-summary .profile-summary-label {
    font-size: 10px;
    letter-spacing: 0.12em;
    line-height: 1.6;
    margin-bottom: 16px;
  }
  .profile-summary .profile-summary-text {
    font-size: 17px;
    line-height: 1.75;
    margin-bottom: 16px;
  }
  .profile-summary > a {
    font-size: 13px;
    min-height: 44px;
  }
  .profile-layout {
    display: flex;
    flex-direction: column;
    gap: 34px;
  }
  .profile-content {
    width: 100%;
    min-width: 0;
    order: 0;
  }
  .profile-content h2 {
    font-size: 27px;
    margin-bottom: 22px;
    padding-bottom: 16px;
  }
  .profile-content > p,
  .profile-content > p:first-of-type {
    font-size: 16px;
    line-height: 1.85;
    margin-bottom: 22px;
  }
  .profile-back {
    min-height: 44px;
    max-width: 100%;
    font-size: 14px;
  }
  .profile-sidebar {
    order: 1;
    width: 100%;
    display: block;
  }
  .profile-sidebar section,
  .profile-sidebar section:first-child {
    padding: 20px 0;
    border-top: 1px solid var(--line);
  }
  .profile-sidebar h2 {
    font-size: 22px;
    margin-bottom: 12px;
  }
  .profile-sidebar p,
  .profile-sidebar a {
    font-size: 14px;
    line-height: 1.8;
  }
  .profile-sidebar a {
    display: flex;
    align-items: center;
    min-height: 44px;
    overflow-wrap: anywhere;
  }
  .profile-pagination {
    margin-top: 35px;
    padding-top: 22px;
    gap: 20px;
  }
  .profile-pagination > a {
    min-width: 0;
    max-width: 48%;
    min-height: 70px;
    gap: 8px;
  }
  .profile-pagination span {
    font-size: 11px;
  }
  .profile-pagination strong {
    font-size: 18px;
    line-height: 1.4;
    overflow-wrap: break-word;
  }
}
@media (max-width: 360px) {
  .profile-page {
    width: calc(100% - 28px);
  }
  .profile-summary {
    padding: 22px 18px;
  }
  .profile-editorial-hero h1 {
    font-size: 33px;
  }
}

/* More prominent biography contact details. */
.profile-sidebar a[href^="mailto:"],
.profile-sidebar a[href^="tel:"] {
  font-size: 20px;
  line-height: 1.6;
  min-height: 44px;
  overflow-wrap: anywhere;
}
@media (max-width: 650px) {
  .profile-sidebar a[href^="mailto:"],
  .profile-sidebar a[href^="tel:"] {
    font-size: 19px;
  }
}

/* Practice-area tags. */
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.profile-tags li {
  display: block;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--tint);
  color: var(--body);
  font-size: 13px;
  line-height: 1.4;
}

/* Compact spacing between biography contact links. */
.profile-sidebar a[href^="mailto:"],
.profile-sidebar a[href^="tel:"] {
  margin: 0;
  min-height: 34px;
  line-height: 1.45;
}
.profile-sidebar a[href^="tel:"] + a[href^="mailto:"] {
  margin-top: 4px;
}

/* Regular team biography phone numbers. */
.profile-sidebar a[href^="tel:"] {
  font-weight: 400;
}
