@import url('variables.css');

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

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

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

main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    margin-top: 3rem;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.single-post {
    display: block;
    max-width: 900px;
}

/* Glass Component */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--blur-amount);
    -webkit-backdrop-filter: var(--blur-amount);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: var(--glass-shine);
    pointer-events: none;
    z-index: 1;
}

/* Header */
.site-header {
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 2rem;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo {
    height: 40px;
    width: auto;
}

.site-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav ul {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

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

/* Posts List */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.post-card {
    padding: 2.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.post-title {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.post-title a {
    background: linear-gradient(to right, var(--text-primary), var(--text-primary));
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease, color 0.3s ease;
}

.post-title a:hover {
    color: var(--accent-primary);
    background-size: 100% 2px;
    background-image: var(--accent-gradient);
}

.post-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.post-excerpt {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.read-more {
    display: inline-block;
    padding: 0.8rem 2.5rem;
    background: var(--accent-gradient);
    color: #fff !important;
    border-radius: var(--radius-full);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.read-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.6);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    padding: 2rem;
}

.widget-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    position: relative;
    padding-left: 1rem;
}

.widget-title::before {
    content: '';
    position: absolute;
    left: 0;
    width: 4px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.widget-list li {
    margin-bottom: 0.8rem;
}

.widget-list a {
    color: var(--text-secondary);
    font-weight: 500;
    display: block;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.widget-list a:hover {
    background: rgba(255,255,255,0.5);
    color: var(--accent-primary);
    transform: translateX(5px);
    box-shadow: var(--shadow-inset);
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.3);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.tag-item:hover {
    color: #fff;
    background: var(--accent-gradient);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    border-color: transparent;
}

/* Single Post Page */
.post-header {
    composes: glass;
    text-align: center;
    margin-bottom: 3rem;
    padding: 4rem;
}

.single-post .post-title {
    font-size: clamp(1.8rem, 2.5vw + 1rem, 3.5rem);
    line-height: 1.2;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
}

.post-content {
    composes: glass;
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-primary);
    padding: 4rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content h2 {
    font-size: 1.8rem;
    margin: 2.5rem 0 1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.post-content img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 4px solid rgba(255,255,255,0.3);
    margin: 2rem 0;
    width: 100%;
    height: auto;
}

.post-content blockquote {
    font-size: 1.4rem;
    font-style: italic;
    color: var(--text-secondary);
    border-left: 4px solid var(--accent-primary);
    padding-left: 2rem;
    margin: 2rem 0;
    background: rgba(255,255,255,0.2);
    padding: 2rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Comments Section */
.comments-section {
    margin-top: 4rem;
}

.comment-form {
    composes: glass;
    padding: 3rem;
    margin-top: 3rem;
}

.form-control {
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-inset);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    width: 100%;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    box-shadow: var(--shadow-soft);
    background: #fff;
    outline: none;
    border-color: var(--accent-primary);
}

.btn {
    background: var(--accent-gradient);
    color: #fff;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    border: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

/* Footer */
footer {
    margin-top: 6rem;
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
    border-top: 1px solid rgba(255,255,255,0.2);
}

/* Tag Links in Post Meta */
.post-tags {
    margin-left: 0.5rem;
}

.tag-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.tag-link:hover {
    background: rgba(99, 102, 241, 0.1);
    text-decoration: none;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        margin-top: 3rem;
    }
}

@media (max-width: 768px) {
    :root {
        --container-width: 100%;
        --spacing-unit: 1rem;
    }

    .site-title {
        font-size: 1.8rem;
    }

    nav ul {
        display: none; /* Mobile menu would be needed */
    }

    .post-content, .post-header {
        padding: 2rem;
    }
}
