/**
 * Prime Agency Code - Frontend Styles
 * 
 * @package PrimeAgencyCode
 */

/* === COPYRIGHT FOOTER STYLES === */
.pac-copyright-footer {
    display: block;
    font-family: inherit;
    line-height: 1.5;
    word-wrap: break-word;
    clear: both;
}

.pac-copyright-footer .pac-agency-link {
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.pac-copyright-footer .pac-agency-link:hover {
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    opacity: 0.8;
}

.pac-copyright-footer .pac-agency-link:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 2px;
}

/* === RESPONSIVE ADJUSTMENTS === */
@media screen and (max-width: 768px) {
    .pac-copyright-footer {
        font-size: 13px !important;
        line-height: 1.4;
        padding: 15px 10px;
    }
}

@media screen and (max-width: 480px) {
    .pac-copyright-footer {
        font-size: 12px !important;
        text-align: center !important;
    }
    
    .pac-copyright-footer .pac-agency-link {
        display: inline-block;
        margin-top: 5px;
    }
}

/* === PRINT STYLES === */
@media print {
    .pac-copyright-footer {
        color: #000 !important;
        font-size: 10pt !important;
        margin: 20pt 0 !important;
    }
    
    .pac-copyright-footer .pac-agency-link {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    .pac-copyright-footer .pac-agency-link::after {
        content: " (" attr(href) ")";
        font-size: 8pt;
        color: #666;
    }
}

/* === ACCESSIBILITY ENHANCEMENTS === */
.pac-copyright-footer .pac-agency-link[target="_blank"]::after {
    content: " ↗";
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pac-copyright-footer .pac-agency-link {
        text-decoration: underline;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .pac-copyright-footer .pac-agency-link {
        transition: none;
    }
}

/* === THEME COMPATIBILITY === */

/* Twenty Twenty-Three and newer themes */
.wp-site-blocks .pac-copyright-footer {
    max-width: none;
}

/* Astra theme compatibility */
.ast-footer-copyright .pac-copyright-footer {
    margin: 0;
}

/* GeneratePress theme compatibility */
.site-footer .pac-copyright-footer {
    margin: 10px 0;
}

/* OceanWP theme compatibility */
#footer-bottom .pac-copyright-footer {
    margin: 0;
}

/* Elementor compatibility */
.elementor-widget-text-editor .pac-copyright-footer {
    margin: 0;
}

/* Gutenberg block compatibility */
.wp-block-group .pac-copyright-footer,
.wp-block-columns .pac-copyright-footer {
    margin: 0;
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
    .pac-copyright-footer {
        color: #e2e8f0;
    }
    
    .pac-copyright-footer .pac-agency-link {
        color: #90cdf4;
    }
    
    .pac-copyright-footer .pac-agency-link:hover {
        color: #63b3ed;
    }
}

/* === WIDGET SPECIFIC STYLES === */
.widget .pac-copyright-footer {
    margin: 0;
    padding: 0;
}

.widget_text .pac-copyright-footer {
    font-size: inherit;
}

/* === FOOTER SPECIFIC ADJUSTMENTS === */
footer .pac-copyright-footer,
.site-footer .pac-copyright-footer,
#footer .pac-copyright-footer,
.footer .pac-copyright-footer {
    margin: 15px 0;
}

/* Footer wrapper adjustments */
.footer-copyright .pac-copyright-footer,
.copyright-area .pac-copyright-footer,
.site-info .pac-copyright-footer {
    margin: 0;
}

/* === UTILITY CLASSES === */
.pac-copyright-footer.pac-small {
    font-size: 12px !important;
}

.pac-copyright-footer.pac-large {
    font-size: 16px !important;
}

.pac-copyright-footer.pac-compact {
    margin: 10px 0 !important;
    line-height: 1.3 !important;
}

.pac-copyright-footer.pac-spaced {
    margin: 30px 0 !important;
    line-height: 1.7 !important;
}

/* === ANIMATION CLASSES === */
.pac-copyright-footer.pac-fade-in {
    opacity: 0;
    animation: pacFadeIn 0.6s ease-out forwards;
}

@keyframes pacFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pac-copyright-footer.pac-slide-up {
    opacity: 0;
    animation: pacSlideUp 0.8s ease-out forwards;
}

@keyframes pacSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === BORDER VARIATIONS === */
.pac-copyright-footer.pac-border-top {
    border-top: 1px solid currentColor;
    padding-top: 15px;
    opacity: 0.8;
}

.pac-copyright-footer.pac-border-bottom {
    border-bottom: 1px solid currentColor;
    padding-bottom: 15px;
    opacity: 0.8;
}

.pac-copyright-footer.pac-border-full {
    border: 1px solid currentColor;
    padding: 15px 20px;
    border-radius: 4px;
    opacity: 0.8;
}

/* === BACKGROUND VARIATIONS === */
.pac-copyright-footer.pac-bg-light {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: 4px;
}

.pac-copyright-footer.pac-bg-dark {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 15px 20px;
    border-radius: 4px;
}

/* === RESET COMMON CONFLICTS === */
.pac-copyright-footer {
    /* Reset common theme conflicts */
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.pac-copyright-footer * {
    box-sizing: inherit;
}

/* Reset link styling conflicts */
.pac-copyright-footer .pac-agency-link {
    background: none;
    border: none;
    box-shadow: none;
    display: inline;
    font-weight: inherit;
    padding: 0;
    margin: 0;
    vertical-align: baseline;
}

/* === RTL SUPPORT === */
.rtl .pac-copyright-footer {
    direction: rtl;
    text-align: right;
}

.rtl .pac-copyright-footer.pac-text-left {
    text-align: left;
}

.rtl .pac-copyright-footer.pac-text-center {
    text-align: center;
}

.rtl .pac-copyright-footer .pac-agency-link[target="_blank"]::after {
    content: " ↙";
    margin-left: 0;
    margin-right: 2px;
}

/* === PERFORMANCE OPTIMIZATIONS === */
.pac-copyright-footer .pac-agency-link {
    /* Hardware acceleration for smooth transitions */
    will-change: color, border-color;
    transform: translateZ(0);
}

/* === CUSTOM PROPERTIES SUPPORT === */
.pac-copyright-footer {
    /* CSS Custom Properties for easy theming */
    --pac-text-color: inherit;
    --pac-link-color: #0073aa;
    --pac-link-hover-color: #005177;
    --pac-font-size: 14px;
    --pac-line-height: 1.5;
    --pac-margin: 20px 0;
    
    color: var(--pac-text-color);
    font-size: var(--pac-font-size);
    line-height: var(--pac-line-height);
    margin: var(--pac-margin);
}

.pac-copyright-footer .pac-agency-link {
    color: var(--pac-link-color);
}

.pac-copyright-footer .pac-agency-link:hover {
    color: var(--pac-link-hover-color);
}

/* === CONTAINER QUERIES SUPPORT (Future-proof) === */
@supports (container-type: inline-size) {
    .pac-copyright-container {
        container-type: inline-size;
    }
    
    @container (max-width: 400px) {
        .pac-copyright-footer {
            font-size: 12px;
            text-align: center;
        }
    }
}

/* === PREFERS COLOR SCHEME ENHANCEMENTS === */
@media (prefers-color-scheme: light) {
    .pac-copyright-footer {
        --pac-text-color: #374151;
        --pac-link-color: #2563eb;
        --pac-link-hover-color: #1d4ed8;
    }
}

@media (prefers-color-scheme: dark) {
    .pac-copyright-footer {
        --pac-text-color: #d1d5db;
        --pac-link-color: #60a5fa;
        --pac-link-hover-color: #93c5fd;
    }
}

/* === FOCUS VISIBLE SUPPORT === */
@supports selector(:focus-visible) {
    .pac-copyright-footer .pac-agency-link:focus {
        outline: none;
    }
    
    .pac-copyright-footer .pac-agency-link:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: 2px;
        border-radius: 2px;
    }
}

/* === GRID AND FLEXBOX CONTEXT === */
.pac-copyright-footer {
    /* Ensure proper sizing in flex contexts */
    flex-shrink: 0;
    
    /* Ensure proper sizing in grid contexts */
    justify-self: stretch;
    align-self: center;
}

/* === MULTI-COLUMN LAYOUT SUPPORT === */
.pac-copyright-footer {
    /* Prevent breaking across columns */
    break-inside: avoid;
    page-break-inside: avoid;
}

/* === SCREEN READER ENHANCEMENTS === */
.pac-copyright-footer .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* External link indicator for screen readers */
.pac-copyright-footer .pac-agency-link[target="_blank"] .sr-only::after {
    content: " (si apre in una nuova finestra)";
}

/* === VENDOR PREFIXES FOR LEGACY SUPPORT === */
.pac-copyright-footer .pac-agency-link {
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

/* === IE11 SPECIFIC FIXES === */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .pac-copyright-footer {
        /* IE11 fallbacks */
        display: block;
    }
    
    .pac-copyright-footer .pac-agency-link {
        /* IE11 transition fallback */
        -ms-transition: color 0.3s ease;
    }
}

/* === SAFARI SPECIFIC OPTIMIZATIONS === */
@supports (-webkit-appearance: none) {
    .pac-copyright-footer .pac-agency-link {
        /* Safari-specific font smoothing */
        -webkit-font-smoothing: antialiased;
    }
}

/* === FINAL CLEANUP AND OVERRIDES === */
.pac-copyright-footer {
    /* Ensure our styles take precedence */
    position: relative;
    z-index: 1;
}

/* Reset any potential conflicts from aggressive theme styles */
.pac-copyright-footer,
.pac-copyright-footer * {
    text-shadow: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

.pac-copyright-footer .pac-agency-link {
    /* Ensure link behaves properly */
    cursor: pointer;
    display: inline;
    text-decoration: none;
}

/* Last resort important declarations for critical styles */
.pac-copyright-footer .pac-agency-link:hover {
    text-decoration: underline !important;
}