/*
Theme Name: UniqueClassyBlog
Theme URI: https://example.com/uniqueclassy
Author: Antigravity
Author URI: https://example.com
Description: A unique, premium, and elegant blogging theme with a minimalist editorial design, classy typography, and advanced single post features.
Version: 1.2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: uniqueblog
*/

/* Reset & Base Variables */
:root {
    --bg-color: #faf9f6;
    --text-color: #1a1a1a;
    --primary-color: #1a1a1a;
    --secondary-color: #8c7e6c;
    --accent-color: #bfa58a;
    --highlight-color: #00E599; /* Neon green from the screenshot */
    --surface-color: #ffffff;
    --border-color: #e5e0d8;
    --font-sans: 'Lato', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --max-width: 1300px;
    --transition: all 0.4s ease-out;
}

:root[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #f0ece1;
    --primary-color: #f0ece1;
    --secondary-color: #bfa58a;
    --surface-color: #1a1a1a;
    --border-color: #333333;
    --highlight-color: #00b377;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: #121212;
        --text-color: #f0ece1;
        --primary-color: #f0ece1;
        --secondary-color: #bfa58a;
        --surface-color: #1a1a1a;
        --border-color: #333333;
        --highlight-color: #00b377;
    }
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 400;
    margin-top: 0;
    color: var(--primary-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

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

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem; /* Better mobile padding */
}

@media (min-width: 768px) {
    .container { padding: 0 5%; }
}

/* Header - Magazine Style */
.site-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0; /* Reduced mobile padding */
    background-color: var(--bg-color); /* Ensure background is solid */
    position: relative;
    z-index: 1000;
}

@media (min-width: 768px) {
    .site-header { padding: 3rem 0; }
}

.header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.site-title {
    margin: 0;
    font-size: 3.5rem;
    font-weight: 600;
    font-family: var(--font-serif);
    letter-spacing: -0.02em;
    text-align: center;
    text-transform: uppercase;
}

.main-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 3rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    font-weight: 700;
}

.main-navigation a {
    color: var(--text-color);
    position: relative;
    padding-bottom: 5px;
    white-space: nowrap;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    transition: var(--transition);
}

.main-navigation a:hover::after {
    width: 100%;
}

/* Editorial Blog Feed - Modern Grid Redesign */
.site-main {
    padding: 4rem 0;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

.post-card {
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

@media (prefers-color-scheme: dark) {
    .post-card:hover {
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        border-color: var(--highlight-color);
    }
}

.post-card .post-title a {
    color: inherit;
    text-decoration: none;
    background-image: linear-gradient(var(--text-color), var(--text-color));
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size var(--transition);
}

.post-card:hover .post-title a {
    background-size: 100% 1px;
}

/* Feature Unlocks Styling */
#reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background-color: var(--highlight-color);
    z-index: 10000;
    display: none;
    transition: width 0.1s ease;
}

.search-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: color-mix(in srgb, var(--bg-color) 95%, transparent);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-overlay.active {
    opacity: 1; visibility: visible;
}

.search-close {
    position: absolute; top: 30px; right: 40px; font-size: 3rem; color: var(--text-color); background: none; border: none; cursor: pointer; transition: transform 0.2s;
}
.search-close:hover {
    transform: scale(1.1);
}

.search-overlay-form-wrap {
    width: 100%; max-width: 800px; padding: 0 20px;
}

.overlay-search-field {
    width: 100%; background: transparent; border: none; border-bottom: 2px solid var(--text-color); font-size: 3rem; color: var(--text-color); padding: 10px 0; outline: none; font-family: var(--font-serif); transition: border-color var(--transition);
}
.overlay-search-field:focus {
    border-color: var(--highlight-color);
}

.overlay-search-field::placeholder { 
    color: color-mix(in srgb, var(--text-color) 30%, transparent); 
}

/* Toggle Hover Logic Override */
.toggle-btn:hover {
    color: var(--highlight-color) !important;
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--highlight-color);
    color: #1a1a1a;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background-color: color-mix(in srgb, var(--highlight-color) 80%, black);
}

/* Load More Button Styling */
.btn-load-more {
    background-color: var(--highlight-color);
    color: #1a1a1a;
    border: none;
    padding: 1rem 2.5rem;
    font-family: var(--font-sans);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 229, 153, 0.2);
}

.btn-load-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 229, 153, 0.4);
    background-color: color-mix(in srgb, var(--highlight-color) 90%, black);
}

/* Spinner Animation */
.spinner {
    margin: 0 auto;
    width: 70px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.spinner > div {
    width: 14px;
    height: 14px;
    background-color: var(--highlight-color);
    border-radius: 100%;
    display: inline-block;
    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner .bounce1 { animation-delay: -0.32s; }
.spinner .bounce2 { animation-delay: -0.16s; }

@keyframes sk-bouncedelay {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

.post-thumbnail-wrap {
    width: 100%;
    aspect-ratio: 16 / 10; /* Prevent Layout Shift */
    background-color: var(--border-color); /* Placeholder while loading */
    overflow: hidden;
    position: relative;
}

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

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

.post-content {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-category {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #000;
    background: var(--highlight-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    margin-bottom: 0.8rem;
    font-family: var(--font-sans);
    display: inline-block;
    width: fit-content;
    align-self: flex-start;
}

.post-title {
    font-size: 1.4rem;
    line-height: 1.3;
    margin-bottom: 1rem;
    font-family: var(--font-serif);
    font-weight: 600;
}

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

.post-title a:hover {
    color: var(--highlight-color);
}

.post-excerpt {
    font-size: 0.95rem;
    color: color-mix(in srgb, var(--text-color) 75%, transparent);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
}

.post-meta-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: color-mix(in srgb, var(--text-color) 60%, transparent);
}

.post-read-more {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--primary-color);
    transition: var(--transition);
}

.post-read-more:hover {
    color: var(--highlight-color);
}

/* Single Post Specific Layout */
.single-post-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin: 4rem auto;
}

.single-post-hero-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
}

.read-time-badge {
    border: 1px solid var(--text-color);
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-sans);
}

.single-post-hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    font-family: var(--font-sans); /* Based on the screenshot it looks sans-serif */
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.single-post-hero-title span.highlight {
    background-color: var(--highlight-color);
    padding: 4px 12px;
    border-radius: 8px;
    display: inline-block;
}

.single-author-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.single-author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.single-author-info {
    display: flex;
    flex-direction: column;
}

.single-author-name {
    font-weight: 700;
    font-family: var(--font-sans);
}

.single-author-role {
    font-size: 0.85rem;
    color: color-mix(in srgb, var(--text-color) 60%, transparent);
}

.single-post-hero-image img {
    border-radius: 16px;
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

/* Post Body with Sidebar */
.single-content-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
    margin-bottom: 5rem;
}

/* Sticky Sidebar */
.single-sidebar {
    position: sticky;
    top: 2rem;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.toc-widget .widget-title {
    font-family: var(--font-sans);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.toc-list a {
    color: color-mix(in srgb, var(--text-color) 70%, transparent);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    transition: var(--transition);
}

.toc-list a:hover {
    color: var(--text-color);
}

.toc-list li {
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

.toc-list li.active {
    border-left: 2px solid var(--highlight-color);
    padding-left: 8px;
}

.toc-list li.active a {
    color: var(--highlight-color);
    font-weight: 700;
}

.share-widget .widget-title {
    font-family: var(--font-sans);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    gap: 1rem;
}

.share-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    color: var(--text-color);
}

.share-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.copy-link-btn {
    margin-top: 1rem;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    width: 100%;
    justify-content: center;
}

.copy-link-btn:hover {
    background: var(--border-color);
}


/* Post Content Typography */
.single-post-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: color-mix(in srgb, var(--text-color) 90%, transparent);
}

.single-post-content a {
    color: skyblue;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
    transition: var(--transition);
}

.single-post-content a:hover {
    color: var(--highlight-color);
    text-decoration-color: var(--highlight-color);
}

.single-post-content h2,
.single-post-content h3 {
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-sans);
    font-weight: 700;
}

/* AI Explore Buttons */
.explore-ai-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.explore-ai-title {
    font-size: 1.8rem;
    font-family: var(--font-sans);
    font-weight: 700;
    color: #2b4b5a; /* Matching the screenshot text color */
    margin-bottom: 1.5rem;
    display: block;
}

@media (prefers-color-scheme: dark) {
    .explore-ai-title { color: #88c0d0; }
}

.ai-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.ai-btn {
    padding: 12px 24px;
    border-radius: 30px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none !important;
    display: inline-block;
    transition: transform 0.2s ease;
}

.ai-btn:hover {
    transform: translateY(-2px);
    color: white !important;
}

.ai-btn-perplexity { background-color: #8c4af2; color: white !important; }
.ai-btn-chatgpt { background-color: #00a67e; color: white !important; }
.ai-btn-grok { background-color: #000000; color: white !important; border: 1px solid #333; }
@media (prefers-color-scheme: dark) { .ai-btn-grok { background-color: #ffffff; color: #000 !important; } .ai-btn-grok:hover { color: #000 !important; } }
.ai-btn-google { background-color: #1a73e8; color: white !important; }

/* Responsive adjustments */
@media (max-width: 992px) {
    .single-post-hero {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin: 2rem auto;
    }
    
    .single-content-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .single-sidebar {
        position: static;
        flex-direction: column;
        gap: 2rem;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 2rem;
    }
    
    .toc-widget { width: 100%; }
}

@media (max-width: 768px) {
    .site-title { font-size: 2.2rem; }
    .single-post-hero-title { font-size: 2rem; }
    
    .main-navigation ul {
        display: none; /* Hide for mobile toggle */
        flex-direction: column;
        gap: 1rem;
        background: var(--surface-color);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 2rem;
        border-bottom: 2px solid var(--highlight-color);
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        margin: 0;
        z-index: 999;
    }
    
    .site-navigation.toggled .main-navigation ul {
        display: flex;
    }
    
    .menu-toggle {
        display: block !important;
        background: none;
        border: 2px solid var(--border-color);
        padding: 8px 15px;
        border-radius: 4px;
        color: var(--text-color);
        font-family: var(--font-sans);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.8rem;
        cursor: pointer;
    }

    .nav-wrapper {
        justify-content: space-between;
        width: 100%;
    }
}

/* Misc Footer Re-design */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 0 0;
    text-align: left;
    background-color: #1a1a1a;
    color: #e5e5e5;
}

.footer-grid-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    padding-bottom: 3rem;
}

.footer-logo {
    font-size: 2rem;
    font-family: var(--font-sans);
    font-weight: 800;
    text-transform: uppercase;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
}

.footer-desc {
    color: color-mix(in srgb, #e5e5e5 70%, transparent);
    font-size: 0.95rem;
    line-height: 1.8;
}

.footer-widget-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-family: var(--font-sans);
}

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

.footer-links a {
    color: color-mix(in srgb, #e5e5e5 70%, transparent);
    font-size: 0.95rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #00b377;
    padding-left: 5px;
}

@media (max-width: 768px) {
    .footer-grid-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}
