/* ========================================
   DEMO FLOAT SECTION - Breathing Effect
   ======================================== */
.demo-float-link {
    display: block;
    float: left;
    margin-right: 30px;
    margin-bottom: 20px;
    width: 350px;
    min-height: 341px;
    /* Reserve space for enlarged state - prevents content jumping! */
    text-decoration: none !important;
    color: inherit !important;
    border-bottom: none !important;
    /* Force no border */
    position: relative;
    /* Anchor for the tooltip */
}

/* Override content-area link styles */
.content-area a.demo-float-link {
    color: inherit !important;
    text-decoration: none !important;
    border-bottom: none !important;
    font-weight: inherit !important;
}

.content-area a.demo-float-link:hover {
    color: inherit !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

.demo-float-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    transition: transform 0.5s ease-out, box-shadow 0.5s ease-out;
    /* ← CHANGE ANIMATION SPEED HERE */
    pointer-events: none;
}

.demo-float-button {
    display: block;
    width: 350px;
    /* Full width of container from the start */
    height: 36px;
    margin: 0 auto;
    padding: 0;
    /* Gradient: darker orange to pure white for better contrast */
    background: linear-gradient(135deg, #E4612F 0%, #FFFFFF 100%);
    color: #C54A20 !important;
    /* Darker orange text for readability */
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    border-bottom: none !important;
    box-sizing: border-box;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    line-height: 36px;
    transform-origin: center;
    /* Scale from center */
    transform: scale(0.857);
    /* 300px ÷ 350px = 0.857 (appears 300px wide) */
    transition: all 0.5s ease-out;
    /* ← CHANGE ANIMATION SPEED HERE */
    box-shadow: 0 2px 6px rgba(228, 97, 47, 0.25);
    white-space: nowrap;
    pointer-events: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: relative;
    z-index: 101;
}

/* Breathing hover: Both image and button scale together */
.demo-float-link:hover {
    text-decoration: none !important;
    border-bottom: none !important;
    color: inherit !important;
}

.demo-float-link:hover .demo-float-image {
    transform: scale(1.043);
    /* Image grows slowly via its own transition */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.demo-float-link:hover .demo-float-button {
    transform: scale(1.043);
    /* Button scales same as image - stays centered! */
    height: 42px;
    line-height: 42px;
    background: var(--primary-orange);
    /* Solid orange on hover */
    color: white !important;
    /* White text on hover */
    box-shadow: 0 4px 12px rgba(228, 97, 47, 0.45);
}

/* Tooltip styles */
.demo-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 310px;
    background: rgba(50, 50, 50, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--primary-orange);
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    padding: 20px 22px 28px 22px;
    font-size: 0.9rem;
    line-height: 1.5;
    z-index: 100;
    transition: opacity 0.2s ease-in, visibility 0.2s ease-in, transform 0.2s ease-in;
    pointer-events: none;
    white-space: normal;
}

.demo-float-link:hover .demo-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.4s ease-out 0.3s, visibility 0.4s ease-out 0.3s, transform 0.4s ease-out 0.3s;
}

/* Delayed hover-off for links with tooltip */
.demo-float-link.has-tooltip .demo-float-image {
    transition: transform 0.5s ease-out 0.3s, box-shadow 0.5s ease-out 0.3s;
}

.demo-float-link.has-tooltip:hover .demo-float-image {
    transition: transform 0.5s ease-out, box-shadow 0.5s ease-out;
}

.demo-float-link.has-tooltip .demo-float-button {
    transition: all 0.5s ease-out 0.3s;
}

.demo-float-link.has-tooltip:hover .demo-float-button {
    transition: all 0.5s ease-out;
}

/* Clear float after content */
.clear-float {
    clear: both;
}

/* ========================================
   CONTENT LAYOUT & POSITIONING
   ======================================== */
.content-area {
    padding: 20px 60px 40px 60px;
    /* Reduced top padding to lift content up */
}

/* ========================================
   TYPOGRAPHY - HEADINGS
   ======================================== */
.content-area h1 {
    font-size: 2.8rem;
    margin-bottom: 35px;
    color: var(--primary-orange);
    line-height: 1.15;
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
}

/* Animated underline for h1 */
.content-area h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-orange), transparent);
    border-radius: 2px;
}

.content-area h2 {
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 20px;
    color: #b85d38;
    padding-bottom: 3px;
    position: relative;
}

.content-area h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    /* Fixed short width - smaller than h1's ~150px */
    height: 2px;
    background: linear-gradient(90deg, var(--primary-orange), transparent);
}

.content-area h3 {
    font-size: 1.3rem;
    margin-top: 35px;
    margin-bottom: 16px;
    color: #555;
    /* Темно-серый - между основным текстом и черным */
    font-weight: 600;
    line-height: 1.3;
}

.content-area h3::before {
    content: '▸ ';
    /* или • или ◆ */
    color: #b85d38;
    margin-right: 8px;
}

/* ========================================
   TYPOGRAPHY - BODY TEXT
   ======================================== */
.content-area p {
    margin-bottom: 10px;
    /* Reduced from 12px for tighter flow */
    font-size: 1.05rem;
    line-height: 1.6;
    /* Reduced from 1.7 */
    color: var(--text-medium);
}

.content-area p strong {
    font-weight: 600;
    color: var(--text-medium);
}

.content-area p em {
    font-style: italic;
    color: var(--text-light);
}

/* ========================================
   LISTS
   ======================================== */
.content-area ul,
.content-area ol {
    margin-bottom: 18px;
    padding-left: 0px;
    /* No padding - indent created by margin on bullets */
}

.content-area li {
    margin-bottom: 1px;
    /* Reduced from 2px for ultra-tight spacing */
    font-size: 1rem;
    /* Reduced from 1.05rem - smaller, more compact */
    line-height: 1.5;
    /* Reduced from 1.6 for tighter line spacing */
    color: var(--text-medium);
}

/* Custom dash bullets for ul */
.content-area ul {
    list-style: none;
}

.content-area ul li::before {
    content: '- ';
    /* Em dash with space */
    display: inline-block;
    color: var(--primary-orange);
    font-weight: 600;
    margin-left: 28px;
    /* Positive margin to create left indent */
    margin-right: 3px;
}

/* Custom orange numbers for ol */
.content-area ol {
    list-style: decimal;
    list-style-position: outside;
}

.content-area ol>li {
    padding-left: 5px;
    margin-left: 28px;
    /* Positive margin to create left indent for numbers */
}

.content-area ol>li::marker {
    color: var(--primary-orange);
    font-weight: 600;
}

/* When OL uses quote-explanation class, apply styling to list items */
.content-area ol.quote-explanation>li {
    font-size: 0.95rem;
    font-style: italic;
    color: #666;
    line-height: 1.6;
}

/* Keep numbers orange and not italic */
.content-area ol.quote-explanation>li::marker {
    color: var(--primary-orange);
    font-weight: 600;
    font-style: normal;
}

/* ========================================
   LINKS
   ======================================== */
.content-area a {
    color: var(--primary-orange);
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
    font-weight: 500;
    border-bottom: 1px solid transparent;
}

.content-area a:hover {
    color: #FF7640;
    border-bottom: 1px solid #FF7640;
}

/* ========================================
   SPECIAL ELEMENTS
   ======================================== */

/* Highlighted text blocks - for key points */
.content-area .highlight-box {
    background: linear-gradient(135deg, #FFF9F0 0%, #FFF4E6 100%);
    border-left: 4px solid var(--primary-orange);
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.content-area .highlight-box p:last-child {
    margin-bottom: 0;
}

/* Quote box - light orange highlight with quotes positioned vertically */
.content-area .quote-box {
    display: inline-flex;
    /* Flex for vertical alignment control */
    align-items: center;
    /* Vertically center the main text */
    background: rgba(228, 97, 47, 0.06);
    /* Very light orange from emphasis palette */
    padding: 20px 25px;
    margin: 15px 0 10px 20px;
    /* User's correction: added 20px left margin */
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    font-style: italic;
    font-size: 1.15rem;
    color: #555;
}

/* Opening quotation mark - bottom-style quote „ */
.content-area .quote-box::before {
    content: '„';
    font-size: 2rem;
    color: #B54A29;
    /* Darker orange */
    margin-right: 8px;
    font-family: Georgia, serif;
    line-height: 1;
    align-self: flex-start;
    /* Align to TOP of container */
}

/* Closing quotation mark - standard quote " */
.content-area .quote-box::after {
    content: '“';
    font-size: 2rem;
    color: #B54A29;
    /* Darker orange */
    margin-left: 8px;
    font-family: Georgia, serif;
    line-height: 1;
    align-self: flex-end;
    /* Align to BOTTOM of container */
}

/* Explanation text after quote - indented to align with quote box start */
.content-area .quote-explanation {
    font-size: 0.95rem;
    font-style: italic;
    color: #666;
    line-height: 1.6;
    margin-top: 10px;
    margin-bottom: 20px;
    margin-left: 70px;
    /* User's correction: increased from 50px to 70px */
}

/* Remove italic for highlighted terms inside quote-explanation */
.content-area .quote-explanation .incorrect,
.content-area .quote-explanation .correct {
    font-style: normal;
}

/* General incorrect/correct classes - single definition for all uses */
.content-area .incorrect {
    color: #c54545;
    /* Slightly red text color */
    text-decoration: line-through;
    text-decoration-color: rgba(197, 69, 69, 0.25);
    /* Very light red strikethrough */
    text-decoration-thickness: 1px;
}

.content-area .correct {
    color: #4a9a3a;
    /* Brighter green - more vibrant than original #5a8a4a */
}

/* Call-to-action emphasis */
.content-area .emphasis {
    font-weight: 400;
    /* Normal weight, not bold */
    color: #1a1a1a;
    /* Darker than normal text (#333) */
    background: rgba(228, 97, 47, 0.08);
    /* Light solid background instead of gradient */
    padding: 2px 6px;
    border-radius: 3px;
    border-bottom: 1px solid rgba(244, 212, 202, 0.3);
    text-decoration-color: rgba(228, 97, 47, 0.2);
    /* Very light underline */
    text-underline-offset: 2px;
}

/* Quote-style callouts */
.content-area .callout {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-dark);
    font-style: italic;
    padding: 12px 0 12px 30px;
    /* Reduced vertical padding */
    border-left: 3px solid var(--primary-orange);
    margin: 15px 0;
    /* Reduced from 20px to tighten spacing */
}

/* ========================================
   LOADING MESSAGE
   ======================================== */
.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1.2rem;
    color: #999;
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media screen and (max-width: 768px) {
    .content-area {
        padding: 20px 20px 30px 20px;
    }

    .content-area h1 {
        font-size: 2rem;
        margin-bottom: 25px;
    }

    .content-area h2 {
        font-size: 1.5rem;
        margin-top: 28px;
        margin-bottom: 15px;
    }

    .content-area p,
    .content-area li {
        font-size: 1rem;
        line-height: 1.6;
    }

    .content-area ul,
    .content-area ol {
        padding-left: 35px;
    }
}

@media screen and (max-width: 480px) {
    .content-area {
        padding: 15px 15px 20px 15px;
    }

    .content-area h1 {
        font-size: 1.75rem;
    }

    .content-area ul,
    .content-area ol {
        padding-left: 30px;
    }
}

/* ========================================
   DEMO FLOAT - RESPONSIVE
   ======================================== */
@media screen and (max-width: 768px) {
    .demo-float-link {
        float: none;
        /* Remove float on mobile */
        margin: 20px auto;
        width: 100%;
        max-width: 350px;
        min-height: 341px;
        /* Prevent content jumping on mobile too */
    }

    .demo-float-image {
        width: 100%;
    }

    .demo-float-button {
        width: 100%;
        /* Full width on mobile */
        transform: scale(0.85);
        /* Appears 85% width */
        height: 36px;
        line-height: 36px;
    }

    .demo-float-link:hover .demo-float-button {
        transform: scale(1);
        /* Full size on hover */
        height: 42px;
        line-height: 42px;
    }
}

@media screen and (max-width: 480px) {
    .demo-float-link {
        max-width: 300px;
        min-height: 290px;
        /* Adjusted for smaller images */
    }

    .demo-float-button {
        font-size: 0.9rem;
        transform: scale(0.85);
        height: 34px;
        line-height: 34px;
    }

    .demo-float-link:hover .demo-float-button {
        transform: scale(1);
        height: 40px;
        line-height: 40px;
    }
}

/* ========================================
   SECTION END DIVIDER
   ======================================== */
.section-end-divider {
    border: none;
    height: 3px;
    margin-top: 220px;
    margin-bottom: 0;
    background: linear-gradient(90deg, transparent, var(--primary-orange), transparent);
    border-radius: 2px;
    width: 150px;
    margin-left: auto;
    margin-right: auto;
}