/*
Theme Name: Alex-Psy Theme
Theme URI: https://alex-psy.club
Author: DevNomad
Description: Минималистичная тема для блога психолога в стиле alex-psy.club
Version: 1.0
Text Domain: alex-psy-theme
*/

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4299e1;
    --primary-dark: #3182ce;
    --primary-light: #90cdf4;
    --secondary-color: #68d391;
    --accent-color: #ed8936;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-light: #718096;
    --background-primary: #ffffff;
    --background-secondary: #f7fafc;
    --border-color: #e2e8f0;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--background-secondary);
}

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

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

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

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

/* Header */
.site-header {
    background: var(--background-primary);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
}

.site-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.site-title a {
    color: inherit;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.main-nav a:hover,
.main-nav .current-menu-item a {
    color: var(--primary-color);
}

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

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

/* Hero Section */
.blog-hero {
    background: var(--gradient-primary);
    color: white;
    text-align: center;
    padding: 80px 20px;
}

.blog-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.blog-hero p {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
}

/* Main Content */
.site-main {
    padding: 60px 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

/* Post Card */
.post-card {
    background: var(--background-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: transform var(--transition), box-shadow var(--transition);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.post-thumbnail {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
}

.post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

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

.post-content {
    padding: 25px;
}

.post-category {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.post-title a {
    color: inherit;
}

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

.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-meta svg {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

/* Single Post */
.single-post-header {
    background: var(--gradient-primary);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.single-post-header .post-category {
    background: rgba(255,255,255,0.2);
    color: white;
}

.single-post-header h1 {
    font-size: 2.5rem;
    max-width: 900px;
    margin: 20px auto;
}

.single-post-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 50px 20px;
    background: var(--background-primary);
    margin-top: -30px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.single-post-content h2 {
    font-size: 1.75rem;
    margin: 40px 0 20px;
    color: var(--text-primary);
}

.single-post-content h3 {
    font-size: 1.4rem;
    margin: 30px 0 15px;
}

.single-post-content p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.single-post-content ul,
.single-post-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

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

.single-post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 20px 30px;
    margin: 30px 0;
    background: var(--background-secondary);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
}

.featured-image {
    margin: 30px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
}

.widget {
    background: var(--background-primary);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-light);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

/* Categories Widget */
.widget_categories ul {
    list-style: none;
}

.widget_categories li {
    margin-bottom: 8px;
}

.widget_categories a {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.widget_categories a:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

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

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 15px;
    border-radius: 10px;
    font-weight: 500;
    transition: all var(--transition);
}

.pagination a {
    background: var(--background-primary);
    color: var(--text-secondary);
    box-shadow: var(--shadow-light);
}

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

.pagination .current {
    background: var(--gradient-primary);
    color: white;
}

/* Footer */
.site-footer {
    background: #1a202c;
    color: #a0aec0;
    padding: 50px 0 30px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.footer-section p {
    margin-bottom: 10px;
}

.footer-section p a {
    color: #a0aec0;
}

.footer-section p a:hover {
    color: var(--primary-light);
}

/* Category list in footer */
.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 8px;
    color: #a0aec0;
}

.footer-section li a {
    color: #a0aec0;
}

.footer-section li a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #2d3748;
    font-size: 0.9rem;
}

.back-to-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: background var(--transition);
}

.back-to-main:hover {
    background: var(--primary-dark);
    color: white;
}

/* Consultation button in header */
.btn-consultation {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-consultation:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    color: white !important;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-consultation:active {
    transform: translateY(0);
}

/* Consultation link in header */
.consultation-link {
    color: var(--primary-color) !important;
    font-weight: 600;
    transition: color 0.3s ease;
}

.consultation-link:hover {
    color: var(--primary-dark) !important;
    text-decoration: underline;
}

/* Consultation Modal */
.consultation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.consultation-modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.consultation-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.consultation-form .form-group {
    margin-bottom: 20px;
}

.consultation-form label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.consultation-form input,
.consultation-form select,
.consultation-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.consultation-form input:focus,
.consultation-form select:focus,
.consultation-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.consultation-form textarea {
    resize: vertical;
    min-height: 80px;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 25px;
}

.form-checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
}

.form-checkbox label {
    margin-bottom: 0;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-checkbox a {
    color: var(--primary-color);
}

.btn-submit {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.success-message {
    text-align: center;
    padding: 30px 0;
}

.success-message h3 {
    color: #48bb78;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.success-message p {
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        flex-direction: column;
        gap: 15px;
    }

    .main-nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .single-post-header h1 {
        font-size: 1.75rem;
    }

    .modal-content {
        padding: 25px;
        margin: 10px;
    }

    .consultation-form .form-row {
        grid-template-columns: 1fr;
    }
}
