/* Acorn brand color scheme */
:root {
    /* Brand colors */
    --primary-color: #e8168a;        /* Acorn bright pink */
    --accent-orange: #fd9826;        /* Acorn orange accent */
    --accent-teal: #0d475b;          /* Acorn teal accent */
    
    /* Background colors */
    --background-main: #f8f9fa;      /* Very light gray */
    --background-card: #ffffff;      /* Pure white for cards */
    --background-accent: #f5f6f7;    /* Light gray accent */
    --background-content: #0d475b;   /* Blue content area */
    --background-header: #041217;    /* Nearly black with subtle blue tint for header/footer */
    
    /* Text colors */
    --text-primary: #000000;         /* Pure black */
    --text-secondary: #495057;       /* Medium gray */
    --text-tertiary: #6c757d;        /* Light gray */
    --text-white: #ffffff;           /* Pure white */
    --text-white-muted: rgba(255, 255, 255, 0.8); /* Muted white */
    
    /* Border colors */
    --border-light: #dee2e6;         /* Light border */
    --border-medium: #ced4da;        /* Medium border */
    
    /* Shadow colors */
    --shadow-light: rgba(0, 0, 0, 0.06);
    --shadow-medium: rgba(0, 0, 0, 0.12);
    
    /* Interactive states */
    --hover-transform: translateY(-4px);
    --transition-smooth: all 0.3s ease;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background-color: var(--background-header);
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 8px var(--shadow-medium);
}

.header__title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-white);
}

.header__subtitle {
    font-size: 1rem;
    color: var(--text-white-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Main content */
.main {
    flex: 1;
    padding: 3rem 0;
    background-color: var(--background-content);
}

/* Tips grid - Mobile first */
.tips-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start; /* This prevents cards from stretching to match the tallest */
}

/* Tablet */
@media (min-width: 768px) {
    .tips-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
    
    .header__title {
        font-size: 2.5rem;
    }
    
    .header__subtitle {
        font-size: 1.125rem;
    }
}

/* Desktop - max 3 columns */
@media (min-width: 1024px) {
    .tips-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}

/* Tip cards */
.tip-card {
    background: var(--background-card);
    border-radius: 12px;
    border: 2px solid var(--border-light);
    overflow: hidden;
    transition: var(--transition-smooth);
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow-light);
    position: relative;
    height: 320px; /* Fixed height for all collapsed cards */
    display: flex;
    flex-direction: column;
}

.tip-card--expanded {
    height: auto; /* Allow expanded cards to grow */
    min-height: 320px; /* But not smaller than collapsed height */
}

.tip-card:hover {
    transform: var(--hover-transform);
    box-shadow: 0 12px 32px var(--shadow-medium);
    border-color: var(--border-medium);
}

/* Visual indicators for story status */
.tip-card--has-stories {
    border-left: 4px solid var(--primary-color);
}

.tip-card--has-stories .tip-card__number {
    background-color: var(--primary-color);
    color: var(--text-white);
}

.tip-card--no-stories {
    border-left: 4px solid var(--accent-orange);
}

.tip-card--no-stories .tip-card__number {
    background-color: var(--background-accent);
    color: var(--accent-orange);
    border: 2px dashed var(--accent-orange);
}

.tip-card__header {
    padding: 1.5rem;
    position: relative;
    flex: 1; /* Allow header to expand and push actions to bottom */
}

.tip-card__actions {
    margin-top: auto; /* Push actions to bottom of card */
}

.tip-card__number {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--background-accent);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tip-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    padding-right: 2.5rem;
}

.tip-card__description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.tip-card__expand-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background-color: var(--background-accent);
    border: none;
    border-top: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tip-card__expand-btn:hover {
    background-color: var(--primary-color);
    color: var(--text-white);
}

.tip-card__expand-btn::after {
    content: '▼';
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.tip-card--expanded .tip-card__expand-btn::after {
    transform: rotate(180deg);
}

.tip-card--expanded .tip-card__expand-btn {
    background-color: var(--primary-color);
    color: var(--text-white);
}

.tip-card__stories {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.tip-card__story {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    background-color: var(--background-accent);
}

.tip-card__story:first-child {
    border-top: none;
}

.tip-card__story-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tip-card__story-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tip-card__tag {
    background-color: var(--background-main);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
}

.tip-card__tag:hover {
    background-color: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

/* Footer */
.footer {
    background-color: var(--background-header);
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

.footer__text {
    margin-bottom: 0.5rem;
    color: var(--text-white-muted);
    font-size: 0.9rem;
}

.footer__contribute {
    color: var(--text-white-muted);
    font-size: 0.9rem;
}

.footer__link {
    color: var(--accent-orange);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer__link:hover {
    color: var(--text-white);
    text-decoration: underline;
}

/* Loading state */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Responsive text sizes */
@media (min-width: 768px) {
    .tip-card__title {
        font-size: 1.25rem;
    }
    
    .tip-card__description {
        font-size: 1rem;
    }
}