/* ============================================================
   Phase 6 Plan 07 — detail-layout.css
   3-column detail surface + activity timeline
   Loaded AFTER shell.css (position 15 in _HeadAssets.cshtml).
   No hex literals — all colors via hsl(var(--token)).
   No force declarations — specificity + load order do the work.
   Per RESTRUCTURE-07. Reused by 06-08, 06-09.
   ============================================================ */


/* ============================================================
   1. Detail surface wrapper
   ============================================================ */

.secuura-detail-surface {
    max-width: 1440px;
    margin: 0 auto;
}


/* ============================================================
   2. Detail surface header
   ============================================================ */

.secuura-detail-surface-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 0 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid hsl(var(--border));
}

.secuura-detail-surface-header h1 {
    flex-grow: 1;
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0;
    color: hsl(var(--foreground));
    line-height: 1.25;
}

.secuura-detail-surface-header-meta {
    flex-basis: 100%;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    margin-top: -4px;
}

.secuura-detail-surface-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.secuura-detail-surface-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    font-size: 1.125rem;
    flex-shrink: 0;
}


/* ============================================================
   3. 3-column grid
   Desktop ≥1280px: 280px | 1fr | 280px
   ============================================================ */

.secuura-detail-surface-grid {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 24px;
    align-items: start;
}

.secuura-detail-surface-left,
.secuura-detail-surface-right {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 16px;
}

.secuura-detail-surface-middle {
    min-width: 0; /* prevent grid blowout from long content */
}

/* Section headings inside the middle column */
.secuura-detail-surface-middle h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin: 0 0 12px;
}

.secuura-detail-surface-middle h3 + * {
    /* Ensure spacing is consistent after heading */
}

/* Card-style blocks inside the middle column */
.secuura-detail-surface-middle-card {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.secuura-detail-surface-middle-card:last-child {
    margin-bottom: 0;
}

.secuura-detail-surface-middle-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 12px 16px;
    background-color: hsl(var(--muted) / 0.4);
    border-bottom: 1px solid hsl(var(--border));
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--card-foreground));
}

.secuura-detail-surface-middle-card-header h3 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.secuura-detail-surface-middle-card-body {
    padding: 0;
}

/* Section headings inside the left/right rails */
.secuura-detail-surface-left h3,
.secuura-detail-surface-right h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    margin: 0 0 12px;
}


/* ============================================================
   4. PDF preview placeholder (left rail)
   Icon-only placeholder until a real preview backend exists.
   ============================================================ */

.secuura-detail-preview-placeholder {
    background-color: hsl(var(--muted));
    aspect-ratio: 8.5 / 11;
    border-radius: calc(var(--radius) - 2px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--muted-foreground));
    margin-bottom: 16px;
    font-size: 2rem;
}


/* ============================================================
   5. Activity timeline (right rail + shared across surfaces)
   ============================================================ */

.secuura-activity-timeline-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 16px;
    color: hsl(var(--muted-foreground));
}

.secuura-activity-timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Vertical rule runs through each event via left border */
.secuura-activity-event {
    position: relative;
    padding: 0 0 16px 24px;
    border-left: 2px solid hsl(var(--border));
    margin-left: 5px;
}

.secuura-activity-event:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

/* Dot anchored to the vertical rule */
.secuura-activity-event-dot {
    position: absolute;
    left: -7px;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: hsl(var(--muted-foreground));
    border: 2px solid hsl(var(--card));
    flex-shrink: 0;
}

/* Event-type color coding — dot color is the primary signal;
   border-left inherits the default --border color for all types */
.secuura-activity-event--primary   .secuura-activity-event-dot { background-color: hsl(var(--primary)); }
.secuura-activity-event--secondary .secuura-activity-event-dot { background-color: hsl(var(--secondary)); }
.secuura-activity-event--accent    .secuura-activity-event-dot { background-color: hsl(var(--accent)); }
.secuura-activity-event--destructive .secuura-activity-event-dot { background-color: hsl(var(--destructive)); }

.secuura-activity-event-body {
    /* Stacks meta + description */
}

.secuura-activity-event-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 2px;
}

.secuura-activity-event-meta time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-family: var(--font-mono);
}

.secuura-activity-event-actor {
    font-weight: 500;
    color: hsl(var(--foreground));
}

.secuura-activity-event-description {
    font-size: 0.8125rem;
    color: hsl(var(--foreground));
    line-height: 1.4;
}

.secuura-activity-timeline-full-link {
    display: inline-block;
    margin-top: 16px;
    font-size: 0.75rem;
    color: hsl(var(--primary));
    text-decoration: none;
}

.secuura-activity-timeline-full-link:hover {
    text-decoration: underline;
    color: hsl(var(--primary));
}


/* ============================================================
   6. Responsive breakpoints
   ============================================================ */

/* Tablet (768–1279px): 3-col → 2-col
   Left rail moves above tables (full-width);
   middle + right stack side-by-side */
@media (max-width: 1279.98px) {
    .secuura-detail-surface-grid {
        grid-template-columns: 1fr 280px;
        grid-template-rows: auto auto;
    }

    .secuura-detail-surface-left {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .secuura-detail-surface-middle {
        grid-column: 1;
        grid-row: 2;
    }

    .secuura-detail-surface-right {
        grid-column: 2;
        grid-row: 2;
    }
}

/* Phone (<768px): fully stacked — left → middle → right */
@media (max-width: 767.98px) {
    .secuura-detail-surface-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .secuura-detail-surface-left,
    .secuura-detail-surface-middle,
    .secuura-detail-surface-right {
        grid-column: 1;
        grid-row: auto;
    }

    .secuura-detail-surface-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    /* Phase 11 touch-target additions — appended by 06-11 */
    .secuura-detail-surface-header h1 { font-size: 1.25rem; }
    .secuura-detail-surface-header-actions .btn { flex-grow: 1; min-height: 44px; }
    .secuura-detail-surface-grid { gap: 12px; }
}


/* ============================================================
   7. Reduced motion guard
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    /* No transitions currently in this file — guard reserved
       for future hover/expand effects on the detail surface. */
}
