/* Post to Image Generator Styles - Newspaper Poster Edition */

/* ------------- Variables & Base Tokens ------------- */
:root {
    --pti-primary: #024982;
    --pti-primary-hover: #013763;
    --pti-accent-red: #dc2626;
    --pti-text-main: #1e293b;
    --pti-text-muted: #64748b;
    --pti-bg-light: #f8fafc;
    --pti-border: #e2e8f0;
    --pti-radius-pill: 9999px;
    --pti-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ------------- Trigger Button (On WP Post Page) ------------- */
#pti-generate {
    background: linear-gradient(135deg, #024982 0%, #0369a1 100%);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--pti-radius-pill);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(2, 73, 130, 0.35);
    transition: var(--pti-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, sans-serif;
    letter-spacing: 0.5px;
    margin: 20px 0;
}

#pti-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 73, 130, 0.45);
    background: linear-gradient(135deg, #013763 0%, #0284c7 100%);
}

#pti-generate:active {
    transform: translateY(0);
}

/* ------------- Off-screen Canvas Target Container ------------- */
#pti-content {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 800px !important;
    max-width: none !important;
    background: #ffffff;
    box-sizing: border-box;
    font-family: 'Mandali', 'Noto Sans Telugu', system-ui, sans-serif;
    color: var(--pti-text-main);
    padding: 0;
    margin: 0;
}

/* The Newspaper Card Outer Box */
.pti-card {
    width: 800px;
    background: #ffffff;
    border: 2.5px solid var(--pti-primary, #024982);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Ensure no video or audio elements render in image target */
#pti-content video,
#pti-content audio,
#pti-content iframe,
#pti-content embed,
#pti-content object,
#pti-content figure,
#pti-content .wp-block-video,
#pti-content .wp-block-embed {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* 1. Header / Masthead */
.pti-header {
    text-align: center;
    padding: 24px 20px 14px 20px;
    background: #ffffff;
}

.pti-custom-logo img {
    max-height: 85px;
    width: auto;
    display: inline-block;
}

.pti-masthead {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pti-masthead-title {
    font-family: 'Ramabhadra', 'Noto Sans Telugu', sans-serif;
    font-size: 48px;
    font-weight: 800;
    color: var(--pti-primary, #024982);
    margin: 0 0 2px 0;
    line-height: 1.15;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(2, 73, 130, 0.15);
}

.pti-masthead-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 3px;
}

.pti-masthead-sub .pti-line {
    display: inline-block;
    height: 1.5px;
    width: 55px;
    background-color: #64748b;
}

.pti-masthead-sub .pti-sub-text {
    font-family: 'Mandali', 'Noto Sans Telugu', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.5px;
}

.pti-masthead-tagline {
    font-family: 'Mandali', 'Noto Sans Telugu', sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--pti-accent-red, #dc2626);
    letter-spacing: 0.5px;
}

/* 2. Date & Time Ribbon */
.pti-ribbon {
    background: var(--pti-primary, #024982);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 24px;
    box-sizing: border-box;
    width: 100%;
}

.pti-ribbon-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Mandali', 'Noto Sans Telugu', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.pti-cal-icon {
    display: block;
    flex-shrink: 0;
}

.pti-ribbon-time {
    background: #ffffff;
    color: var(--pti-primary, #024982);
    padding: 3px 14px;
    border-radius: var(--pti-radius-pill);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

/* 3. Headline */
.pti-title-container {
    padding: 24px 28px 18px 28px;
    text-align: center;
    box-sizing: border-box;
}

.pti-post-title {
    font-family: 'Ramabhadra', 'Noto Sans Telugu', sans-serif;
    font-size: 29px;
    font-weight: 800;
    line-height: 1.45;
    color: var(--pti-primary, #024982);
    margin: 0;
    text-align: center;
    letter-spacing: -0.2px;
}

/* 4. Body Content Columns */
.pti-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    padding: 0 28px;
    box-sizing: border-box;
}

/* 1 Column Layout Override */
.pti-columns.columns-1 {
    grid-template-columns: 1fr;
    gap: 16px;
}

/* 3 Columns Layout Override */
.pti-columns.columns-3 {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.pti-col {
    display: flex;
    flex-direction: column;
}

.pti-thumbnail {
    width: 100%;
    margin-bottom: 12px;
}

.pti-thumbnail img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.pti-byline {
    display: none !important;
}

.pti-text-left,
.pti-text-right {
    font-family: 'Mandali', 'Noto Sans Telugu', sans-serif;
    font-size: 17.5px;
    font-weight: 500;
    line-height: 1.75;
    color: #1e293b;
    text-align: justify;
    text-justify: inter-word;
}

.pti-text-left p,
.pti-text-right p {
    margin: 0 0 12px 0;
    text-align: justify;
}

/* 5. Footer */
.pti-footer {
    margin: 22px 28px 18px 28px;
    padding-top: 14px;
    border-top: 1.2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

/* Footer Left: QR Box */
.pti-footer-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pti-qr-box {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.pti-qr-img {
    width: 56px;
    height: 56px;
    display: block;
}

.pti-scan-label {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 9.5px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Footer Center: Brand + Social Icons */
.pti-footer-brand-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.pti-brand-title {
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 800;
    font-size: 15.5px;
    color: var(--pti-accent-red, #dc2626);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.pti-social-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pti-social-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.pti-social-instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}

.pti-social-facebook {
    background: #1877f2;
}

.pti-social-youtube {
    background: #ff0000;
}

.pti-social-twitter {
    background: #1da1f2;
}

.pti-social-whatsapp {
    background: #25d366;
}

/* Footer Right: Author */
.pti-footer-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pti-author-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.pti-posted-label {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1px;
}

.pti-author-name {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: var(--pti-primary, #024982);
    letter-spacing: 0.2px;
}

.pti-author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--pti-primary, #024982);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(2, 73, 130, 0.25);
}

/* ------------- Modal Preview & Toolbar ------------- */
#pti-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999999;
    flex-direction: column;
    opacity: 0;
    animation: ptiFadeIn 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ptiFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pti-modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
}

.pti-close {
    position: absolute;
    top: 20px;
    right: 28px;
    cursor: pointer;
    font-size: 42px;
    color: white;
    font-weight: 200;
    z-index: 100000;
    line-height: 1;
    transition: var(--pti-transition);
    text-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.pti-close:hover {
    color: #f87171;
    transform: scale(1.1) rotate(90deg);
}

.pti-scroll-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 20px;
}

.pti-scroll-container::-webkit-scrollbar {
    width: 8px;
}
.pti-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05); 
}
.pti-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25); 
    border-radius: 10px;
}

#pti-canvas {
    max-width: 90%;
    max-height: 85vh;
    height: auto;
    display: block;
    box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.4), 0 10px 15px -5px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    animation: ptiSlideUp 0.4s forwards cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(20px) scale(0.98);
    opacity: 0;
}

@keyframes ptiSlideUp {
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Toolbar */
.pti-toolbar {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    padding: 18px 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    border-top: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 -8px 25px rgba(0,0,0,0.06);
}

.pti-btn {
    border: none;
    padding: 11px 26px;
    border-radius: var(--pti-radius-pill);
    font-weight: 700;
    cursor: pointer;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13.5px;
    text-decoration: none;
    font-family: system-ui, -apple-system, sans-serif;
    transition: var(--pti-transition);
    letter-spacing: 0.5px;
}

.pti-btn:hover {
    transform: translateY(-2px);
    color: white;
}

.pti-btn-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    background-color: #ffffff;
    color: #1e293b;
    border: 1.5px solid #cbd5e1;
    min-width: 170px;
}

.pti-btn-select:hover {
    border-color: #94a3b8;
    background-color: #f8fafc;
}

.pti-btn-cyan {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
}
.pti-btn-cyan:hover { box-shadow: 0 6px 16px rgba(14, 165, 233, 0.45); }

.pti-btn-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}
.pti-btn-green:hover { box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45); }

.pti-btn-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}
.pti-btn-orange:hover { box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45); }

/* Responsive adjustments for toolbar */
@media (max-width: 768px) {
    .pti-toolbar {
        padding: 16px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .pti-btn {
        padding: 10px 14px;
        font-size: 13px;
        width: 100%;
        box-sizing: border-box;
    }

    .pti-close {
        top: 15px;
        right: 18px;
        font-size: 36px;
    }
}