/* styles/xun.css */

    /* Provided header styles */
    .header {
        padding: 10px;
        text-align: left;
        background: #0080ff;
        color: white;
        font-size: 18px;
        margin: auto;
    }
    .topnav {
        background-color: #333;
        overflow: hidden;
    }
    .topnav a {
        float: left;
        color: #f2f2f2;
        text-align: center;
        padding: 14px 16px;
        text-decoration: none;
        font-size: 17px;
    }
    .topnav a:hover {
        background-color: #ddd;
        color: black;
    }
    .topnav a.active {
        background-color: #04AA6D;
        color: white;
    }

    /* General page styles */
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
        background-color: #f4f4f4;
        background-image: url('../webassets/bg_xun.png');
        background-attachment: fixed;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    .container {
        max-width: 1400px;
        margin: 20px auto;
        padding: 0 20px;
    }

    /* Character showcase styles */
    .character-showcase {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        background-image: url('../webassets/bg_whitetrans.png');
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        align-items: flex-start; /* Align items to top to reduce vertical white space */
    }

    .character-image {
        flex: 0 0 auto; /* Prevent growing, use content width */
        width: auto; /* Let content dictate width */
        max-width: 350px; /* Cap width to reduce white space */
        text-align: center;
    }

    .character-image img {
        max-height: 500px;
        width: auto;
        border-radius: 8px;
    }

    .image-buttons {
        margin-top: 10px;
        display: flex;
        flex-wrap: wrap; /* Allow buttons to wrap to next line */
        justify-content: center;
        gap: 10px;
        max-width: 100%; /* Prevent overflow */
        box-sizing: border-box; /* Ensure padding/margins don’t cause overflow */
    }
    
    .image-buttons button {
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        transition: opacity 0.3s;
        flex: 0 0 auto; /* Prevent buttons from growing */
        max-width: 120px; /* Cap button width to fit more buttons */
    }

    .image-buttons button img {
        width: auto; /* Respect image aspect ratio */
        height: 50px;
        display: block;
    }

    .image-buttons button:hover {
        opacity: 0.8;
    }

    .image-buttons button.active {
        border: 2px solid #04AA6D;
        border-radius: 4px;
    }

    .character-details {
        flex: 2 1 400px; /* Grow more than image, prioritize text space */
        min-width: 300px;
        position: relative;
    }

    .character-details h2 {
        margin-top: 0;
        color: #333;
    }

    .character-details p {
        margin: 5px 0;
        color: #000;
    }

    .character-bio {
        margin-top: 20px;
    }

    .language-selector {
        position: absolute;
        top: 5px;
        right: 5px;
        margin-top: 5px;
        text-align: right;
    }
    .language-selector img {
        height: 35px;
        width: auto;
    }

    @media (min-width: 701px) and (max-width: 1100px) {
        .character-image {
            max-width: 200px; /* Cap width to reduce white space */
        }
        .character-details p {
            font-size: 14px;
        }
        .character-image img {
        max-height: 370px;
        }
    }

    /* Responsive design */
    @media (max-width: 700px) {
        .character-showcase {
            flex-direction: column;
        }

        .character-image,
        .character-details {
            min-width: 100%;
            max-width: 100%; /* Ensure full width usage */
            position: static; /* Remove relative positioning from parent */
        }

        .character-image {
            max-width: none; /* Remove desktop max-width constraint */
        }

        .image-buttons {
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: center;
            align-items: center;
            gap: 10px;
            max-width: 100%; /* Prevent overflow */
        }

        .image-buttons button {
            width: auto;
            max-width: 105px; /* Compact buttons for mobile */
        }

        .image-buttons button img {
            width: auto; /* Prevent stretching */
            height: 50px;
            max-height: 50px;
        }

        .language-selector {
            position: static; /* Remove absolute positioning */
            margin-top: 0;
            margin-bottom: 10px;
            text-align: center;
            order: -1;
        }
        
        .topnav a {
        font-size: 12px;
        }

        .header h1 {
        font-size: 30px;
        }
        
        .character-image img {
        max-height: 350px;
        }
    }