@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600&display=swap');

:root {
    --ip-primary-btn: #2F5189;
    /* Updated Blue */
    --ip-primary-btn-hover: #24406b;
    /* Darker shade */
    --ip-bg-color: #fafafa;
    --ip-border-color: #dbdbdb;
    --ip-text-main: #534F4F;
    /* Updated Text */
    --ip-text-secondary: #7a7575;
    /* Slightly lighter for secondary */
    --ip-font-stack: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ... existing code ... */

/* Teaser Shortcode */
.ip-teaser-grid {
    margin-bottom: 20px;
    padding-bottom: 0;
}

.ip-teaser-footer {
    text-align: center;
    margin-bottom: 40px;
}

.ip-btn-view-more {
    display: inline-block;
    background-color: transparent;
    color: #534F4F;
    /* Requested Color */
    border: none;
    border-bottom: 1px solid transparent;
    padding: 10px 24px;
    /* Requested Weight */
    transition: all 0.2s;
    font-size: 20px;
    /* Requested Size */
    font-family: 'Montserrat', sans-serif;
    /* Requested Font */
}

.ip-btn-view-more:hover {
    background-color: transparent;
    color: #2F5189;
    /* Hover to blue */
    border-bottom: 1px solid #2F5189;
}

/* Calendar Styles - Compact Fix */
.ip-calendar-container {
    box-sizing: border-box;
    width: 320px;
    height: 280px;
    /* Fixed Height */
    margin: 20px auto;
    background: #fff;
    border: 1px solid var(--ip-border-color);
    border-left: 4px solid var(--ip-primary-btn);
    border-radius: 8px;
    padding: 15px;
    /* Compact Padding */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    font-size: 13px;
    color: #534F4F;
    font-family: 'Montserrat', sans-serif;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ip-calendar-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 81, 137, 0.1);
}

/* ... existing calendar header/grid styles ... */

/* Counter Shortcode - Premium Horizontal Compact */
.ip-counter-card {
    box-sizing: border-box;
    width: 320px;
    /* Keep width */
    height: 280px;
    /* Reduced Height to match */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--ip-border-color);
    border-left: 4px solid var(--ip-primary-btn);
    border-radius: 8px;
    padding: 15px;
    /* Compact Padding */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin: 20px auto;
    font-family: 'Montserrat', sans-serif;
    gap: 15px;
    transition: transform 0.2s;
}

.ip-counter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 81, 137, 0.1);
}

.ip-counter-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #f4f6f9;
    border-radius: 50%;
    flex-shrink: 0;
}

.ip-counter-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Left align text */
    justify-content: center;
    text-align: left;
}

.ip-counter-value {
    font-size: 42px;
    /* Slightly smaller */
    font-weight: 700;
    color: var(--ip-primary-btn);
    line-height: 1;
    margin-bottom: 3px;
}

.ip-counter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ip-text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.ip-counter-desc {
    font-size: 11px;
    /* Smaller desc */
    color: var(--ip-text-secondary);
    margin: 0;
    line-height: 1.3;
    max-width: 150px;
    /* Limit text width to fit nicelly next to icon */
}

.ip-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 600;
    color: #2F5189;
    /* Title in Blue */
}

.ip-cal-nav {
    text-decoration: none;
    color: #534F4F;
    padding: 5px 10px;
    font-size: 18px;
}

.ip-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 5px;
}

.ip-cal-head {
    color: #534F4F;
    font-size: 12px;
    margin-bottom: 5px;
    font-weight: 600;
}

.ip-cal-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 35px;
    border-radius: 50%;
    color: #d1d1d1;
    /* Disabled look */
    font-size: 13px;
    background: #fff;
}

.ip-cal-day.empty {
    background: transparent;
}

.ip-cal-day.has-post {
    color: #534F4F;
    font-weight: 600;
    cursor: pointer;
    background: #f0f4f8;
    /* Slight blue tinge for available days */
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s;
}

.ip-cal-day.has-post:hover {
    background: #2F5189;
    /* Hover Blue */
    color: #fff;
    /* White text on blue bg */
    border-color: #2F5189;
}

.ip-cal-day.selected {
    background: #2F5189;
    color: #fff;
    border-color: #2F5189;
    box-shadow: 0 2px 4px rgba(47, 81, 137, 0.3);
}

.ip-calendar-footer {
    margin-top: 15px;
    text-align: center;
}

.ip-btn-reset {
    font-size: 12px;
    color: #2F5189;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed #2F5189;
}

/* Container & Typography */
.ip-feed,
.ip-form-container {
    font-family: var(--ip-font-stack);
    color: var(--ip-text-main);
}

/* Form Styles */
.ip-form-container {
    max-width: 480px;
    margin: 40px auto;
    background: #fff;
    border: 1px solid #f1f3f5;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
}

.ip-success-message {
    background: #f0fdf4 !important;
    color: #166534 !important;
    padding: 16px !important;
    border-radius: 12px !important;
    margin-bottom: 24px !important;
    text-align: center !important;
    border: 1px solid #dcfce7 !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
}

.ip-upload-preview {
    width: 100%;
    min-height: 250px;
    background: var(--ip-bg-color);
    border: 2px dashed var(--ip-border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}

.ip-upload-preview:hover,
.ip-upload-preview.drag-over {
    border-color: var(--ip-text-secondary);
}

.ip-upload-preview.has-image {
    border-style: solid;
    border-color: transparent;
}

.ip-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ip-upload-preview span {
    color: var(--ip-text-secondary);
    font-weight: 600;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ip-form-container textarea {
    width: 100%;
    background: var(--ip-bg-color);
    border: 1px solid var(--ip-border-color);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ip-form-container textarea:focus {
    border-color: var(--ip-text-secondary);
}

.ip-form-container {
    max-width: 850px;
    /* Increased to fit side-by-side */
    margin: 40px auto;
    background: #fff;
    border: 1px solid #f1f3f5;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
}

.ip-form-flex {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.ip-form-media-part {
    flex: 1;
    /* Left side */
    min-width: 300px;
}

.ip-form-content-part {
    flex: 1.2;
    /* Right side - slightly wider for text */
}

.ip-form-content-part textarea {
    min-height: 200px;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 15px;
}

/* Video Preview Specifics */
#ip-video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .ip-form-flex {
        flex-direction: column;
    }

    .ip-form-media-part,
    .ip-form-content-part {
        width: 100%;
    }
}

.ip-btn {
    width: 100%;
    background-color: var(--ip-primary-btn);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ip-btn:hover {
    background-color: var(--ip-primary-btn-hover);
}

.ip-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ip-error-message {
    color: #ed4956;
    font-size: 12px;
    margin-bottom: 15px;
    display: none;
    text-align: left;
}

/* Feed Grid Styles */
.ip-feed-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 3px !important;
    max-width: 1000px !important;
    margin: 20px auto !important;
    padding: 0 5px 50px !important;
}

/* Responsive Grid */
@media (max-width: 768px) {
    .ip-feed-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

.ip-grid-item {
    position: relative !important;
    width: 100% !important;
    padding-bottom: 125% !important;
    /* Vertical Aspect Ratio (4:5) */
    background-color: #fff !important;
    cursor: pointer !important;
    overflow: hidden !important;
    border: none !important;
    box-shadow: none !important;
}

.ip-grid-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

.ip-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.ip-grid-item:hover .ip-grid-overlay {
    opacity: 1;
    /* Show overlay on hover */
}

/* Video Indicator on Grid */
.ip-video-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    z-index: 5;
}

.ip-video-icon svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

/* Modal Video */
.ip-modal-image video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Modal Styles */
.ip-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ip-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 10001;
}

/* Modal Close Button - Fixed Position */
/* Modal Close Button - Flex Item */
.ip-modal-close {
    cursor: pointer;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #333;
    padding: 8px;
    line-height: 1;
    position: relative;
    /* Keep in flow */
    margin-left: auto;
    /* Push to right */
    z-index: 10020;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ip-modal-close:hover {
    color: #ed4956;
}

/* Post Navigation (Outer Arrows) */
.ip-nav-btn {
    position: fixed;
    /* Fixed to screen edges */
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background-color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10010;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
    color: #333;
    padding: 0;
}

.ip-nav-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    color: #000;
}

.ip-nav-btn svg {
    width: 24px;
    height: 24px;
    display: block;
    stroke-width: 2px;
    pointer-events: none;
}

.ip-prev {
    left: 20px;
}

.ip-next {
    right: 20px;
}

/* Modal Layout (Desktop) */

/* Modal Layout (Desktop) */
.ip-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 1100px;
    height: 85vh;
    max-height: 85vh;
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    z-index: 10002;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.ip-modal-body {
    display: flex;
    width: 100%;
    height: 100%;
}

.ip-modal-image {
    flex: 1.5;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100%;
    overflow: hidden;
}

.ip-modal-image img,
.ip-modal-image video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.ip-modal-details {
    flex: 1;
    min-width: 350px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-left: 1px solid #efefef;
}

.ip-modal-header {
    padding: 16px;
    border-bottom: 1px solid #efefef;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.ip-modal-user {
    display: flex !important;
    align-items: center !important;
    gap: 12px;
    /* Explicit gap */
}

.ip-modal-close {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    padding: 0;
    line-height: 1;
}

/* Responsive Nav */
@media (max-width: 768px) {
    .ip-nav-btn {
        width: 32px;
        height: 32px;
    }

    .ip-nav-btn svg {
        width: 18px;
        height: 18px;
    }

    .ip-prev {
        left: 10px;
    }

}

.ip-modal-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.ip-modal-username,
.ip-modal-username-caption {
    font-weight: 600;
    font-size: 14px;
    color: #262626;
    text-decoration: none;
}

.ip-modal-username-caption {
    margin-right: 5px;
}

.ip-modal-caption-area {
    padding: 16px;
    flex-grow: 1;
    overflow-y: auto;
}

.ip-caption-content {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* Add Paragraph Spacing */
.ip-caption-content p {
    margin-bottom: 12px;
}

.ip-modal-time {
    font-size: 10px;
    color: #8e8e8e;
    text-transform: uppercase;
    margin-top: 10px;
}

/* Responsive */
/* Responsive Modal only - Grid handled above */
/* Responsive Modal only - Grid handled above */
@media (max-width: 768px) {

    /* Modal Mobile */
    .ip-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        max-width: 100%;
        border-radius: 0;
        flex-direction: column;
    }

    .ip-modal-body {
        flex-direction: column;
    }

    .ip-modal-image {
        min-width: 100%;
        height: auto;
        flex: 1;
        /* Take available space */
        max-height: 60vh;
        /* Limit image height on mobile */
    }

    /* Override img styles for mobile to fit width */
    .ip-modal-image img,
    .ip-modal-image video {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .ip-modal-details {
        width: 100%;
        min-width: 100%;
        flex: 1;
        border-left: none;
        border-top: 1px solid #efefef;
    }

    .ip-modal-details {
        border-left: none;
        border-top: 1px solid #efefef;
    }

    .ip-modal-caption-area {
        max-height: 200px;
        /* Limit height on mobile */
    }
}

/* Base Carousel Styles */
.ip-carousel-container {
    width: 100%;
    /* Fills the .ip-modal-image container */
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #000;
}

.ip-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease-in-out;
}

.ip-carousel-slide {
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ip-carousel-slide img,
.ip-carousel-slide video {
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Carousel Navigation */
.ip-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 99999 !important;
    /* Force on top */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.ip-carousel-btn:hover {
    opacity: 1;
    background: #fff;
}

.ip-carousel-prev {
    left: 10px;
}

.ip-carousel-next {
    right: 10px;
}

/* Dots */
.ip-carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.ip-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.ip-carousel-dot.active {
    background: #fff;
}