/* =============================================================
   Aviv FreeGuide CTA — styles v1.7
   ========================================================== */

/* CRITICAL: box-sizing for all CTA elements (fixes mobile overflow) */
.aviv-sticky-cta,
.aviv-sticky-cta *,
.aviv-inline-cta,
.aviv-inline-cta * {
    box-sizing: border-box;
    max-width: 100%;
}

/* Prevent page-level horizontal scroll caused by overflowing fixed element */
.single-post,
.single-post .entry-content {
    overflow-x: hidden;
}

/* ============================================================
   1. Blog typography fix — force black text + better readability
   ============================================================ */

.single-post .entry-content,
.single-post .entry-content p,
.single-post .entry-content li,
.single-post .entry-content td,
.single-post .entry-content th,
.single-post .entry-content h1,
.single-post .entry-content h2,
.single-post .entry-content h3,
.single-post .entry-content h4,
.single-post .entry-content h5,
.single-post .entry-content h6,
.single-post .entry-content strong,
.single-post .entry-content em,
.single-post .entry-content blockquote {
    color: #1a1a1a !important;
}

.single-post .entry-content {
    font-size: 18px;
    line-height: 1.85;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Heebo", "Assistant", "Rubik", Arial, sans-serif;
}

.single-post .entry-content > p:first-of-type {
    font-size: 20px;
    line-height: 1.75;
    font-weight: 500;
    margin-bottom: 1.6em;
}

.single-post .entry-content p {
    margin-bottom: 1.4em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.single-post .entry-content h2 {
    margin-top: 2.5em;
    margin-bottom: 0.8em;
    padding-bottom: 0.4em;
    border-bottom: 3px solid #FFB800;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.3;
}

.single-post .entry-content h3 {
    margin-top: 1.8em;
    margin-bottom: 0.6em;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.35;
}

.single-post .entry-content h4 {
    font-size: 19px;
    font-weight: 700;
    margin-top: 1.4em;
    margin-bottom: 0.5em;
}

.single-post .entry-content ul,
.single-post .entry-content ol {
    margin-bottom: 1.4em;
    padding-right: 1.6em;
}

.single-post .entry-content ul li,
.single-post .entry-content ol li {
    margin-bottom: 0.55em;
}

.single-post .entry-content a:not(.aviv-inline-cta__btn):not(.aviv-sticky-cta__btn) {
    color: #c00060;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    font-weight: 600;
    word-wrap: break-word;
}

.single-post .entry-content a:not(.aviv-inline-cta__btn):not(.aviv-sticky-cta__btn):hover {
    color: #FF8800;
}

.single-post .entry-content blockquote {
    border-right: 4px solid #FFB800;
    background: #FFF8E5;
    padding: 1.4em 1.8em;
    margin: 2em 0;
    font-size: 19px;
    border-radius: 0 10px 10px 0;
}

/* Tables — mobile-friendly horizontal scroll */
.single-post .entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.8em 0;
    font-size: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
}

.single-post .entry-content thead th {
    background: #1a1a1a;
    color: #fff !important;
    font-weight: 700;
    text-align: right;
    padding: 14px 16px;
    font-size: 16px;
}

.single-post .entry-content tbody td {
    border-top: 1px solid #f0f0f0;
    padding: 14px 16px;
    text-align: right;
    vertical-align: top;
}

.single-post .entry-content tbody tr:nth-child(even) td {
    background: #fafafa;
}

/* Bottom padding so sticky bar doesn't cover content */
.single-post {
    padding-bottom: 90px;
}

@media (max-width: 768px) {
    .single-post {
        padding-bottom: 130px;
    }
    .single-post .entry-content {
        font-size: 16.5px;
        line-height: 1.7;
    }
    .single-post .entry-content > p:first-of-type {
        font-size: 17.5px;
    }
    .single-post .entry-content h2 {
        font-size: 22px;
        margin-top: 2em;
    }
    .single-post .entry-content h3 {
        font-size: 19px;
    }
    .single-post .entry-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 13px;
        max-width: 100%;
    }
    .single-post .entry-content thead th,
    .single-post .entry-content tbody td {
        padding: 8px 10px;
    }
    .single-post .entry-content blockquote {
        padding: 1.1em 1.3em;
        font-size: 17px;
    }
    .single-post .entry-content ul,
    .single-post .entry-content ol {
        padding-right: 1.2em;
    }
}

/* ============================================================
   2. Inline CTA box (auto-injected mid-article)
   ============================================================ */

.aviv-inline-cta {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 2.5em 0;
    padding: 24px 26px;
    background: linear-gradient(135deg, #FFC933 0%, #FF8800 100%);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(255, 136, 0, 0.28);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.aviv-inline-cta::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.aviv-inline-cta__icon {
    font-size: 44px;
    flex-shrink: 0;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
    z-index: 1;
}

.aviv-inline-cta__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1;
}

.aviv-inline-cta__hook {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.4;
    color: #1a1a1a !important;
    margin: 0;
    word-wrap: break-word;
}

.aviv-inline-cta__btn {
    display: inline-block;
    align-self: flex-start;
    background: #1a1a1a;
    color: #FFB800 !important;
    padding: 13px 26px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 16px;
    text-decoration: none !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.aviv-inline-cta__btn:hover {
    transform: translateY(-2px);
    background: #2a2a2a;
    color: #FFCD33 !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

@media (max-width: 600px) {
    .aviv-inline-cta {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
        gap: 12px;
        margin: 2em 0;
    }
    .aviv-inline-cta__icon {
        font-size: 36px;
    }
    .aviv-inline-cta__hook {
        font-size: 17px;
        line-height: 1.35;
    }
    .aviv-inline-cta__body {
        align-items: center;
        gap: 10px;
        width: 100%;
    }
    .aviv-inline-cta__btn {
        align-self: stretch;
        text-align: center;
        font-size: 15px;
        padding: 12px 16px;
        white-space: normal;
    }
}

/* ============================================================
   3. Sticky bottom bar
   ============================================================ */

.aviv-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: #1a1a1a;
    color: #fff;
    padding: 14px 22px 14px 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 -6px 28px rgba(0,0,0,0.35);
    transform: translateY(0);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    border-top: 4px solid #FFB800;
    width: 100%;
}

.aviv-sticky-cta.aviv-sticky-cta--dismissed {
    transform: translateY(110%);
}

.aviv-sticky-cta__hook {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff !important;
    line-height: 1.4;
    margin: 0;
    word-wrap: break-word;
}

.aviv-sticky-cta__btn {
    background: #FFB800;
    color: #1a1a1a !important;
    padding: 12px 22px;
    border-radius: 9px;
    font-weight: 800;
    font-size: 15px;
    text-decoration: none !important;
    flex-shrink: 0;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(255, 184, 0, 0.4);
}

.aviv-sticky-cta__btn:hover {
    transform: scale(1.04);
    background: #FFC933;
    box-shadow: 0 6px 18px rgba(255, 184, 0, 0.55);
}

.aviv-sticky-cta__close {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    opacity: 0.55;
    transition: opacity 0.15s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aviv-sticky-cta__close:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .aviv-sticky-cta {
        flex-direction: column;
        gap: 8px;
        padding: 38px 14px 12px 14px;
        align-items: stretch;
    }
    .aviv-sticky-cta__hook {
        font-size: 13.5px;
        text-align: center;
        line-height: 1.35;
    }
    .aviv-sticky-cta__btn {
        text-align: center;
        font-size: 14px;
        padding: 11px 14px;
        width: 100%;
    }
    .aviv-sticky-cta__close {
        top: 4px;
        left: 4px;
        transform: none;
        font-size: 22px;
        width: 32px;
        height: 32px;
    }
}

/* ============================================================
   4. "כתבתי עוד על..." — Related Posts section
   ============================================================ */

.aviv-related {
    margin: 4em 0 2em;
    padding: 2.5em 0 0;
    border-top: 1px solid #e5e5e5;
}

.aviv-related__heading {
    font-size: 28px !important;
    font-weight: 800 !important;
    color: #1a1a1a !important;
    margin: 0 0 1.4em !important;
    padding: 0 !important;
    border: none !important;
    text-align: right;
}

.aviv-related__heading::before {
    content: "";
    display: inline-block;
    width: 50px;
    height: 4px;
    background: #FFB800;
    border-radius: 2px;
    margin-bottom: 14px;
    vertical-align: middle;
}

.aviv-related__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

.aviv-related__item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none !important;
    color: #1a1a1a !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.aviv-related__item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    border-color: #FFB800;
    color: #1a1a1a !important;
}

.aviv-related__thumb {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
    flex-shrink: 0;
}

.aviv-related__thumb--ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFE5A8 0%, #FFB800 100%);
    font-size: 48px;
}

.aviv-related__thumb--ph span {
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12));
}

.aviv-related__body {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aviv-related__title {
    font-size: 18px !important;
    font-weight: 800 !important;
    line-height: 1.4 !important;
    color: #1a1a1a !important;
    margin: 0 !important;
    text-decoration: none !important;
}

.aviv-related__item:hover .aviv-related__title {
    color: #c00060 !important;
}

.aviv-related__excerpt {
    font-size: 14.5px;
    line-height: 1.55;
    color: #555 !important;
    flex: 1;
}

.aviv-related__date {
    font-size: 13px;
    color: #888 !important;
    font-weight: 500;
    margin-top: auto;
}

@media (max-width: 600px) {
    .aviv-related {
        margin: 3em 0 1.5em;
        padding-top: 2em;
    }
    .aviv-related__heading {
        font-size: 22px !important;
    }
    .aviv-related__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .aviv-related__thumb {
        height: 180px;
    }
    .aviv-related__title {
        font-size: 17px !important;
    }
}
