/*
Theme Name: Enviro Blog Theme
Theme URI: https://example.com/enviro-blog
Author: Antigravity
Author URI: https://example.com/
Description: A lightweight, SEO-friendly WordPress theme tailored for environmental issues blogs. Features a modern, clean design inspired by premium tech blogs.
Version: 1.4.2
License: GNU General Public License v2 or later
Text Domain: enviroblog

This theme focuses on using minimal CSS/JS, native typography, and a semantic structure to ensure fast load times and a positive, low-bounce-rate user experience.
*/

:root {
  --color-primary: #10b981; /* Shifted to an eco-friendly vibrant emerald green */
  --color-primary-light: #d1fae5;
  --color-text-dark: #111827; 
  --color-text-body: #4b5563; 
  --color-bg: #ffffff;
  --color-border: #e2e8f0;
  
  --font-base: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Inter', system-ui, -apple-system, sans-serif; 
  --font-logo: 'Caveat', cursive, sans-serif; 

  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
  
  --radius: 8px;
  --max-width: 1200px;
}

/* Reset basics */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-base);
  color: var(--color-text-dark);
  background-color: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--color-text-dark); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-primary); }

img { max-width: 100%; height: auto; display: block; }
ul, ol { margin-bottom: var(--spacing-sm); padding-left: var(--spacing-md); }

/* Layout Wrapper */
.site-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.site-header {
    background: transparent;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 10;
}
.header-inner {
    width: 100%;
    max-width: var(--max-width);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; /* Fixes stacking issues */
    gap: 1.5rem;
}
.site-title { font-family: var(--font-logo); font-size: 2.2rem; color: #000; font-weight: 500; letter-spacing: -1px; white-space: nowrap; line-height: 1.1; display: inline-block; }
.site-branding .custom-logo { max-height: 60px; width: auto; display: block; }

.main-navigation ul { display: flex; gap: 1rem 1.5rem; list-style: none; margin:0; padding:0; flex-wrap: wrap; justify-content: center; }
.main-navigation a { color: #64748b; font-size: 0.95rem; font-weight: 500; white-space: nowrap; }
.main-navigation a:hover { color: #0f172a; }

.search-form-inline {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    background: #fff;
    width: 100%;
    max-width: 250px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.search-icon { width: 16px; height: 16px; color: #94a3b8; margin-right: 8px; flex-shrink: 0; }
.search-field-inline { border: none; outline: none; flex: 1; font-size: 0.9rem; color: #334155; }
.search-field-inline::placeholder { color: #94a3b8; }

@media (max-width: 768px) {
    .header-inner { flex-direction: column; gap: 1rem; }
    .main-navigation ul { flex-wrap: wrap; justify-content: center; }
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 4rem 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
}
.hero-bg-gradient {
    position: absolute;
    top: -150px; left: 50%;
    transform: translateX(-50%);
    width: 100vw; height: 800px;
    background: radial-gradient(circle at 75% 30%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 25% 40%, rgba(59, 130, 246, 0.06) 0%, transparent 40%),
                radial-gradient(circle at 50% 10%, rgba(251, 191, 36, 0.04) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

.hero-kicker { color: var(--color-primary); font-weight: 700; font-size: 0.9rem; margin-bottom: 0.5rem; display: block; }
.hero-title { font-size: 4.5rem; font-weight: 800; letter-spacing: -0.05em; margin: 0 0 1rem 0; color: #111; line-height: 1.1; }
.hero-subtitle { font-size: 1.35rem; color: var(--color-text-body); max-width: 700px; line-height: 1.5; font-weight: 400; }

.hero-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    flex-wrap: wrap;
}
.hero-text-content {
    flex: 1 1 300px;
}
.hero-about-site {
    margin-top: 2rem;
    font-size: 1.1rem;
    color: var(--color-text-body);
    line-height: 1.7;
    border-left: 4px solid var(--color-primary);
    padding-left: 1.5rem;
    background: rgba(16, 185, 129, 0.03);
    border-radius: 0 8px 8px 0;
    padding-top: 1rem;
    padding-bottom: 1rem;
    padding-right: 1.5rem;
}

/* Founder Box in Hero */
.founder-box {
    flex: 0 1 450px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    max-width: 550px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}
.founder-avatar {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    object-fit: contain;
    background-color: #f8fafc;
    flex-shrink: 0;
    border: 2px solid var(--color-primary);
}
.founder-info {
    display: flex;
    flex-direction: column;
}
.founder-title {
    font-weight: 800;
    font-size: 1.15rem;
    color: #111;
    margin-bottom: 0.35rem;
}
.founder-desc {
    font-size: 0.95rem;
    color: var(--color-text-body);
    line-height: 1.5;
    margin: 0;
}

/* Main Content Split (The Featured Post / Recent Posts layout) */
.main-content-split { display: flex; gap: 5rem; max-width: var(--max-width); margin: 0 auto; padding: 4rem 2rem; }
@media (max-width: 900px) { .main-content-split { flex-direction: column; gap: 3rem; } }
.featured-column { flex: 1.3; }
.recent-column { flex: 1; }

/* Cleaned up badge so it's not a direct clone */
.featured-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 2rem;
    background: var(--color-primary-light);
    color: #065f46;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

/* Featured Article inside Carousel Wrapper */
.carousel-wrapper { position: relative; width: 100%; overflow: hidden; }
.carousel-container { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.carousel-container::-webkit-scrollbar { display: none; }
.carousel-slide { flex: 0 0 100%; width: 100%; scroll-snap-align: start; }

.featured-title { font-size: 2.2rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.03em; margin-bottom: 1rem; }
.featured-title a { color: #111; }
.featured-excerpt { font-size: 1.05rem; color: var(--color-text-body); margin-bottom: 1.5rem; line-height: 1.6;}
.featured-img { width: 100%; height: 380px; border-radius: 8px; margin-top: 0.5rem; object-fit: contain; background: #f1f5f9; }
@media (max-width: 768px) { .featured-img { height: 240px; } }

/* Post Navigation */
.carousel-nav-inline { display: flex; gap: 10px; margin-top: 1rem; }
.carousel-btn { background: #f1f5f9; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; color: #475569; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.carousel-btn:hover { background: #e2e8f0; color: #0f172a; }

/* Recent List */
.recent-list { border-top: 1px solid var(--color-border); }
.recent-article-mini { padding: 1.8rem 0; border-bottom: 1px solid var(--color-border); }
.recent-title { font-size: 1.15rem; font-weight: 700; line-height: 1.35; margin-bottom: 0.5rem; }
.recent-title a { color: #111; }
.recent-title a:hover { color: var(--color-primary); }
.recent-excerpt { font-size: 0.95rem; color: var(--color-text-body); line-height: 1.5; }

/* Single Post & Page Content Area */
.single .site-container, .page .site-container { background: var(--color-bg); /* Prevents customizer background showing behind text */ }
.single .site-main, .page .site-main { max-width: 900px; margin: 4rem auto; padding: 0 2rem; }

.single-post-title { font-size: 3rem; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 1rem; line-height: 1.2; }
@media (max-width: 768px) { .single-post-title { font-size: 2.2rem; } }

.single-post-meta { display: flex; flex-wrap: wrap; gap: 1rem; color: #64748b; font-size: 0.9rem; margin-bottom: 2rem; border-bottom: 1px solid var(--color-border); padding-bottom: 1.5rem; }
.single-post-thumbnail img { width: 100%; max-height: 550px; object-fit: contain; background-color: #f8fafc; border-radius: 12px; margin-bottom: 3rem; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

.single-post-content { font-size: 1.15rem; line-height: 1.8; color: var(--color-text-dark); }
.single-post-content p { margin-bottom: 1.8rem; }
.single-post-content h2 { font-weight: 800; font-size: 2rem; margin-top: 3.5rem; margin-bottom: 1.2rem; color: #111; border-bottom: 2px solid var(--color-bg); padding-bottom: 0.4rem; }
.single-post-content h3 { font-weight: 700; font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 1rem; color: #1f2937; }
.single-post-content ul, .single-post-content ol { margin-bottom: 2rem; padding-left: 2rem; }
.single-post-content li { margin-bottom: 0.5rem; }

/* Footer */
.site-footer { padding: 4rem 2rem; text-align: center; border-top: 1px solid var(--color-border); margin-top: auto; color: #64748b; font-size: 0.95rem; background: #fff; }
.site-footer a { color: #111; font-weight: 600; }
.footer-navigation { margin-bottom: 2rem; }
.footer-navigation ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 2rem; list-style: none; margin: 0; padding: 0; }
.footer-navigation a { color: #64748b; font-size: 0.95rem; font-weight: 500; }
.footer-navigation a:hover { color: var(--color-primary); }

/* Author Bio */
.author-bio { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 1.5rem; background-color: #f8fafc; padding: 2.5rem; border-radius: 12px; margin-top: 4rem; margin-bottom: 2rem; border: 1px solid var(--color-border); }
.author-avatar:empty { display: none; }
.author-avatar img { border-radius: 50%; width: 80px; height: 80px; object-fit: contain; background-color: #f1f5f9; }
.author-info { flex: 1; }
.author-info h3 { margin-bottom: 0.5rem; font-size: 1.2rem; font-weight: 700; color: #111; }
.author-info p { margin-bottom: 0; font-size: 1rem; color: var(--color-text-body); line-height: 1.6; }

/* Author Page Header (Stacked Layout) */
.author-page-header.single-post-header {
    background: #f8fafc;
    border-radius: 16px;
    padding: 4rem 3rem;
    margin-bottom: 4rem;
    border: 1px solid var(--color-border);
}
.author-profile-wrapper-stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 850px;
    margin: 0 auto;
}
.author-avatar-centered {
    margin-bottom: 1.5rem;
    width: 100%;
    display: flex;
    justify-content: center;
}
.author-avatar-centered img.author-img-large {
    border-radius: 50% !important;
    width: 250px !important;
    height: 250px !important;
    object-fit: cover !important;
    border: 5px solid #fff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    margin: 0 auto;
}
.author-name-centered {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    color: #111;
    text-align: center !important;
    width: 100%;
}
.author-bio-formatted {
    width: 100%;
    text-align: justify !important; 
    max-width: none !important;
}
.author-bio-formatted p {
    font-size: 1.15rem;
    line-height: 1.85;
    color: var(--color-text-body);
    margin-bottom: 1.5rem;
    text-align: justify !important;
}
.author-bio-formatted p:last-child {
    margin-bottom: 0;
}

/* Related Posts Structural Grid */
.related-posts-container { margin-top: 4rem; padding-top: 2rem; border-top: 2px solid var(--color-border); }
.related-posts-container h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.5rem; }
.related-posts-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; list-style: none; padding: 0; margin: 0; }
.related-posts-list li { margin: 0; padding: 0; }
.related-posts-list h4 { font-size: 1.15rem; font-weight: 700; margin-top: 1rem; line-height: 1.4; }
.related-posts-list h4 a { color: #111; transition: color 0.2s; }
.related-posts-list h4 a:hover { color: var(--color-primary); }
.related-post-img { width: 100%; aspect-ratio: 16/9; object-fit: contain; background-color: #f1f5f9; border-radius: 8px; transition: transform 0.2s; }
.related-post-img:hover { transform: scale(1.02); }

/* Comment Form Styles */
.comments-area { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--color-border); }
.comments-title, .comment-reply-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 2rem; }
.comment-form { display: flex; flex-direction: column; gap: 1rem; max-width: 700px; }
.comment-form label { font-weight: 600; font-size: 0.95rem; display: block; margin-bottom: 0.3rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: 0.8rem; border: 1px solid var(--color-border); border-radius: 6px; font-family: var(--font-base); font-size: 1rem; background: #fff; }
.comment-form textarea { min-height: 150px; resize: vertical; }
.comment-form input[type="submit"] { background: var(--color-primary); color: #fff; border: none; padding: 0.8rem 2rem; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 1rem; align-self: flex-start; transition: background 0.2s; }
.comment-form input[type="submit"]:hover { background: #059669; }
.comment-list { list-style: none; padding: 0; margin-top: 3rem; }
.comment-body { padding: 1.5rem; background: #f8fafc; border-radius: 8px; margin-bottom: 1.5rem; border: 1px solid var(--color-border); }
.comment-meta { margin-bottom: 1rem; font-size: 0.9rem; color: #64748b; }
.comment-author b { font-size: 1.1rem; color: #111; margin-right: 0.5rem; }

/* Archive & Search Results Grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: var(--max-width);
    margin: 3rem auto 5rem;
    padding: 0 2rem;
}
.post-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.post-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    transform: translateY(-4px);
}
.post-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: contain;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--color-border);
}
.post-card-content {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.post-card-meta {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.post-card-title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 1rem;
}
.post-card-title a { color: #111; }
.post-card-title a:hover { color: var(--color-primary); }
.post-card-excerpt {
    font-size: 1rem;
    color: var(--color-text-body);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}
.read-more-link {
    display: inline-block;
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.95rem;
    align-self: flex-start;
}
.read-more-link:hover {
    color: #059669;
    text-decoration: underline;
}

/* Page Header for Archives */
.single-post-header {
    max-width: var(--max-width);
    margin: 4rem auto 2rem;
    padding: 0 2rem;
    text-align: center;
}
.single-post-header .page-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #111;
}
.single-post-header .archive-description {
    font-size: 1.15rem;
    color: var(--color-text-body);
    max-width: 700px;
    margin: 0 auto;
}

/* Contact Page Template */
.contact-page-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 3rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.contact-text-content {
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
    color: var(--color-text-body);
}
.contact-form-container {
    margin-top: 2rem;
}
.enviro-contact-form .form-group {
    margin-bottom: 1.5rem;
}
.enviro-contact-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #111;
}
.enviro-contact-form input[type="text"],
.enviro-contact-form input[type="email"],
.enviro-contact-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.enviro-contact-form input[type="text"]:focus,
.enviro-contact-form input[type="email"]:focus,
.enviro-contact-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: #fff;
}
.enviro-contact-form textarea {
    resize: vertical;
}
.contact-submit-btn {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.contact-submit-btn:hover {
    background: #059669;
}
.contact-submit-btn:active {
    transform: scale(0.98);
}
.contact-success {
    background: #d1fae5;
    color: #065f46;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 600;
    border-left: 4px solid #10b981;
}
.contact-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 600;
    border-left: 4px solid #ef4444;
}

/* Editor's Choice Section */
.editors-choice-wrapper {
    max-width: var(--max-width);
    margin: 4rem auto;
    padding: 0 2rem;
}
.editors-choice-heading {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: #111;
    position: relative;
    display: inline-block;
}
.editors-choice-heading::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 2px;
}
.editors-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}
.editors-choice-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.editors-choice-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}
.ec-img-link {
    display: block;
    width: 100%;
}
.ec-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: contain;
    background: #f8fafc;
    border-bottom: 1px solid var(--color-border);
}
.ec-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.ec-meta {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
}
.ec-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 1rem;
}
.ec-title a { color: #111; }
.ec-title a:hover { color: var(--color-primary); }
.ec-excerpt {
    font-size: 0.95rem;
    color: var(--color-text-body);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}
.ec-read-more {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.95rem;
    display: inline-block;
}
.ec-read-more:hover {
    color: #059669;
    text-decoration: underline;
}
