/* ============================================
    PATTERNS.CSS - Component-Based Architecture
   ============================================ */

/* ============================================
    SECTION LAYOUTS
   ============================================ */

/* Base section with consistent spacing */
.section {
    margin: 5rem 0;
}

.section--compact {
    margin: 3rem 0;
}

.section--wide {
    margin: 6rem 0;
}

/* Full-width sections that break out of container */
.section--fullwidth {
    margin-left: -12.5%;
    margin-right: -12.5%;
    padding: 4rem 3rem;
}

/* Sections with backgrounds */
.section--highlight {
    background: var(--background-alt);
    padding: 3rem;
}

.section--bordered {
    border: 1px solid var(--border-light);
    padding: 2.5rem;
}

.section--accent-border {
    border-left: 4px solid var(--accent);
}

/* ============================================
   HERO COMPONENTS
   ============================================ */

.hero {
    margin: 3rem 0 4rem;
    text-align: center;
}

.hero__title {
    font-size: 3.2rem;
    font-style: normal;
    margin-bottom: 1rem;
}

.hero__subtitle {
    font-size: 1.6rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero__intro {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.hero__intro p {
    font-size: 1.5rem;
    line-height: 2.2rem;
    text-align: left;
}

.hero__stats {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    font-weight: 800;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid {
    display: grid;
    align-items: stretch;
    gap: 2rem;
}

.grid--auto {
    grid-template-columns: repeat(auto-fit, minmax(var(--grid-min, 250px), 1fr));
}

.grid--2col {
    grid-template-columns: repeat(2, 1fr);
}

.grid--3col {
    grid-template-columns: repeat(3, 1fr);
}

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

.grid--5col {
    grid-template-columns: repeat(5, 1fr);
}

/* Grid modifiers */
.grid--narrow-gap {
    gap: 1rem;
}

.grid--wide-gap {
    gap: 3rem;
}

/* Specific grid variations */
.grid--members {
    --grid-min: 220px;
}

.grid--traits {
    --grid-min: 250px;
}

.grid--cta {
    --grid-min: 250px;
}

/* ============================================
   CARD COMPONENTS
   ============================================ */

.card {
    background: var(--background);
    border: 1px solid var(--border-light);
    padding: 2rem;
    transition: all 0.3s ease;
     height: 100%; 
}

.card--clickable {
    cursor: pointer;
}

.card--clickable:hover {
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

/* Card variations */
.card--centered {
    text-align: center;
}

.card--compact {
    padding: 1.5rem;
}

.card--spacious {
    padding: 2.5rem;
}

.card--highlight {
    background: var(--background-alt);
}

.card--bordered-medium {
    border-color: var(--border-medium);
}

/* Card content elements */
.card__number {
    font-size: 3rem;
    font-weight: 400;
    line-height: 1;
    margin-bottom: 1rem;
    color: var(--accent);
}

.card__title {
    font-size: 1.4rem;
    margin: 0 0 0.5rem;
    font-style: normal;
}

.card__meta {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.card__description {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.card__link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ============================================
   PREVIEW COMPONENTS (Author previews)
   ============================================ */

.preview {
    margin: 3rem 0;
    padding: 3rem;
    background: var(--background);
    border: 1px solid var(--border-medium);
}

.preview--with-image {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.preview__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.preview__title {
    font-size: 2rem;
    margin: 0;
    font-style: normal;
}

.preview__stats {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview__image {
    width: 100%;
    height: auto;
    border: 1px solid var(--border-light);
    filter: sepia(10%) contrast(1.05);
}

.preview__highlights h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.preview__highlights ul {
    list-style: none;
    padding: 0;
}

.preview__highlights li {
    padding: 0.5rem 0 0.5rem 2rem;
    position: relative;
}

.preview__highlights li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* ============================================
   STAT COMPONENTS
   ============================================ */

.stat {
    text-align: center;
}

.stat__number {
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat__label {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.stat--inline {
    display: inline-block;
    margin: 0 1rem;
}

/* ============================================
   VISUALIZATION CONTAINERS
   ============================================ */

.viz {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--background-alt);
    border: 1px solid var(--border-light);
    min-height: 300px;
    position: relative;
}

.viz--no-bg {
    margin: 1rem 0;
    padding: 1rem;
    min-height: 300px;
    position: relative;
}

.viz--tall {
    min-height: 400px;
    max-height: 700px;
}

.viz--compact {
    min-height: 200px;
}

/* ============================================
   METHODOLOGY/NOTES SECTIONS
   ============================================ */

.notes {
    margin: 6rem 0;
    padding: 4rem 3rem;
    background: var(--background-alt);
    border-top: 2px solid var(--border-light);
    border-bottom: 2px solid var(--border-light);
}

.notes--fullwidth {
    margin-left: -12.5%;
    margin-right: -12.5%;
}

.notes__title {
    margin-top: 0;
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.notes__content {
    max-width: 800px;
    margin: 0 auto;
}

.notes__subtitle {
    font-size: 1.4rem;
    margin: 2.5rem 0 1rem;
    font-style: italic;
    color: var(--text-primary);
}

/* ============================================
   CTA (Call to Action) SECTIONS
   ============================================ */

.cta {
    margin: 6rem 0 0;
    padding-top: 4rem;
    background: var(--background);
    text-align: center;
}

.cta__title {
    font-size: 2.2rem;
    margin-bottom: 3rem;
}

.cta__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem auto 0;
}

.cta__grid h3 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
    font-style: normal;
}

.cta__grid p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-italic { font-style: italic; }

/* Spacing utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

/* Content containers */
.content-narrow {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.content-medium {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.content-wide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 760px) {
    /* Adjust grids to single column */
    .grid--2col,
    .grid--3col,
    .grid--4col,
    .grid--5col {
        grid-template-columns: 1fr;
    }
    
    /* Adjust preview layout */
    .preview--with-image {
        grid-template-columns: 1fr;
    }
    
    .preview__image {
        max-width: 150px;
        margin: 0 auto 1.5rem;
        display: block;
    }
    
    /* Adjust hero sizing */
    .hero__title {
        font-size: 2.4rem;
    }
    
    .hero__intro p {
        font-size: 1.3rem;
    }
    
    /* Adjust fullwidth sections */
    .section--fullwidth,
    .notes--fullwidth {
        margin-left: -5%;
        margin-right: -5%;
        padding: 3rem 1.5rem;
    }
    
    /* Stack preview header */
    .preview__header {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ============================================
   LEGACY SUPPORT / MIGRATION HELPERS
   Keep these temporarily during migration
   ============================================ */

/* During migration, you can either:
   1. Use multiple classes in HTML: class="card member-card"
   2. Or duplicate the styles temporarily (shown below)
   3. Or use CSS custom properties to share values
*/

/* Example migration approach - duplicate key styles */
.pattern-hero {
    /* Same as .hero */
    margin: 3rem 0 4rem;
    text-align: center;
}

.pattern-title {
    /* Same as .hero__title */
    font-size: 3.2rem;
    font-style: normal;
    margin-bottom: 1rem;
}

/* Or better: just add both classes to HTML elements during migration:
   <div class="hero pattern-hero"> for backwards compatibility */