/* =========================================
   1. GLOBAL RESET & VARIABLES
   ========================================= */
   :root {
    --primary-blue: #0056b3;
    --text-dark: #222;
    --bg-light: #fdfdfd;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.container {
    width: 95%;
    max-width: 1300px;
    margin: 0 auto;
}

/* =========================================
   2. TINYMCE IMAGE HANDLING (For Blog Posts)
   ========================================= */
/* Styling for images inside blog posts */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Align Left Logic */
.post-content img[style*="float: left"] {
    margin-right: 20px;
    margin-bottom: 10px;
    float: left;
}

/* Align Right Logic */
.post-content img[style*="float: right"] {
    margin-left: 20px;
    margin-bottom: 10px;
    float: right;
}

/* Clearfix */
.post-content::after {
    content: "";
    clear: both;
    display: table;
}

/* =========================================
   3. FULL POST VIEW STYLES (view-post.php)
   ========================================= */
.post-page-wrapper {
    background-color: #fdfdfd;
    padding-bottom: 60px;
}

.post-view-header {
    margin-bottom: 40px;
    text-align: left;
}

.category-pill {
    display: inline-block;
    background: #0056b3;
    color: white;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.post-full-content {
    font-size: 19px;
    line-height: 1.8;
    color: #374151;
}

.post-full-content p {
    margin-bottom: 25px;
}

/* Image Handling inside full posts */
.post-full-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    display: block;
}

/* Alignment Logic for Full Post */
.post-full-content img[style*="float: left"] {
    float: left;
    margin: 10px 30px 20px 0 !important;
    max-width: 45%;
}

.post-full-content img[style*="float: right"] {
    float: right;
    margin: 10px 0 20px 30px !important;
    max-width: 45%;
}

.post-full-content::after {
    content: "";
    clear: both;
    display: table;
}

.post-full-content h2, .post-full-content h3 {
    margin-top: 45px;
    margin-bottom: 20px;
    color: #111827;
    font-weight: 800;
}

.post-full-content blockquote {
    border-left: 5px solid #0056b3;
    padding-left: 20px;
    font-style: italic;
    color: #4b5563;
    margin: 30px 0;
    background: #f9fafb;
    padding: 15px 20px;
}

/* =========================================
   4. IMPORTANT RESOURCES SECTION (Footer Area)
   ========================================= */
.resource-grid {
    display: grid;
    /* Creates 4 columns on large screens */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.resource-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-color: #0056b3;
}

.res-icon {
    font-size: 32px;
    margin-bottom: 15px;
    background: #f0f7ff;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.resource-card h3 {
    color: #111827;
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 700;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 10px;
}

.resource-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-card ul li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 15px;
}

/* Custom Bullet Point */
.resource-card ul li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: #0056b3;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
}

.resource-card ul li a {
    text-decoration: none;
    color: #4b5563;
    font-size: 15px;
    transition: color 0.2s;
    font-weight: 500;
}

.resource-card ul li a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* =========================================
   5. UNIVERSAL GRID SYSTEM (For Latest Posts)
   ========================================= */

/* The Grid Container */
.universal-grid {
    display: grid;
    /* 3 Columns on Desktop, Auto-resize */
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

/* The Card */
.uni-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column; /* Stacks items vertically */
    height: 100%; /* Forces equal height in grid */
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.uni-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-color: #0056b3;
}

/* Top Section: Category & View Count */
.uni-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.uni-category {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 4px;
    color: white;
    /* Background color set by PHP */
}

.uni-views {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

/* Middle Section: Content */
.uni-card-body {
    flex-grow: 1; /* Pushes footer down if content is short */
    margin-bottom: 20px;
}

.uni-title {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.uni-subtitle {
    font-size: 13px;
    color: #0056b3;
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

/* 2-Line Limit Trick */
.uni-excerpt {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    
    /* CSS Line Clamp */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Show only 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bottom Section: Button */
.uni-card-footer {
    border-top: 1px solid #f3f4f6;
    padding-top: 15px;
}

.uni-link {
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.uni-card:hover .uni-link {
    color: #0056b3;
}

/* Responsive Mobile Fixes */
@media (max-width: 1099px) {
    .resource-grid {
        grid-template-columns: 1fr;
    }
    .universal-grid {
        grid-template-columns: 1fr;
    }
}