/* ===== pages-posts.css - Стили для обычных страниц и постов ===== */
/* ===== Базовые стили для контента ===== */

/* ===== Типография ===== */
.algkod-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.algkod-content h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 2.5rem 0 1.5rem;
    line-height: 1.3;
    position: relative;
}

.algkod-content h2:first-of-type {
    margin-top: 1rem;
}

.algkod-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    line-height: 1.4;
}

.algkod-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
}

.algkod-content p {
    margin-bottom: 1.5rem;
    color: var(--text-gray);
    font-size: 1rem;
}

.algkod-content p:last-child {
    margin-bottom: 0;
}

/* Выделение жирным */
.algkod-content strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* Ссылки */
.algkod-content a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.algkod-content a:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

/* ===== Списки ===== */
.algkod-content ul,
.algkod-content ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.algkod-content li {
    margin-bottom: 0.75rem;
    color: var(--text-gray);
    line-height: 1.6;
}

.algkod-content ul li {
    list-style-type: disc;
}

.algkod-content ul li::marker {
    color: var(--accent-primary);
}

.algkod-content ol li {
    list-style-type: decimal;
}

.algkod-content ol li::marker {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Вложенные списки */
.algkod-content ul ul,
.algkod-content ol ol,
.algkod-content ul ol,
.algkod-content ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ===== Разделители ===== */
.algkod-content hr {
    margin: 3rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
    opacity: 0.5;
}

/* ===== Кнопки и CTA блоки ===== */
.algkod-btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
}

.algkod-btn--primary {
    background: var(--accent-primary);
    color: white;
}

.algkod-btn--primary:hover {
    background: var(--accent-primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
}

.algkod-btn--secondary {
    background: var(--accent-secondary);
    color: var(--text-dark);
}

.algkod-btn--secondary:hover {
    background: var(--accent-secondary-hover);
    color: var(--text-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
}

.algkod-btn--outline {
    background: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
}

.algkod-btn--outline:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    text-decoration: none;
}

.algkod-cta-block {
    background: var(--bg-light);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    margin: 40px 0;
    text-align: center;
    border: 1px solid var(--border-color);
}

.algkod-cta-block__title {
    font-size: 1.75rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.algkod-cta-block__text {
    color: var(--text-gray);
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.algkod-cta-block__buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Кейсы и карточки ===== */
.algkod-case {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    margin: 30px 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.algkod-case:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.algkod-case__title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.algkod-case__subtitle {
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 15px;
}

.algkod-case__content {
    color: var(--text-gray);
}

.algkod-case__list {
    margin: 15px 0;
    padding-left: 20px;
}

.algkod-case__list li {
    margin-bottom: 8px;
}

.algkod-case__list li strong {
    color: var(--text-dark);
}

.algkod-case__result {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.algkod-case__result strong {
    color: var(--accent-primary);
    font-size: 1.1rem;
}

/* ===== Технологический стек (сетка) ===== */
.algkod-tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.algkod-tech-item {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--accent-primary);
}

.algkod-tech-item__category {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.algkod-tech-item__list {
    color: var(--text-gray);
    line-height: 1.6;
}

/* ===== Процесс разработки ===== */
.algkod-process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.algkod-step {
    position: relative;
    padding: 25px;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.algkod-step__number {
    position: absolute;
    top: -15px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(43, 179, 193, 0.3);
}

.algkod-step__title {
    font-size: 1.25rem;
    margin: 20px 0 10px;
    color: var(--text-dark);
    font-weight: 600;
}

.algkod-step__desc {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ===== FAQ аккордеон ===== */
.algkod-faq {
    margin: 30px 0;
}

.algkod-faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    overflow: hidden;
}

.algkod-faq-item__question {
    padding: 20px;
    background: var(--bg-light);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-dark);
    transition: var(--transition);
}

.algkod-faq-item__question:hover {
    background: var(--bg-gray);
}

.algkod-faq-item__question::after {
    content: '▼';
    font-size: 0.8rem;
    color: var(--accent-primary);
    transition: var(--transition);
}

.algkod-faq-item.active .algkod-faq-item__question::after {
    transform: rotate(180deg);
}

.algkod-faq-item__answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--bg-white);
    color: var(--text-gray);
}

.algkod-faq-item.active .algkod-faq-item__answer {
    padding: 20px;
    max-height: 500px;
}

/* ===== Нумерованные списки (для процесса) ===== */
.algkod-content ol.algkod-numbered-list {
    counter-reset: item;
    list-style: none;
    padding-left: 0;
}

.algkod-content ol.algkod-numbered-list li {
    counter-increment: item;
    margin-bottom: 20px;
    padding-left: 40px;
    position: relative;
}

.algkod-content ol.algkod-numbered-list li::before {
    content: counter(item);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.algkod-content ol.algkod-numbered-list li strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text-dark);
}

/* ===== Акционные блоки ===== */
.algkod-promo {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    padding: 30px;
    border-radius: var(--border-radius-lg);
    margin: 40px 0;
    text-align: center;
}

.algkod-promo__title {
    font-size: 1.75rem;
    margin-bottom: 15px;
    color: white;
}

.algkod-promo__text {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.algkod-promo__highlight {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 50px;
    display: inline-block;
    font-weight: 600;
}

/* ===== Цитаты и выделения ===== */
.algkod-content blockquote {
    margin: 30px 0;
    padding: 20px 30px;
    background: var(--bg-light);
    border-left: 4px solid var(--accent-primary);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    color: var(--text-gray);
}

.algkod-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ===== Таблицы ===== */
.algkod-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.95rem;
}

.algkod-content th {
    background: var(--accent-primary);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.algkod-content td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
}

.algkod-content tr:nth-child(even) {
    background: var(--bg-light);
}

.algkod-content tr:hover {
    background: var(--bg-gray);
}

/* ===== Изображения и медиа ===== */
.algkod-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 30px 0;
}

.algkod-content figure {
    margin: 30px 0;
}

.algkod-content figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 10px;
}

/* ===== Адаптивность ===== */
@media (max-width: 1024px) {
    .algkod-content {
        padding: 30px 20px;
    }
    
    .algkod-content h1 {
        font-size: 2.2rem;
    }
    
    .algkod-content h2 {
        font-size: 1.8rem;
    }
    
    .algkod-content h3 {
        font-size: 1.4rem;
    }
}

@media (max-width: 768px) {
    .algkod-content {
        padding: 25px 15px;
    }
    
    .algkod-content h1 {
        font-size: 2rem;
    }
    
    .algkod-content h2 {
        font-size: 1.6rem;
    }
    
    .algkod-content h3 {
        font-size: 1.3rem;
    }
    
    .algkod-process-steps {
        grid-template-columns: 1fr;
    }
    
    .algkod-step__number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .algkod-cta-block {
        padding: 30px 20px;
    }
    
    .algkod-cta-block__buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .algkod-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .algkod-tech-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .algkod-content h1 {
        font-size: 1.8rem;
    }
    
    .algkod-content h2 {
        font-size: 1.4rem;
    }
    
    .algkod-content h2::after {
        width: 40px;
    }
    
    .algkod-content h3 {
        font-size: 1.2rem;
    }
    
    .algkod-case {
        padding: 20px;
    }
    
    .algkod-promo {
        padding: 20px;
    }
    
    .algkod-promo__title {
        font-size: 1.4rem;
    }
    
    .algkod-content blockquote {
        padding: 15px 20px;
    }
}

/* ===== Анимации ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.algkod-case,
.algkod-step,
.algkod-tech-item {
    animation: fadeIn 0.6s ease forwards;
}

/* Печатная версия */
@media print {
    .algkod-content {
        max-width: 100%;
        padding: 20px;
    }
    
    .algkod-btn,
    .algkod-cta-block__buttons {
        display: none;
    }
    
    .algkod-content a {
        color: var(--text-dark);
        text-decoration: underline;
    }
    
    .algkod-content h2::after {
        background: var(--text-gray);
    }
}