.pa-profile {
  --pa-pale: #eee;
  padding-bottom: 74px;
  color: var(--ink, #151515);
}

.pa-profile a {
  text-underline-offset: .19em;
}

.pa-topbar, .pa-hero, .pa-metrics, .pa-section, .pa-section-nav {
  width: min(100%, 1160px);
  margin-inline: auto;
}

.pa-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-block: 26px 19px;
}

.pa-return, .pa-map-link a {
  font-weight: 650;
}

.pa-return::before {
  display: inline-block;
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-left: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.pa-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  position: relative;
}

.pa-actions button, .pa-section-nav button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line, #dedede);
  background: #fff;
  color: inherit;
  padding: 8px 13px;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 650;
}

.pa-actions button:hover, .pa-section-nav button:hover {
  border-color: var(--green, #202020);
  background: var(--pa-pale);
}

.pa-feedback {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 3;
  background: #fff;
  border-radius: 5px;
  box-shadow: 0 3px 15px #16382b19;
  padding: 6px 9px;
  width: max-content;
  max-width: 200px;
  font-size: .82rem;
}

.pa-feedback:empty {
  display: none;
}

.pa-hero {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line, #dedede);
  border-radius: 12px;
  background: #fff;
  color: var(--ink, #151515);
  min-height: 280px;
}

.pa-hero-with-photo {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
}

.pa-hero-copy {
  min-width: 0;
  padding: clamp(23px, 3.8vw, 52px);
  align-self: center;
}

.pa-profile .pa-eyebrow {
  color: var(--muted, #575757);
  letter-spacing: .12em;
  font-size: .78rem;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 15px;
}

.pa-hero h1 {
  margin: 0 0 12px;
  color: var(--ink, #151515);
  font-family: var(--serif, Georgia), serif;
  font-size: clamp(2.7rem, 5.8vw, 5.2rem);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: 1.01;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.pa-hero-sub {
  margin-block: 15px 0;
  color: var(--muted, #575757);
  font-size: .93rem;
  font-weight: 500;
}

.pa-hero-sub span {
  margin-inline: 4px;
}

.pa-intro {
  color: var(--ink, #151515);
  line-height: 1.62;
  max-width: 62ch;
  margin-block: 20px 0;
}

.pa-hero-photo {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  position: relative;
  margin: 0;
  min-width: 0;
  background: #f4f4f4;
}

.pa-hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.pa-map-link a {
  color: inherit;
}

.pa-map-link {
  margin-top: 19px;
  font-size: .9rem;
}

.pa-metrics {
  --metric-column-width: 145px;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  padding: 0;
  margin-block: 16px 0;
  background: var(--line, #dedede);
  border: 1px solid var(--line, #dedede);
  border-radius: 9px;
  overflow: hidden;
}

.pa-metrics-secondary {
  margin-block-start: 16px;
}

.pa-metric {
  flex: 1 1 var(--metric-column-width);
  min-width: 0;
  background: #fff;
  padding: 20px 21px;
}

.pa-metric dt {
  margin: 0 0 7px;
  color: var(--muted, #575757);
  font-size: .88rem;
  font-weight: 650;
}

.pa-metric dd {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .2em .36rem;
  font-family: var(--serif, Georgia), serif;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
  letter-spacing: -.035em;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin: 0;
}

.pa-metric dd span {
  color: var(--muted, #575757);
  font: 600 .86rem/1.1 system-ui, sans-serif;
  letter-spacing: 0;
  white-space: nowrap;
}

.pa-metric small {
  display: block;
  margin-top: 7px;
  max-width: 225px;
  color: var(--muted, #575757);
  font-size: .78rem;
  line-height: 1.4;
}

.pa-section-nav {
  display: flex;
  gap: 8px;
  overflow: auto;
  scrollbar-width: thin;
  padding-block: 23px 18px;
  border-bottom: 1px solid var(--line, #dedede);
}

.pa-section-nav button {
  flex: 0 0 auto;
  white-space: nowrap;
  background: transparent;
}

.pa-section {
  margin-top: 40px;
  scroll-margin-top: 90px;
  padding-block-end: 34px;
  border-bottom: 1px solid var(--line, #dedede);
}

.pa-section:last-child {
  border-bottom: 0;
}

.pa-section:focus {
  outline: 0;
}

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

.pa-text-button {
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pa-market-guide ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pa-market-note {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: .88rem;
}

.pa-market-comparison { margin-bottom: 18px; }
.pa-market-scroll { overflow-x: auto; }
.pa-market-scroll table { min-width: 530px; font-variant-numeric: tabular-nums; }
.pa-market-scroll :is(th, td):first-child { width: auto; }

.pa-local-work-table { overflow-x: auto; }
.pa-local-work-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pa-local-work-table caption { text-align: left; font-weight: 700; margin-bottom: .4rem; }
.pa-local-work-table :is(th, td) { padding: .5rem .4rem; border-bottom: 1px solid var(--line); text-align: left; }
.pa-local-work-table :is(th, td):not(:first-child) { text-align: right; }

@media (max-width: 550px) {
  .pa-living .pa-resource-grid { grid-template-columns: 1fr; }
}

@media print {
  .pa-text-button { display: none; }
}

.pa-section-heading {
  margin: 0 0 17px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  justify-content: space-between;
  align-items: baseline;
}

.pa-section-heading h2 {
  margin: 0;
  font-family: var(--serif, Georgia), serif;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  letter-spacing: -.047em;
  font-weight: 500;
  line-height: 1.05;
}

.pa-section-heading p, .pa-method > p {
  color: var(--muted, #575757);
  margin-block: 0 8px;
  line-height: 1.65;
}

.pa-demography {
  display: grid;
  gap: 16px;
}

.pa-demography-grid {
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
}

.pa-chart, .pa-comparison, .pa-local-note, .pa-resource, .pa-related-grid a {
  background: #fff;
  border: 1px solid var(--line, #dedede);
  border-radius: 8px;
  min-width: 0;
}

.pa-chart, .pa-comparison {
  margin: 0;
  padding: clamp(14px, 2.2vw, 26px);
}

.pa-chart figcaption, .pa-comparison h3 {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3px 9px;
  font-size: 1.1rem;
  font-weight: 720;
}

.pa-chart figcaption span {
  font-size: .83rem;
  color: var(--muted, #575757);
  font-weight: 550;
}

.pa-chart svg {
  display: block;
  max-width: 100%;
  min-height: 120px;
  width: 100%;
  margin-block: 8px;
  overflow: visible;
}

.pa-chart svg text {
  font: 600 13px system-ui, sans-serif;
  fill: var(--muted, #575757);
}

.pa-gridline {
  stroke: #e9e9e9;
  stroke-width: 1;
}

.pa-chart-area {
  fill: #ededed;
}

.pa-chart-line {
  stroke: var(--green, #202020);
  stroke-width: 3;
}

.pa-point {
  stroke: var(--green, #202020);
  stroke-width: 2;
  fill: #fff;
}

.pa-chart details summary {
  cursor: pointer;
  color: var(--green, #202020);
  font-size: .88rem;
  font-weight: 650;
}

.pa-chart caption {
  text-align: left;
  color: var(--muted, #575757);
  padding-top: 8px;
  padding-bottom: 4px;
  font-size: .85rem;
}

.pa-comparison p {
  margin: 7px 0 13px;
  color: var(--muted, #575757);
  font-size: .89rem;
  line-height: 1.5;
}

.pa-chart table, .pa-comparison table {
  border-collapse: collapse;
  width: 100%;
  font-size: .9rem;
}

.pa-comparison th, .pa-comparison td, .pa-chart th, .pa-chart td {
  border-bottom: 1px solid var(--line, #dedede);
  padding: 8px 5px;
  text-align: right;
}

.pa-comparison th:first-child, .pa-chart th:first-child {
  text-align: left;
}

.pa-comparison td, .pa-chart td {
  font-variant-numeric: tabular-nums;
}

@supports (grid-template-rows: subgrid) {
  .pa-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--metric-column-width)), 1fr));
  }

  .pa-metric {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
  }

  .pa-metric dd { align-self: start; }

  @media screen and (min-width: 651px) and (max-width: 1000px) {
    .pa-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .pa-metric { grid-column: span 2; }
    .pa-metric:last-child:nth-child(3n+1) { grid-column: span 6; }
    .pa-metric:nth-last-child(2):nth-child(3n+1),
    .pa-metric:last-child:nth-child(3n+2) { grid-column: span 3; }
  }

  @media screen and (max-width: 650px) {
    .pa-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pa-metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
  }
}

.pa-comparison thead, .pa-chart thead {
  color: var(--muted, #575757);
}

.pa-comparison thead th, .pa-chart thead th {
  font-weight: 650;
}

.pa-comparison tbody th, .pa-chart tbody th {
  font-weight: 560;
}

.pa-local-notes, .pa-resource-grid, .pa-related-grid {
  display: grid;
  gap: 13px;
}

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

.pa-resource-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pa-related-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pa-local-note, .pa-resource, .pa-related-grid a {
  padding: clamp(14px, 2.1vw, 22px);
}

.pa-local-note h3, .pa-resource h3, .pa-subheading {
  font-size: 1.1rem;
  margin: 0;
}

.pa-subheading {
  margin: 23px 0 12px;
}

.pa-local-note p, .pa-resource p {
  color: var(--muted, #575757);
  line-height: 1.52;
  margin: 8px 0 12px;
}

.pa-resource a {
  font-weight: 650;
  font-size: .9rem;
}

.pa-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.pa-sources a {
  font-weight: 620;
  font-size: .88rem;
}

.pa-method > p {
  max-width: 82ch;
}

.pa-related-grid a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.pa-related-grid a:hover {
  border-color: var(--green, #202020);
}

.pa-related-grid strong {
  display: block;
  font-family: var(--serif, Georgia), serif;
  font-size: 1.35rem;
  font-weight: 550;
}

.pa-related-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted, #575757);
  font-size: .87rem;
}

@media screen and (max-width: 830px) {
  .pa-hero-with-photo {
    grid-template-columns: 1fr;
  }

  .pa-hero-photo img {
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .pa-demography-grid {
    grid-template-columns: 1fr;
  }

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

  .pa-section {
    scroll-margin-top: 60px;
  }
}

@media screen and (max-width: 600px) {
  .pa-profile {
    padding-bottom: 35px;
  }

  .pa-topbar {
    margin-top: 17px;
    gap: 8px;
  }

  .pa-topbar a, .pa-actions button {
    font-size: .79rem;
  }

  .pa-actions button {
    padding: 6px 8px;
  }

  .pa-metrics { --metric-column-width: 125px; }

  .pa-metric {
    padding: 14px;
  }

  .pa-section {
    margin-top: 28px;
    padding-bottom: 25px;
  }

  .pa-local-notes, .pa-related-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (prefers-reduced-motion: reduce) {
  .pa-profile {
    scroll-behavior: auto;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 13mm 14mm 15mm;
  }

  body:has(.pa-profile) {
    background: #fff !important;
  }

  .pa-profile :is(.pa-topbar, .pa-section-nav, .pa-map-link, .pa-related, .eco-budget-link) {
    display: none !important;
  }

  .pa-profile, .pa-profile * {
    box-shadow: none !important;
  }

  .pa-profile {
    color: #151515;
    font-size: 9.5pt;
    line-height: 1.45;
    padding: 0;
  }

  .pa-hero {
    min-height: 0;
    background: #fff;
    border: 0;
    border-bottom: 2px solid #333;
    border-radius: 0;
    color: #151515;
    padding-bottom: 4mm;
    break-inside: avoid;
  }

  .pa-hero-with-photo {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 5mm;
  }

  .pa-hero-copy {
    padding: 0;
  }

  .pa-hero-copy::before {
    display: block;
    content: "ITS ITALY · SMALL TOWN ITALY";
    margin-bottom: 4mm;
    font-size: 8pt;
    font-weight: 700;
    letter-spacing: .09em;
  }

  .pa-hero h1, .pa-hero .pa-eyebrow, .pa-hero-sub, .pa-intro {
    color: #151515;
  }

  .pa-hero .pa-eyebrow, .pa-hero-sub {
    font-size: 8.5pt;
    margin-block: 2mm 1.5mm;
  }

  .pa-hero h1 {
    margin-bottom: 2mm;
    font-size: 32pt;
  }

  .pa-intro {
    margin-block: 2mm 0;
    line-height: 1.45;
  }

  .pa-hero-photo {
    display: block;
    align-self: center;
    background: transparent;
  }

  .pa-hero-photo img {
    height: auto;
    max-height: 52mm;
    aspect-ratio: 3 / 2;
  }

  .pa-hero-photo .photo-credit {
    padding: 0.6mm 1mm;
    font-size: 5.5pt;
  }

  .pa-topbar, .pa-hero, .pa-metrics, .pa-section {
    width: 100%;
  }

  .pa-metrics {
    --metric-column-width: 26mm;
    margin-top: 3.5mm;
    break-inside: avoid;
  }

  .pa-metric {
    padding: 2.5mm;
    border: 1px solid #dedede;
  }

  .pa-metric dt, .pa-metric dd span, .pa-metric small {
    font-size: 8.5pt;
  }

  .pa-metric dd {
    font-size: 19pt;
  }

  .pa-section {
    margin-top: 5mm;
    padding-bottom: 4mm;
  }

  .pa-section-heading {
    margin-bottom: 3mm;
    break-after: avoid;
  }

  .pa-section-heading h2 {
    font-size: 22pt;
  }

  .pa-demography-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 3mm;
  }

  .pa-resource-grid, .relocation-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pa-chart, .pa-comparison, .pa-local-note, .pa-resource, .relocation-card {
    break-inside: avoid;
    padding: 3mm;
  }

  .pa-chart svg {
    min-height: 0;
    print-color-adjust: exact;
  }

  .pa-profile :is(h2, h3, th, figcaption) {
    break-after: avoid;
  }

  .pa-profile :is(p, li) {
    orphans: 2;
    widows: 2;
  }

  .pa-profile :is(.pa-sources, .eco-sources) a {
    color: #222;
    text-decoration: underline;
  }

  .pa-profile :is(.eco-market, .eco-benchmarks, .eco-dwellings) {
    break-inside: avoid;
  }
}

.pa-movement {
  margin-top: 23px;
}

.pa-movement-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 14px;
  justify-content: space-between;
}

.pa-movement-heading h3, .pa-access h3 {
  margin: 0;
  font-size: 1.1rem;
}

.pa-movement-heading p, .pa-access p {
  margin: 0;
  color: var(--muted, #575757);
  font-size: .87rem;
}

.pa-access {
  display: flex;
  justify-content: space-between;
  gap: 14px 24px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 15px;
  padding: 19px 22px;
  background: #f4f4f4;
  border-radius: 8px;
  border: 1px solid var(--line, #dedede);
}

.pa-access p {
  margin: 5px 0 7px;
}

.pa-access a {
  font-weight: 650;
  font-size: .88rem;
}

.pa-access-time {
  display: grid;
  line-height: 1.15;
  gap: 5px;
}

.pa-access-time strong {
  font: 500 clamp(1.75rem, 4vw, 2.5rem)/1 var(--serif, Georgia), serif;
}

.pa-access-time span {
  font-size: .79rem;
  color: var(--muted, #575757);
}

.pa-profile :is(.pa-return, .pa-map-link a, .pa-sources a, .pa-resource a a, .pa-access a) {
  text-decoration: underline;
  text-decoration-color: currentColor;
}

.pa-local-note .pa-note-category {
  color: var(--green, #202020);
  font-weight: 670;
  margin: 0 0 6px;
  font-size: .83rem;
}

#pa-services-data:not(:empty) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 13px;
  margin-top: 14px;
}

.pa-service-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 17px 21px;
  border-radius: 8px;
  border: 1px solid var(--line, #dedede);
  background: #fff;
}

.pa-service-stat h3 {
  font-size: 1rem;
  font-weight: 670;
  margin: 0;
}

.pa-service-stat strong {
  font: 500 2.25rem/1 var(--serif, Georgia), serif;
  font-variant-numeric: lining-nums tabular-nums;
}

.pa-service-detail {
  display: grid;
  align-content: start;
  gap: 5px;
}

.pa-service-detail a { justify-self: start; }

@supports (grid-template-rows: subgrid) {
  .pa-service-stat {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 5px;
  }
}

.pa-service-stat p, .pa-service-stat a {
  margin: 0;
  color: var(--muted, #575757);
  font-size: .85rem;
}

.pa-service-stat a {
  color: var(--green, #202020);
  font-weight: 650;
  text-decoration: underline;
}

.pa-service-stat dl {
  display: grid;
  gap: 3px 11px;
  margin: 2px 0 4px;
}

.pa-service-stat dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: .83rem;
}

.pa-service-stat dl dd {
  font-weight: 700;
  margin: 0;
}

@media print {
  .pa-service-stat, .pa-access {
    break-inside: avoid;
  }
}
