/* =========================================================================
   Culture Compass page  (.cult-compass-page)

   Enqueued only on the Culture Compass page template (company-compass.php).
   Uses only design tokens from css/design-system.css. Light mode only,
   hairline borders, no shadows — warm-editorial system.
   ========================================================================= */

/* --- Page layout --------------------------------------------------------- */

.cult-compass-page {
    padding-top: var(--space-6);
    padding-bottom: var(--space-9);
}

.compass-intro {
    margin-bottom: var(--space-4);
}

.compass-intro h1 {
    margin-bottom: var(--space-2);
}

.compass-intro .text-lg {
    color: var(--color-text-muted);
    margin-bottom: 0;
}

/* --- Control row --------------------------------------------------------- */

.compass-controls {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.compass-copy-confirm {
    font-size: var(--text-sm);
    color: var(--color-success);
    font-weight: var(--weight-medium);
}

/* --- Radar stage --------------------------------------------------------- */

.compass-workspace {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-5);
}

#compass-stage {
    width: 100%;
    max-width: 440px;
}

/* Rings (background scale guides) */
.compass-ring {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 1;
}

/* Spoke guide lines */
.compass-spoke-line {
    stroke: var(--color-border-strong);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

/* Filled weighted area polygon */
.compass-polygon {
    fill: var(--color-accent-soft);
    fill-opacity: 0.7;
    stroke: var(--color-accent);
    stroke-width: 2;
}

/* Hub circle */
.compass-hub {
    fill: var(--color-accent);
}

/* Spoke labels */
.compass-spoke-label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: var(--weight-medium);
    fill: var(--color-text);
}

/* Draggable handles */
.compass-handle {
    fill: var(--color-surface);
    stroke: var(--color-accent);
    stroke-width: 2.5;
    cursor: grab;
    transition: fill var(--dur-fast) var(--ease);
}

.compass-handle:hover {
    fill: var(--color-accent-soft);
}

.compass-handle:active {
    cursor: grabbing;
}

/* Focus ring on handles — keyboard navigation */
.compass-handle:focus {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* -----------------------------------------------------------------------
   Dot axis (#compass-axis)
----------------------------------------------------------------------- */

.compass-axis-section {
    margin-bottom: var(--space-6);
}

.compass-axis-label {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--color-text-subtle);
    margin-bottom: var(--space-1);
    padding: 0 2px;
}

.compass-axis-label__mid {
    font-weight: var(--weight-medium);
    text-align: center;
}

#compass-axis {
    position: relative;
    height: 80px;
    background: var(--color-surface-sunken);
    border: var(--border-thin);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Left / right edge tick marks */
#compass-axis::before,
#compass-axis::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--color-border-strong);
}

#compass-axis::before {
    left: 0;
}

#compass-axis::after {
    right: 0;
}

/* Animated company dots */
.compass-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: var(--radius-pill);
    background: var(--color-accent);
    opacity: 0.65;
    border: 2px solid var(--color-surface);
    transform: translate(-50%, -50%);
    cursor: pointer;
    padding: 0;
    transition: left 0.35s var(--ease), top 0.35s var(--ease), opacity var(--dur) var(--ease);
}

.compass-dot:hover {
    opacity: 1;
    z-index: 2;
    transform: translate(-50%, -50%) scale(1.35);
}

.compass-dot:focus {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
    opacity: 1;
    z-index: 3;
}

.compass-dot--active {
    opacity: 1;
    background: var(--color-accent-hover, #164439);
    border-color: var(--color-accent);
    z-index: 4;
    transform: translate(-50%, -50%) scale(1.25);
}

/* -----------------------------------------------------------------------
   Breakdown detail panel (#compass-detail)
----------------------------------------------------------------------- */

.compass-detail {
    background: var(--color-surface);
    border: var(--border-thin);
    border-radius: var(--radius);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
}

.compass-detail__header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.compass-detail__logo {
    max-height: 48px;
    max-width: 96px;
    width: auto;
    flex-shrink: 0;
}

.compass-detail__meta {
    flex: 1 1 auto;
    min-width: 0;
}

.compass-detail__name {
    margin: 0 0 var(--space-1);
    font-size: var(--text-xl);
    line-height: var(--leading-snug);
}

.compass-detail__name a {
    color: var(--color-text);
    text-decoration: none;
}

.compass-detail__name a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.compass-detail__type {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-1);
}

.compass-detail__match {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-accent);
}

.compass-detail__badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.compass-detail__callout {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin: 0 0 var(--space-4);
    line-height: var(--leading-normal);
}

.compass-detail__close {
    margin-top: var(--space-2);
}

/* -----------------------------------------------------------------------
   Top matches grid (#compass-matches)
----------------------------------------------------------------------- */

.compass-matches-section {
    margin-top: var(--space-2);
}

.compass-matches-heading {
    font-size: var(--text-xl);
    margin: 0 0 var(--space-4);
}

.compass-matches-empty {
    font-style: italic;
    padding: var(--space-4) 0;
}

.compass-matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-4);
}

/* Individual snapshot card */
.compass-card {
    background: var(--color-surface);
    border: var(--border-thin);
    border-radius: var(--radius);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.compass-card__header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.compass-card__logo {
    max-height: 36px;
    max-width: 72px;
    width: auto;
    flex-shrink: 0;
}

.compass-card__logo--empty {
    display: block;
    width: 36px;
    height: 36px;
    background: var(--color-surface-sunken);
    border-radius: var(--radius-sm);
}

.compass-card__info {
    flex: 1 1 auto;
    min-width: 0;
}

.compass-card__name {
    display: block;
    font-weight: var(--weight-semibold);
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: var(--space-1);
}

.compass-card__name:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.compass-card__type {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.compass-card__match {
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--color-accent);
    white-space: nowrap;
    flex-shrink: 0;
}

.compass-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

/* Mini compass rose container within the card */
.compass-card__rose {
    width: 80px;
    height: 80px;
    align-self: center;
}

/* -----------------------------------------------------------------------
   Responsive adjustments
----------------------------------------------------------------------- */

@media (max-width: 768px) {
    .cult-compass-page {
        padding-top: var(--space-4);
        padding-bottom: var(--space-7);
    }

    .compass-intro h1 {
        font-size: var(--text-2xl);
        margin-top: var(--space-2);
    }

    .compass-intro .text-lg {
        font-size: var(--text-sm);
    }

    #compass-stage {
        max-width: 320px;
    }

    .compass-spoke-label {
        font-size: 9px;
    }

    #compass-axis {
        height: 64px;
    }

    .compass-matches-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }

    .compass-detail {
        padding: var(--space-4);
    }

    .compass-card {
        padding: var(--space-3);
    }
}

@media (max-width: 480px) {
    .compass-matches-grid {
        grid-template-columns: 1fr;
    }
}
