/* ==========================================================================
   styles.css – Main stylesheet for A Skeptic Substack news aggregator
   Overall approach: clean, single-column, centered, very readable,
   mobile-first friendly, soft & calm color palette.
   
   Content types are fully separated:
   - .youtube-embed     → YouTube video embeds
   - .substack-embed    → Substack post embeds (official lightweight embed)
   - .proprietary-post  → Your custom Facebook-style link preview cards
   
   Styles are replicated per type for maximum tweak independence.
   Substack section significantly improved to reduce squishing.
   ========================================================================== */

/* ------------------------------------------------
   1. Global reset
   ------------------------------------------------ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ------------------------------------------------
   2. List styling – indentation for <ul>/<ol>
   ------------------------------------------------ */
ul {
    margin-left: 0;
    padding-left: 40px;
}

ul ul {
    margin-left: 20px;
    padding-left: 20px;
}

ul ul ul {
    margin-left: 40px;
    padding-left: 40px;
}

/* ------------------------------------------------
   3. Body – page foundation + flex for footer
   ------------------------------------------------ */
body {
    background-color: #f5f7fa;
    color: #2d3748;
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ------------------------------------------------
   4. Main content container
   ------------------------------------------------ */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

/* ------------------------------------------------
   5. Page heading / title area
   ------------------------------------------------ */
.page-heading {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 1rem 0;
}

.page-heading h1 {
    font-size: 2.4rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    line-height: 1.2;
}

.page-heading .update-time {
    font-size: 1.1rem;
    color: #718096;
    margin-top: 0.5rem;
    font-weight: 400;
}

/* ------------------------------------------------
   6. YouTube embed blocks
   ------------------------------------------------ */
.youtube-embed {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.youtube-embed iframe {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.youtube-embed h2,
.youtube-embed h3 {
    margin-bottom: 1rem;
    color: #4a5568;
    max-width: 70ch;
    margin-left: auto;
    margin-right: auto;
}

.youtube-embed p,
.youtube-embed li {
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}

/* ------------------------------------------------
   7. Substack embed blocks – improved to prevent squishing
   ------------------------------------------------ */
.substack-embed {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    /* Core anti-squish measures */
    min-width: 320px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.substack-embed .substack-post-embed {
    width: 100% !important;
    min-height: 180px;
    padding: 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.substack-embed .substack-post-embed img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
    object-fit: cover;
}

.substack-embed .substack-post-embed p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    line-height: 1.5;
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}

.substack-embed .substack-post-embed a[data-post-link] {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    background-color: #4c51bf;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.substack-embed .substack-post-embed a[data-post-link]:hover {
    background-color: #5a67d8;
}

.substack-embed h2,
.substack-embed h3 {
    margin-bottom: 1rem;
    color: #4a5568;
    max-width: 70ch;
    margin-left: auto;
    margin-right: auto;
}

.substack-embed p,
.substack-embed li {
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}

/* ------------------------------------------------
   8. Proprietary posts (Facebook-style cards)
   ------------------------------------------------ */
.proprietary-post {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.proprietary-post img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: block;
}

.proprietary-post h2,
.proprietary-post h3 {
    margin-bottom: 1rem;
    color: #4a5568;
    max-width: 70ch;
    margin-left: auto;
    margin-right: auto;
}

.proprietary-post p,
.proprietary-post li {
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}

/* ------------------------------------------------
   9. Optional full-width sections
   ------------------------------------------------ */
.full-width {
    background-color: #f0f4ff;
    padding: 2.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
}

/* ------------------------------------------------
   10. Footer
   ------------------------------------------------ */
.footer {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem 1rem;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 1rem;
}

.footer a {
    color: #4c51bf;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer a:hover,
.footer a:focus {
    color: #5a67d8;
    text-decoration: underline;
}

.footer .copyright {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #94a3b8;
}

/* ------------------------------------------------
   11. Mobile adjustments
   ------------------------------------------------ */
@media screen and (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    .youtube-embed,
    .substack-embed,
    .proprietary-post {
        padding: 1.5rem;
    }
    
    .page-heading {
        margin-bottom: 2rem;
    }
    
    .footer {
        padding: 1.5rem 1rem;
        margin-top: 2.5rem;
    }

    .substack-embed {
        padding: 1rem;
        min-width: 100%;
    }
    
    .substack-embed .substack-post-embed {
        min-height: 140px;
    }
}


/* ------------------------------------------------
   12. Legacy - Proprietary posts (Facebook-style cards)
   ------------------------------------------------ */
.column {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.column img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: block;
}

.column h2,
.column h3 {
    margin-bottom: 1rem;
    color: #4a5568;
    max-width: 70ch;
    margin-left: auto;
    margin-right: auto;
}

.column p,
.column li {
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}
