/* ============================================
   RELATED PAGES BLOCK - FRONTEND STYLES
   ============================================ */

.related-pages-block {
    width: 100%;
}

.related-pages-block > div {
    width: 100%;
    max-width: 100%;
}

  

.related-pages-block .flex-col {
    flex-direction: column;
}

.related-pages-block .lg\\:flex-row {
    @media (min-width: 1024px) {
        flex-direction: row;
    }
}

.related-pages-block .flex-1 {
    flex: 1;
}
.description-related-pages {
    color: #373a19;
    width: 100%;
    max-width: 500px;
}
/* Column styling */
.related-pages-block .flex-1 h3 {
    color: #1f2937;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.related-pages-block .flex-1 > div {
    color: --color-green-950;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Button spacing */
.related-pages-block .cta-button {
    margin-top: 1rem;
}

/* Responsive behavior */
@media (max-width: 1023px) {
    .related-pages-block .flex {
        flex-direction: column;
   
    }
    
    .related-pages-block {
        padding: 1.5rem 0;
    }
}

/* ============================================
   EDITOR STYLES - FRONTEND-LIKE PREVIEW
   ============================================ */

.wp-block[data-type="doctailwind/related-pages"] .related-pages-block-editor {
    background: #f3f0e5; /* Custom beige color */
    border-radius: 8px;
    padding: 0;
    margin: 16px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    border: 2px solid #e8e3d3; /* Slightly darker beige */
}

/* ============================================
   EDITOR HEADER
   ============================================ */

.wp-block[data-type="doctailwind/related-pages"] .editor-header {
    background: linear-gradient(135deg, #8b5a3c, #6d4c41); /* Brown gradient instead of green */
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wp-block[data-type="doctailwind/related-pages"] .editor-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.wp-block[data-type="doctailwind/related-pages"] .editor-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0 !important;
    line-height: 1.2;
}

.wp-block[data-type="doctailwind/related-pages"] .editor-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-left: auto;
    font-style: italic;
}

/* ============================================
   FRONTEND PREVIEW CONTAINER
   ============================================ */

.wp-block[data-type="doctailwind/related-pages"] .editor-frontend-preview {
    background: #f3f0e5; /* Custom beige color */
    padding: 48px 0; /* Matching py-12 from frontend */
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-columns {
    display: flex;
    max-width: 1240px; /* Matching max-w-[1240px] from frontend */
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 1024px) {
    .wp-block[data-type="doctailwind/related-pages"] .frontend-columns {
        flex-direction: column;
    }
    
    .wp-block[data-type="doctailwind/related-pages"] .editor-frontend-preview {
        padding: 32px 16px;
    }
}

/* ============================================
   FRONTEND COLUMNS
   ============================================ */

.wp-block[data-type="doctailwind/related-pages"] .frontend-column {
    flex: 1;
    padding: 0 20px 0 96px; /* Matching px-5 lg:px-24 from frontend */
    position: relative;
}

@media (min-width: 1024px) {
    .wp-block[data-type="doctailwind/related-pages"] .frontend-column {
        padding: 0 96px; /* lg:px-24 */
    }
}

@media (max-width: 1024px) {
    .wp-block[data-type="doctailwind/related-pages"] .frontend-column {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .wp-block[data-type="doctailwind/related-pages"] .right-frontend-column {
        margin-bottom: 0;
    }
}

/* ============================================
   FRONTEND DIVIDER
   ============================================ */

.wp-block[data-type="doctailwind/related-pages"] .frontend-divider {
    width: 1px;
    background: #8b5a3c; /* Brown color to match header */
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .wp-block[data-type="doctailwind/related-pages"] .frontend-divider {
        display: none;
    }
}

/* ============================================
   FIELD GROUPS
   ============================================ */

.wp-block[data-type="doctailwind/related-pages"] .field-wrapper {
    margin-bottom: 24px;
}

.wp-block[data-type="doctailwind/related-pages"] .field-wrapper:last-child {
    margin-bottom: 0;
}

/* ============================================
   FIELD LABELS
   ============================================ */

.wp-block[data-type="doctailwind/related-pages"] .field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #8b5a3c; /* Brown color to match theme */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
}

.wp-block[data-type="doctailwind/related-pages"] .field-label svg {
    opacity: 0.8;
}

/* ============================================
   FRONTEND TITLE FIELDS
   ============================================ */

.wp-block[data-type="doctailwind/related-pages"] .frontend-title-wrapper {
    margin-bottom: 16px; /* Matching mb-4 from frontend */
    border: 1px dashed #d1d5db;
    border-radius: 4px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.5);
    min-height: 50px;
    transition: all 0.3s ease;
    position: relative;
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-title-wrapper:hover {
    border-color: #8b5a3c;
    background: rgba(255, 255, 255, 0.8);
}

/* Prevent text selection conflicts between fields */
.wp-block[data-type="doctailwind/related-pages"] .left-frontend-column .frontend-title-wrapper {
    isolation: isolate;
}

.wp-block[data-type="doctailwind/related-pages"] .right-frontend-column .frontend-title-wrapper {
    isolation: isolate;
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-title-input {
    font-size: 24px !important; /* Matching text-2xl from frontend */
    font-weight: 700 !important; /* Matching font-bold from frontend */
    color: #1f2937 !important; /* Default title color for both columns */
    line-height: 1.2 !important;
    padding: 0 !important;
    min-height: auto !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    width: 100%;
    position: relative;
    z-index: 1;
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-title-input.left-title {
    color: #1f2937 !important; /* Same color for left title */
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-title-input.right-title {
    color: #1f2937 !important; /* Same color for right title - removing green difference */
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-title-input:empty::before {
    color: #9ca3af !important;
    font-weight: 500 !important;
    opacity: 0.6;
}

/* ============================================
   FRONTEND CONTENT FIELDS
   ============================================ */

.wp-block[data-type="doctailwind/related-pages"] .frontend-content-wrapper {
    margin-bottom: 24px; /* Matching mb-6 from frontend */
    border: 1px dashed #d1d5db;
    border-radius: 4px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    min-height: 80px;
    transition: all 0.3s ease;
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-content-wrapper:hover {
    border-color: #8b5a3c;
    background: rgba(255, 255, 255, 0.8);
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-content-input {
    font-size: 16px !important;
    color: #4b5563 !important; /* Same color for both columns */
    line-height: 1.6 !important;
    padding: 0 !important;
    min-height: 60px !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    width: 100%;
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-content-input.left-content {
    color: #4b5563 !important; /* Same color for left content */
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-content-input.right-content {
    color: #4b5563 !important; /* Same color for right content - removing green difference */
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-content-input:empty::before {
    color: #9ca3af !important;
    opacity: 0.6;
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-content-input p {
    margin-bottom: 12px !important;
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-content-input p:last-child {
    margin-bottom: 0 !important;
}

/* ============================================
   FRONTEND BUTTON FIELDS
   ============================================ */

.wp-block[data-type="doctailwind/related-pages"] .frontend-button-fields {
    margin-top: 16px; /* Some spacing before button section */
}

.wp-block[data-type="doctailwind/related-pages"] .button-field-group {
    margin-bottom: 12px;
}

.wp-block[data-type="doctailwind/related-pages"] .button-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-button-text-input,
.wp-block[data-type="doctailwind/related-pages"] .frontend-button-url-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    color: #374151;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-button-text-input:focus,
.wp-block[data-type="doctailwind/related-pages"] .frontend-button-url-input:focus {
    border-color: #8b5a3c; /* Brown color to match theme */
    box-shadow: 0 0 0 2px rgba(139, 90, 60, 0.1);
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-button-url-input {
    font-family: monospace;
    font-size: 13px;
}

/* ============================================
   FRONTEND BUTTON PREVIEW
   ============================================ */

.wp-block[data-type="doctailwind/related-pages"] .frontend-button-preview {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background-color:var(--color-yellow-200); /* Matching CTA button color from design system */
    border: 1px solid #D4D2C4;
    border-radius: 0; /* Matching border-radius: 0 from design system */
    padding: 24px; /* Matching p-6 from component */
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: default;
    max-width: 420px;
    width: 100%;
    margin-top: 8px;
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-button-preview:hover {
    background-color: #78716c; /* Brown-500 equivalent for hover */
    color:var(--color-yellow-200);
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-preview-text {
    font-size: 14px; /* Matching text-sm from component */
    font-weight: 500; /* Matching font-medium from component */
    line-height: 1; /* Matching leading-4 from component */
    letter-spacing: 0.8px; /* Matching tracking-[0.8px] from component */
    text-transform: uppercase; /* Matching uppercase from component */
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-preview-icon {
    width: 24px; /* Matching w-6 from component */
    height: 24px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-button-preview:hover .frontend-preview-icon {
    transform: translateX(2px);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .wp-block[data-type="doctailwind/related-pages"] .editor-header {
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    
    .wp-block[data-type="doctailwind/related-pages"] .editor-subtitle {
        margin-left: 0;
        width: 100%;
        margin-top: 4px;
    }
    
    .wp-block[data-type="doctailwind/related-pages"] .frontend-title-input {
        font-size: 20px !important;
    }
    
    .wp-block[data-type="doctailwind/related-pages"] .frontend-content-input {
        font-size: 15px !important;
    }
    
    .wp-block[data-type="doctailwind/related-pages"] .frontend-button-preview {
        padding: 20px;
    }
}

/* ============================================
   ANIMATION & MICRO-INTERACTIONS
   ============================================ */

.wp-block[data-type="doctailwind/related-pages"] .related-pages-block-editor {
    animation: slideInUp 0.4s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wp-block[data-type="doctailwind/related-pages"] .frontend-column {
    animation: fadeInScale 0.5s ease;
}

.wp-block[data-type="doctailwind/related-pages"] .right-frontend-column {
    animation-delay: 0.1s;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}