/* ==========================================================================
   GMM.ie Blog Section - Scoped Stylesheet
   All classes are prefixed with .gmm-blog-* to prevent global CSS leaks.
   ========================================================================== */

/* Variables / Brand Colors */
:root {
    --gmm-brand-green: #467C45;
    --gmm-brand-green-dark: #376236;
    --gmm-brand-green-light: rgba(70, 124, 69, 0.1);
    --gmm-text-dark: #2d3748;
    --gmm-text-muted: #718096;
    --gmm-border-color: #e2e8f0;
    --gmm-bg-light: #f7fafc;
    --gmm-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --gmm-card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 1. Blog General & Containers */
.gmm-blog-wrapper {
    color: var(--gmm-text-dark);
    font-family: inherit;
    line-height: 1.6;
    padding-bottom: 60px;
}

.gmm-blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 2. Hero Section */
.gmm-blog-hero {
    background-color: var(--gmm-bg-light);
    border-bottom: 1px solid var(--gmm-border-color);
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.gmm-blog-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gmm-text-dark);
    margin-bottom: 15px;
}

.gmm-blog-hero-subtitle {
    font-size: 1.15rem;
    color: var(--gmm-text-muted);
    max-width: 800px;
    margin: 0 auto 25px auto;
}

.gmm-blog-btn {
    display: inline-block;
    background-color: var(--gmm-brand-green);
    color: #ffffff !important;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 4px;
    text-decoration: none !important;
    transition: background-color 0.2s ease-in-out;
    border: none;
    cursor: pointer;
}

.gmm-blog-btn:hover {
    background-color: var(--gmm-brand-green-dark);
}

/* 3. Featured Post Card */
.gmm-blog-featured-section {
    margin-bottom: 50px;
}

.gmm-blog-featured-card {
    display: flex;
    background: #ffffff;
    border: 1px solid var(--gmm-border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--gmm-card-shadow);
    transition: box-shadow 0.2s ease-in-out;
}

.gmm-blog-featured-card:hover {
    box-shadow: var(--gmm-card-shadow-hover);
}

.gmm-blog-featured-image {
    flex: 1.2;
    min-height: 380px;
    background-color: #f0f4f1;
    position: relative;
    overflow: hidden;
}

.gmm-blog-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.gmm-blog-featured-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gmm-blog-badge {
    display: inline-block;
    align-self: flex-start;
    background-color: var(--gmm-brand-green-light);
    color: var(--gmm-brand-green);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 50px;
    margin-bottom: 15px;
}

.gmm-blog-featured-title {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
}

.gmm-blog-featured-title a {
    color: var(--gmm-text-dark);
    text-decoration: none !important;
}

.gmm-blog-featured-title a:hover {
    color: var(--gmm-brand-green);
}

.gmm-blog-featured-excerpt {
    color: var(--gmm-text-muted);
    font-size: 1rem;
    margin-bottom: 20px;
}

.gmm-blog-meta {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--gmm-text-muted);
    gap: 15px;
    margin-bottom: 25px;
}

.gmm-blog-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 4. Filters and Search Bar Row */
.gmm-blog-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gmm-border-color);
    padding-bottom: 15px;
    margin-bottom: 35px;
    gap: 20px;
}

.gmm-blog-filter-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
}

.gmm-blog-filter-tab {
    background: none;
    border: 1px solid transparent;
    color: var(--gmm-text-muted);
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.15s ease-in-out;
}

.gmm-blog-filter-tab:hover {
    color: var(--gmm-brand-green);
    background-color: var(--gmm-bg-light);
}

.gmm-blog-filter-tab.active {
    color: #ffffff;
    background-color: var(--gmm-brand-green);
    border-color: var(--gmm-brand-green);
}

.gmm-blog-search-container {
    position: relative;
    width: 320px;
    max-width: 100%;
}

.gmm-blog-search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--gmm-border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease-in-out;
}

.gmm-blog-search-input:focus {
    border-color: var(--gmm-brand-green);
}

.gmm-blog-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gmm-text-muted);
    pointer-events: none;
}

/* 5. Article Grid & Cards */
.gmm-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.gmm-blog-card {
    background: #ffffff;
    border: 1px solid var(--gmm-border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease-in-out;
}

.gmm-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--gmm-card-shadow-hover);
}

.gmm-blog-card-image {
    height: 220px;
    background-color: #f0f4f1;
    position: relative;
    overflow: hidden;
}

.gmm-blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

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

.gmm-blog-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
}

.gmm-blog-card-title a {
    color: var(--gmm-text-dark);
    text-decoration: none !important;
}

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

.gmm-blog-card-excerpt {
    color: var(--gmm-text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gmm-blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--gmm-border-color);
    padding-top: 15px;
    font-size: 0.8rem;
    color: var(--gmm-text-muted);
}

.gmm-blog-card-link {
    color: var(--gmm-brand-green);
    text-decoration: none !important;
    font-weight: 700;
    font-size: 0.85rem;
}

.gmm-blog-card-link:hover {
    color: var(--gmm-brand-green-dark);
}

/* No results state */
.gmm-blog-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background-color: var(--gmm-bg-light);
    border-radius: 8px;
    border: 1px solid var(--gmm-border-color);
}

/* 6. Individual Article Template */
.gmm-article-layout {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.gmm-article-breadcrumbs {
    font-size: 0.85rem;
    color: var(--gmm-text-muted);
    margin-bottom: 25px;
}

.gmm-article-breadcrumbs a {
    color: var(--gmm-text-muted);
    text-decoration: none !important;
}

.gmm-article-breadcrumbs a:hover {
    color: var(--gmm-brand-green);
}

.gmm-article-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--gmm-text-dark);
    margin-bottom: 20px;
}

.gmm-article-featured-image {
    width: 100%;
    max-height: 480px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 40px;
    background-color: #f0f4f1;
}

.gmm-article-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Reading Typography */
.gmm-article-body {
    font-size: 1.125rem;
    line-height: 1.75;
    color: #2d3748;
}

.gmm-article-body p {
    margin-bottom: 28px;
}

.gmm-article-body h2 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-top: 45px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.gmm-article-body h3 {
    font-size: 1.45rem;
    font-weight: 700;
    margin-top: 35px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.gmm-article-body ul, .gmm-article-body ol {
    margin-bottom: 28px;
    padding-left: 25px;
}

.gmm-article-body li {
    margin-bottom: 8px;
}

.gmm-article-body blockquote {
    border-left: 4px solid var(--gmm-brand-green);
    background-color: var(--gmm-bg-light);
    padding: 20px 30px;
    margin: 35px 0;
    font-style: italic;
    font-size: 1.2rem;
    color: #4a5568;
    border-radius: 0 4px 4px 0;
}

.gmm-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 35px 0;
    font-size: 1rem;
}

.gmm-article-body th, .gmm-article-body td {
    padding: 12px 15px;
    border: 1px solid var(--gmm-border-color);
    text-align: left;
}

.gmm-article-body th {
    background-color: var(--gmm-bg-light);
    font-weight: 700;
}

.gmm-article-body table-wrapper {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 30px;
}

/* Callout Box / Internal Links */
.gmm-article-callout {
    background-color: var(--gmm-bg-light);
    border-left: 4px solid var(--gmm-brand-green);
    padding: 25px;
    border-radius: 0 8px 8px 0;
    margin: 40px 0;
}

.gmm-article-callout-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gmm-brand-green);
}

.gmm-article-callout ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.gmm-article-callout li {
    margin-bottom: 5px;
}

.gmm-article-callout a {
    color: var(--gmm-brand-green);
    font-weight: 600;
    text-decoration: underline !important;
}

.gmm-article-callout a:hover {
    color: var(--gmm-brand-green-dark);
}

/* Bottom CTA Card */
.gmm-article-cta-box {
    background-color: #f0f4f1;
    border: 1px solid var(--gmm-border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin: 50px 0;
}

.gmm-article-cta-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.gmm-article-cta-desc {
    color: var(--gmm-text-muted);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto 25px auto;
}

/* Author Box */
.gmm-article-author {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--gmm-border-color);
    border-bottom: 1px solid var(--gmm-border-color);
    padding: 30px 0;
    margin: 50px 0;
    gap: 25px;
}

.gmm-article-author-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #e2e8f0;
    flex-shrink: 0;
}

.gmm-article-author-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gmm-article-author-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.gmm-article-author-bio {
    color: var(--gmm-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Related Articles Area */
.gmm-related-section {
    border-top: 1px solid var(--gmm-border-color);
    padding-top: 50px;
    margin-top: 60px;
}

.gmm-related-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 30px;
}

/* Pagination */
.gmm-blog-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.gmm-blog-pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--gmm-border-color);
    border-radius: 4px;
    text-decoration: none !important;
    color: var(--gmm-text-dark);
    font-weight: 600;
    transition: all 0.2s ease;
}

.gmm-blog-pagination .page-numbers:hover {
    border-color: var(--gmm-brand-green);
    color: var(--gmm-brand-green);
}

.gmm-blog-pagination .page-numbers.current {
    background-color: var(--gmm-brand-green);
    border-color: var(--gmm-brand-green);
    color: #ffffff;
}

/* Responsive Styles */
@media (max-width: 991px) {
    .gmm-blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gmm-blog-featured-card {
        flex-direction: column;
    }
    .gmm-blog-featured-image {
        min-height: 280px;
    }
    .gmm-blog-featured-content {
        padding: 30px;
    }
}

@media (max-width: 767px) {
    .gmm-blog-grid {
        grid-template-columns: 1fr;
    }
    .gmm-blog-controls-row {
        flex-direction: column;
        align-items: stretch;
    }
    .gmm-blog-search-container {
        width: 100%;
    }
    .gmm-blog-hero {
        padding: 40px 0;
    }
    .gmm-blog-hero-title {
        font-size: 2rem;
    }
    .gmm-article-title {
        font-size: 2rem;
    }
}
