﻿/* CRITICAL: Pre-hide FarmML elements to prevent content flash - Must load before content */
/* Use multiple selectors for maximum coverage */
farmml\:cite[data-purpose="seo"],
farmml\:cite,
farmml-cite[data-purpose="seo"],
farmml-cite,
*[data-farmml-content="true"],
*[data-farmpress-expandable="true"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    transition: none !important; /* Remove transition for immediate hiding */
    max-height: 0 !important;
    max-width: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

/* Backup rule for any element containing farmml */
*[class*="farmml"],
*[id*="farmml"] {
    display: none !important;
    visibility: hidden !important;
}

/* Show processed elements - only apply after JavaScript conversion */
.farmpress-container .farmpress-info-button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    left: auto !important;
    width: 20px !important;
    height: 20px !important;
    overflow: visible !important;
    transition: all 0.2s ease !important;
}

/* Container for info button and SEO content */
.farmpress-container {
    display: inline;
    position: relative;
    margin-left: 0.25rem; /* Small spacing to separate from text */
}

/* Ensure proper text flow - the container should not break text layout */
.farmpress-container {
    vertical-align: baseline;
    line-height: normal;
}

/* Hidden content for SEO crawlers */
.farmpress-seo-content {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    white-space: nowrap !important;
}

/* FarmPress Info Button Styles */
.farmpress-info-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 4px; /* Reduced margin for better text flow */
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    vertical-align: baseline; /* Changed from middle for better text alignment */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    flex-shrink: 0; /* Prevent button from shrinking */
}

    .farmpress-info-button:hover {
        background: #2196f3;
        border-color: #1976d2;
        transform: scale(1.1);
    }

        .farmpress-info-button:hover .farmpress-info-icon {
            color: white;
        }

.farmpress-info-icon {
    color: #1976d2;
    font-size: 12px;
    font-weight: bold;
    transition: color 0.2s ease;
}

/* Popup Modal Styles */
.farmpress-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

    .farmpress-popup-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.farmpress-popup-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.farmpress-popup-overlay.active .farmpress-popup-content {
    transform: scale(1) translateY(0);
}

.farmpress-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.farmpress-popup-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 18px;
    margin: 0;
}

.farmpress-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

    .farmpress-popup-close:hover {
        background: #e5e7eb;
        color: #1f2937;
    }

.farmpress-popup-body {
    padding: 0rem 1.5rem 1.5rem 1.5rem;
    max-height: calc(80vh - 120px);
    overflow-y: auto;
    color: #4b5563;
    line-height: 1.6;
}

    .farmpress-popup-body h1,
    .farmpress-popup-body h2,
    .farmpress-popup-body h3 {
        color: #1f2937;
        margin-top: 0;
        margin-bottom: 16px;
    }

    .farmpress-popup-body h1 {
        font-size: 24px;
    }

    .farmpress-popup-body h2 {
        font-size: 20px;
    }

    .farmpress-popup-body h3 {
        font-size: 18px;
    }

    .farmpress-popup-body ul,
    .farmpress-popup-body ol {
        margin: 16px 0;
        padding-left: 24px;
    }

    .farmpress-popup-body li {
        margin-bottom: 8px;
    }

    .farmpress-popup-body p {
        margin: 16px 0;
    }

        .farmpress-popup-body p:first-child {
            margin-top: 0;
        }

        .farmpress-popup-body p:last-child {
            margin-bottom: 0;
        }

    .farmpress-popup-body strong {
        color: #1f2937;
        font-weight: 600;
    }

/* Mobile responsive */
@media (max-width: 768px) {
    .farmpress-popup-overlay {
        padding: 16px;
    }

    .farmpress-popup-content {
        max-height: 90vh;
        border-radius: 8px;
    }

    .farmpress-popup-header {
        padding: 16px 20px 12px 20px;
    }

    .farmpress-popup-title {
        font-size: 16px;
    }

    .farmpress-popup-body {
        padding: 20px;
        max-height: calc(90vh - 100px);
    }

    .farmpress-info-button {
        width: 18px;
        height: 18px;
    }

    .farmpress-info-icon {
        font-size: 11px;
    }
}

/* Animation for popup appearance */
@keyframes fadeInPopup {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Focus styles for accessibility */
.farmpress-info-button:focus {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

.farmpress-popup-close:focus {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

/* Smooth scrollbar for popup body */
.farmpress-popup-body::-webkit-scrollbar {
    width: 8px;
}

.farmpress-popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.farmpress-popup-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

    .farmpress-popup-body::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

/* ================================================================
   FARMPRESS STANDARDIZED CONTENT STYLES
   Matches LifeOwnerSite MyPoliciesView design language
   ================================================================ */

/* Content Wrapper - Main container for formatted content */
.farmpress-content-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Content Title - Matches policies page header styling */
.farmpress-content-title {
    color: #3f5b6a;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #8C2232;
    display: block;
    font-weight: 600;
}

/* Content Body Container */
.farmpress-content-body {
    margin-top: 1rem;
}

/* Paragraph Styles - Clean, readable typography */
.farmpress-paragraph {
    margin: 0.75rem 0;
    color: #333;
    line-height: 1.6;
    font-size: 1rem;
}

    .farmpress-paragraph:first-child {
        margin-top: 0;
    }

    .farmpress-paragraph:last-child {
        margin-bottom: 0;
    }

/* Title Paragraphs - For standalone titles */
.farmpress-paragraph-title {
    margin: 1rem 0 0.5rem 0;
    color: #3f5b6a;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.4;
}

/* Bullet Item Paragraphs - Styled like policy details */
.farmpress-bullet-item {
    margin: 0.5rem 0;
    padding-left: 0;
    color: #333;
    line-height: 1.6;
    display: flex;
    align-items: center;
}

    .farmpress-bullet-item::before {
        content: '';
        display: inline-block;
        width: 4px;
        height: 4px;
        background-color: #8C2232;
        border-radius: 50%;
        margin-right: 8px;
        margin-bottom: 2px;
        vertical-align: middle;
    }

/* Remove the text bullet since we're using CSS */
.farmpress-bullet-item {
    text-indent: 0;
}

/* Heading Styles - Consistent with LifeOwnerSite hierarchy */
.farmpress-heading {
    color: #3f5b6a;
    font-weight: 600;
    line-height: 1.3;
    margin: 1.5rem 0 0.75rem 0;
}

    .farmpress-heading:first-child {
        margin-top: 0;
    }

.farmpress-heading-1 {
    font-size: 1.75rem;
    border-bottom: 2px solid #8C2232;
    padding-bottom: 0.5rem;
}

.farmpress-heading-2 {
    font-size: 1.5rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.25rem;
}

.farmpress-heading-3 {
    font-size: 1.25rem;
}

.farmpress-heading-4 {
    font-size: 1.1rem;
}

.farmpress-heading-5,
.farmpress-heading-6 {
    font-size: 1rem;
    font-weight: 700;
}

/* Strong/Bold Text - Matches brand emphasis */
.farmpress-strong {
    color: #3f5b6a;
    font-weight: 600;
}

/* Emphasis/Italic Text */
.farmpress-emphasis {
    color: #555;
    font-style: italic;
}

/* List Styles - Clean and organized */
.farmpress-list {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.farmpress-ul {
    list-style-type: none;
    padding-left: 0.5rem;
}

.farmpress-ol {
    list-style-type: decimal;
}

.farmpress-list-item {
    margin: 0.5rem 0;
    line-height: 1.6;
    color: #333;
    display: flex;
    align-items: flex-start;
}

/* Custom bullets for unordered lists */
.farmpress-ul .farmpress-list-item::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    min-width: 6px;
    background-color: #8C2232;
    border-radius: 50%;
    margin-right: 0.8rem;
    margin-top: 0.6em;
    vertical-align: top;
}

/* Text Spans - Minimal styling */
.farmpress-text {
    color: inherit;
    font-style: inherit;
    font-weight: inherit;
}

/* Special Content Types */
.farmpress-quote {
    border-left: 4px solid #8C2232;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #555;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0 4px 4px 0;
}

.farmpress-highlight {
    background-color: #fff3cd;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 4px solid #ffc107;
    margin: 1rem 0;
}

.farmpress-info-box {
    background-color: #e3f2fd;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 4px solid #0078d4;
    margin: 1rem 0;
}

.farmpress-warning-box {
    background-color: #fff3e0;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 4px solid #ff9800;
    margin: 1rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .farmpress-content-title {
        font-size: 1.25rem;
    }

    .farmpress-heading-1 {
        font-size: 1.5rem;
    }

    .farmpress-heading-2 {
        font-size: 1.25rem;
    }

    .farmpress-paragraph,
    .farmpress-list-item {
        font-size: 0.95rem;
    }

    .farmpress-list {
        padding-left: 0.75rem;
    }

    .farmpress-ul .farmpress-list-item::before {
        margin-right: 0.6rem;
    }
}
