/*
 * Practice profile (boards Profile, ProfileCall, MobProfile, MobProfileCall) and its "Fehler melden" dialog
 * (XReport, MobReport). Loaded only by directory/profile.html, next to directory.css (its --dir-* values)
 * and forms.css (the form inside the dialog). Values that are not tokens come from the boards.
 */
:root {
  --profile-species-bg: #E3F1F4;
  --profile-closed: #8FA6AB;
  --profile-bar-height: 76px;
}

.profile-page {
  padding-top: var(--sp-4);
  padding-bottom: 72px;
}
.profile-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: var(--fs-body);
  font-weight: 700;
}
.profile-crumbs {
  margin-top: var(--sp-1);
}
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--sp-7);
  align-items: start;
  margin-top: var(--sp-5);
}
.profile-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

/* Head card */
.profile-head {
  overflow: hidden;
  border: 1.5px solid var(--pl-line);
  border-radius: var(--r-bubble);
  background: var(--pl-surface-card);
  box-shadow: var(--sh-1);
}
.profile-head__photo {
  height: 260px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--dir-band);
}
.profile-head__photo img {
  width: auto;
  height: 215px;
  max-width: 92%;
  object-fit: contain;
}
.profile-head__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 24px 28px 28px;
}
.profile-head__identity {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.profile-head__logo,
.profile-head__initials {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--r-card);
}
.profile-head__logo {
  object-fit: contain;
  background: var(--pl-surface-card);
  border: 1.5px solid var(--pl-line-soft);
}
.profile-head__initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pl-teal-pale);
  font-family: var(--font-display);
  font-size: var(--fs-22);
  font-weight: 600;
  color: var(--pl-teal-deep);
}
.profile-head__names {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-head__title {
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.6px;
  overflow-wrap: anywhere;
}
.profile-head__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-weight: 600;
}
.profile-head__fact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.profile-head__fact[hidden] {
  display: none;
}
.profile-head__fact .icon {
  flex-shrink: 0;
  color: var(--pl-teal-deep);
}
.profile-opening__dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: var(--r-round);
  background: var(--profile-closed);
}
.profile-opening--open .profile-opening__dot {
  background: var(--dir-match);
}
.profile-species {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.profile-species__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 14px 4px 4px;
  border: 1.5px solid var(--pl-line);
  border-radius: var(--r-pill-inf);
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--pl-teal-deep);
}
.profile-species__chip--text {
  padding-left: 14px;
}
.profile-species__picture {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: var(--r-round);
  background: var(--profile-species-bg);
}
.profile-species__picture img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.profile-head__intro {
  max-width: 680px;
  font-weight: 500;
  color: var(--pl-ink-muted);
  overflow-wrap: anywhere;
}

/* In-page navigation */
.profile-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  border-bottom: 1.5px solid var(--pl-line);
  font-size: var(--fs-md);
  font-weight: 700;
}
.profile-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: -1.5px;
  border-bottom: 3px solid transparent;
}
.profile-nav a:hover {
  border-bottom-color: var(--pl-teal-deep);
}

/* Sections */
.profile-section,
.profile-card {
  scroll-margin-top: var(--sp-4);
}
.profile-section__title {
  margin-bottom: var(--sp-4);
  font-size: var(--fs-26);
  line-height: 1.2;
}
.profile-card {
  padding: var(--sp-6);
  border: 1.5px solid var(--pl-line);
  border-radius: var(--r-card);
  background: var(--pl-surface-card);
}
.profile-card__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: var(--sp-4);
}
.profile-card__head .profile-section__title {
  margin-bottom: 0;
}
.profile-card__note {
  align-self: center;
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--pl-ink-muted);
}
.profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.profile-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  max-width: 100%;
  padding: 6px 14px;
  border: 1.5px solid var(--pl-line);
  border-radius: var(--r-pill-inf);
  background: var(--pl-surface-card);
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--pl-teal-deep);
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}
.profile-team {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-3);
}
.profile-team__member {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: var(--sp-4);
  border: 1.5px solid var(--pl-line);
  border-radius: var(--r-card);
  background: var(--pl-surface-card);
}
.profile-team__initials {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-round);
  background: var(--pl-teal-pale);
  font-family: var(--font-display);
  font-size: var(--fs-title-sm);
  font-weight: 600;
  color: var(--pl-teal-deep);
}
.profile-team__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}
.profile-team__text strong {
  color: var(--pl-teal-deep);
}
.profile-team__text span {
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--pl-ink-muted);
}
.profile-hours {
  width: 100%;
  border-collapse: collapse;
  font-weight: 600;
}
.profile-hours th,
.profile-hours td {
  padding: 10px 12px;
  text-align: left;
  font-weight: inherit;
}
.profile-hours thead th {
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: var(--fs-overline);
  font-weight: 700;
  letter-spacing: var(--pl-label-tracking);
  text-transform: uppercase;
  color: var(--pl-ink-muted);
}
.profile-hours tbody tr {
  border-top: 1.5px solid var(--pl-line-soft);
}
.profile-hours tbody th {
  width: 40%;
}
.profile-hours .profile-hours__today {
  background: var(--pl-teal-pale);
  color: var(--pl-teal-deep);
  font-weight: 800;
}
/* The location: the map (T12, A2; our own picture before the visitor's intent, then MapLibre) above the address. */
.profile-location {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.profile-location [hidden] {
  display: none !important;
}
.profile-location__map {
  position: relative;
  height: 280px;
  border-bottom: 1.5px solid var(--pl-line);
  background-color: #dcebee;
  background-image: linear-gradient(#ffffff 2px, transparent 2px), linear-gradient(90deg, #ffffff 2px, transparent 2px);
  background-size: 96px 96px;
}
.profile-location__canvas {
  position: absolute;
  inset: 0;
}
/* A pin of our own at the practice's place: the picture before the map, no request to anyone. */
.profile-location__pin {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--pl-teal-deep);
  box-shadow: 0 3px 10px rgba(0, 61, 74, 0.3);
  transform: rotate(-45deg);
}
.profile-location .profile-directions {
  border: 0;
}
.profile-directions__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.profile-directions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: var(--sp-5) var(--sp-6);
}
.profile-directions__address {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.profile-directions__address .icon {
  flex-shrink: 0;
  color: var(--pl-teal-deep);
}
.profile-faq {
  margin-bottom: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  border: 1.5px solid var(--pl-line);
  border-radius: var(--r-card);
  background: var(--pl-surface-card);
}
.profile-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 28px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  overflow-wrap: anywhere;
}
.profile-faq summary::-webkit-details-marker {
  display: none;
}
.profile-faq summary .icon {
  flex-shrink: 0;
  color: var(--pl-teal-deep);
  transition: transform 0.3s var(--ez-soft);
}
.profile-faq[open] summary .icon {
  transform: rotate(180deg);
}
.profile-faq p {
  margin-top: var(--sp-2);
  font-weight: 500;
  color: var(--pl-ink-muted);
  overflow-wrap: anywhere;
}
.profile-ways {
  padding: var(--sp-5) var(--sp-6);
}
.profile-ways__title {
  font-family: var(--font-body);
  font-size: var(--fs-body-lg);
  font-weight: 700;
}
.profile-ways__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: var(--fs-md);
  font-weight: 600;
}
.profile-ways__list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  text-decoration: underline;
  overflow-wrap: anywhere;
}
.profile-ways__list .icon {
  flex-shrink: 0;
}

/* Side column: the contact box and the source line */
.profile-side {
  position: sticky;
  top: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.profile-box {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-6);
  border: 1.5px solid var(--pl-line);
  border-radius: var(--r-bubble);
  background: var(--pl-surface-card);
  box-shadow: var(--sh-3);
}
.profile-box__main {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.profile-box .label,
.profile-bar .label {
  font-size: var(--fs-overline);
}
.profile-box__value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--pl-teal-deep);
  overflow-wrap: anywhere;
}
.profile-box__button {
  min-height: 54px;
  font-size: 17px;
}
.profile-box__hint {
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--pl-ink-muted);
  text-align: center;
}
.profile-box__note {
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--pl-ink-muted);
}
.profile-box__main + .profile-box__note {
  padding-top: var(--sp-4);
  border-top: 1.5px solid var(--pl-line);
}
.profile-source {
  padding: 0 var(--sp-2);
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--pl-ink-muted);
  text-align: center;
}
.profile-source a {
  text-decoration: underline;
}
.profile-bar {
  display: none;
}

/* "Fehler melden": a dialog on desktop, a bottom sheet on phones */
.report-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.report-dialog__panel {
  position: absolute;
  top: 60px;
  left: 50%;
  width: 620px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 80px);
  overflow-y: auto;
  transform: translateX(-50%);
  padding: 28px 32px;
  border-radius: 24px;
  background: var(--pl-surface-card);
  box-shadow: var(--sh-dialog);
}
.report-dialog__handle {
  display: none;
}
/* The card of the form page is the panel here. */
.report-dialog .report-card {
  max-width: none;
  margin: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 1023px) {
  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-5);
  }
  /* The generic picture would push the practice's name under the fixed bar (profile.html). */
  .profile-head__photo {
    display: none;
  }
  .profile-side {
    position: static;
  }
  /* The fixed bar carries the box's contact way; the box keeps only the basic entry's sentence. */
  .profile-box__main {
    display: none;
  }
  .profile-box:not(:has(.profile-box__note)) {
    display: none;
  }
  .profile-box {
    padding: 14px var(--sp-4);
    border-radius: var(--r-card);
    box-shadow: none;
  }
  .profile-box__main + .profile-box__note {
    padding-top: 0;
    border-top: 0;
  }
  .profile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-height: var(--profile-bar-height);
    padding: 10px max(var(--gutter), env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px))
      max(var(--gutter), env(safe-area-inset-left, 0px));
    border-top: 1.5px solid var(--pl-line);
    background: var(--pl-surface-card);
    box-shadow: 0 -6px 28px rgba(0, 88, 103, 0.11);
  }
  .profile-bar__text {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  .profile-bar__value {
    font-family: var(--font-display);
    font-size: var(--fs-lead);
    font-weight: 600;
    line-height: 1.15;
    color: var(--pl-teal-deep);
    /* "Freien Wunschtermin wählen" next to the button: split at syllables ("Wunsch-termin"), never mid-letter. */
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
  }
  .profile-bar .btn {
    flex-shrink: 0;
    padding: 0 22px;
  }
  /* Room for the fixed bar, so it never covers the footer's last line. */
  body:has(.profile-bar) .site-footer {
    padding-bottom: calc(var(--profile-bar-height) + env(safe-area-inset-bottom, 0px));
  }
  /* The bar already keeps the footer clear of the browser's bottom bar (base.css). */
  body:has(.profile-bar) .site-footer__inner {
    padding-bottom: 28px;
  }
}

@media (max-width: 680px) {
  .profile-page {
    padding-top: var(--sp-2);
    padding-bottom: var(--sp-7);
  }
  .profile-layout {
    margin-top: var(--sp-3);
  }
  .profile-main {
    gap: var(--sp-5);
  }
  .profile-head__body {
    gap: 10px;
    padding: var(--sp-4);
  }
  .profile-head__logo,
  .profile-head__initials {
    width: 52px;
    height: 52px;
    font-size: var(--fs-lead);
  }
  .profile-head__title {
    font-size: 30px;
    letter-spacing: -0.5px;
  }
  .profile-head__facts {
    flex-direction: column;
    font-size: var(--fs-md);
  }
  .profile-species__chip {
    min-height: 40px;
  }
  .profile-species__picture {
    width: 32px;
    height: 32px;
    padding: 5px;
  }
  .profile-nav {
    gap: 0 20px;
  }
  .profile-section__title {
    margin-bottom: 10px;
    font-size: var(--fs-22);
  }
  .profile-card {
    padding: var(--sp-4);
  }
  .profile-hours th,
  .profile-hours td {
    padding: 10px 8px;
  }
  .profile-hours td {
    text-align: right;
    text-wrap: balance;
  }
  .profile-hours thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .profile-hours tbody tr:first-child {
    border-top: 0;
  }
  .profile-directions {
    padding: 14px var(--sp-4);
  }
  .profile-directions .btn {
    flex: 1 1 140px;
  }
  .profile-directions__actions {
    width: 100%;
  }
  .profile-location__map {
    height: 300px;
  }
  .profile-team {
    grid-template-columns: 1fr;
  }
  .profile-ways {
    padding: 14px var(--sp-4);
  }
  .profile-source {
    text-align: left;
    padding: 0;
  }
  .profile-bar .btn {
    padding: 0 var(--sp-4);
  }
  .report-dialog__panel {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    max-height: 92%;
    transform: none;
    padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    border-radius: 24px 24px 0 0;
  }
  .report-dialog__handle {
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 14px;
    border-radius: 2px;
    background: var(--pl-line);
  }
}
