/* Профіль widget — layout only; visual primitives come from the DS atoms.
       The widget lives in .two-col's narrow left column, so its internal layout
       reflows on its OWN width (container query), not the viewport. */
.profile {
    container-type: inline-size;
    padding: 0;
}

.profile__body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
}

/* "Статус у ЄДР" badge: green only for "Зареєстровано", pink for anything else
   (припинено, в процесі припинення, тощо). Dedicated modifier so this status
   logic doesn't ride on the generic .badge--success/--neutral pair. */
.profile__status-badge--active {
    background: color-mix(in srgb, #2f9e44 14%, transparent);
    color: #216e4e;
}

.profile__status-badge--inactive {
    background: #f9dce3;
    color: #d00f3c;
}

.profile__meta {
    overflow: hidden;
    color: var(--text-subtlest);
    text-overflow: ellipsis;
}

/* Header icon is a bare dark glyph (macet has no purple chip). */
.profile>.widget__header .widget__header-icon {
    width: auto;
    height: auto;
    background: none;
    color: var(--text-default);
}

/* Іконка тут 24px (не 32) — добираємо до рядка 40px, як у styles.css. */
.profile>.widget__header .widget__header-main>.widget__header-icon {
    margin-block: 8px;
}

.profile>.widget__header .btn--transparent {
    color: var(--color-neutral-solid-600);
}

/* Inner section cards */
.profile__sec {
    border: 1px solid var(--color-primary-200);
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-neutral-solid-100);
    padding: 0;
}

.profile__sec-head {
    padding: 16px;
    background: var(--color-neutral-solid-100);
    /* macet: plain white head */
    border-bottom: 1px solid var(--color-primary-200);
}

.profile__sec-head h4 {
    margin: 0;
    color: var(--text-default);
}

/* Rows / cells */
.profile__row {
    display: grid;
grid-template-columns: repeat(2, 1fr);
}

.profile__row--2 {
    grid-template-columns: 1fr 1fr;
}

.profile__row--1 {
    grid-template-columns: 1fr;
}

.profile__row--3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.profile__row+.profile__row {
    border-top: 1px solid var(--color-neutral-solid-300);
}

.profile__cell {
    min-width: 0;
    padding: 16px 20px;
}

.profile__row--2>.profile__cell+.profile__cell,
.profile__row--3>.profile__cell+.profile__cell {
    border-left: 1px solid var(--color-neutral-solid-300);
}

/* Field content */
.profile__label {
    margin: 0 0 10px;
    color: var(--text-default);
}

.profile__value {
    margin: 0 0 8px;
    color: var(--text-default);
    overflow-wrap: anywhere;
    cursor: pointer;
}

.profile__value:last-child {
    margin-bottom: 0;
}

/* Sub-labels: Medium 12, UPPERCASE display, neutral-600 (macet textCase=UPPER). */
.profile__sub {
    margin: 12px 0 4px;
    color: var(--color-neutral-solid-600);
}

.profile__label+.profile__sub,
.profile__sub:first-child {
    margin-top: 0;
}

.profile__subfield {
    padding: 6px 0 10px;
}

.profile__subfield+.profile__subfield {
    border-top: 1px solid var(--color-neutral-solid-300);
}

/* Masked (gated) value bar — .mask-hatch supplies stripes + hover lock/tooltip. */
.profile__mask {
    vertical-align: middle;
}

/* Links */
.profile__link {
    color: var(--color-primary-500);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.profile__link:hover {
    color: var(--color-primary-600);
}

/* Copy icon button */
.profile__copy {
    display: inline-flex;
    vertical-align: -3px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-neutral-solid-600);
    cursor: pointer;
}

.profile__copy:hover {
    color: var(--color-primary-500);
}

/* Скопійовано (company-detail.js): іконка — галочка. !important перебиває
   інлайнове --ic:url(Copy.svg) на <i>. */
.profile__copy.is-copied {
    color: var(--color-primary-500);
}

.profile__copy.is-copied .ic {
    --ic: url('/assets/icons/Check.svg') !important;
}

/* "показати більше" — transparent DS button, uppercase caps, grey label + badge */
.profile__more {
    align-self: flex-start;
    height: auto;
    margin: 6px 0 4px;
    padding: 2px 8px 2px 0;
    gap: 4px;
    color: var(--color-neutral-solid-600);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 12px;
    line-height: 15px;
    font-weight: 500;
}

.profile__more:hover {
    background: transparent;
    color: var(--color-primary-500);
}

/* Linked-company rows (yellow org icon) */
.profile__org-list {
    list-style: none;
    margin: 4px 0 6px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile__org {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.profile__org-ic {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--color-other-colors-warm-yellow-500);
    color: var(--color-neutral-solid-100);
}

/* Назва без посилання (альтернативні назви — це та сама компанія) */
.profile__org-name {
    overflow-wrap: anywhere;
}

/* Person rows — blue avatar with white person glyph (macet), + link or masked bar */
.profile__person {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
}

.avatar.profile__avatar {
    width: 20px;
    height: 20px;
    flex: none;
    background: var(--node-bg-person, #015ce5);
    color: #fff;
}

.profile__avatar .ic {
    width: 12px;
    height: 12px;
}

.profile__mask--row {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    max-width: 320px;
}

/* Frosted-locked section (Контакти, Кількість) — real content blurred + centred CTA */
.profile__locked {
    position: relative;
    min-height: 240px;
}

.profile__locked-content {
    padding: 4px 0;
    filter: blur(5px);
    opacity: 0.55;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.profile__locked--image {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.profile__locked--image > * {
    grid-area: 1 / 1;
}

.profile__locked--image .profile__lock-overlay {
    position: relative;
    inset: auto;
}

.profile__locked-img {
    aspect-ratio: 770 / 254;
    align-self: stretch;
    width: 100%;
    padding: 0;
    background: url('/assets/img/contacts-locked.png') left top / cover no-repeat;
}

.profile__lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 24px;
    background: color-mix(in srgb, var(--color-neutral-solid-100) 35%, transparent);
}

.profile__lock-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary-100);
    color: var(--color-primary-500);
}

.profile__lock-title {
    margin: 0;
    color: var(--text-default);
}

.profile__lock-text {
    margin: 0;
    max-width: 460px;
    color: var(--color-neutral-solid-700);
}

.profile__lock-overlay .btn {
    margin-top: 4px;
}

/* Promo band = reused top-of-page banner carousel; full-bleed within the card,
       rounded to sit inside the 12px section rhythm. */
.profile__banner {
    border-radius: 12px;
    overflow: hidden;
}

/* Реєстри cards */
.profile__reg-card {
    margin-top: 12px;
    padding: 16px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--color-neutral-solid-200) 60%, var(--color-neutral-solid-100));
}

.profile__reg-title {
    display: inline-block;
    margin-bottom: 12px;
    letter-spacing: 0.2px;
}

.profile__reg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.profile__reg-field {
    min-width: 0;
    padding: 8px 16px 8px 0;
}

.profile__reg-field:not(:nth-child(4n + 1)) {
    padding-left: 16px;
    border-left: 1px solid var(--color-neutral-solid-300);
}

.profile__reg-field:nth-child(n + 5) {
    border-top: 1px solid var(--color-neutral-solid-300);
}

.profile__reg-field .profile__sub {
    margin-top: 0;
}

/* Історичні назви (masked bars) */
.profile__hist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Структура власності grid */
.profile__own-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.profile__own-field {
    min-width: 0;
    padding: 8px 16px 12px 0;
}

.profile__own-field:not(:nth-child(3n + 1)) {
    padding-left: 16px;
    border-left: 1px solid var(--color-neutral-solid-300);
}

.profile__own-field:nth-child(n + 4) {
    border-top: 1px solid var(--color-neutral-solid-300);
}

.profile__own-field .profile__sub {
    margin-top: 0;
}

.profile__own-full {
    padding-top: 12px;
    border-top: 1px solid var(--color-neutral-solid-300);
}

.profile__own-full .profile__sub {
    margin-top: 0;
}

/* Responsive: collapse internal grids (container-relative — profile's own width) */
@container (max-width: 900px) {

    .profile__row--2,
    .profile__row--3 {
        grid-template-columns: 1fr;
    }

    .profile__row--2>.profile__cell+.profile__cell,
    .profile__row--3>.profile__cell+.profile__cell {
        border-left: 0;
        border-top: 1px solid var(--color-neutral-solid-300);
    }

    .profile__reg-grid,
    .profile__own-grid {
        grid-template-columns: 1fr;
    }

    .profile__reg-field,
    .profile__own-field {
        padding: 8px 0;
    }

    .profile__reg-field:not(:nth-child(4n + 1)),
    .profile__own-field:not(:nth-child(3n + 1)) {
        padding-left: 0;
        border-left: 0;
    }

    .profile__reg-field+.profile__reg-field,
    .profile__own-field+.profile__own-field {
        border-top: 1px solid var(--color-neutral-solid-300);
    }
}