/*
Theme Name: Custom Blog Theme
Theme URI: https://preview--clusteriq-ai-seo.lovable.app
Author: Scopic Software
Author URI: https://scopicsoftware.com
Description: ClusterView blog theme — matches the ClusterView mini-site header and footer.
Version: 2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: custom-blog-theme
*/

/* ========================================
   Reset & Base
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    font-family: inherit;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

main {
    padding: 0 0 40px 0 !important;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0px;
}

/* ========================================
   Header
   ======================================== */

:root {
    --site-header-height: 76px;
}

@media (max-width: 768px) {
    :root {
        --site-header-height: 72px;
    }
}

.site-header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    position: sticky;
    top: 0;
    z-index: 1001;
    border-bottom: 1px solid transparent;
    min-height: 76px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    transition: min-height 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.site-header.is-scrolled {
    border-bottom-color: rgb(224, 227, 235);
    box-shadow: rgba(19, 21, 32, 0.04) 0px 1px 3px 0px, rgba(19, 21, 32, 0.06) 0px 6px 24px 0px;
    min-height: 60px;
}

@media (max-width: 768px) {
    .site-header {
        min-height: 72px;
    }

    .site-header.is-scrolled {
        min-height: 56.8px;
    }
}

.site-header > .container {
    width: 100%;
}

.header-wrapper {
    display: flex;
    align-items: center;
    padding: 20px 32px;
    box-sizing: border-box;
    transition: padding 0.25s ease;
}

.site-header.is-scrolled .header-wrapper {
    padding-top: 14px;
    padding-bottom: 14px;
}

@media (max-width: 768px) {
    .site-header.is-scrolled .header-wrapper {
        padding-top: 12.4px;
        padding-bottom: 12.4px;
    }
}

.site-branding {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-logo-img {
    height: 2rem;
    width: auto;
    object-fit: contain;
}

.custom-logo-link {
    display: flex;
    align-items: center;
}

.custom-logo-link img {
    height: 2rem;
    width: auto;
    object-fit: contain;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    padding: 0;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    z-index: 1001;
}

.mobile-menu-toggle .menu-icon-open,
.mobile-menu-toggle .menu-icon-close {
    color: #131520;
}

.mobile-menu-toggle .menu-icon-close {
    display: none;
}

.mobile-menu-toggle.active .menu-icon-open {
    display: none;
}

.mobile-menu-toggle.active .menu-icon-close {
    display: block;
}

/* ========================================
   Navigation
   ======================================== */

.main-navigation {
    display: flex;
    align-items: center;
    flex: 1;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 32px;
    margin: 0 auto;
    padding: 0;
    align-items: center;
}

.main-navigation li {
    margin: 0;
}

.main-navigation ul a {
    text-decoration: none;
    color: #676D7E;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s ease;
    padding: 8px 0;
    white-space: nowrap;
}

.main-navigation ul a:hover {
    color: #131520;
}

.main-navigation .current-menu-item a,
.main-navigation .current_page_item a {
    color: #131520;
    font-weight: 600;
}

/* ========================================
   Header Actions (Log In + CTA)
   ======================================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.header-login {
    text-decoration: none;
    color: #131520;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-login:hover {
    color: #ffffff;
    background: #3B82F6;
}

.header-cta {
    background-color: rgb(70, 58, 203);
    background-image: linear-gradient(135deg, rgb(70, 58, 203), rgb(117, 71, 209), rgb(42, 109, 244));
    color: #ffffff;
    height: 36px;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-cta:hover {
    opacity: 0.85;
    color: #ffffff;
}

/* ========================================
   Hero Banner
   ======================================== */

.hero-header {
    background: #f7f7fa;
    background-size: cover;
    background-position: center;
    padding: 84px 32px 64px;
    color: #1a1a2e;
    margin-bottom: 40px;
    overflow: hidden;
    position: relative;
}

@media (max-width: 1280px) {
    .hero-header {
        padding-top: 52px;
    }
}

@media (max-width: 1024px) {
    .hero-header {
        padding-top: 48px;
    }
}

.hero-title {
    font-size: 48px;
    color: #131520;
    text-shadow: none;
    margin-bottom: 16px;
    font-weight: 800;
}

.hero-description {
    font-size: 18px;
    color: #676D7E;
    text-shadow: none;
    width: 60%;
    line-height: 1.7;
}

.hero-grid {
    background-image: linear-gradient(rgba(109, 40, 217, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(109, 40, 217, 0.04) 1px, transparent 1px);
    opacity: 0.5;
    background-size: 60px 60px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-circle-1 {
    background: radial-gradient(circle, rgba(109, 40, 217, 0.06) 0%, transparent 70%);
    position: absolute;
    top: -80px;
    left: -80px;
    width: 400px;
    height: 400px;
}

.hero-circle-2 {
    background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
    position: absolute;
    bottom: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
}

.hero-content {
    position: relative;
    z-index: 1;
}

/* ========================================
   Posts Grid
   ======================================== */

main {
    padding: 40px 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   Post Card
   ======================================== */

.post {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.post-thumbnail-link {
    display: block;
    overflow: hidden;
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-category {
    display: inline-block;
    background: #edeff3;
    color: #0f192e;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    text-transform: capitalize;
    width: fit-content;
}

.post-title {
    font-size: 18px;
    color: #0f192e;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
}

.post-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-title a:hover {
    color: #6D28D9;
}

.post-excerpt {
    color: #626d84;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    flex-grow: 1;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #626d84;
    font-size: 12px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-author::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23626d84' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.post-read-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-read-time::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23626d84' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
    background: #ffffff;
    color: #6B7280;
    padding: 0;
    margin-top: 80px;
    border-top: 1px solid #e5e7eb;
}

.footer-wrapper {
    padding: 64px 32px 32px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-column {
    display: flex;
    flex-direction: column;
}

.footer-logo {
    margin-bottom: 16px;
}

.footer-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.footer-logo-img {
    height: 1.75rem;
    width: auto;
    object-fit: contain;
}

.footer-logo .custom-logo-link img {
    height: 1.75rem;
    width: auto;
    object-fit: contain;
}

.footer-description {
    font-size: 14px;
    color: #676D7E;
    line-height: 1.7;
    margin: 0;
    max-width: 380px;
}

.footer-nav-col {
    padding-top: 8px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-links a {
    color: #676D7E;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #131520;
}

.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 32px;
    border-top: 1px solid #e5e7eb;
}

.footer-copyright {
    font-size: 12px;
    color: #676D7E;
    margin: 0;
}

/* ========================================
   Mobile Responsive
   ======================================== */

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        margin-left: auto;
    }
    
    .main-navigation {
        position: fixed;
        left: 0;
        width: 100%;
        height: auto;
        background: #ffffff;
        flex-direction: column;
        justify-content: flex-start;
        padding: 24px;
        z-index: 999;
        border-top: 1px solid rgb(224, 227, 235);
        border-bottom: 1px solid rgb(224, 227, 235);
        box-shadow: rgba(19, 21, 32, 0.04) 0px 1px 3px 0px, rgba(19, 21, 32, 0.06) 0px 6px 24px 0px;
        overflow-y: auto;
        display: none;
        top: 64px;
        max-height: calc(100vh - 64px);
    }

    .main-navigation.active {
        display: flex;
        top: 64px;
        max-height: calc(100vh - 64px);
    }

    .site-header.is-scrolled .main-navigation.active {
        top: 56px;
        max-height: calc(100vh - 56px);
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        align-items: flex-start;
    }
    
    .main-navigation li {
        width: 100%;
        margin-top: 16px;
    }

    .main-navigation li:first-child {
        margin-top: 0;
    }
    
    .main-navigation ul a {
        display: block;
        padding: 0;
        height: 20px;
        line-height: 20px;
        font-size: 14px;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
        margin-top: 16px;
        padding-top: 16px;
    }

    .header-login {
        width: 100%;
        height: 40px;
        padding: 8px 16px;
        justify-content: flex-start;
    }

    .header-cta {
        width: 100%;
        height: 40px;
        padding: 8px 16px;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-description {
        width: 100%;
    }

    .hero-header {
        padding-top: 56px;
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 64px;
    }

    .hero-title {
        font-size: 36px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .footer-bottom {
        text-align: center;
    }
    
    .footer-wrapper {
        padding: 48px 20px 24px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 32px;
    }

    .main-navigation ul {
        gap: 20px;
    }

    .header-wrapper {
        gap: 20px;
    }
}

/* ========================================
   Single Post
   ======================================== */

.single-post-header {
    margin-bottom: 64px;
}

.single-post-header-image {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.single-post-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single-post-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
}

.single-post-back-link {
    position: absolute;
    bottom: 32px;
    left: 32px;
    z-index: 10;
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #626d84;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.back-to-blog:hover {
    color: #6D28D9;
}

.back-to-blog svg {
    stroke: currentColor;
}

.single-post-header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 0 0 0;
    text-align: start;
}

.single-post-category {
    display: inline-block;
    background: #6D28D9;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 16px;
    text-transform: capitalize;
}

.single-post-title {
    font-size: 48px;
    font-weight: 700;
    color: #0f192e;
    line-height: 1.2;
    margin: 0 0 16px 0;
}

.single-post-excerpt {
    font-size: 18px;
    color: #626d84;
    line-height: 1.6;
    margin: 0;
}

.single-post-article {
    margin-bottom: 80px;
}

.single-post-content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.single-post-content-wrapper .post-content {
    font-size: 16px;
    line-height: 1.8;
    color: #1a1a1a;
    margin-bottom: 48px;
}

.single-post-content-wrapper .post-content p {
    margin-bottom: 24px;
}

.single-post-content-wrapper .post-content h2 {
    font-size: 32px;
    font-weight: 700;
    color: #0f192e;
    margin: 48px 0 24px 0;
    line-height: 1.3;
}

.single-post-content-wrapper .post-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: #0f192e;
    margin: 36px 0 20px 0;
    line-height: 1.4;
}

.single-post-content-wrapper .post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 32px 0;
}

.single-post-content-wrapper .post-content ul,
.single-post-content-wrapper .post-content ol {
    margin: 24px 0;
    padding-left: 32px;
}

.single-post-content-wrapper .post-content li {
    margin-bottom: 12px;
}

.single-post-content-wrapper .post-content a {
    color: #6D28D9;
    text-decoration: underline;
}

.single-post-content-wrapper .post-content a:hover {
    color: #5B21B6;
}

.post-meta-footer {
    display: flex;
    gap: 32px;
    padding: 24px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 48px;
}

.post-author-info,
.post-date-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #626d84;
    font-size: 14px;
}

.post-meta-icon {
    width: 16px;
    height: 16px;
    stroke: #626d84;
}

@media (max-width: 768px) {
    .single-post-header-image {
        height: 300px;
    }
    
    .single-post-back-link {
        top: 16px;
        left: 16px;
    }
    
    .single-post-header-content {
        padding-top: 32px;
    }
    
    .single-post-title {
        font-size: 32px;
    }
    
    .single-post-excerpt {
        font-size: 16px;
    }
    
    .post-meta-footer {
        flex-direction: column;
        gap: 16px;
    }
}

/* ========================================
   Pagination
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 15px;
    background: #fff;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover {
    background: #6D28D9;
    color: #fff;
}

.pagination .current {
    background: #6D28D9;
    color: #fff;
}
