@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Roboto:wght@400;500;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif; background: #ebebeb; color: #444; line-height: 1.7; }
a { color: #108496; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #0b5e6b; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ----------------------------------------------------
   1. HERO HEADER COVER
   ---------------------------------------------------- */
.header-cover {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1441974231531-c6227db76b6e?q=80&w=1600&auto=format&fit=crop') center/cover no-repeat;
    padding: 80px 20px;
    text-align: center;
    color: #fff;
}
.site-title { font-family: 'Libre Baskerville', serif; font-size: 2.8rem; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,0.4); margin-bottom: 8px; }
.site-title a { color: #fff; }
.site-tagline { font-size: 1rem; color: #e2e8f0; letter-spacing: 0.5px; font-weight: 400; }

/* ----------------------------------------------------
   2. DARK NAVIGATION BAR
   ---------------------------------------------------- */
.main-navbar { background: #222222; border-bottom: 1px solid #1a1a1a; position: relative; }
.nav-container { display: flex; justify-content: space-between; align-items: center; }

.mobile-nav-bar { display: none; } /* Hidden on desktop */

.nav-menu { list-style: none; display: flex; flex-wrap: wrap; }
.nav-menu li a { display: block; padding: 16px 18px; color: #a5a5a5; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.nav-menu li a:hover, .nav-menu li.active a { color: #fff; background: #1a1a1a; }

.search-toggle-form { display: flex; align-items: center; }
.search-toggle-form form { display: flex; align-items: center; }
.search-toggle-form input { background: #1a1a1a; border: 1px solid #333; color: #fff; padding: 7px 12px; border-radius: 3px; font-size: 0.82rem; outline: none; width: 180px; }
.search-toggle-form button { background: transparent; border: none; color: #a5a5a5; padding: 6px 10px; cursor: pointer; font-size: 0.9rem; }
.search-toggle-form button:hover { color: #fff; }

/* ----------------------------------------------------
   3. BASKERVILLE MASONRY GRID (INDEX)
   ---------------------------------------------------- */
.baskerville-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

article.baskerville-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.card-media { width: 100%; height: 200px; overflow: hidden; background: #ddd; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.card-media:hover img { transform: scale(1.04); }

.card-header { padding: 22px 25px 18px 25px; position: relative; border-bottom: 1px solid #eee; }
.card-header:after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 30px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    transform: rotate(45deg);
}
.card-header h2 { font-family: 'Libre Baskerville', serif; font-size: 1.3rem; font-weight: 700; line-height: 1.4; }
.card-header h2 a { color: #222; }
.card-header h2 a:hover { color: #108496; }

.card-body { padding: 22px 25px; flex: 1; font-size: 0.92rem; color: #555; }
.card-meta { padding: 12px 25px; background: #fafafa; border-top: 1px solid #f0f0f0; font-size: 0.78rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }

/* ----------------------------------------------------
   4. TWO-COLUMN POST & PAGE LAYOUT (WITH SIDEBAR)
   ---------------------------------------------------- */
.post-layout-grid {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 30px;
    margin: 40px auto;
    align-items: flex-start;
}
.post-main-column { min-width: 0; }

.single-post-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.single-post-header {
    padding: 35px 40px 25px 40px;
    border-bottom: 1px solid #eee;
    position: relative;
}
.single-post-header:after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 40px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    transform: rotate(45deg);
}
.single-post-header h1 {
    font-family: 'Libre Baskerville', serif;
    font-size: 2.1rem;
    line-height: 1.35;
    color: #222;
}

.single-content {
    padding: 40px;
    font-size: 1.05rem;
    line-height: 1.85;
    color: #333;
}
.single-content p { margin-bottom: 20px; }
.single-content img { max-width: 100%; height: auto; border-radius: 4px; }

/* ----------------------------------------------------
   5. DARK AUTHOR/META RIBBON BANNER
   ---------------------------------------------------- */
.post-meta-banner {
    background: #2e3842;
    color: #a0abb6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px 0 0;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 15px;
}

.meta-banner-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Teal Ribbon Badge */
.meta-ribbon-badge {
    background: #108496;
    color: #fff;
    width: 48px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.meta-ribbon-badge:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 24px 10px 24px;
    border-color: transparent transparent #2e3842 transparent;
}

.meta-author-info strong {
    color: #fff;
    font-size: 1rem;
}

.meta-banner-right {
    font-size: 0.82rem;
    color: #8c98a4;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}
.meta-banner-right a { color: #cbd5e1; }
.meta-banner-right a:hover { color: #fff; }

/* ----------------------------------------------------
   6. COMMENTS & FORM WITH FIELD ICONS
   ---------------------------------------------------- */
.comments-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    padding: 40px;
    margin-top: 30px;
}

.comments-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.4rem;
    margin-bottom: 25px;
    color: #222;
}

.comment-item { display: flex; gap: 15px; padding: 20px 0; border-bottom: 1px solid #f1f5f9; }
.comment-item:last-child { border-bottom: none; }
.comment-avatar img { border-radius: 50%; }
.comment-author { font-weight: 700; color: #222; font-size: 0.95rem; }
.comment-date { font-size: 0.75rem; color: #888; text-transform: uppercase; margin-bottom: 5px; }
.comment-body { font-size: 0.92rem; color: #444; }

.comment-form-wrap h3 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.5rem;
    color: #222;
    margin-bottom: 5px;
}
.comment-notes { font-size: 0.85rem; color: #777; margin-bottom: 25px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: #555; margin-bottom: 6px; }
.form-group textarea { width: 100%; padding: 12px; border: 1px solid #e0e0e0; background: #f9f9f9; font-family: inherit; font-size: 0.95rem; resize: vertical; }
.form-group textarea:focus { background: #fff; border-color: #108496; outline: none; }

/* Input with icon on right */
.input-with-icon { position: relative; }
.input-with-icon input {
    width: 100%;
    padding: 12px 42px 12px 12px;
    border: 1px solid #e0e0e0;
    background: #f9f9f9;
    font-family: inherit;
    font-size: 0.95rem;
}
.input-with-icon input:focus { background: #fff; border-color: #108496; outline: none; }
.input-with-icon .field-icon {
    position: absolute;
    right: 14px;
    bottom: 10px;
    font-size: 1rem;
    color: #888;
    pointer-events: none;
}

/* ----------------------------------------------------
   7. SIDEBAR WIDGETS
   ---------------------------------------------------- */
.baskerville-sidebar .sidebar-widget {
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    padding: 25px;
    margin-bottom: 25px;
}
.sidebar-widget .widget-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.15rem;
    color: #222;
    margin-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}

.widget-search-form { display: flex; gap: 6px; }
.widget-search-form input { flex: 1; padding: 9px 12px; border: 1px solid #ccc; font-size: 0.88rem; outline: none; }
.widget-search-form button { padding: 9px 16px; background: #222; color: #fff; border: none; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.widget-search-form button:hover { background: #108496; }

.widget-list { list-style: none; }
.widget-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f8fafc; font-size: 0.92rem; }
.widget-list li:last-child { border-bottom: none; }
.widget-list li a { color: #444; }
.widget-list li a:hover { color: #108496; }
.widget-count { background: #f0f0f0; color: #666; font-size: 0.75rem; padding: 2px 8px; border-radius: 10px; }

/* ----------------------------------------------------
   8. THREE-COLUMN DARK WIDGET FOOTER
   ---------------------------------------------------- */
footer.baskerville-footer {
    background: #222222 !important;
    color: #999 !important;
    margin-top: 60px;
    width: 100%;
    clear: both;
}
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
    padding: 50px 0;
    border-bottom: 1px solid #2d2d2d;
}
.footer-widget h3 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.1rem;
    color: #fff !important;
    margin-bottom: 20px;
}
.footer-widget p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #aaa;
}
.footer-widget ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.footer-widget ul li {
    list-style: none !important;
    padding: 10px 0;
    border-bottom: 1px solid #2d2d2d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-widget ul li a {
    color: #aaa !important;
    font-size: 0.9rem;
}
.footer-widget ul li a:hover {
    color: #fff !important;
}
.count-tag {
    background: #333;
    color: #ccc;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 10px;
}
.footer-bottom {
    text-align: center;
    padding: 25px 0;
    font-size: 0.8rem;
    color: #777;
}

/* ----------------------------------------------------
   9. BUTTONS, ALERTS & 404
   ---------------------------------------------------- */
.pagination { display: flex; justify-content: space-between; margin: 40px 0; }
.btn { display: inline-block; padding: 10px 20px; background: #222; color: #fff; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; border: none; cursor: pointer; }
.btn:hover { background: #108496; color: #fff; }

.alert { padding: 15px 20px; margin-top: 20px; font-size: 0.9rem; }
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.alert-error { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }

/* ----------------------------------------------------
   10. MOBILE RESPONSIVE NAVIGATION & GRID
   ---------------------------------------------------- */
@media (max-width: 800px) {
    .site-title { font-size: 2.2rem; }
    
    .nav-container { 
        flex-direction: column; 
        padding: 0 !important; 
        width: 100%; 
    }
    
    .mobile-nav-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        height: 52px;
        padding: 0 15px;
        background: #222222;
        border-bottom: 1px solid #1a1a1a;
    }
    
    .nav-toggle-btn, .search-toggle-btn {
        background: transparent;
        border: none;
        color: #fff;
        font-size: 1.4rem;
        cursor: pointer;
        padding: 8px 12px;
        line-height: 1;
    }
    .nav-toggle-btn:active, .search-toggle-btn:active {
        color: #108496;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        background: #1c1c1c;
    }
    .nav-menu.active {
        display: flex;
    }
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #282828;
    }
    .nav-menu li a {
        padding: 14px 20px;
        color: #ccc;
        font-size: 0.85rem;
    }
    .nav-menu li a:hover {
        background: #111;
        color: #fff;
    }

    .search-toggle-form {
        display: none;
        width: 100%;
        padding: 15px 20px;
        background: #1c1c1c;
        border-bottom: 1px solid #282828;
    }
    .search-toggle-form.active {
        display: flex;
    }
    .search-toggle-form form {
        width: 100%;
    }
    .search-toggle-form input {
        flex: 1;
        width: 100%;
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .baskerville-grid { grid-template-columns: 1fr; }
    .post-layout-grid { grid-template-columns: 1fr; }
    .footer-widgets { grid-template-columns: 1fr; }
    .single-post-header, .single-content, .comments-card { padding: 22px 18px; }
    .post-meta-banner { padding: 0 15px 15px 0; }
    .meta-banner-right { text-align: left; padding-left: 20px; }
}