/* --- Single Violet Glassy Card (Two-Piece Stitch) --- */

/* 1. The Top Half: Page Title 
   Using `#main-content >` ensures this ONLY applies to dedicated pages (Courses, About) 
   and ignores the index page sections! */
#main-content > h1.title-container {
    position: relative;
    z-index: 1;
    
    /* FIX: Keeps padding inside the 100% width so it doesn't overhang */
    box-sizing: border-box !important;
    width: 100%;
    
    /* FORCE CENTERING */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    
    /* Remove default borders and adjust spacing */
    border-bottom: none !important;
    margin-top: 2rem;
    margin-bottom: 0 !important;
    padding: 3rem 2rem 1.5rem;
    
    /* Top border radius only */
    border-radius: 24px 24px 0 0;
    
    /* The Glass Effect with Violet Border */
    background: rgba(250, 250, 250, var(--glassy-base-opacity)); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--bcg-grad-violette-soft);
    border-bottom: none; /* Opens the bottom to connect with the content */
}

/* 2. The Bottom Half: Main Text Content */
main > #page-content {
    position: relative;
    z-index: 2; /* Sits slightly above the title to hide any internal shadow overlap */
    
    /* FIX: Ensures the width perfectly matches the title block above it */
    box-sizing: border-box !important;
    width: 100%;
    
    /* Crush the margins so it perfectly touches the title above it */
    margin-top: 0 !important; 
    margin-bottom: 4rem;
    padding: 1.5rem 3.5rem 3.5rem; /* Generous internal padding for reading */
    
    /* Bottom border radius only */
    border-radius: 0 0 24px 24px;
    
    /* The Glass Effect with Violet Border */
    background: rgba(250, 250, 250, var(--glassy-base-opacity)); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--bcg-grad-violette-soft);
    border-top: none; /* Opens the top to connect with the title */
    
    /* The main shadow dropping off the bottom of the complete card */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
    
    /* Typography formatting for longer reading */
    color: var(--text-color);
    font-weight: 350;
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Ensure any old pseudo-elements from previous ribbon attempts are totally gone */
#main-content > h1.title-container::before,
main > #page-content::before {
    content: none !important;
    display: none !important;
}

/* Make links inside the page content pop */
main > #page-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

main > #page-content a:hover {
    opacity: 0.8;
    color: white;
}

/* Mobile Responsiveness for the Card */
@media only screen and (max-width: 800px) {
    #main-content > h1.title-container {
        padding: 2rem 1rem 1rem;
        border-radius: 16px 16px 0 0;
    }
    
    main > #page-content {
        padding: 1rem 1.5rem 2rem;
        border-radius: 0 0 16px 16px;
    }
}


/* --- Single Violet Glassy Card for Articles/Posts --- */

main > article.h-entry {
    position: relative;
    z-index: 1;
    
    box-sizing: border-box !important;
    width: 100%;
    
    /* Card Spacing and Padding */
    margin-top: 2rem;
    margin-bottom: 4rem;
    padding: 3.5rem 3.5rem;
    
    /* Fully rounded corners for the single card */
    border-radius: 24px;
    
    /* The Glass Effect with Violet Border */
    background: rgba(250, 250, 250, var(--glassy-base-opacity)); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--bcg-grad-violette-soft);
    
    /* The main shadow */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
}

/* 1. Center the article title inside the card */
article.h-entry h1.article-title {
    text-align: center !important;
    margin-top: 0;
    margin-bottom: 1rem;
}

/* 2. Center the metadata (date, reading time, tags) under the title */
article.h-entry ul.meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center !important; /* Pushes the flex items to the middle */
    margin-bottom: 3rem; /* Breathing room before the text starts */
    padding-left: 0;
}

/* 3. Typography formatting for the main text */
article.h-entry section.e-content {
    color: var(--text-color);
    font-weight: 350;
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Make links inside the article content pop */
article.h-entry section.e-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

article.h-entry section.e-content a:hover {
    opacity: 0.8;
    color: white;
}

/* Mobile Responsiveness for Articles */
@media only screen and (max-width: 800px) {
    main > article.h-entry {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }
}