/** * A-Z Index Block - Enhanced Styles
 * Version: 1.5.2
 * Add this to your existing CSS or replace your az-index.css
 */

/* Container */
.az-index-container {
    margin: 30px 0;
}

/* Sticky wrapper */
.az-sticky-wrapper {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 100;
    padding: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

/* Category Filter Buttons */
.az-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding: 0 10px;
}

.az-cat-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #333;
}

.az-cat-btn:hover {
    border-color: #999;
    background: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.az-cat-btn.active {
    background: #2a6972;
    color: #fff;
    border-color: #2a6972;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.3);
}

.az-cat-btn:focus {
    outline: 2px solid #49c0a8;
    outline-offset: 2px;
}

/* Alphabet Navigation */
.az-index-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 0 10px;
}

.az-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    text-decoration: none !important;
    color: #333;
    font-weight: 600;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: #fff;
}

.az-letter:hover {
    background: #ffffff;
	color: #2a6972;
    border-color: #999;
    transform: scale(1.1);
}

.az-letter.current {
    background: #2a6972;
    border-color: #ffffff;
    color: #ffffff;
}

.az-letter.active-filter {
    background: #2a6972;
    color: #fff;
    border-color: #2a6972;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.4);
}

.az-letter.disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
}

/* Section Styles */
.az-section {
    margin-bottom: 40px;
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

.az-section-title {
    font-size: 32px;
    font-weight: 700;
    color: #2a6972;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #003c47;
}

/* Items List */
.az-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.az-item {
    margin-bottom: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.az-item-wrapper {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.az-item-wrapper:hover {
    border-color: #2a6972;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* Logo */
.az-item-logo {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
}

.az-item-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Content */
.az-item-content {
    flex: 1;
}

.az-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.az-item-title {
    font-size: 20px;
    font-weight: 600;
    color: #2a6972;
    text-decoration: none;
    margin: 0;
    transition: color 0.2s ease;
}

a.az-item-title:hover {
    color: #135e96;
    text-decoration: underline;
}

.az-item-category {
    display: inline-block;
    padding: 4px 12px;
    background: #e8f4f8;
    color: #2a6972;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Description */
.az-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* Contact Block */
.az-contact-block {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
}

.az-contact-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #555;
    font-size: 14px;
}

.az-contact-icon {
    flex-shrink: 0;
    color: #2a6972;
}

.az-contact-link {
    color: #2a6972;
    text-decoration: none;
    transition: color 0.2s ease;
}

.az-contact-link:hover {
    color: #135e96;
    text-decoration: underline;
}

.az-contact-text {
    color: #555;
}

/* Empty State */
.az-index-empty {
    padding: 40px;
    text-align: center;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .az-sticky-wrapper {
        padding: 10px 0;
    }
    
    .az-category-filter {
        padding: 0 5px;
    }
    
    .az-cat-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .az-index-nav {
        gap: 6px;
        padding: 0 5px;
    }
    
    .az-letter {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .az-section-title {
        font-size: 24px;
    }
    
    .az-item-wrapper {
        flex-direction: column;
        padding: 15px;
    }
    
    .az-item-logo {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }
    
    .az-contact-block {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .az-letter {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    
    .az-cat-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    .az-sticky-wrapper {
        position: relative;
        box-shadow: none;
    }
    
    .az-category-filter,
    .az-index-nav {
        display: none;
    }
    
    .az-item-wrapper {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Animation Classes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Accessibility */
.az-letter:focus,
.az-cat-btn:focus {
    outline: 2px solid #2a6972;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .az-letter,
    .az-cat-btn {
        border-width: 3px;
    }
    
    .az-item-wrapper {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/**
 * A-Z Index Block - Enhanced Editor Styles
 * Version: 1.6.1
 * 
 * Add this to your existing az-index.css file (append to end)
 * OR save as az-index-editor.css and enqueue separately
 * 
 * This improves the Gutenberg editor experience without touching any code
 */

/* ============================================
   EDITOR CONTAINER
   ============================================ */

.az-index-editor {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.az-index-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.az-index-header h3 {
    margin: 0;
    font-size: 20px;
    color: #1e1e1e;
    font-weight: 600;
}

.az-index-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================
   ITEM EDITOR - COLLAPSED STATE (PREVIEW CARD)
   ============================================ */

.az-item-editor {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
}

.az-item-editor:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.15);
}

/* Collapsed state - shows preview card */
.az-item-editor.collapsed {
    background: #f9f9f9;
}

.az-item-editor.collapsed:hover {
    background: #fff;
}

/* Preview Card Styling */
.az-editor-preview-card {
    padding: 16px;
    cursor: pointer;
    position: relative;
    min-height: 80px;
    transition: background 0.2s ease;
}

.az-editor-preview-card:hover {
    background: rgba(34, 113, 177, 0.05);
}

.az-editor-preview-card:active {
    background: rgba(34, 113, 177, 0.1);
}

.az-editor-preview-content {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* Preview Logo */
.az-editor-preview-logo {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.az-editor-preview-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Preview Info */
.az-editor-preview-info {
    flex: 1;
    min-width: 0;
}

.az-editor-preview-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e1e1e;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.az-editor-preview-title::before {
    content: '📄';
    font-size: 14px;
}

.az-editor-preview-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.4;
}

.az-editor-preview-contact {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #666;
}

.az-editor-preview-contact span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Preview Toggle Button */
.az-editor-preview-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    background: #2271b1;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    user-select: none;
}

.az-editor-preview-card:hover .az-editor-preview-toggle {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(34, 113, 177, 0.3);
}

/* ============================================
   ITEM EDITOR - EXPANDED STATE (FULL EDITOR)
   ============================================ */

.az-item-editor.expanded {
    border-color: #2271b1;
    box-shadow: 0 2px 12px rgba(34, 113, 177, 0.2);
}

.az-editor-full-view {
    background: #fff;
}

/* Collapse Bar (Header) */
.az-editor-collapse-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    cursor: pointer;
    border-bottom: 3px solid #0f4c81;
    transition: all 0.2s ease;
}

.az-editor-collapse-bar:hover {
    background: linear-gradient(135deg, #135e96 0%, #0f4c81 100%);
}

.az-editor-collapse-bar:active {
    transform: scale(0.99);
}

.az-editor-collapse-bar strong {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.az-editor-collapse-bar strong::before {
    content: '✏️';
    font-size: 18px;
}

.az-editor-collapse-bar span {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.az-editor-collapse-bar span::after {
    content: '▲';
    font-size: 10px;
}

/* Action Buttons */
.az-editor-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.az-editor-actions .components-button {
    min-height: 36px;
    padding: 0 16px;
    font-size: 13px;
}

.az-editor-actions .components-button.is-secondary {
    border-color: #2271b1;
    color: #2271b1;
}

.az-editor-actions .components-button.is-secondary:hover {
    background: #2271b1;
    color: #fff;
}

.az-editor-actions .components-button.is-destructive {
    border-color: #cc1818;
    color: #cc1818;
}

.az-editor-actions .components-button.is-destructive:hover {
    background: #cc1818;
    color: #fff;
}

/* Item Fields */
.az-item-fields {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.az-item-fields .components-base-control {
    margin-bottom: 0;
}

.az-item-fields .components-base-control__label {
    font-weight: 600;
    color: #1e1e1e;
    margin-bottom: 8px;
    display: block;
}

.az-item-fields .components-text-control__input,
.az-item-fields .components-textarea-control__input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.az-item-fields .components-text-control__input:focus,
.az-item-fields .components-textarea-control__input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/* ============================================
   VISUAL INDICATORS
   ============================================ */

/* Add a subtle indicator when item is collapsed */
.az-item-editor.collapsed::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #2271b1;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.az-item-editor.collapsed:hover::before {
    opacity: 1;
}

/* Add a subtle indicator when item is expanded */
.az-item-editor.expanded {
    position: relative;
}

.az-item-editor.expanded::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #2271b1 0%, #135e96 100%);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.az-index-items > div[style*="text-align: center"] {
    padding: 60px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    color: #666;
    font-size: 15px;
    border: 2px dashed #ddd;
}

/* ============================================
   COLLAPSE/EXPAND ANIMATIONS
   ============================================ */

.az-item-editor {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth transition between states */
.az-item-editor * {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* ============================================
   RESPONSIVE IMPROVEMENTS
   ============================================ */

@media (max-width: 782px) {
    .az-index-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .az-editor-preview-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .az-editor-preview-logo {
        width: 80px;
        height: 80px;
    }
    
    .az-editor-preview-toggle {
        position: static;
        margin-top: 12px;
        width: 100%;
        text-align: center;
    }
    
    .az-editor-actions {
        flex-wrap: wrap;
    }
    
    .az-editor-actions .components-button {
        flex: 1;
        min-width: calc(50% - 4px);
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus states */
.az-editor-preview-card:focus-within,
.az-editor-collapse-bar:focus-within {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .az-item-editor {
        border-width: 3px;
    }
    
    .az-editor-collapse-bar {
        border-bottom-width: 4px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .az-item-editor,
    .az-item-editor *,
    .az-editor-preview-toggle,
    .az-editor-collapse-bar {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   VISUAL HIERARCHY IMPROVEMENTS
   ============================================ */

/* Add subtle shadows for depth */
.az-item-editor.expanded {
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.05),
        0 4px 12px rgba(34, 113, 177, 0.15),
        0 0 0 1px rgba(34, 113, 177, 0.1);
}

/* Make collapsed items feel lighter */
.az-item-editor.collapsed {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ============================================
   BUTTON IMPROVEMENTS
   ============================================ */

/* Improve primary button in header */
.az-index-header .components-button.is-primary {
    background: #2271b1;
    border-color: #2271b1;
    padding: 8px 24px;
    height: auto;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(34, 113, 177, 0.3);
    transition: all 0.2s ease;
}

.az-index-header .components-button.is-primary:hover {
    background: #135e96;
    border-color: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.4);
}

.az-index-header .components-button.is-primary:active {
    transform: translateY(0);
}

/* ============================================
   HELPFUL TOOLTIPS & LABELS
   ============================================ */

/* Add visual cue for clickable collapsed items */
.az-editor-preview-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    transition: background 0.2s ease;
}

.az-editor-preview-card:hover::after {
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(34, 113, 177, 0.05) 0%,
        transparent 50%
    );
}

/* ============================================
   CATEGORY BADGE (if categories enabled)
   ============================================ */

.az-editor-preview-info .category-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #e8f4f8;
    color: #2271b1;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   LOADING STATES (for future enhancements)
   ============================================ */

.az-item-editor.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.az-item-editor.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #2271b1;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   DARK MODE SUPPORT (if needed in future)
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Uncomment if dark mode needed:
    .az-index-editor {
        background: #1e1e1e;
        border-color: #3a3a3a;
    }
    
    .az-item-editor {
        background: #2a2a2a;
        border-color: #3a3a3a;
    }
    
    .az-editor-preview-title,
    .components-base-control__label {
        color: #e0e0e0;
    }
    */
}