/* ==========================================================================
   MYGC NOW - BLOG SYSTEM STYLESHEET (GLASSMORPHIC & WCAG 2.2 AA COMPLIANT)
   Aesthetic visual enhancements integrating seamlessly with Montserrat/Lato fonts.
   ========================================================================== */

/* --- 1. GLOBAL LAYOUTS & ACCESSIBILITY CONTRAST --- */
.page-blog {
    background: linear-gradient(135deg, #f4f6f4 0%, #e2ece3 50%, #f4f4f4 100%);
    background-attachment: fixed;
}

/* Ensure focus states are highly visible for keyboard tabbing (WCAG 2.2 AA) */
a:focus-visible, 
button:focus-visible, 
input:focus-visible, 
textarea:focus-visible, 
select:focus-visible {
    outline: 3px solid #349946 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9) !important;
}

/* --- 2. PUBLIC LISTING CARD GRID --- */
.blog-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 35px;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .blog-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .blog-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- 3. PREMIUM ACCESSIBLE BADGES & LABELS --- */
/* Categories styled with dark green text on light green background (7.3:1 - passes AAA) */
.blog-card-category {
    background-color: #e2f0d9;
    color: #1b5e20;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

/* Content Type Badges (All combinations exceed 4.5:1 minimum contrast ratio) */
.blog-card-type {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 700;
    display: inline-block;
}

/* Article: Dark blue on light blue (9.1:1 contrast) */
.badge-article {
    background-color: #e3f2fd;
    color: #0d47a1;
}

/* Video: Dark orange on light orange (4.8:1 contrast) */
.badge-video {
    background-color: #fff3e0;
    color: #c75100;
}

/* Podcast: Dark purple on light purple (7.7:1 contrast) */
.badge-podcast {
    background-color: #f3e5f5;
    color: #6a1b9a;
}

/* Photo: Dark brown on light brown/grey (9.4:1 contrast) */
.badge-photo {
    background-color: #efebe9;
    color: #4e342e;
}

/* --- 4. GLASSMORPHIC PUBLIC BLOG CARD --- */
.blog-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), 
                background-color 0.3s ease, 
                border-color 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.blog-card:hover {
    transform: translateY(-6px);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    border-color: rgba(255, 255, 255, 0.7);
}

.blog-card-image {
    width: 100%;
    height: 230px;
    overflow: hidden;
    background: #e2e8f0;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.04);
}

.blog-card-content {
    padding: 28px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.blog-card-title {
    font-size: 1.4em;
    margin: 0 0 12px 0;
    line-height: 1.35;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.blog-card-title a {
    color: var(--dark-grey);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-card-title a:hover {
    color: var(--primary-green);
}

/* Enforce uniform card layout via line clamping (max 3 lines of text) */
.blog-card-excerpt {
    color: #444;
    font-size: 0.95em;
    line-height: 1.6;
    margin: 0 0 24px 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 16px;
    font-size: 0.85em;
}

.blog-card-date {
    color: #666;
    font-weight: 500;
}

.blog-card-link {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s ease, color 0.2s ease;
}

.blog-card-link:hover {
    color: #246b31;
    transform: translateX(4px);
}

/* --- 5. RESPONSIVE AUDIO & VIDEO MEDIA PLAYERS --- */
.media-video-container {
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: 100%;
    display: block;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 4px solid var(--primary-green);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    margin: 0 auto;
}

.media-video-container iframe,
.media-video-container video,
.media-video-container .blog-native-video,
.media-video-container .blog-iframe-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    outline: none;
    border: 0;
}

.media-audio-container {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    text-align: center;
}

.blog-audio-player {
    width: 100%;
    max-width: 600px;
    outline: none;
    border-radius: 30px;
}

/* --- 6. GLASSMORPHIC DETAILS CARD LAYOUT --- */
.post-container-inner {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 30px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

@media (min-width: 768px) {
    .post-container-inner {
        padding: 50px;
    }
}

.post-content-body {
    font-size: 1.15em;
    line-height: 1.8;
    color: #2b2b2b;
    font-family: 'Lato', sans-serif;
}

/* Premium bottom CTA Block matching main home cards */
.cta-section {
    border-radius: 16px;
    margin-top: 50px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
}

/* --- 7. GLASSMORPHIC ADMIN DASHBOARD & CRUD STYLING --- */
.admin-table-wrapper {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    margin-top: 25px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.admin-blog-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    text-align: left;
}

.admin-blog-table th {
    padding: 16px 20px;
    background-color: rgba(247, 250, 252, 0.6);
    border-bottom: 2px solid rgba(226, 230, 240, 0.8);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9em;
    color: var(--dark-grey);
}

.admin-blog-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

.admin-blog-table tbody tr {
    transition: background-color 0.2s ease;
}

.admin-blog-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.admin-form-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.admin-form-card label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.9em;
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-grey);
}

.admin-form-card input[type="text"],
.admin-form-card input[type="url"],
.admin-form-card input[type="datetime-local"],
.admin-form-card textarea,
.admin-form-card select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #cbd5e0;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: 'Lato', sans-serif;
    font-size: 0.95em;
    color: var(--dark-grey);
    background-color: rgba(255, 255, 255, 0.7);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.admin-form-card input:focus,
.admin-form-card textarea:focus,
.admin-form-card select:focus {
    border-color: var(--primary-green);
    background-color: var(--white);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 153, 70, 0.15);
}

.btn-delete {
    background: none;
    border: none;
    color: #e02424;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: 1em;
    padding: 0;
    transition: color 0.2s;
}

.btn-delete:hover {
    color: #9b1c1c;
    text-decoration: underline;
}

.btn-edit:hover {
    text-decoration: underline;
}

/* Alert Boxes */
.alert-message, .alert-danger {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-family: 'Lato', sans-serif;
    font-size: 0.95em;
}

/* --- 8. POST DETAIL PAGE STYLING --- */
.post-header-section {
    padding: 40px 0;
    background: var(--white);
    border-bottom: 1px solid #eee;
}

.post-header-section .container {
    display: block;
    max-width: 800px;
    margin: 0 auto;
}

.post-meta {
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.post-title {
    font-size: 2.8em;
    margin: 0 0 15px 0;
    line-height: 1.2;
    color: var(--dark-grey);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.post-excerpt-detail {
    font-size: 1.2em;
    line-height: 1.5;
    color: #555;
    font-style: italic;
    border-left: 3px solid var(--primary-green);
    padding-left: 15px;
    margin: 20px 0 0 0;
}

.post-body-section {
    padding: 50px 0;
}

.post-body-section .container {
    display: block;
    max-width: 800px;
    margin: 0 auto;
}

.post-featured-image {
    margin-bottom: 30px;
    text-align: center;
}

.post-featured-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* --- 9. ADMIN LOGIN PAGE GLASSMORPHIC STYLES --- */
.admin-login-section {
    padding: 100px 0;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.admin-login-container {
    display: block;
    max-width: 450px;
    margin: 0 auto;
}

.admin-login-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-top: 5px solid var(--primary-green);
}
