/*
 * AQARK R78 public marketplace completion layer.
 * Brand-neutral: preserves the deployed AQARK brand mark, colors and identity.
 * Scope: layout, responsive behavior, accessibility and content hierarchy only.
 */

.r78-page-shell,
main > .container,
main > [class*="container"] {
    width: min(100% - 32px, 1240px);
    margin-inline: auto;
}

.r78-breadcrumbs,
.breadcrumb,
[class*="breadcrumb"] {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.r78-breadcrumbs {
    margin-block: 18px 22px;
    font-size: 14px;
}

.r78-breadcrumbs a,
.r78-area-links a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.r78-page-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.r78-page-hero h1 {
    margin: 4px 0 10px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.025em;
}

.r78-page-hero p {
    max-width: 720px;
    margin: 0;
    line-height: 1.7;
}

.r78-eyebrow,
.r78-area-card__meta {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.65;
}

.r78-area-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 44px;
}

.r78-area-card,
.r78-empty-state {
    border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
    border-radius: 18px;
    padding: 20px;
    background: var(--surface, inherit);
}

.r78-area-card {
    display: flex;
    min-height: 260px;
    flex-direction: column;
}

.r78-area-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.r78-area-card h2 {
    margin: 4px 0 14px;
    font-size: 21px;
    line-height: 1.25;
}

.r78-area-card__count {
    display: inline-flex;
    min-width: 34px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.r78-area-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.r78-area-links a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.r78-primary-action,
.r78-secondary-action,
a[role="button"],
button,
.btn,
[class*="button"] {
    min-height: 44px;
}

.r78-primary-action,
.r78-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    border-radius: 10px;
    padding: 10px 16px;
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

.r78-primary-action {
    border: 1px solid currentColor;
}

.r78-secondary-action {
    margin-top: auto;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}

.r78-muted {
    opacity: 0.68;
    line-height: 1.6;
}

/* Existing public cards: hierarchy, consistent height and image behavior. */
[class*="property-card"],
[class*="project-card"],
[class*="developer-card"],
[class*="agency-card"],
.card {
    min-width: 0;
}

[class*="property-card"] img,
[class*="project-card"] img,
[class*="developer-card"] img,
[class*="agency-card"] img,
[class*="gallery"] img {
    max-width: 100%;
    object-fit: cover;
}

[class*="property-card"] img,
[class*="project-card"] img,
[class*="developer-card"] img {
    aspect-ratio: 4 / 3;
}

/* Detail pages: keep contact/advertiser actions available without obscuring content. */
@media (min-width: 992px) {
    [class*="advertiser-card"],
    [class*="contact-card"],
    [class*="seller-card"],
    [class*="agent-card"] {
        position: sticky;
        top: 92px;
        align-self: start;
    }
}

/* Responsive navigation: prevent overflow and preserve tap targets. */
header nav,
header [class*="nav"],
[class*="main-nav"] {
    min-width: 0;
}

header nav a,
header [class*="nav"] a,
[class*="main-nav"] a {
    min-height: 40px;
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.r78-empty-state {
    margin-block: 24px 48px;
    text-align: center;
}

.r78-empty-state h2 {
    margin-top: 0;
}

@media (max-width: 960px) {
    .r78-area-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .r78-page-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    header nav,
    header [class*="nav"],
    [class*="main-nav"] {
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
    }
}

@media (max-width: 640px) {
    .r78-page-shell,
    main > .container,
    main > [class*="container"] {
        width: min(100% - 22px, 1240px);
    }

    .r78-area-grid,
    .r78-area-links {
        grid-template-columns: 1fr;
    }

    .r78-area-card {
        min-height: 0;
    }

    .r78-primary-action,
    .r78-secondary-action {
        width: 100%;
    }

    [class*="property-card"],
    [class*="project-card"],
    [class*="developer-card"],
    [class*="agency-card"] {
        max-width: 100%;
    }
}
