/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* Image Container */
.pinnerpress-pin-it-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    font-size: 0; /* Eliminate whitespace */
}

/* Special handling for gallery figures acting as containers */
.wp-block-gallery figure.pinnerpress-pin-it-container {
    position: relative;
    /* Don't override display or max-width for gallery figures */
    font-size: inherit; /* Keep gallery's font-size */
}

/* Ensure the button wrapper isn't constrained by gallery styles */
.wp-block-gallery figure.pinnerpress-pin-it-container .pinnerpress-pin-it-button-wrapper {
    position: absolute !important;
    z-index: 10 !important;
    transform: none !important;
    scale: none !important;
}

/* Fix pin button styling for gallery images to match regular images */
.wp-block-gallery figure.pinnerpress-pin-it-container .pinnerpress-pin-it-button {
    /* Ensure same padding and sizing as regular images */
    padding: 8px 12px !important; /* Override any inherited styles */
    font-size: 14px !important;
    font-weight: 500 !important;
    display: inline-flex !important;
    align-items: center !important;
    min-height: auto !important;
    height: auto !important;
    width: auto !important;
    min-width: auto !important;
    box-sizing: border-box !important;
    transform: none !important;
    scale: none !important;
}

/* Fix image banner styling for gallery images to match regular images */
.wp-block-gallery figure.pinnerpress-pin-it-container .pinnerpress-image-banner {
    /* Ensure proper flexbox layout for inline logo */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important; /* Force horizontal layout */
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    gap: 5px !important; /* Add small gap between icon and text */
}

/* Ensure the banner icon stays inline within gallery banners */
.wp-block-gallery figure.pinnerpress-pin-it-container .pinnerpress-image-banner .pinnerpress-banner-icon {
    display: inline-block !important;
    margin-right: 5px !important;
    flex-shrink: 0 !important;
}

/* Ensure banner text stays inline */
.wp-block-gallery figure.pinnerpress-pin-it-container .pinnerpress-image-banner span {
    display: inline !important;
    flex-shrink: 1 !important;
}

.pinnerpress-pin-it-container img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Pin Button Styles */
.pinnerpress-pin-it-button-wrapper {
    z-index: 10; /* Ensure button appears above the image */
    position: absolute;
}

.pinnerpress-pin-it-button {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    text-decoration: none;
    cursor: pointer;
    background-color: #E60023;
    color: #FFFFFF;
    border-radius: 3px;
}

/* Pinterest Icon Specific Styles */
.pinnerpress-pin-icon {
    /* No special rendering properties */
    display: inline-block !important;
    vertical-align: middle;
    fill: currentColor !important;
    width: 1em;
    height: 1em;
    pointer-events: none;
}

/* Image Banner Styles */
.pinnerpress-image-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.5);
    color: #BD081C;
    padding: 8px 15px;
    font-size: 22px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    z-index: 9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.pinnerpress-image-banner:hover {
    text-decoration: none;
    color: #BD081C;
    background-color: rgba(255, 255, 255, 0.7);
}

.pinnerpress-banner-icon {
    /* Remove drop shadow */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Prevent page jumping when hovering images */
body {
    overflow-x: hidden;
}

/* Button size variations are handled inline via PHP */

/* Follow Box Modal */
.pinnerpress-follow-box-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pinnerpress-follow-box-wrapper {
    max-width: 400px;
    width: 90%;
}

.pinnerpress-follow-box {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pinnerpress-shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.pinnerpress-follow-box-header {
    height: 120px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.pinnerpress-follow-box-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    filter: drop-shadow(0px 0px 3px rgba(0, 0, 0, 1)) drop-shadow(0px 0px 1px rgba(0, 0, 0, 1));
}

.pinnerpress-follow-box-close svg {
    display: block;
}

.pinnerpress-follow-box-close path {
    fill: #FFFFFF;
}

.pinnerpress-follow-box-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 4px solid #fff;
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
}

.pinnerpress-follow-box-inner {
    padding: 50px 20px 20px;
    text-align: center;
}

.pinnerpress-follow-box-inner h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
}

.pinnerpress-follow-box-inner p {
    margin: 0 0 20px;
    font-size: 14px;
    color: #666;
}

.pinnerpress-follow-box-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.pinnerpress-follow-box-button:hover {
    opacity: 0.9;
}

.pinnerpress-follow-button-text {
    margin-right: 6px;
    display: inline-block;
    line-height: 1;
}

.pinnerpress-pinterest-button-logo {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: -0.125em;
    position: relative;
    top: 0.5px;
}

.pinnerpress-follow-box-dismiss {
    margin-top: 15px;
}

.pinnerpress-follow-box-dismiss-link {
    display: inline-block;
    font-size: 12px;
    color: #888;
    text-decoration: none;
}

.pinnerpress-follow-box-dismiss-link:hover {
    color: #555;
    text-decoration: underline;
}

.pinnerpress-dont-remind {
    display: block;
    margin-top: 15px;
    font-size: 12px;
    color: #888;
    text-decoration: none;
}

.pinnerpress-dont-remind:hover {
    color: #555;
    text-decoration: underline;
}

/* Call Out Banner Styles */
.pinnerpress-call-out-banner {
    box-sizing: border-box;
    margin: 25px 0;
    clear: both;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    border-radius: 6px;
    background-color: #E60023;
    color: #FFFFFF;
}

.pinnerpress-call-out-banner * {
    box-sizing: border-box;
}

.pinnerpress-call-out-banner span {
    font-size: 18px;
    line-height: 1.4;
    margin: 0 !important;
    font-weight: 600;
    flex: 1;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pinnerpress-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-right: 15px;
    width: auto;
    min-width: 24px;
    flex-shrink: 0;
}

.pinnerpress-call-out-button {
    display: inline-block;
    background-color: #FFFFFF;
    color: #E60023 !important; /* Force text color */
    padding: 10px 20px;
    text-decoration: none !important; /* Prevent theme overrides */
    border-radius: 50px;
    font-weight: 700; /* Make text bolder */
    white-space: nowrap;
    margin-left: 15px;
    min-width: 90px;
    text-align: center;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    font-size: 16px;
    line-height: 1.4;
}

.pinnerpress-call-out-button:hover {
    opacity: 0.9;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    text-decoration: none !important;
}

/* Style Variations */
.pinnerpress-call-out-classic {
    border-radius: 6px;
    border-width: 0;
    border-style: solid;
    padding: 30px 25px;
    text-align: center;
    background-color: #E60023;
    color: #FFFFFF;
}

.pinnerpress-call-out-modern {
    border-radius: 10px;
    border: none;
    padding: 30px 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.pinnerpress-call-out-modern .pinnerpress-call-out-button {
    border-radius: 30px; /* More rounded button for modern style */
    padding: 12px 24px;
}

.pinnerpress-call-out-simple {
    border-top: 1px solid;
    border-bottom: 1px solid;
    border-left: none;
    border-right: none;
    padding: 20px 15px;
    border-radius: 0;
    text-align: center;
}

/* New Inline Style - Horizontal layout */
.pinnerpress-call-out-inline {
    border-radius: 6px;
    border: none;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    background-color: #E60023;
    color: #FFFFFF;
    flex-wrap: wrap;
}

.pinnerpress-call-out-inline h3 {
    font-size: 18px;
    margin: 10px 20px 10px 0 !important;
    font-weight: 600;
    text-align: left;
    flex: 1;
}

.pinnerpress-call-out-inline p {
    display: none; /* Hide description in inline mode */
}

.pinnerpress-call-out-inline .pinnerpress-call-out-button {
    white-space: nowrap;
    margin: 5px 0;
    padding: 10px 20px;
    border-radius: 30px;
    min-width: 90px;
}

.pinnerpress-call-out-inline .pinnerpress-pinterest-icon {
    margin-right: 10px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .pinnerpress-call-out-banner {
        flex-direction: column;
        padding: 20px;
        align-items: center;
    }
    
    .pinnerpress-call-out-banner span {        
        text-align: center;
        display: block;
        width: 100%;
    }
    
    .pinnerpress-call-out-button {
        width: 100%;
        max-width: 200px;
        margin: 10px auto 5px !important;
    }
    
    .pinnerpress-logo {
        margin: 0 auto 10px !important;
    }
    
    .pinnerpress-call-out-inline {
        flex-direction: column;
        padding: 20px;
    }
    
    .pinnerpress-call-out-inline h3 {
        margin: 0 0 15px 0 !important;
        text-align: center;
        font-size: 16px;
    }
    
    .pinnerpress-call-out-inline .pinnerpress-call-out-button {
        width: 100%;
        max-width: 200px;
    }
}

/* Hide pin buttons on images with pinning disabled */
.pinnerpress-pinning-disabled .pinnerpress-pin-it-button-wrapper,
.pinnerpress-pinning-disabled + .pinnerpress-pin-it-button-wrapper,
figure.pinnerpress-pinning-disabled > .pinnerpress-pin-it-button-wrapper,
div.pinnerpress-pinning-disabled > .pinnerpress-pin-it-button-wrapper,
img[data-pin-nopin="true"] + .pinnerpress-pin-it-button-wrapper,
img[data-pin-nopin="true"] ~ .pinnerpress-pin-it-button-wrapper {
    display: none !important;
}

/* Hide Pinterest banner on images with pinning disabled */
.pinnerpress-pinning-disabled .pinnerpress-banner,
.pinnerpress-pinning-disabled + .pinnerpress-banner,
figure.pinnerpress-pinning-disabled > .pinnerpress-banner,
div.pinnerpress-pinning-disabled > .pinnerpress-banner,
img[data-pin-nopin="true"] + .pinnerpress-banner,
img[data-pin-nopin="true"] ~ .pinnerpress-banner {
    display: none !important;
} 