/*
Theme Name: ILAW Bio Editor Theme
Description: Enhanced grid gallery for biography pages with template editor integration.
Author: I_Love_Asian_Women
Version: 1.0
Requires at least: 6.8.3
Requires PHP: 8.3
*/

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #1a1a2e;
    color: #fff;
    line-height: 1.6;
    min-height: 100vh;
}

@keyframes backgroundFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(1deg); }
    66% { transform: translateY(10px) rotate(-1deg); }
}

.bio-gallery {
    margin: 2vw 0px;
    padding: 0 10px;
    position: relative;
    z-index: 1;
}

.bio-grid {
    display: flex;
    flex-direction: column;
    gap: 1vw;
    z-index: 1;
    position: relative;
}

.bio-row {
    /* Use flex instead of grid for simpler horizontal alignment inside the grid-template area */
    display: flex !important;
    flex-wrap: wrap !important;
    /* Use gap for consistent spacing between cells */
    gap: 1vw !important;
    /* Center the row of cells horizontally within the .bio-grid container */
    justify-content: center !important; 
    /* Remove any default left/right margins */
    margin: 0 !important;
    width: 100%;
}

/* Responsive adjustments for placeholders */
@media (max-width: 600px) {
    /* ... (Existing mobile placeholder styles like .no-image-placeholder .icon) ... */
    
    /* NEW MOBILE GRID FIX - Insert the code here */
    .bio-row {
        flex-direction: column !important; 
        align-items: center !important; 
        gap: 20px !important; 
    }

    .bio-cell {
        width: 100% !important; 
        max-width: 100% !important; 
        min-width: 100% !important;
        height: auto !important; 
    }

    .bio-cell img,
    .bio-cell .no-image-placeholder {
        width: 100% !important;
        height: auto !important; 
    }
}

/* FORCE CHANGES - Override everything */
.bio-cell {
    /* ... existing styles ... */
    /* CHANGE THIS LINE: Set a flexible max-width for desktop/tablet */
    max-width: 340px !important; /* Keep fixed max width for desktop/tablet */
    /* ... existing styles ... */
    /* Base size: Start with a fixed size, but allow it to shrink */
    width: 340px; 
    /* Force minimum width for mobile layout */
    min-width: 340px !important; 
    /* Allow cell to grow/shrink based on screen width */
    flex-grow: 1; 
    /* Calculate the max width to ensure 5 columns (20% - half the gap) */
    max-width: calc(20% - 1.6vw) !important; 
    /* Preserve fixed height to maintain uniform row appearance */
    height: 360px !important; 
    padding: 8px !important;
    flex: none !important;
    box-sizing: border-box; /* Ensure padding is included in the width */
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.bio-cell:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(195, 9, 130, 0.3);
}

.bio-cell a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.bio-cell img {
    width: 324px;
    height: 300px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(195, 9, 130, 0.4);
    transition: all 0.3s ease;
}

.bio-cell img:hover {
    transform: scale(1.05);
    border-color: rgba(195, 9, 130, 0.7);
}

.bio-cell h3 {
    margin: 4px 0 8px 0;
    text-align: center;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.no-image-placeholder {
    width: 324px;
    height: 300px;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(195, 9, 130, 0.4);
    transition: all 0.3s ease;
}

.no-image-placeholder:hover {
    transform: scale(1.05);
    border-color: rgba(195, 9, 130, 0.7);
}

.no-image-placeholder .placeholder-content {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.no-image-placeholder .icon {
    font-size: 2.5em;
    margin-bottom: 0.2em;
    opacity: 0.8;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.no-image-placeholder .initials {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 0.2em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.no-image-placeholder .text {
    font-size: 0.8em;
    opacity: 0.7;
    font-weight: 500;
}

.no-biographies {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.empty-state {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3em 2em;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.empty-state .empty-icon {
    font-size: 4em;
    margin-bottom: 0.5em;
    opacity: 0.8;
}

.empty-state h2 {
    margin: 0.5em 0;
    color: #fff;
    font-size: 1.8em;
}

.empty-state p {
    margin: 0;
    opacity: 0.8;
    font-size: 1.1em;
}

/* Header Styles */
.site-header {
    padding: 1rem 2rem;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(195, 9, 130, 0.5);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.header-image {
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.header-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.site-branding h1 {
    margin: 0;
    font-size: 1.8rem;
}

.site-branding h1 a {
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, #fff, #e8e8e8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.site-branding .description {
    font-size: 0.9rem;
    opacity: 0.8;
    color: #ddd;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.header-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #c30982, #3498db);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(195, 9, 130, 0.3);
}

.header-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(195, 9, 130, 0.4);
}

.search-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.search-toggle[aria-expanded="true"] {
    background: linear-gradient(135deg, #c30982, #3498db);
    border-color: transparent;
}

.header-filters {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.header-filters .filter-btn {
    padding: 0.5rem 1rem;
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.header-filters .filter-btn:hover {
    background: rgba(52, 152, 219, 0.3);
    transform: translateY(-2px);
}

#search-form {
    display: none;
    margin-top: 1rem;
    max-width: 600px;
    display: flex;
    gap: 0.5rem;
}

#search-form input[type="search"] {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50px;
    font-size: 1rem;
}

#search-form input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#search-form button[type="submit"] {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #c30982, #3498db);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

#search-form button[type="submit"]:hover {
    transform: translateY(-2px);
}

/* Single Biography Page */

/* FIX: Force specific margins to override the centering effect (margin: auto) and remove max-width */
.theme-bio-single-container {
    width: auto !important;
    max-width: none !important;
    backdrop-filter: blur(10px);
    position: relative;
    padding: 2rem 1rem;
}

.theme-bio-header {
    text-align: center;
    margin-bottom: 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.theme-bio-title-section:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c30982, #3498db, #e74c3c, #c30982);
    background-size: 400% 400%;
    animation: gradientShift 4s 
ease infinite;
}

.theme-bio-title-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 4px 14px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    display: inline-block; 
}

.theme-bio-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #fff, #e8e8e8);
    background-clip: text;
    -webkit-background-clip: text;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.theme-nav-title {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #fff;
}

.theme-bio-nav-wrapper {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.theme-bio-nav-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.theme-nav-item {
    flex: 1;
    min-width: 250px;
}

.theme-nav-link {
    display: block;
    text-decoration: none;
    color: #fff;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.theme-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.theme-nav-direction {
    font-size: 0.9rem;
    opacity: 0.8;
}

.theme-nav-bio-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0.5rem 0;
}

.theme-nav-thumb img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(195, 9, 130, 0.4);
}

/* Plugin Integration Styles */

.editor-container { 
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 20px;
    flex-grow: 1;
    background: transparent;
}

.bio-fields {
    width: 350px; 
    flex-shrink: 0; 
    padding: 20px;
}

.bio-field-wrap {
    margin-bottom: 15px;
}

.bio-field-wrap label {
    display: block;
    color: #ddd;
    margin-bottom: 5px;
    font-weight: 500;
}

.bio-field-input,
.bio-fields textarea,
.bio-fields input {
    width: 100%;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 1rem;
}

.bio-fields textarea {
    resize: vertical;
    min-height: 100px;
}

.bte-download-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #c30982, #3498db);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.bte-download-btn:hover {
    background: linear-gradient(135deg, #1a1a2e, #121221);
    box-shadow: 0 4px 5px rgba(195, 9, 130, 0.3);
}

/* --- PREVIEW CONTAINER FIX (Overflow-Only Solution) --- */
.bio-preview {
    flex-grow: 1;
    padding: 2rem 0;
}

.custom-editor-preview {
flex-grow: 1;
    padding: 2rem 0;
}


/* --- Universal Strict Content Constraint --- */
/* This is the most effective line to tame the runaway 'vw' elements: */
#bio-template-preview ul,
#bio-template-preview li,
#bio-template-preview div,
#bio-template-preview p,
#bio-template-preview img {
    /* Force elements to not exceed the width of the parent (the iframe/preview box) */
    max-width: 100% !important; 
    
    /* Neutralize horizontal margins that might push content out of bounds */
    margin-left: auto !important;
    margin-right: auto !important; 
    
    /* Ensures sizing includes padding/border to prevent overflow */
    box-sizing: border-box !important;
}


/* Template-specific utility class (keep this) */
#bio-template-preview [data-bte-field] {
    padding: 2px 6px;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        margin-top: 1rem;
        width: 100%;
        justify-content: space-between;
    }
    
    #search-form {
        flex-direction: column;
    }
    
    .theme-bio-single-container {
        /* On small screens, reduce side margin and padding */
        padding: 1rem !important; 
        margin-left: 1rem !important;
        margin-right: 1rem !important;
    }
    
    .editor-container {
        flex-direction: column; /* Correctly stack on mobile */
        flex-wrap: wrap;
    }

    .bio-fields {
        width: 100%; /* FIX: Fields should take full width on mobile */
        position: static;
        max-height: none;
    }
    
    .theme-bio-nav-links {
        flex-direction: column;
    }
    
    .theme-nav-item {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .theme-bio-title {
        font-size: 2rem;
    }
    
    .theme-nav-title {
        font-size: 1.5rem;
    }
    
    .header-img {
        max-height: 150px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c30982, #3498db);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #a0075f, #2980b9);
}

/* Override colored scrollbars specifically for biography template preview */
.bio-template-edit ::-webkit-scrollbar {
    width: 12px !important;
    background: #f1f1f1 !important;
}

.bio-template-edit ::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 0 !important;
}

.bio-template-edit ::-webkit-scrollbar-thumb {
    background: #c1c1c1 !important;
    border-radius: 0 !important;
}

.bio-template-edit ::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8 !important;
}

    /* Override colored scrollbars specifically for custom biography template preview */
.custom-editor-container ::-webkit-scrollbar {
    width: 12px !important;
    background: #f1f1f1 !important;
}

.custom-editor-container ::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 0 !important;
}

.custom-editor-container ::-webkit-scrollbar-thumb {
    background: #c1c1c1 !important;
    border-radius: 0 !important;
}

.custom-editor-container ::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8 !important;
}

/* --- REVISED HEADER LAYOUT STYLES (Full Fix) --- */

/* Base header container (Keep sticky background) */
.site-header {
    padding: 1rem 0;
    top: 0;
    z-index: 100;
}

/* 1. TOP AREA: LOGO & DESCRIPTION (CENTERED) */
.header-top-logo-area {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 20px 20px; /* Padding-bottom moves it down a little */
    text-align: center;
}

.logo-and-description-wrapper {
    display: inline-block;
    text-align: center;
}

/* Logo Image Styling (Centering and Sizing) */
.logo-and-description-wrapper .custom-logo-link img {
    max-width: 240px; 
    height: auto;
    border-radius: 10px;
    display: block;
    margin: 0 auto; /* Center the logo image */
}

/* Site Description (Tagline) */
.site-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 10px 0 0 0; /* Directly under the logo */
    font-weight: 500;
    text-align: center;
}

/* 2. BOTTOM AREA: MENU & SEARCH (ALIGNED) */
.header-bottom-menu-area {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pushes menu left and search right */
}

/* Main Navigation (Contains Home button and Menu links) */
.main-navigation {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 10px; 
}

/* WordPress Menu Container */
.menu-links-wrapper {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 10px;
}

/* 3. MENU AND HOME BUTTON STYLING (Matching Search Button Gradient) */

/* Base button styles (Home, Menu Links) - Ensures proper vertical alignment */
.main-navigation a.home-button,
.menu-links-wrapper a {
    color: #fff;
    text-decoration: none;
    padding: 10px 15px; 
    display: block;
    border-radius: 6px;
    font-weight: 500;
    
    background: transparent;
    box-shadow: none;
    transition: all 0.3s ease;
    
    /* Alignment Fix: Match height of search input/button */
    height: 44px;
    line-height: 24px;
}

/* Apply gradient style on hover/active to Home button and Menu links */
.main-navigation a.home-button:hover,
.main-navigation li:hover > a,
.main-navigation .current-menu-item > a {
    /* Base gradient: #c30982 to #3498db */
    background: linear-gradient(135deg, #c30982, #3498db);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Apply HOVER gradient to Home button and Menu links (Slightly brighter hover state) */
.main-navigation a.home-button:hover,
.main-navigation li:hover > a {
    background: linear-gradient(135deg, #e329a2, #44a8eb);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* 4. SEARCH FORM STYLING (Text Button) */

.header-search-section {
    flex-shrink: 0;
}

#searchform {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Search Input Field */
#searchform input[type="text"] {
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 6px;
    transition: all 0.3s;
    min-width: 200px;
    height: 44px; /* Align with button */
}

#searchform input[type="text"]:focus {
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

/* Search Submit Button (Text-based) */
.header-search-section .search-submit-btn {
    /* Base color (matches menu buttons on hover) */
    background: linear-gradient(135deg, #c30982, #3498db); 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 15px;
    width: auto;
    height: 44px; /* Ensure vertical alignment */
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hover gradient for Search submit button */
.header-search-section .search-submit-btn:hover {
    background: linear-gradient(135deg, #e329a2, #44a8eb);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Clearfix */
.clear {
    clear: both;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 900px) {
    /* The container for the entire bottom header/menu area */
    .header-bottom-menu-area {
        /* Keep: Stack items vertically */
        flex-direction: column; 
        /* Change: Center items horizontally instead of aligning to the start */
        align-items: center; 
        gap: 15px;
        /* Add: Give it full width to allow for centering */
        width: 100%;
    }
    
    /* The main navigation container */
    .main-navigation {
        width: 100%;
        flex-wrap: wrap;
        /* Keep: Center the menu links */
        justify-content: center; 
    }

    /* The wrapper holding the actual list of menu links */
    .menu-links-wrapper {
        width: 100%; /* Ensure full width for wrapping */
        flex-wrap: wrap;
        /* Keep: Center the menu links */
        justify-content: center; 
    }
    
    /* The search bar container */
    .header-search-section {
        width: 100%;
        margin-top: 15px;
        /* Add: Center the search form within its section */
        display: flex;
        justify-content: center;
    }
    
    /* The search form element */
    #searchform {
        /* Change: Limit max width for centering on tablet, otherwise it looks too wide */
        max-width: 450px; 
        width: 100%;
        /* The form itself is a flex container, so items are already aligned */
    }

    /* The search input field */
    #searchform input[type="text"] {
        flex-grow: 1;
        min-width: 150px;
    }
}

/* Remove list markers globally */
li::marker {
  content: none !important;
}

ul::marker {
  content: none !important;
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/*
 * MISSING ANIMATION KEYFRAMES
 * This definition is required to make the gradient top border move.
 */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/*
 * Gallery Header Styles (theme-gallery-header)
 * Mirrors the complex styling of theme-bio-header for visual consistency.
 */
.theme-gallery-header {
    /* Outer container style, centers the title section */
    text-align: center;
    margin-bottom: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.theme-gallery-title-section {
    /* Inner box style: blur, shadow, translucent background, border */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 4px 14px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    display: inline-block; 
}

.theme-gallery-title-section:before {
    /* Animated top border style (calls the keyframe above) */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c30982, #3498db, #e74c3c, #c30982); 
    background-size: 400% 400%;
    animation: gradientShift 4s ease infinite; 
}

.theme-gallery-title {
    /* Title text style: gradient color, font size, shadow */
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #fff, #e8e8e8); 
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* ===================================
   CUSTOM BIOGRAPHY EDITOR PAGE STYLES
   =================================== */

/* Page-specific wrapper */
.page-template-page-custom-editor .custom-editor-wrapper {
    min-height: 100vh;
    padding: 2rem 0;
    position: relative;
}

/* Custom Editor Header - Matches theme-bio-header */
.custom-editor-header {
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.custom-editor-title-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 4px 14px;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.custom-editor-title-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c30982, #3498db, #e74c3c, #c30982);
    background-size: 400% 400%;
    animation: gradientShift 4s ease infinite;
}

.custom-editor-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #fff, #e8e8e8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Ensure template preview content doesn't overflow */
.page-template-page-custom-editor #template-preview ul,
.page-template-page-custom-editor #template-preview li,
.page-template-page-custom-editor #template-preview div,
.page-template-page-custom-editor #template-preview p,
.page-template-page-custom-editor #template-preview img {
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}