/* ================================================================
   WP Post to Image Plugin — style.css v1.0
   Premium news-card styling matching the reference layout
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=Mallanna&family=Ramabhadra&display=swap');

/* --- Outer wrapper --- */
.wpi-wrapper {
    width: 550px;
    max-width: 100%;
    margin: 2rem auto;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

.wpi-wrapper * {
    box-sizing: border-box;
}

/* ──────────────────────────────────────────────────────────────
   THE NEWS CARD (Visible & captured by html2canvas)
   ────────────────────────────────────────────────────────────── */
.wpi-card-container {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.wpi-card {
    width: 1590px;
    height: 2226px;
    background: #ffffff;
    border-radius: 0; /* Removing border radius for cleaner 1590x2226 image capture */
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
}

.wpi-card-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    min-height: 0;
}

/* ── Image & Overlay ── */
.wpi-card-media {
    position: relative;
    width: 100%;
    height: 900px;
    flex-shrink: 0;
    overflow: hidden;
}

.wpi-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Vignette / Dark Gradient on image */
.wpi-image-overlay-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Overlay content container */
.wpi-overlay-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 48px 60px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 2;
    gap: 60px;
}

/* Overlay Left: Logo and Reporter Info */
.wpi-overlay-left {
    display: flex;
    align-items: center;
    gap: 36px;
    max-width: 65%;
    overflow: hidden;
}

.wpi-overlay-logo-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    padding: 8px; /* Instagram ring thickness */
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.wpi-overlay-logo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 6px solid #000000; /* space border to make the ring pop */
    object-fit: cover;
    flex-shrink: 0;
    background: #ffffff;
}

.wpi-overlay-logo-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 6px solid #000000;
    background: #e50914;
    color: #ffffff;
    font-weight: 800;
    font-size: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex-shrink: 0;
}

.wpi-overlay-left-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.35;
    overflow: hidden;
}

.wpi-overlay-site-name {
    color: #ffffff;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    text-transform: uppercase;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.wpi-overlay-reporter {
    color: #e0e0e0;
    font-size: 32px;
    font-weight: 500;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Overlay Right: logo & Domain */
.wpi-overlay-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 18px;
    line-height: 1.2;
    max-width: 30%;
    overflow: hidden;
    text-align: right;
}

.wpi-overlay-right-logo {
    max-height: 80px;
    max-width: 290px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 6px;
    display: block;
}

.wpi-overlay-domain {
    color: #ffffff;
    font-size: 32px;
    font-weight: 600;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    letter-spacing: 0.5px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* ── Card details (Title & Content & Footer) ── */
.wpi-card-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 60px 80px 60px 80px;
    min-height: 0;
    overflow: hidden;
}

.wpi-card-title {
   font-family: 'Mallanna', sans-serif;
    font-size: 72px;
    font-weight: 100;
    color: #111111;
    line-height: 1.25;
    margin: 0 0 40px 0;
    text-align: left;
    word-wrap: break-word;
    flex-shrink: 0;
}

.wpi-card-body {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;

    font-size: 24px !important;
    line-height: 1.75 !important;
    font-weight: 400 !important;

    color: #222 !important;
    text-align: left !important;
}

.wpi-card-body p {
    font-size: 24px !important;
    line-height: 1.75 !important;
    margin: 0 0 20px 0 !important;
}

/* ── Footer / QR Code area ── */
.wpi-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 3px solid #f0f0f0;
    padding-top: 40px;
    margin-top: auto; /* Push to bottom */
    flex-shrink: 0;
}

.wpi-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wpi-footer-logo-text {
    font-family: 'Mallanna', sans-serif;
    font-size: 48px;
    font-weight: 800;
    color: #111111;
    letter-spacing: 1px;
}

.wpi-footer-tagline {
    font-family: 'Mallanna', sans-serif;
    font-size: 32px;
    color: #666666;
}

.wpi-footer-qr-wrapper {
    display: flex;
    align-items: center;
    gap: 32px;
}

.wpi-footer-qr-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    text-align: right;
}

.wpi-qr-label {
    font-family: 'Mallanna', sans-serif;
    font-size: 32px;
    color: #555555;
    font-weight: 600;
}

.wpi-qr-url {
    font-family: 'Inter', sans-serif;
    font-size: 28px;
    color: #008cc9;
    font-weight: 700;
}

.wpi-footer-qr-img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 8px;
    background: #ffffff;
}

/* ──────────────────────────────────────────────────────────────
   ACTION BUTTONS (Below the Card)
   ────────────────────────────────────────────────────────────── */
.wpi-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 24px;
}

.wpi-actions-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.wpi-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.wpi-btn-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 0;
    display: inline-block;
}

.wpi-action-btn stroke {
    stroke-width: 2.5;
}

/* WhatsApp Share Button (Green) - Solid vibrant WhatsApp green */
.wpi-btn-whatsapp {
    background: #25d366;
    color: #ffffff;
}

.wpi-btn-whatsapp:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.25);
}

/* Download Image Button (Blue) - Solid vibrant blue */
.wpi-btn-download {
    background: #008cc9;
    color: #ffffff;
}

.wpi-btn-download:hover {
    background: #007bb3;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 140, 201, 0.25);
}

/* Back to Read Article Button (Charcoal) - Solid dark grey */
.wpi-btn-back {
    background: #333333;
    color: #ffffff;
    border: none;
}

.wpi-btn-back:hover {
    background: #222222;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.wpi-btn-back.wpi-btn-back-small {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpi-btn-back.wpi-btn-back-small .wpi-btn-icon {
    margin: 0;
    width: 20px;
    height: 20px;
}

.wpi-action-btn:active {
    transform: translateY(0);
}

.wpi-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ──────────────────────────────────────────────────────────────
   SPINNER OVERLAY
   ────────────────────────────────────────────────────────────── */
.wpi-spinner-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(4px);
}

.wpi-spinner-overlay.wpi-visible {
    display: flex;
}

.wpi-spinner-ring {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.15);
    border-top-color: #008cc9;
    border-radius: 50%;
    animation: wpi-spin 0.8s linear infinite;
}

.wpi-spinner-text {
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

@keyframes wpi-spin {
    to { transform: rotate(360deg); }
}

/* ──────────────────────────────────────────────────────────────
   RESPONSIVE DESIGN
   ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .wpi-modal .wpi-wrapper {
        width: 480px; /* Keep layout wide and compact inside the popup modal */
        max-width: none;
        margin: 0 auto;
    }

    .wpi-modal {
        padding: 10px;
    }

    .wpi-modal-content {
        overflow-x: auto; /* Enable horizontal scrolling if screen is narrower than 480px */
    }

    .wpi-wrapper {
        margin: 1rem auto;
    }
    
    .wpi-actions-row {
        flex-direction: column;
        gap: 12px;
    }
}

/* ──────────────────────────────────────────────────────────────
   TRIGGER BUTTON AND POPUP MODAL STYLING
   ────────────────────────────────────────────────────────────── */
.wpi-trigger-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem auto;
    width: 100%;
}

.wpi-trigger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
    background: #25d366;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.25);
}

.wpi-trigger-btn:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.35);
}

.wpi-trigger-btn:active {
    transform: translateY(0);
}

.wpi-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.wpi-modal.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.wpi-modal-content {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(-30px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wpi-modal.is-active .wpi-modal-content {
    transform: translateY(0);
}

/* Close Button */
.wpi-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #333333;
    font-size: 32px;
    font-weight: 300;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0 0 4px 0;
}

.wpi-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #000000;
    transform: rotate(90deg);
}

/* Modal Content adjustments */
.wpi-modal-content .wpi-wrapper {
    margin: 0;
    padding: 24px;
    max-width: 100%;
}

