/**
 * @file
 * Business profile (bprofile) styling — teaser cards and the full profile page.
 *
 * The business_profiles module ships layout-only CSS (flex columns, teaser
 * link, mobile action bar) and deliberately leaves field internals to the
 * theme. This file provides the brand look on top of that structure and maps
 * the booking widget / action bar onto our design tokens (see tokens.css).
 */

/* ==========================================================================
   Shared field rendering inside a profile
   ========================================================================== */
.bprofile .field {
  margin-bottom: var(--space-4);
}

.bprofile .field:last-child {
  margin-bottom: 0;
}

.bprofile .field__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.bprofile .field__item {
  color: var(--color-text);
}

/* Address block. */
.bprofile .address {
  position: relative;
  margin: 0;
  padding-inline-start: 1.25rem;
  color: var(--color-text-muted);
  font-style: normal;
  line-height: var(--leading-snug);
}

.bprofile .address::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.2em;
  width: 0.875rem;
  height: 0.875rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Entity-reference lists (languages, specialties, city) → tag pills. */
.bprofile .field--type-entity-reference .field__items,
.bprofile .field--name-field-specialties .field__items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.bprofile .field--type-entity-reference .field__item,
.bprofile .field--name-field-specialties .field__item {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border: none;
  border-radius: var(--radius-pill);
}

.bprofile .field--type-entity-reference .field__item a {
  color: inherit;
}

/* ==========================================================================
   Teaser card (search results, related listings, …)
   ========================================================================== */
.bprofile--teaser {
  height: 100%;
  min-width: 0;
  max-width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.bprofile--teaser:hover {
  border-color: var(--color-primary-border);
  box-shadow: var(--shadow-md);
}

.bprofile--teaser .bprofile__teaser-link {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-width: 0;
  padding: var(--space-5);
  color: inherit;
}

.bprofile--teaser .bprofile__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
  margin-bottom: var(--space-3);
}

.bprofile--teaser .field--name-field-address .field__label {
  display: none;
}

.bprofile--teaser .bprofile__header-media {
  width: 64px;
  height: 64px;
  max-width: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}

.bprofile--teaser .bprofile__header-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.bprofile--teaser .bprofile__header-text {
  min-width: 0;
}

.bprofile--teaser .bprofile__header-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-heading);
  overflow-wrap: anywhere;
}

.bprofile--teaser .bprofile__main {
  min-width: 0;
  max-width: 100%;
  margin-top: auto;
}

.bprofile--teaser .field--name-field-specialties .field__label {
  display: none;
}

/* One-line specialty strip; a fade on the trailing edge hints at more tags.
   min-width: 0 + overflow clip so nowrap pills cannot inflate the card/page. */
.bprofile--teaser .field--name-field-specialties {
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.bprofile--teaser .field--name-field-specialties .field__items,
.bprofile--teaser .field--name-field-specialties.field__items {
  display: flex;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  margin-bottom: 0;
}

.bprofile--teaser .field--name-field-specialties .field__item {
  flex: 0 0 auto;
  white-space: nowrap;
}

.bprofile--teaser .field--name-field-specialties::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 3.25rem;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--color-surface));
}

[dir="rtl"] .bprofile--teaser .field--name-field-specialties::after {
  background: linear-gradient(to left, transparent, var(--color-surface));
}


/* ==========================================================================
   Full profile page
   ========================================================================== */
.bprofile--default .bprofile__layout {
  width: 100%;
}

.bprofile--default .bprofile__main {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

@media (min-width: 48rem) {
  .bprofile--default .bprofile__main {
    padding: var(--space-8);
  }
}

.bprofile--default .bprofile__header {
  display: flex;
  gap: var(--space-5);
  align-items: center;
  padding-bottom: var(--space-6);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.bprofile--default .bprofile__header-media {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
  background: var(--color-surface-alt);
}

.bprofile--default .bprofile__header-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bprofile--default .bprofile__header-text {
  min-width: 0;
  flex: 1 1 auto;
}

.bprofile--default .bprofile__header-title {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: var(--weight-extra);
  color: var(--color-heading);
}

.bprofile--default .bprofile__header .field--name-field-address .field__label {
  display: none;
}

/* Hide administrative fields on the public profile for a cleaner look. */
.bprofile--default .field--name-status,
.bprofile--default .field--name-uid,
.bprofile--default .field--name-created {
  display: none;
}

/* Long-text sections (education, about) render as prose. */
.bprofile--default .field--type-text-long .field__item {
  color: var(--color-text);
  line-height: var(--leading-normal);
}

.bprofile--default .field--type-text-long .field__item :last-child {
  margin-bottom: 0;
}

/* Photo gallery. */
.bprofile--default .field--name-field-photos .field__items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-3);
}

.bprofile--default .field--name-field-photos img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

/* --- Aside sections (map + booking) -------------------------------------- */
.bprofile__section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.bprofile__section .field__label {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-heading);
  margin-bottom: var(--space-3);
}

/* Booking card: title lives inside the section. */
.bprofile__section--booking {
  padding: 0;
  overflow: hidden;
}

.bprofile__booking-header {
  padding: var(--space-5) var(--space-5) var(--space-4);
  background:
    linear-gradient(160deg, var(--color-primary-soft) 0%, var(--color-surface) 70%);
  border-bottom: 1px solid var(--color-primary-border);
}

.bprofile__booking-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-extra);
  letter-spacing: -0.02em;
  color: var(--color-heading);
  line-height: var(--leading-snug);
}

.bprofile__booking-title::before {
  content: "\f073"; /* fa-calendar-days */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-style: normal;
  font-size: 0.95em;
  color: var(--color-primary);
  line-height: 1;
  -webkit-font-smoothing: antialiased;
}

.bprofile__booking-lead {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}

.bprofile__section--booking .field--name-field-working-hours {
  padding: var(--space-5);
}

/* Contacts strip in the main column (always available, even without booking). */
.bprofile__contacts {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.bprofile__contacts-lead {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
}

.bprofile__contacts-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--space-2);
}

.bprofile__contacts-actions > .field,
.bprofile__contacts-actions > .field__item,
.bprofile__contacts-actions > .bprofile__message {
  display: flex;
  align-items: stretch;
  margin: 0;
}

.bprofile__contacts .field__label {
  display: none;
}

.bprofile__contacts .contact-reveal-wrapper {
  display: flex;
  align-items: stretch;
}

/*
 * Phone (native <button>), WhatsApp/Viber, website and "send message"
 * (<a>) must share one size in this row. Scoped to the trigger / row
 * links so the reveal dialog controls stay untouched.
 */
.bprofile__contacts-actions .contact-reveal-wrapper > .contact-reveal-trigger,
.bprofile__contacts-actions .bprofile__message a,
.bprofile__contacts-actions .field--name-field-booking-url a {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  gap: var(--space-2);
  margin: 0;
  min-height: 2.5rem;
  padding: 0.65rem 1.4rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent !important;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-on-primary) !important;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

.bprofile__contacts-actions .contact-reveal-wrapper > .contact-reveal-trigger:hover,
.bprofile__contacts-actions .bprofile__message a:hover,
.bprofile__contacts-actions .field--name-field-booking-url a:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-primary);
  transform: none;
}

/* Font Awesome icons on the control via ::before. */
.bprofile__contacts a::before,
.bprofile__contacts .contact-reveal-trigger::before {
  display: inline-block;
  flex-shrink: 0;
  width: 1em;
  font-family: "Font Awesome 6 Free";
  font-size: 0.875em;
  font-weight: 900;
  font-style: normal;
  line-height: 1;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}

.bprofile__contacts .field--name-field-phone .contact-reveal-trigger::before,
.bprofile__contacts .field--name-field-phone a::before {
  content: "\f095"; /* fa-phone */
}

.bprofile__contacts .field--name-field-whatsapp .contact-reveal-trigger::before,
.bprofile__contacts .field--name-field-whatsapp a::before,
.bprofile__contacts .contact-reveal-wrapper--whatsapp .contact-reveal-trigger::before {
  font-family: "Font Awesome 6 Brands";
  font-weight: 400;
  content: "\f232"; /* fa-whatsapp */
}

.bprofile__contacts .field--name-field-viber .contact-reveal-trigger::before,
.bprofile__contacts .field--name-field-viber a::before,
.bprofile__contacts .contact-reveal-wrapper--viber .contact-reveal-trigger::before {
  font-family: "Font Awesome 6 Brands";
  font-weight: 400;
  content: "\f409"; /* fa-viber */
}

.bprofile__contacts .field--name-field-booking-url a::before {
  content: "\f0ac"; /* fa-globe */
}

.bprofile__contacts .bprofile__message-link::before {
  content: "\f0e0"; /* fa-envelope */
}

@media (min-width: 62rem) {
  .bprofile--default.bprofile--has-aside .bprofile__aside {
    top: calc(var(--header-height) + var(--space-4));
  }
}

/* Leaflet map. */
.bprofile__section--map .leaflet-container,
.bprofile__section--map [id^="leaflet-map"] {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

/* ==========================================================================
   Contact reveal (phone) modal
   ========================================================================== */
.contact-reveal-modal {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0;
  max-width: 360px;
}

.contact-reveal-modal::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
}

.contact-reveal-modal .modal-content {
  position: relative;
  padding: var(--space-6);
}

.contact-reveal-modal .modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   Mobile action bar (map / book) — brand refinements
   ========================================================================== */
.bprofile__actionbar {
  border-top: 1px solid var(--color-border);
}

.bprofile__actionbar-map {
  color: var(--color-primary);
}

/* Mobile: room for the action bar when only contacts exist (no aside). */
@media (max-width: 61.99rem) {
  .bprofile--has-contacts:not(.bprofile--has-aside) {
    padding-bottom: 4.5rem;
  }
}
