/* CPG Attachment V5 - Professional Layout */

:root {
    --primary: #111;
    --secondary: #666;
    --border: #eee;
    --bg-light: #f9f9f9;
    --radius: 8px;
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.cpg-attachment-v2 {
    background: white;
    padding: 40px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--primary);
}

.cpg-main-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 50px;
    color: var(--primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.cpg-main-title.centered {
    text-align: center;
}

/* Split Layout 50/50 */
.cpg-split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px; /* Aumentado de 40px para 60px para mais whitespace */
    margin-bottom: 100px; /* Aumentado de 60px para 100px */
    align-items: start;
}

.cpg-image-column {
    position: relative;
}

.cpg-main-image-box {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.cpg-main-img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.cpg-info-column {
    display: flex;
    flex-direction: column;
    gap: 30px; /* Aumentado de 20px para 30px para mais respiro entre boxes */
}

/* Action Box */
.cpg-action-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.cpg-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.cpg-meta-item {
    display: flex;
    flex-direction: column;
}

.cpg-meta-item .label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    font-weight: 600;
}

.cpg-meta-item .value {
    font-weight: 600;
    color: var(--primary);
    font-size: 16px;
}

.cpg-color-dots {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    transition: transform 0.2s;
    cursor: pointer;
}

.color-dot:hover {
    transform: scale(1.1);
}

/* Buttons */
.cpg-buttons-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cpg-btn-v5 {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-size: 16px;
    font-family: inherit;
}

.cpg-btn-v5.primary {
    background: linear-gradient(135deg, #111 0%, #444 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.cpg-btn-v5.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #222 0%, #555 100%);
}

.cpg-btn-v5.primary:active {
    transform: translateY(-1px);
}

/* Animação de Pulso Sutil */
@keyframes cpg-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2); }
    70% { box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

.cpg-btn-v5.primary {
    animation: cpg-pulse 2s infinite;
}

.cpg-btn-v5.secondary {
    background: linear-gradient(135deg, #f9f9f9 0%, #e9e9e9 100%);
    color: var(--primary);
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.cpg-btn-v5.secondary:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.cpg-btn-v5.secondary {
    background: var(--bg-light);
    color: var(--primary);
    border: 1px solid var(--border);
}

.cpg-btn-v5.secondary:hover {
    background: #f0f0f0;
}

.cpg-btn-v5.outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--secondary);
}

.cpg-btn-v5.outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cpg-btn-v5 .icon {
    margin-right: 10px;
    font-size: 18px;
}

/* Info Boxes */
.cpg-tax-box,
.cpg-tags-box,
.cpg-related-posts {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.cpg-tax-box h4,
.cpg-tags-box h4,
.cpg-related-posts h4 {
    font-size: 16px;
    margin: 0 0 15px;
    color: var(--primary);
    font-weight: 600;
}

.cpg-parent-link a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.cpg-parent-link a:hover {
    text-decoration: underline;
}

.cpg-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cpg-tag {
    display: inline-block;
    background: var(--bg-light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.cpg-tag:hover {
    background: #e0e0e0;
    color: var(--primary);
}

.cpg-posts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cpg-post-link {
    display: block;
    padding: 8px 0;
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    transition: color 0.2s;
}

.cpg-post-link:last-child {
    border-bottom: none;
}

.cpg-post-link:hover {
    color: #005a87;
}

/* Infinite Gallery - Grid Horizontal */
.cpg-infinite-section {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 2px solid var(--border);
}

.cpg-infinite-section h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--primary);
}

.cpg-masonry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.cpg-grid-item {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    background: var(--bg-light);
    position: relative;
}

.cpg-grid-item:hover {
    transform: translateY(-5px);
}

.cpg-grid-link {
    display: block;
    text-decoration: none;
    position: relative;
}

.cpg-grid-item img {
    width: 100%;
    height: auto;
    display: block;
    background: var(--bg-light);
}

.cpg-grid-item:hover img {
    opacity: 0.9;
}

@keyframes cpg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos para Descrição Expansível */
.cpg-description-box {
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#cpg-desc-content.cpg-desc-collapsed {
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

#cpg-desc-content.cpg-desc-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent, white);
}

#cpg-desc-content.cpg-desc-expanded {
    max-height: none;
}

#cpg-expand-desc {
    margin-top: 10px;
}

/* Garantir que imagens não apareçam na descrição */
.cpg-description-box img,
.cpg-description-box figure {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cpg-split-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cpg-image-column {
        order: 1;
    }
    
    .cpg-info-column {
        order: 2;
    }
    
    .cpg-sticky-image {
        position: static;
    }
    
    .cpg-masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .cpg-main-title {
        font-size: 24px;
    }
    
    .cpg-meta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .cpg-split-layout {
        gap: 15px;
    }
    
    .cpg-masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .cpg-main-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .cpg-action-box {
        padding: 15px;
    }
    
    .cpg-buttons-stack {
        gap: 10px;
    }
    
    .cpg-btn-v5 {
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .cpg-main-img,
    .cpg-main-img * {
        visibility: visible;
        max-width: 100%;
    }
    
    .cpg-attachment-v2 {
        padding: 0;
    }
}

/* Coloring Tool Styles */
.cpg-coloring-box {
    margin-top: 30px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.cpg-coloring-header {
    padding: 15px 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cpg-coloring-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.cpg-expand-btn {
    background: #ff4757;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.cpg-expand-btn:hover {
    background: #ff6b81;
}

.cpg-expand-btn svg {
    display: block;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.cpg-expand-btn:hover {
    background: #ff6b81;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.cpg-expand-btn::before {
    content: "⛶";
    font-size: 18px;
}

.cpg-expand-btn:hover {
    background: #333;
    transform: scale(1.05);
}

.cpg-coloring-box.is-expanded .cpg-expand-btn::before {
    content: "✕";
}

.cpg-coloring-container {
    width: 100%;
    min-height: 500px;
    position: relative;
}

/* Fullscreen mode for coloring tool */
.cpg-coloring-box.is-expanded {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    margin: 0;
    border-radius: 0;
}

.cpg-coloring-box.is-expanded .cpg-coloring-container {
    height: calc(100vh - 60px);
}

.cpg-btn-v5.coloring-btn {
    background: #e67e22;
    color: #fff;
}

.cpg-btn-v5.coloring-btn:hover {
    background: #d35400;
}

/* Sidebar Box Styles */
.cpg-sidebar-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.cpg-author-info {
    margin-bottom: 15px;
    font-size: 15px;
}

.cpg-author-info a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.cpg-share-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.share-btn {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.share-btn.pin { background: #bd081c; }
.share-btn.face { background: #3b5998; }
.share-btn.whatsapp { background: #25d366; }

.cpg-btn-v5.coloring-btn {
    background: #ff4757;
    color: #fff;
    border: none;
}

.cpg-btn-v5.coloring-btn:hover {
    background: #ff6b81;
}

.cpg-meta-info p {
    margin: 5px 0;
    font-size: 13px;
    color: var(--secondary);
}

.cpg-flex-box {
    display: flex;
    gap: 20px;
}

.cpg-half {
    flex: 1;
}

.cpg-half h4 {
    margin-top: 0;
    font-size: 14px;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

/* Expandable Description Styles */
.cpg-description-box {
    margin-top: 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.cpg-desc-collapsed {
    max-height: 100px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
}

.cpg-desc-collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(transparent, white);
}

.cpg-desc-expanded {
    max-height: none;
}

.cpg-desc-expanded::after {
    display: none;
}

.cpg-btn-v5.small {
    padding: 8px 15px;
    font-size: 13px;
    margin-top: 10px;
}

/* Categories Grid and External Shortcode Styles */
.cpg-categories-grid-box {
    margin-top: 60px;
    padding: 40px;
    background: var(--bg-light);
    border-radius: var(--radius);
    text-align: center;
}

.cpg-categories-grid-box h3 {
    margin-bottom: 30px;
    font-size: 24px;
}

.cpg-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.cpg-cat-grid-item {
    background: #fff;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.cpg-cat-grid-item:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

.cpg-external-shortcode {
    margin-top: 60px;
    padding: 20px;
    border-top: 1px solid var(--border);
}