/**
 * Single Post template (blog article).
 *
 * @package hello-elementor-child
 */

.hec-single-post {
    background: var(--color-bg-light, #F6F1EA);
    padding: 0 0 var(--space-16, 64px);
}

body:not([class*="elementor-page-"]) .site-main.hec-single-post {
    max-width: none;
    width: 100%;
}

.hec-single-post__inner {
    max-width: var(--container-width, 1280px);
    width: 100%;
    margin: 0 auto;
    padding: var(--space-6, 24px) var(--container-padding, 0px) 0;
}

/* ============================================
   BREADCRUMBS
   Base styles come from breadcrumbs.css (.hec-breadcrumbs).
   Here we only adjust spacing for the single layout.
   ============================================ */

.hec-single-post__breadcrumbs {
    padding: 0;
    margin-bottom: var(--space-6, 24px);
}

/* ============================================
   HERO
   ============================================ */

.hec-single-post__hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5, 20px);
    align-items: stretch;
    margin-bottom: var(--space-12, 48px);
}

.hec-single-post__hero-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-8, 32px);
    min-height: 353px;
    padding: 40px;
    border-radius: 8px;
    background: #EEEEB6;
}

.hec-single-post__title {
    margin: 0;
    color: #212121;
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 500;
    line-height: 1.28;
    letter-spacing: -0.02em;
}

.hec-single-post__hero-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-5, 20px);
}

.hec-single-post__meta {
    display: flex;
    align-items: center;
    gap: var(--space-6, 24px);
    color: #656565;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
}

.hec-single-post__share {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
}

.hec-single-post__share-label {
    margin-right: var(--space-1, 4px);
    color: #656565;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.hec-single-post__share-link {
    --hec-share-bg: #FDFCFB;
    --hec-share-icon: #4E5B31;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: var(--radius-full, 9999px);
    background: var(--hec-share-bg);
    color: var(--hec-share-icon);
    text-decoration: none !important;
    line-height: 0;
    overflow: hidden;
    transition:
        background var(--transition-base, 0.2s ease),
        color var(--transition-base, 0.2s ease),
        transform var(--transition-base, 0.2s ease);
}

.hec-single-post__share-link:hover,
.hec-single-post__share-link:focus {
    --hec-share-bg: #4E5B31;
    --hec-share-icon: #FDFCFB;

    background: var(--hec-share-bg);
    color: var(--hec-share-icon);
    text-decoration: none !important;
    transform: translateY(-2px);
}

.hec-share-icon {
    display: block;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
}

.hec-share-icon__main {
    fill: currentColor;
    transition: fill var(--transition-base, 0.2s ease);
}

/* Facebook чуть меньше, чтобы f не была слишком жирной */
.hec-share-icon--facebook .hec-share-icon__main {
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(0.95);
}

/* Telegram */
.hec-share-icon--telegram .hec-share-icon__main {
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(1);
}

/* WhatsApp / Viber — только внутренняя иконка, без внешнего SVG-фона */
.hec-share-icon--whatsapp .hec-share-icon__main,
.hec-share-icon--viber .hec-share-icon__main {
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(1.08);
}

.hec-single-post__hero-image {
    position: relative;
    min-height: 353px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-bg-alt, #DCE0CF);
}

.hec-single-post__hero-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================
   CONTENT
   ============================================ */

/* ============================================
   CONTENT
   ============================================ */

.hec-single-post__content {
    margin: 0 auto;
    color: var(--color-text, #212121);
    font-family: var(--font-primary);
    font-size: var(--text-lg, 18px);
    line-height: var(--leading-relaxed, 1.625);
}

.hec-single-post__content > *:first-child {
    margin-top: 0;
}

/*
 * Article typography.
 * Works for classic editor and Gutenberg.
 * Does NOT affect Elementor widgets inside the_content().
 */
.hec-single-post__content :where(h2, h3, h4):not(.elementor *) {
    margin: var(--space-10, 40px) 0 var(--space-4, 16px);
    color: var(--color-primary-dark, #212B10);
    font-family: var(--font-heading);
    font-weight: var(--font-semibold, 600);
    line-height: var(--leading-tight, 1.25);
    letter-spacing: -0.01em;
}

.hec-single-post__content h2:not(.elementor *) {
    font-size: var(--text-3xl, 30px);
}

.hec-single-post__content h3:not(.elementor *) {
    font-size: var(--text-2xl, 24px);
}

.hec-single-post__content h4:not(.elementor *) {
    font-size: var(--text-xl, 20px);
}

.hec-single-post__content p:not(.elementor *) {
    margin: 0 0 var(--space-5, 20px);
}

.hec-single-post__content a:not(.elementor *) {
    color: var(--color-primary, #4E5B31);
    text-decoration: underline;
}

.hec-single-post__content :where(ul, ol):not(.elementor *) {
    margin: 0 0 var(--space-5, 20px);
    padding-left: var(--space-6, 24px);
}

.hec-single-post__content li:not(.elementor *) {
    margin-bottom: var(--space-2, 8px);
}

.hec-single-post__content img:not(.elementor *) {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-xl, 16px);
}

.hec-single-post__content blockquote:not(.elementor *) {
    margin: var(--space-8, 32px) 0;
    padding: var(--space-4, 16px) var(--space-6, 24px);
    border-left: 4px solid var(--color-accent-light, #E2E868);
    background: var(--color-white, #ffffff);
    border-radius: var(--radius-md, 8px);
    color: var(--color-text-light, #5a5a5a);
    font-style: italic;
}

.hec-single-post__pages {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2, 8px);
    margin-top: var(--space-8, 32px);
}
/* ============================================
   RELATED POSTS
   ============================================ */

.hec-single-post__related {
    margin-top: var(--space-16, 64px);
}

.hec-single-post__related-inner {
    max-width: var(--container-width, 1280px);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--container-padding, 0px);
}

.hec-single-post__related-title {
    margin: 0 0 var(--space-8, 32px);
    color: var(--color-title-card-doctor, #212121);
    font-family: var(--font-heading);
    font-size: var(--text-4xl, 36px);
    font-weight: var(--font-medium, 500);
    line-height: 1.16;
    letter-spacing: -0.02em;
}

.hec-single-post__related-actions {
    display: flex;
    justify-content: center;
    margin-top: var(--space-10, 40px);
}

.hec-single-post__related-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 var(--space-8, 32px);
    border-radius: var(--radius-full, 9999px);
    background: var(--color-bg-alt, #DCE0CF);
    color: var(--color-primary-dark, #212B10);
    font-family: var(--font-primary);
    font-size: var(--text-base, 16px);
    font-weight: var(--font-medium, 500);
    text-decoration: none;
    transition: background var(--transition-base, 0.2s ease),
                color var(--transition-base, 0.2s ease);
}

.hec-single-post__related-button:hover {
    background: var(--color-primary, #4E5B31);
    color: var(--color-white, #ffffff);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1320px) {
    .hec-single-post__inner,
    .hec-single-post__related-inner {
        padding-left: var(--space-6, 24px);
        padding-right: var(--space-6, 24px);
    }
}

@media (max-width: 1024px) {
    .hec-single-post__hero-card,
    .hec-single-post__hero-image {
        min-height: 300px;
    }
}

@media (max-width: 860px) {
    .hec-single-post__hero {
        grid-template-columns: 1fr;
    }

    .hec-single-post__hero-image {
        order: -1;
        min-height: 240px;
    }
}

@media (max-width: 768px) {
    .hec-single-post {
        padding-bottom: var(--space-12, 48px);
    }

    .hec-single-post__inner {
        padding-top: var(--space-5, 20px);
        padding-left: var(--container-padding-mobile, 20px);
        padding-right: var(--container-padding-mobile, 20px);
    }

    .hec-single-post__related-inner {
        padding-left: var(--container-padding-mobile, 20px);
        padding-right: var(--container-padding-mobile, 20px);
    }

    .hec-single-post__breadcrumbs {
        font-size: var(--text-xs, 12px);
        margin-bottom: var(--space-4, 16px);
    }

    .hec-single-post__hero {
        gap: var(--space-4, 16px);
        margin-bottom: var(--space-8, 32px);
    }

    .hec-single-post__hero-card {
        padding: var(--space-6, 24px);
        gap: var(--space-6, 24px);
        min-height: 0;
    }

    .hec-single-post__title {
        font-size: var(--text-3xl, 30px);
    }

    .hec-single-post__hero-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4, 16px);
    }

    .hec-single-post__content {
        font-size: var(--text-base, 16px);
    }

    .hec-single-post__content h2 { font-size: var(--text-2xl, 24px); }
    .hec-single-post__content h3 { font-size: var(--text-xl, 20px); }

    .hec-single-post__related {
        margin-top: var(--space-12, 48px);
    }

    .hec-single-post__related-title {
        font-size: var(--text-3xl, 30px);
        margin-bottom: var(--space-6, 24px);
    }
}

@media (max-width: 480px) {
    .hec-single-post__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1, 4px);
    }
}