/* --- Widget Toggle Logic (No JS required) --- */

/* 1. Hide the actual checkbox input */
#widget-toggle {
    display: none;
}

/* 2. Style the "Button" (The Label) */
.widget-trigger-btn {
    display: inline-block;
    cursor: pointer;
    background-color: #2c3e50; /* Dark Blue-Grey */
    color: #ffffff;
    padding: 12px 24px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    user-select: none;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.widget-trigger-btn:hover {
    background-color: #34495e;
    transform: translateY(-2px);
}

.widget-trigger-btn:active {
    transform: translateY(0);
}

/* Change button text visual cue based on state (Optional) */
.widget-trigger-btn::after {
    content: " ▼";
    font-size: 0.8em;
}

#widget-toggle:checked + .widget-trigger-btn::after {
    content: " ▲";
}

/* 3. The Wrapper for the Iframe (Controls the animation) */
.iframe-wrapper {
    width: 100%;
    /* Start hidden */
    max-height: 0;
    overflow: hidden; 
    opacity: 0;
    transition: max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease;
}

/* 4. When Checkbox is Checked -> Reveal Wrapper */
#widget-toggle:checked ~ .iframe-wrapper {
    /* Set max-height larger than actual content to allow expansion.
       350px matches your max-height requirement.
    */
    max-height: 350px; 
    opacity: 1;
}

/* 5. The Iframe Class */
.character-widget-frame {
    width: 100%;
    border: none;
    display: block;
    
    /* Dynamic Height Logic */
    height: 35vh; /* Tries to take 35% of viewport height */
    max-height: 350px; /* Hard Limit Upper */
    min-height: 155px; /* Hard Limit Lower */
    
    /* Transparent bg to blend with main site */
    background-color: transparent; 
}