/* Blog Listing Page Styles */
.blog-listing {
    min-height: 100vh;
    padding: 160px 5% 80px;
    background: #000;
    position: relative;
}

.blog-listing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(250, 229, 0, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(250, 229, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.blog-listing-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.language-filter {
    position: absolute;
    top: 160px;
    right: 5%;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10;
    padding: 5px 10px;
}

.lang-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    transition: all 0.3s ease;
    font-family: inherit;
    border-radius: 30px;
    letter-spacing: 1px;
}

.lang-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
}

.lang-btn.active {
    color: #000;
    background: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 700;
    box-shadow: 0 0 15px rgba(250, 229, 0, 0.3);
}

.blog-listing-header h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 8px;
    color: white;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.blog-listing-header h1::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--primary-color);
}

.blog-listing-header h1 span {
    color: var(--primary-color);
}

.blog-listing-header p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 30px auto 0;
    line-height: 1.8;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.blog-card {
    background: var(--tertiary-color);
    border-left: 4px solid var(--primary-color);
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(250, 229, 0, 0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.blog-card:hover::before {
    transform: translateX(100%);
}

.blog-card:hover {
    border-left-width: 8px;
    transform: translateX(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.blog-card-content {
    padding: 35px;
}

.blog-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.blog-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 25px;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--primary-color);
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
}

.read-more-btn:hover {
    background: transparent;
    color: var(--primary-color);
    transform: translateX(5px);
}

.read-more-btn svg {
    transition: transform 0.3s ease;
}

.read-more-btn:hover svg {
    transform: translateX(5px);
}

/* Blog Post Page Styles */
.blog-post {
    min-height: 100vh;
    padding: 160px 5% 80px;
    background: #f5f5f0;
    position: relative;
}

.blog-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 10% 10%, rgba(0, 0, 0, 0.02) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 90%, rgba(0, 0, 0, 0.02) 0%, transparent 40%);
    pointer-events: none;
}

.blog-post-header {
    max-width: 900px;
    margin: 0 auto 50px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.back-link {
    position: absolute;
    top: 160px;
    left: 5%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10;
    transition: all 0.3s ease;
    padding: 10px 20px;
    border: 2px solid transparent;
    background: rgba(0, 0, 0, 0.05);
}

.back-link:hover {
    border-color: #1a1a1a;
    background: rgba(0, 0, 0, 0.1);
}

.back-link:hover svg {
    transform: translateX(-5px);
}

.back-link svg {
    transition: transform 0.3s ease;
    stroke: #1a1a1a;
}

.blog-post-header h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 900;
    color: #1a1a1a;
    margin-bottom: 20px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    display: inline-block;
}

.blog-post-header h1::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: #1a1a1a;
}

.blog-description {
    font-size: 1.2rem;
    color: #4a4a4a;
    line-height: 1.7;
    margin-top: 30px;
}

/* Blog Content - Paper/Newspaper Theme */
.blog-content {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border-left: 5px solid #1a1a1a;
    padding: 60px 70px;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    font-family: 'Georgia', 'Times New Roman', serif;
}

.blog-content::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #1a1a1a 0%, #1a1a1a 100%);
}

.blog-content h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1a1a1a;
    margin: 40px 0 20px;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding-bottom: 15px;
    border-bottom: 2px solid #1a1a1a;
    font-family: 'Arial', 'Helvetica', sans-serif;
}

.blog-content h1:first-child {
    margin-top: 10px;
}

.blog-content h1.doc-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #1a1a1a;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: none;
    padding-bottom: 0;
    text-shadow: none;
    font-family: 'Arial', 'Helvetica', sans-serif;
}

.blog-content p.doc-subtitle {
    font-size: 1.3rem;
    color: #555555;
    text-align: center;
    font-style: italic;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #cccccc;
}

.blog-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #222;
    margin: 40px 0 15px;
    line-height: 1.3;
    font-family: 'Arial', 'Helvetica', sans-serif;
    border-bottom: none;
    /* Removed the line */
    text-transform: none;
}

.blog-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    margin: 30px 0 12px;
    line-height: 1.4;
    padding-left: 0;
    border-left: none;
    /* Cleaner look */
    font-family: 'Arial', 'Helvetica', sans-serif;
}

.blog-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #444;
    margin: 25px 0 10px;
    font-family: 'Arial', 'Helvetica', sans-serif;
}

.blog-content p {
    font-size: 1.1rem;
    color: #2d2d2d;
    line-height: 1.8;
    margin-bottom: 1.5em;
    text-align: left;
    /* Better readability than justify for web */
    max-width: 65ch;
    /* Optimal reading length */
    margin-left: auto;
    margin-right: auto;
}

.blog-content strong,
.blog-content b {
    color: #1a1a1a;
    font-weight: 700;
}

.blog-content em,
.blog-content i {
    font-style: italic;
    color: #2d2d2d;
}

.blog-content u {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: #1a1a1a;
}

.blog-content a {
    color: #0066cc;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
    font-weight: 600;
}

.blog-content a:hover {
    border-bottom-color: #0066cc;
}

.blog-content ul,
.blog-content ol {
    margin: 20px 0;
    padding-left: 30px;
    color: #2d2d2d;
}

.blog-content li {
    margin-bottom: 12px;
    line-height: 1.7;
    position: relative;
}

.blog-content ul li::marker {
    color: #1a1a1a;
}

.blog-content ol li::marker {
    color: #1a1a1a;
    font-weight: 700;
}

.blog-content blockquote {
    margin: 30px 0;
    padding: 25px 30px;
    border-left: 5px solid #555555;
    background: #f9f9f7;
    font-style: italic;
    color: #444444;
    position: relative;
}

.blog-content blockquote::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 3rem;
    color: #888888;
    opacity: 0.5;
    font-family: Georgia, serif;
    line-height: 1;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: #ffffff;
    border: 1px solid #dddddd;
}

.blog-content th,
.blog-content td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #dddddd;
}

.blog-content th {
    background: #f5f5f2;
    color: #1a1a1a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    font-family: 'Arial', 'Helvetica', sans-serif;
}

.blog-content td {
    color: #2d2d2d;
}

.blog-content tr:hover td {
    background: #f9f9f7;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    margin: 25px 0;
    border: 1px solid #dddddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.blog-content code {
    background: #f5f5f2;
    color: #c7254e;
    padding: 2px 8px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9em;
    border-radius: 3px;
}

.blog-content pre {
    background: #f5f5f2;
    border-left: 4px solid #1a1a1a;
    padding: 20px;
    overflow-x: auto;
    margin: 25px 0;
}

.blog-content pre code {
    background: none;
    padding: 0;
    color: #333333;
}

/* Specific Doc Styles */
.blog-content h2.doc-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 5px;
    text-align: center;
    border-bottom: none;
    padding-bottom: 0;
    line-height: 1.2;
    font-family: 'Arial', 'Helvetica', sans-serif;
    text-transform: none;
    /* Let the doc dictate capitalization or use none */
}

.blog-content p.doc-subtitle {
    font-size: 1.2rem;
    color: #666;
    text-align: center;
    font-style: italic;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    font-family: 'Georgia', serif;
}

/* Clean Divider */
.blog-content hr {
    border: none;
    height: 1px;
    background: #cccccc;
    margin: 40px 0;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
    border: 2px dashed var(--primary-color);
}

.error-message p {
    font-size: 1.2rem;
}

/* Safety Icon Decorations */
.blog-listing-header::after {
    content: '⚠';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 1420px) {
    .blog-listing {
        padding: 140px 4% 60px;
    }

    .blog-listing-header {
        margin-bottom: 40px;
    }

    .blog-listing-header h1 {
        font-size: 2.5rem;
        letter-spacing: 4px;
        margin-bottom: 15px;
        /* Ensure space for subtitle */
    }

    .language-filter {
        position: relative;
        top: auto;
        right: auto;
        justify-content: center;
        margin-bottom: 30px;
        padding-top: 20px;
    }

    .blog-card-content {
        padding: 25px;
    }

    .blog-card h2 {
        font-size: 1.3rem;
    }

    .blog-post {
        padding: 180px 4% 60px;
    }

    .blog-content {
        padding: 30px 20px;
    }

    .blog-content::before {
        height: 6px;
    }

    .blog-content h1 {
        font-size: 1.6rem;
    }

    .blog-content h1.doc-title,
    .blog-content h2.doc-title {
        font-size: 1.8rem;
    }

    .blog-content h2 {
        font-size: 1.4rem;
    }

    .blog-content p {
        font-size: 1rem;
    }

    .back-link {
        position: relative;
        top: auto;
        left: auto;
        display: inline-flex;
        margin-bottom: 20px;
        font-size: 0.85rem;
        padding: 8px 15px;
    }
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Construction Corner Accents */
.blog-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 40px 40px 0;
    border-color: transparent var(--primary-color) transparent transparent;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.blog-card:hover::after {
    opacity: 0.6;
}