/*
Theme Name: MIST Blog
Theme URI: https://mistsoftware.com
Author: MIST Software
Author URI: https://mistsoftware.com
Description: Custom theme matching the MIST Software brand
Version: 1.0
License: Proprietary
Text Domain: mist-blog
*/

/* ========================================
   CSS Variables / Brand Colors
======================================== */
:root {
    --mist-bg-dark: #24252a;
    --mist-bg-darker: #1a1b1f;
    --mist-primary: #4b73e3;
    --mist-accent: #4b73e3;
    --mist-text-gray: #606c7e;
    --mist-text-light: #ffffff;
    --mist-card-bg: #2e3240;
    --mist-border: #40445e;
}

/* ========================================
   Base Styles
======================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--mist-bg-dark);
    color: var(--mist-text-light);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Background gradient effects matching main site */
body::before {
    content: '';
    position: fixed;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    height: 90vw;
    background: radial-gradient(closest-side, #2e3749ff 15%, #2a303cff 45%, #262a33aa 70%, #262c3300 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

body::after {
    content: '';
    position: fixed;
    top: -15%;
    left: 50%;
    transform: translateX(-50%);
    width: 170vw;
    height: 35vw;
    background: radial-gradient(#2e3749ff 15%, #2a303ccc 45%, #262c3377 60%, #262c3300 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

/* Gradient glow utility classes */
.fx__gradient--circle {
    background-color: transparent;
    background: radial-gradient(closest-side, #2e3749ff 15%, #2a303cff 45%, #262a33aa 70%, #262c3300 100%);
    width: 1em;
    height: 0.9em;
    border-radius: 1em;
    pointer-events: none;
}

.fx__gradient--ellipse {
    background-color: transparent;
    background: radial-gradient(#2e3749ff 15%, #2a303ccc 45%, #262c3377 60%, #262c3300 70%);
    width: 1em;
    height: 0.35em;
    border-radius: 1em;
    pointer-events: none;
}

/* Hide WordPress admin bar to prevent header overlap */
#wpadminbar {
    display: none !important;
}

html {
    margin-top: 0 !important;
}

a {
    color: var(--mist-accent);
    text-decoration: none;
    transition: color 0.25s ease-in-out;
}

a:hover {
    color: var(--mist-primary);
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   Typography
======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1em;
    color: #b0b8c4;
}

/* ========================================
   Layout
======================================== */
.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-area {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Main content needs padding for fixed header */
main#main-content {
    padding-top: 150px;
    position: relative;
    z-index: 1;
}

.site-container {
    position: relative;
    z-index: 1;
}

.site-footer {
    display: none;
}

/* ========================================
   Header - Matching Main Site
======================================== */
header#site-header {
    position: fixed;
    width: 100%;
    top: 50px;
    padding: 0 50px;
    font-weight: 500;
    color: #606c7e;
    display: flex;
    flex-direction: row;
    z-index: 9999;
}
header#site-header::before {
    position: absolute;
    content: '';
    top: -50px;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(180deg, rgb(36, 37, 42, 1) 20%, rgba(36, 37, 42, 0.98) 50%, rgba(36, 37, 42, 0.8) 75%, rgba(36, 37, 42, 0.65) 85%,rgba(36, 37, 42, 0) 100%);
    opacity: 0;
    z-index: -1;
    transition: 0.05s opacity ease-in-out, 0.15s height ease-in-out;
}
header#site-header.pinned::before {
    height: 180px;
    opacity: 1;
}
.header__brand {
    display: flex;
    justify-content: center;
    align-items: center;
}
.header__brand img {
    height: 28px;
    width: auto;
}
header#site-header nav {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
header#site-header nav a {
    padding: 0 10px;
    margin: 0 13px;
    font-size: 20px;
    font-weight: 500;
    color: #606c7e;
    transition: 0.25s color ease-in-out;
}
header#site-header nav a:hover {
    color: #fff;
}
.header__actions {
    position: relative;
    margin-right: auto;
    margin-left: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}
header#site-header .btn {
    height: 50px;
    width: 175px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 9999px;
    cursor: pointer;
}
header#site-header .btn span {
    position: relative;
    display: inline-block;
    font-size: 22px;
    font-weight: 500;
    top: -1px;
}
.btn--dark {
    color: #606c7eff !important;
    background-color: transparent !important;
    border: 3px solid #606c7eff !important;
    transition: 0.15s background ease-in-out, 0.15s color ease-in-out, 0.15s border ease-in-out;
}
.btn--dark:hover {
    background: #4b73e3 !important;
    color: #fff !important;
    border-color: transparent !important;
}
#mist-dedicated-phone {
    position: absolute;
    top: 40px;
    width: 100%;
    right: 0;
    font-size: 18px;
    font-weight: 600;
    color: #606c7e;
    text-align: center;
    padding: 20px 0;
}
.header__icon {
    display: none;
}
.header__bg {
    display: none;
}
.link {
    color: #ffffff;
    transition: 0.25s color ease-in-out;
}
.link:hover {
    color: #4b73e3 !important;
}

/* Mobile Header */
@media (max-width: 1080px) {
    header#site-header.pinned::before {
        height: 120px;
        opacity: 1;
    }
    header#site-header.open .header__bg {
        display: block;
    }
    header#site-header .header__bg {
        position: absolute;
        display: none;
        top: -50px;
        left: 0;
        width: 100%;
        height: calc(100vh + 75px);
        background-color: #24252a;
    }
    .header__icon {
        position: absolute;
        display: block;
        height: 35px;
        width: auto;
        top: -20px;
        left: 0;
        right: 0;
        margin: 0 auto;
        user-select: none;
        cursor: pointer;
        z-index: 6;
    }
    header#site-header .menu {
        position: absolute;
        opacity: 1;
        z-index: 6;
        pointer-events: initial;
    }
    header#site-header .close {
        opacity: 0;
        pointer-events: none;
    }
    header#site-header.open .menu {
        opacity: 0;
        pointer-events: none;
    }
    header#site-header.open .close {
        position: absolute;
        z-index: 6;
        opacity: 1;
        pointer-events: initial;
    }
    header#site-header .header__brand {
        position: fixed;
        bottom: 8vh;
        left: 0;
        right: 0;
        margin: 0 auto;
        opacity: 0;
        z-index: 6;
        pointer-events: none;
    }
    header#site-header.open .header__brand {
        opacity: 1;
        pointer-events: initial;
    }
    header#site-header nav {
        position: fixed;
        top: 20vh;
        flex-direction: column;
        left: 0;
        right: 0;
        margin: 0 auto;
        opacity: 0;
        z-index: 6;
        pointer-events: none;
    }
    header#site-header nav a {
        font-size: clamp(32px, calc(32px + (48 - 32) * ((100vw - 480px) / (1080 - 480))), 48px);
    }
    header#site-header.open nav {
        opacity: 1;
        pointer-events: initial;
    }
    header#site-header .header__actions {
        position: fixed;
        bottom: 25vh;
        flex-direction: column;
        left: 0;
        right: 0;
        margin: 0 auto;
        opacity: 0;
        z-index: 6;
        pointer-events: none;
    }
    header#site-header .btn {
        width: clamp(200px, calc(200px + (350 - 200) * ((100vw - 480px) / (1080 - 480))), 350px);
        height: clamp(60px, calc(60px + (90 - 60) * ((100vw - 480px) / (1080 - 480))), 90px);
        border-width: 5px;
    }
    header#site-header .btn span {
        font-size: clamp(32px, calc(32px + (48 - 32) * ((100vw - 480px) / (1080 - 480))), 48px);
    }
    #mist-dedicated-phone {
        position: relative;
        margin-top: -25px;
        right: initial;
        font-size: clamp(20px, calc(20px + (32 - 20) * ((100vw - 480px) / (1080 - 480))), 48px);
        padding: 0;
    }
    header#site-header.open .header__actions {
        opacity: 1;
        pointer-events: initial;
    }
}

/* ========================================
   Main Content Area
======================================== */
main {
    padding-top: 100px;
    min-height: calc(100vh - 300px);
}

/* ========================================
   Blog Posts
======================================== */
.posts-list {
    display: grid;
    gap: 30px;
}

.post-card {
    background: var(--mist-card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.post-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-card-content {
    padding: 25px;
}

.post-card-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.post-card-title a {
    color: var(--mist-text-light);
}

.post-card-title a:hover {
    color: var(--mist-accent);
}

.post-card-meta {
    font-size: 0.85rem;
    color: var(--mist-text-gray);
    margin-bottom: 15px;
}

.post-card-excerpt {
    color: #9ca3af;
    font-size: 0.95rem;
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    color: var(--mist-accent);
    font-weight: 500;
}

.read-more:hover {
    color: var(--mist-primary);
}

/* ========================================
   Single Post
======================================== */
.single-post-header {
    text-align: center;
    padding: 60px 20px 40px;
}

.single-post-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.single-post-meta {
    color: var(--mist-text-gray);
    font-size: 0.9rem;
}

.single-post-content {
    background: var(--mist-card-bg);
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 40px;
}

.single-post-content h2,
.single-post-content h3,
.single-post-content h4 {
    margin-top: 1.5em;
    color: var(--mist-text-light);
}

.single-post-content ul,
.single-post-content ol {
    margin: 1em 0;
    padding-left: 2em;
    color: #b0b8c4;
}

.single-post-content li {
    margin-bottom: 0.5em;
}

.single-post-content blockquote {
    border-left: 4px solid var(--mist-primary);
    padding-left: 20px;
    margin: 1.5em 0;
    font-style: italic;
    color: #9ca3af;
}

.single-post-content pre,
.single-post-content code {
    background: var(--mist-bg-darker);
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
}

.single-post-content pre {
    padding: 20px;
    overflow-x: auto;
}

.single-post-content code {
    padding: 2px 6px;
    font-size: 0.9em;
}

.single-post-content pre code {
    padding: 0;
}

/* Featured Image */
.post-thumbnail {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
}

/* ========================================
   Sidebar
======================================== */
.sidebar {
    background: var(--mist-card-bg);
    border-radius: 12px;
    padding: 30px;
}

.widget {
    margin-bottom: 30px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--mist-border);
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 8px 0;
    border-bottom: 1px solid var(--mist-border);
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: #9ca3af;
}

.widget a:hover {
    color: var(--mist-accent);
}

/* ========================================
   Footer
======================================== */
.site-footer {
    background: var(--mist-bg-darker);
    padding: 60px 20px 30px;
    margin-top: 80px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-brand img {
    height: 40px;
    margin-bottom: 20px;
}

.footer-brand p {
    color: var(--mist-text-gray);
    font-size: 0.9rem;
}

.footer-links h4 {
    color: var(--mist-text-light);
    margin-bottom: 15px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--mist-text-gray);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--mist-accent);
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--mist-border);
    text-align: center;
    color: var(--mist-text-gray);
    font-size: 0.85rem;
}

/* ========================================
   Buttons
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 9999px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border 0.15s ease;
}

.btn-primary {
    background: var(--mist-primary);
    color: var(--mist-text-light);
}

.btn-primary:hover {
    background: var(--mist-accent);
}

.btn-outline {
    background: transparent;
    color: var(--mist-text-gray);
    border-color: var(--mist-text-gray);
}

.btn-outline:hover {
    background: var(--mist-accent);
    color: var(--mist-text-light);
    border-color: transparent;
}

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

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--mist-card-bg);
    color: var(--mist-text-light);
    font-weight: 500;
}

.pagination a:hover {
    background: var(--mist-primary);
}

.pagination .current {
    background: var(--mist-primary);
}

/* ========================================
   Comments
======================================== */
.comments-area {
    background: var(--mist-card-bg);
    border-radius: 12px;
    padding: 40px;
    margin-top: 40px;
}

.comments-title {
    margin-bottom: 30px;
}

.comment-list {
    list-style: none;
}

.comment {
    padding: 20px 0;
    border-bottom: 1px solid var(--mist-border);
}

.comment:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 5px;
}

.comment-meta {
    font-size: 0.85rem;
    color: var(--mist-text-gray);
    margin-bottom: 10px;
}

.comment-content p {
    color: #b0b8c4;
}

/* Comment Form */
.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    background: var(--mist-bg-dark);
    border: 1px solid var(--mist-border);
    border-radius: 8px;
    color: var(--mist-text-light);
    font-family: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--mist-primary);
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.comment-form .submit {
    background: var(--mist-primary);
    color: var(--mist-text-light);
    border: none;
    padding: 15px 30px;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.comment-form .submit:hover {
    background: var(--mist-accent);
}

/* ========================================
   Search Form
======================================== */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 12px 15px;
    background: var(--mist-bg-dark);
    border: 1px solid var(--mist-border);
    border-radius: 8px;
    color: var(--mist-text-light);
}

.search-form button {
    padding: 12px 20px;
    background: var(--mist-primary);
    border: none;
    border-radius: 8px;
    color: var(--mist-text-light);
    cursor: pointer;
}

.search-form button:hover {
    background: var(--mist-accent);
}

/* ========================================
   404 Page
======================================== */
.error-404 {
    text-align: center;
    padding: 100px 20px;
}

.error-404 h1 {
    font-size: 6rem;
    color: var(--mist-primary);
}

.error-404 p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* ========================================
   Mobile Menu
======================================== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--mist-text-light);
    margin: 5px 0;
    transition: transform 0.3s ease;
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 1080px) {
    .site-header {
        padding: 15px 20px;
    }
    
    .main-navigation {
        display: none;
    }
    
    .main-navigation.active {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--mist-bg-dark);
        padding: 20px;
    }
    
    .main-navigation.active ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-navigation.active li {
        border-bottom: 1px solid var(--mist-border);
    }
    
    .main-navigation.active a {
        display: block;
        padding: 15px 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .header-cta {
        display: none;
    }
}

@media (max-width: 768px) {
    main {
        padding-top: 80px;
    }
    
    .content-area {
        padding: 20px 15px;
    }
    
    .single-post-title {
        font-size: 1.8rem;
    }
    
    .single-post-content {
        padding: 25px;
    }
    
    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ========================================
   WordPress Core Styles
======================================== */
.alignleft {
    float: left;
    margin-right: 20px;
    margin-bottom: 10px;
}

.alignright {
    float: right;
    margin-left: 20px;
    margin-bottom: 10px;
}

.aligncenter {
    display: block;
    margin: 20px auto;
}

.wp-caption {
    max-width: 100%;
    margin-bottom: 20px;
}

.wp-caption-text {
    font-size: 0.85rem;
    color: var(--mist-text-gray);
    text-align: center;
    padding: 10px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.gallery-item {
    margin: 0;
}

.gallery-item img {
    border-radius: 8px;
}

/* Screen reader text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}
