/* Wagtail Admin Custom Branding Colors */
/* Using your new brand color palette */

:root {
    /* Primary brand colors - using your new brand palette */
    --w-color-primary: #CD2028; /* Button/Main/Default - Primary brand red */
    --w-color-primary-600: #3B1519; /* Brand/Secondary - Dark burgundy */
    --w-color-primary-100: #BBE5F4; /* Accent - Light blue accent */
    --w-color-primary-200: #333333;
    
    /* Secondary colors */
    --w-color-secondary: #3B1519; /* Brand/Secondary - Burgundy */
    --w-color-secondary-600: #333333; /* Brand/Neutral/800 - Dark grey */
    
    /* Background colors */
    --w-color-background: #FFFFFF; /* white - Main background */
    --w-color-background-alt: #F5F5F5; /* Light grey for secondary backgrounds */
    
    /* Text colors */
    --w-color-text: #333333; /* Brand/Neutral/800 - Primary text */
    --w-color-text-label: #666666; /* Medium grey for labels */
    
    /* Border colors */
    --w-color-border: #E0E0E0; /* Light grey borders */
    --w-color-border-focus: #CD2028; /* Primary brand red for focus */
    
    /* Status colors */
    --w-color-positive: #28A745;
    --w-color-warning: #FFC107;
    --w-color-critical: #DC3545;
    
    /* Header and navigation */
    --w-color-header: #3B1519; /* Brand/Secondary - Dark burgundy header */
    --w-color-header-text: #FFFFFF;
    --w-color-header-link: #BBE5F4; /* Accent - Light blue */
    
    /* Sidebar */
    --w-color-sidebar: #333333; /* Brand/Neutral/800 - Dark sidebar */
    --w-color-sidebar-text: #FFFFFF;
    --w-color-sidebar-link: #BBE5F4; /* Accent - Light blue */
}

/* Custom header styling */
.w-header {
    background-color: var(--w-color-header) !important;
    border-bottom: 3px solid var(--w-color-primary) !important;
}

.w-header__title {
    color: var(--w-color-header-text) !important;
}

.w-header__account {
    color: var(--w-color-header-link) !important;
}

/* Custom sidebar styling */
.w-sidebar {
    background-color: linear-gradient(180deg, var(--w-color-header) 0%, var(--w-color-sidebar) 100%) !important;
}

.w-sidebar__nav-link {
    color: var(--w-color-sidebar-text) !important;
}

.w-sidebar__nav-link:hover,
.w-sidebar__nav-link.w-sidebar__nav-link--active {
    background-color: linear-gradient(180deg, var(--w-color-header) 0%, var(--w-color-sidebar) 100%) !important;
    color: var(--w-color-header-text) !important;
}

/* Sidebar panel styling */
.sidebar-panel {
    background: linear-gradient(180deg, var(--w-color-header) 0%, var(--w-color-sidebar) 100%) !important;
}

.sidebar-panel--visible,
.sidebar-panel--open {
    background: linear-gradient(180deg, var(--w-color-header) 0%, var(--w-color-sidebar) 100%) !important;
}

/* Sidebar menu items */
.sidebar-menu-item {
    color: var(--w-color-sidebar-text) !important;
    transition: all 0.3s ease !important;
}

.sidebar-menu-item:hover {
    background: rgba(205, 32, 40, 0.2) !important;
    color: var(--w-color-primary-100) !important;
}

.sidebar-menu-item--active {
    background: linear-gradient(135deg, var(--w-color-secondary) 0%, var(--w-color-primary) 100%) !important;
    color: var(--w-color-header-text) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Page explorer items */
.sidebar-page-explorer-item {
    color: var(--w-color-sidebar-text) !important;
    transition: all 0.3s ease !important;
}

.sidebar-page-explorer-item:hover {
    background: rgba(205, 32, 40, 0.2) !important;
    color: var(--w-color-primary-100) !important;
}

.sidebar-page-explorer-item--active {
    background: linear-gradient(135deg, var(--w-color-secondary) 0%, var(--w-color-primary) 100%) !important;
    color: var(--w-color-header-text) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Custom button styling */
.button,
.button-primary {
    background-color: var(--w-color-primary) !important;
    border-color: var(--w-color-primary) !important;
    color: var(--w-color-header-text) !important;
}

.button:hover,
.button-primary:hover {
    background-color: var(--w-color-primary-600) !important;
    border-color: var(--w-color-primary-600) !important;
}

/* Custom form styling */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--w-color-border-focus) !important;
    box-shadow: 0 0 0 2px rgba(38, 137, 158, 0.2) !important;
}

/* Custom branding logo area */
.w-header__branding {
    background: linear-gradient(135deg, var(--w-color-primary) 0%, var(--w-color-primary-600) 100%);
    padding: 0.5rem 1rem;
    border-radius: 0 0 8px 8px;
    margin-right: 1rem;
}

/* Custom page title styling */
.w-page-title {
    color: var(--w-color-primary) !important;
}

/* Custom breadcrumb styling */
.breadcrumb {
    background-color: var(--w-color-background-alt) !important;
    border-left: 4px solid var(--w-color-primary) !important;
}

/* Custom table styling */
.table th {
    background-color: var(--w-color-background-alt) !important;
    color: var(--w-color-text) !important;
    border-bottom: 2px solid var(--w-color-primary) !important;
}

/* Custom panel styling */
.panel {
    border-left: 4px solid var(--w-color-primary) !important;
}

/* Custom tag styling */
.tag {
    background-color: var(--w-color-primary-100) !important;
    color: var(--w-color-primary-600) !important;
}

/* Custom status indicators */
.status-tag--live {
    background-color: var(--w-color-positive) !important;
    color: white !important;
}

.status-tag--draft {
    background-color: var(--w-color-warning) !important;
    color: white !important;
}

.status-tag--private {
    background-color: var(--w-color-critical) !important;
    color: white !important;
}

/* Main sidebar: same maroon as the civicmedia.us masthead (#511a1f -> #3a1418),
   settling into the neutral grey lower down. Wagtail paints the rail with
   --w-color-surface-menus, so override that rather than the element. */
.sidebar {
    --w-color-surface-menus: #3a1418;
    background: linear-gradient(180deg, #511a1f 0%, #3a1418 30%, #333333 100%) !important;
}

/* Sidebar logo: bare wordmark when expanded, app icon when the rail is slim. */
.cm-sidebar-wordmark {
    display: block;
    width: 100%;
    max-width: 164px;
    height: auto;
    margin: 1rem auto 0.5rem;
}
.cm-sidebar-icon {
    display: none;
    width: 40px;
    height: auto;
    margin: 0.75rem auto 0.5rem;
}
.sidebar--slim .cm-sidebar-wordmark { display: none; }
.sidebar--slim .cm-sidebar-icon { display: block; }
