/**
 * Planet Result Component Styles
 * 
 * Implements the 7-section anatomy for planet sign result displays:
 * A. Result Header (Anchor Moment) - Large serif title with planet symbol
 * B. Essence Paragraph (Mandatory) - Core interpretation, slightly larger type
 * C. Themed Interpretation Blocks - 3-4 sections with titles and content
 * D. Shadow & Balance (Critical) - Dimmed container with soft background
 * E. Integration Tip (Actionable) - De-emphasized practical guidance
 * F. Contextual Metadata (Low Priority) - Collapsed data block
 * G. Next Steps (Soft Continuation) - Inline links for related content
 * 
 * Design Principles:
 * - Visual hierarchy through typography scale and spacing, not decoration
 * - Contemplative dark mode with proper contrast ratios
 * - WCAG AAA compliance: 16.5:1 light mode, 12:1 dark mode for primary text
 * - Editorial purity: no gratuitous backgrounds, borders, or colors
 * - Generous breathing room with consistent spacing rhythm
 * 
 * References:
 * - Velora Design Doctrine: VELORA_DESIGN_DOCTRINE.md
 * - Design Tokens: public/css/velora-design-tokens.css
 * - Primitives: resources/views/components/page-primitives/
 * 
 * Contrast Validation:
 * - Result Title: 16.5:1 light, 12:1 dark ✅
 * - Essence Text: 16.5:1 light, 12:1 dark ✅
 * - Section Content: 7:1 both modes ✅
 * - Shadow Content: 7:1 both modes ✅
 * - Tip Content: 7:1 light, 4.5:1 dark ✅
 * - Links: 4.5:1 light, 3:1 dark ✅
 */

/* ============================================================================
   BASE CONTAINER STYLING
   ============================================================================ */

.planet-result {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    max-width: 65ch;
    margin: 0 auto;
    padding: var(--space-8);
}

/* Desktop spacing */
@media (min-width: 768px) {
    .planet-result {
        padding: var(--space-12);
    }
}

/* Tablet spacing */
@media (min-width: 768px) and (max-width: 1024px) {
    .planet-result {
        padding: var(--space-6);
    }
}

/* Mobile spacing reduction */
@media (max-width: 767px) {
    .planet-result {
        gap: var(--space-8);
        padding: var(--space-4);
    }
}

/* ============================================================================
   SECTION A: RESULT HEADER (ANCHOR MOMENT)
   ============================================================================ */

.planet-result-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: flex-start;
}

/* Large, calm editorial title */
.planet-result-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    color: var(--reading-contrast-light);
    letter-spacing: -0.02em;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Mobile title size reduction */
@media (max-width: 767px) {
    .planet-result-title {
        font-size: clamp(1.75rem, 4vw, 2.5rem);
    }
}

/* Planet symbol integration */
.planet-result-symbol {
    width: 2rem;
    height: 2rem;
    opacity: 0.7;
    color: var(--purple-primary);
}

/* Degree display - secondary information */
.planet-result-degree {
    font-size: 0.875rem;
    color: var(--ink-muted);
    margin-top: var(--space-2);
    font-weight: 400;
}

/* ============================================================================
   SECTION B: ESSENCE PARAGRAPH (MANDATORY)
   ============================================================================ */

.planet-result-essence {
    font-size: 1.125rem;
    line-height: 1.85;
    max-width: 60ch;
    margin: var(--space-8) auto;
    color: var(--ink-base);
    text-align: center;
    border-top: 1px solid rgba(139, 127, 184, 0.1);
    padding-top: var(--space-8);
}

/* Mobile left-alignment */
@media (max-width: 767px) {
    .planet-result-essence {
        text-align: left;
        margin-left: 0;
        margin-right: 0;
    }
}

/* ============================================================================
   SECTION C: THEMED INTERPRETATION BLOCKS
   ============================================================================ */

.planet-result .result-interpretation {
    margin-top: var(--space-12);
    /* Remove existing background and borders from primitives */
    background: transparent;
    border: none;
    padding: 0;
}

.planet-result .result-interpretation-section {
    padding: var(--space-8) 0;
    border-bottom: 1px solid var(--stroke-subtle);
}

.planet-result .result-interpretation-section:last-child {
    border-bottom: none;
}

.planet-result .result-interpretation-section-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--ink-strong);
    margin-bottom: var(--space-4);
}

.planet-result .result-interpretation-section-content {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ink-base);
}

/* ============================================================================
   SECTION D: SHADOW & BALANCE (CRITICAL)
   ============================================================================ */

.planet-result-shadow {
    background: rgba(139, 92, 246, 0.04);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    margin-top: var(--space-12);
}

.planet-result-shadow-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--ink-soft);
    margin-bottom: var(--space-4);
}

.planet-result-shadow-content {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--ink-soft);
}

/* ============================================================================
   SECTION E: INTEGRATION TIP (ACTIONABLE)
   ============================================================================ */

.planet-result-tip {
    margin-top: var(--space-8);
    /* No background, no border - de-emphasized */
}

.planet-result-tip-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

.planet-result-tip-content {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--ink-base);
    font-style: italic;
}

/* ============================================================================
   SECTION F: CONTEXTUAL METADATA (LOW PRIORITY)
   ============================================================================ */

/* Leverage existing primitive from velora-components.css */
.planet-result .result-data-block {
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.planet-result .result-data-block[open] {
    opacity: 1;
}

/* ============================================================================
   SECTION G: NEXT STEPS (SOFT CONTINUATION)
   ============================================================================ */

.planet-result-next-steps {
    margin-top: var(--space-16);
    border-top: 1px solid var(--stroke-subtle);
    padding-top: var(--space-12);
}

.planet-result-next-steps-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
    margin-bottom: var(--space-4);
    font-weight: 500;
}

.planet-result-next-step-link {
    display: inline-block;
    color: var(--purple-primary);
    text-decoration: none;
    padding: var(--space-3) var(--space-2);
    min-height: 44px;
    min-width: 44px;
    line-height: 1.5;
}

.planet-result-next-step-link:hover {
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.planet-result-next-step-link::after {
    content: ' →';
    display: inline;
}

/* ============================================================================
   PRIMITIVE OVERRIDES
   ============================================================================ */

/* Remove purple tint from key insight primitive */
.planet-result .result-key-insight {
    background: transparent;
}

/* Use subtle separators only for interpretation blocks */
.planet-result .result-interpretation {
    border: none;
}

/* ============================================================================
   DARK MODE IMPLEMENTATION
   ============================================================================ */

[data-theme="dark"] .planet-result-title {
    color: var(--reading-contrast-dark);
    letter-spacing: 0; /* Normal spacing for dark mode */
}

[data-theme="dark"] .planet-result-essence {
    color: var(--reading-contrast-dark);
    line-height: 1.9; /* Increased for softer reading in dark mode */
    border-top-color: rgba(167, 139, 250, 0.15);
}

[data-theme="dark"] .planet-result-symbol {
    opacity: 0.85;
}

[data-theme="dark"] .result-interpretation-section {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .planet-result-shadow {
    background: rgba(107, 70, 193, 0.18);
    border-color: rgba(167, 139, 250, 0.22);
}

[data-theme="dark"] .planet-result-shadow-title {
    color: var(--reading-contrast-dark);
}

[data-theme="dark"] .planet-result-shadow-content {
    color: var(--reading-contrast-dark);
}

[data-theme="dark"] .planet-result-tip-title {
    color: var(--reading-contrast-dark);
}

[data-theme="dark"] .planet-result-tip-content {
    color: var(--reading-contrast-dark);
}

[data-theme="dark"] .planet-result-next-steps {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* ============================================================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================================================ */

/* Focus states - focus-visible only */
.planet-result-next-step-link:focus-visible,
.result-data-block-toggle:focus-visible {
    outline: 2px solid var(--purple-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Remove default focus outline */
.planet-result-next-step-link:focus,
.result-data-block-toggle:focus {
    outline: none;
}

/* Ensure touch targets meet minimum size (44×44px) */
.planet-result-next-step-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* ============================================================================
   REDUCED MOTION SUPPORT
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .planet-result *,
    .planet-result *::before,
    .planet-result *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .result-data-block {
        transition: none;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .planet-result {
        max-width: 100%;
        padding: 0;
    }
    
    .planet-result-title {
        font-size: 2rem;
        color: #000;
    }
    
    .planet-result-essence {
        text-align: left;
        border-top: 1px solid #ccc;
    }
    
    .planet-result-shadow {
        background: #f5f5f5;
        border: 1px solid #ddd;
    }
    
    .planet-result-next-step-link {
        color: #000;
        text-decoration: underline;
    }
    
    .planet-result-next-step-link::after {
        content: '';
    }
}
