:root {
    --subject-color: #655484;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--color-bg-light);
    border-bottom: 1px solid var(--color-card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--color-primary);
}

.back-arrow {
    font-size: 1.2rem;
}

.print-all-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--subject-color);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.print-all-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(124, 141, 181, 0.25);
}

.print-icon {
    font-size: 1.1rem;
}

.subject-hero {
    padding: 60px 20px 50px;
    text-align: center;
    background: linear-gradient(180deg, var(--color-bg-light) 0%, var(--color-bg) 100%);
    position: relative;
    overflow: hidden;
}

.subject-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse, #e1daf166 0%, transparent 70%);
    pointer-events: none;
}

.subject-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
}

.subject-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--subject-color);
    margin-bottom: 8px;
}

.subject-hero .tgia-hero-note {
    max-width: 42rem;
    margin: 1.25rem auto 0;
    text-align: left;
}

.ideas-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}

.idea-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: fadeInUp 0.6s ease backwards;
}

.idea-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #f5f0e8;
    border-bottom: 1px solid var(--color-card-border);
}

.idea-header h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--subject-color);
    margin: 0;
}

.print-single-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-card-border);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.print-single-btn:hover {
    background: var(--subject-color);
    border-color: var(--subject-color);
}

.idea-content {
    padding: 24px;
}

.idea-content h1 {
    display: none;
}

.idea-content h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text);
    margin-top: 24px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-card-border);
}

.idea-content h2:first-of-type {
    margin-top: 0;
}

.idea-content h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 20px;
    margin-bottom: 10px;
}

.idea-content p {
    color: var(--color-text);
    margin-bottom: 12px;
    line-height: 1.7;
}

.idea-content ul,
.idea-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.idea-content li {
    color: var(--color-text);
    margin-bottom: 8px;
    line-height: 1.6;
}

.idea-content li::marker {
    color: var(--subject-color);
}

.idea-content strong {
    color: var(--subject-color);
    font-weight: 600;
}

.idea-content em {
    color: var(--color-text-muted);
}

.idea-content hr {
    border: none;
    height: 1px;
    background: var(--color-card-border);
    margin: 24px 0;
}

.print-container {
    display: none;
}

.print-section.hidden {
    display: none !important;
}

@media print {
    .background-pattern,
    .top-nav,
    .subject-hero,
    .ideas-list,
    footer,
    .no-print {
        display: none !important;
    }
    
    .print-container {
        display: block !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .print-header {
        text-align: center;
        padding-bottom: 20px;
        margin-bottom: 30px;
        border-bottom: 2px solid #333;
    }
    
    .print-header h1 {
        font-size: 24pt;
        color: black;
        margin-bottom: 8px;
    }
    
    .print-header p {
        font-size: 12pt;
        color: #666;
    }
    
    .print-section {
        page-break-inside: avoid;
        margin-bottom: 40px;
        padding-bottom: 20px;
        border-bottom: 1px solid #ccc;
    }
    
    .print-section:last-child {
        border-bottom: none;
    }
    
    .print-section h1 {
        font-size: 18pt;
        color: black;
        margin-bottom: 16px;
        padding-bottom: 8px;
        border-bottom: 1px solid #999;
    }
    
    .print-section h2 {
        font-size: 14pt;
        color: black;
        margin-top: 20px;
        margin-bottom: 10px;
    }
    
    .print-section h3 {
        font-size: 12pt;
        color: #333;
        margin-top: 16px;
        margin-bottom: 8px;
    }
    
    .print-section p,
    .print-section li {
        color: black;
        font-size: 11pt;
    }
    
    .print-section strong {
        color: black;
        font-weight: bold;
    }
    
    .print-section ul,
    .print-section ol {
        margin-left: 20px;
    }
    
    @page {
        margin: 2cm;
        size: A4;
    }
}

@media (max-width: 768px) {
    .top-nav {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .subject-hero {
        padding: 40px 16px;
    }
    
    .subject-icon {
        font-size: 3rem;
    }
    
    .idea-header {
        padding: 16px;
    }
    
    .idea-header h2 {
        font-size: 1.2rem;
    }
    
    .idea-content {
        padding: 16px;
    }
}

/* Reading pages keep the same warm palette with quieter surfaces. */
@media screen {
    .top-nav { background: #fffefbf2; border-color: #e8dfd6; }
    .back-link { color: #655484; padding: 8px 0; }
    .print-all-btn { min-height: 44px; border-radius: 14px; }
    .print-all-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
    .subject-hero { background: linear-gradient(180deg, #f6f0fa, #fff9f2); padding-top: 48px; }
    .subject-icon { width: 100px; height: 100px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 32px; background: #fffefb; border: 1px solid #e8dfd6; font-size: 3.2rem; position: relative; }
    .subject-hero h1 { position: relative; letter-spacing: -.025em; }
    .subject-hero .tgia-hero-note { background: #fffefb; border-color: #c9c2e8; }
    .idea-card { box-shadow: 0 4px 18px rgb(67 44 30 / 3%); }
    .idea-header { gap: 20px; background: #f5f0e8; align-items: flex-start; }
    .idea-header h2 { line-height: 1.4; }
    .print-single-btn { flex-shrink: 0; width: 44px; height: 44px; background: #fffefb; border-radius: 14px; }
    .print-single-btn:hover { background: #e7dff3; border-color: #c9c2e8; }
    .idea-content { padding: 30px; overflow-wrap: anywhere; }
    .idea-content a { color: #59436f; text-underline-offset: 3px; }
    .idea-content blockquote { background: #eff7f1; border-left: 3px solid #b7d9c5; padding: 14px 18px; margin: 20px 0; border-radius: 0 12px 12px 0; }
    .idea-content pre { background: #f5f0e8; padding: 18px; border-radius: 12px; overflow-x: auto; margin-bottom: 16px; }
    .idea-content code { font-size: .9em; }
    .idea-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin-bottom: 16px; }
    .idea-content th, .idea-content td { border: 1px solid #e8dfd6; padding: 8px 12px; }
}
@media screen and (max-width: 640px) {
    .top-nav { flex-direction: row; gap: 12px; padding: 12px 16px; }
    .back-link { font-size: .9rem; }
    .print-all-btn { padding: 10px 12px; font-size: .88rem; flex-shrink: 0; }
    .print-icon { display: none; }
    .subject-icon { width: 80px; height: 80px; font-size: 2.6rem; border-radius: 26px; }
    .idea-header { padding: 20px; gap: 12px; }
    .idea-content { padding: 22px 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .print-all-btn:hover { transform: none; }
}
