/**
 * Estilos CSS para o Custom Post Timeline.
 * Versão: 1.1.4 - Adicionado Espaçamento Lateral na Timeline
 */

/* --- ESTILOS BASE (TEMA PADRÃO) --- */
.cptl-timeline-container {
    position: relative;
    margin: 30px auto;
    padding: 20px 30px; /* Adicionado padding lateral (30px) */
    max-width: 1000px; 
    box-sizing: border-box;
    font-family: inherit;
    color: inherit;
}

.cptl-timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background-color: #ddd;
    transform: translateX(-50%);
    z-index: 1;
}

.cptl-timeline-item {
    display: flex;
    align-items: stretch;
    position: relative;
    width: 100%; /* Ocupa a largura do conteúdo dentro do padding do container */
    margin-bottom: 60px; 
    z-index: 2;
    opacity: 0;
    transform: translateY(50px); 
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.cptl-timeline-item.cptl-is-visible {
    opacity: 1;
    transform: translateY(0);
}

.cptl-timeline-item::after {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    background-color: #fff;
    border: 3px solid #bbb;
    border-radius: 50%;
    z-index: 3;
    box-sizing: border-box;
}

.cptl-timeline-image,
.cptl-timeline-content {
    width: calc(50% - 45px); /* Vão central de 90px */
    box-sizing: border-box;
    padding: 15px;
    background-color: transparent;
    border: 1px solid #eee;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}

.cptl-item-left {
    justify-content: space-between;
}

.cptl-item-right {
    flex-direction: row-reverse;
    justify-content: space-between;
}

.cptl-timeline-image img {
    width: 100%;
    height: auto;
    max-height: 300px; 
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.cptl-timeline-image-placeholder {
    width: 100%;
    min-height: 200px; 
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #aaa;
    font-size: 0.9em;
    text-align: center;
    padding: 15px;
}
.cptl-timeline-image-placeholder a {
    text-decoration: none;
    color: inherit;
}

.cptl-timeline-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.5em;
    line-height: 1.3;
    font-weight: bold;
}

.cptl-timeline-title a {
    text-decoration: none;
    color: inherit;
}

.cptl-timeline-excerpt {
    font-size: 1em;
    line-height: 1.6;
    color: inherit;
    margin-bottom: 0;
    flex-grow: 1;
}

.cptl-no-posts-found {
    text-align: center;
    padding: 30px 20px;
    color: #777;
    background-color: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 6px;
}

/* --- FIM DOS ESTILOS BASE --- */


/* --- TEMA JORNAL ANOS 50 (.cptl-theme-anos50) --- */
.cptl-theme-anos50 {
    font-family: "Georgia", "Times New Roman", Times, serif;
    background-color: #e9e0d8; 
    padding-top: 20px; 
    padding-bottom: 1px; 
    /* O padding lateral do .cptl-timeline-container já cria o espaçamento */
}

.cptl-theme-anos50 .cptl-timeline-container::before {
    background-color: #8c7d6b; 
    width: 2px;
}

.cptl-theme-anos50 .cptl-timeline-item::after {
    border-color: #5a4a3a; 
    background-color: #d7c8b8; 
    width: 16px;
    height: 16px;
    border-width: 2px;
    box-shadow: 0 0 3px rgba(0,0,0,0.2); 
}

.cptl-theme-anos50 .cptl-timeline-image,
.cptl-theme-anos50 .cptl-timeline-content {
    background-color: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 25px; 
    position: relative;
}

.cptl-theme-anos50 .cptl-timeline-content {
    border-left: 1px dashed #a08f7c; 
    padding-left: 30px; 
}
.cptl-theme-anos50 .cptl-item-right .cptl-timeline-content {
    border-left: none;
    border-right: 1px dashed #a08f7c;
    padding-left: 25px; 
    padding-right: 30px; 
}

.cptl-theme-anos50 .cptl-timeline-image {
    padding: 0; 
}

.cptl-theme-anos50 .cptl-image-wrapper {
    position: relative;
    display: block;
    line-height: 0;
    border: 2px solid #4a3c2d; 
    padding: 4px; 
    background-color: #cdc0b0; 
    box-shadow: inset 0 0 1px 1px rgba(255,255,255,0.15); 
}

.cptl-theme-anos50 .cptl-image-wrapper img,
.cptl-theme-anos50 .cptl-timeline-excerpt img { 
    filter: grayscale(100%);
    opacity: 0.8; 
    border-radius: 0;
    display: block;
    width: 100%; 
    height: auto;
    position: relative; 
    z-index: 1; 
}

.cptl-theme-anos50 .cptl-image-wrapper::before, 
.cptl-theme-anos50 .cptl-image-wrapper::after,  
.cptl-theme-anos50 .cptl-timeline-excerpt .wp-block-image::before, 
.cptl-theme-anos50 .cptl-timeline-excerpt .wp-block-image::after {
    content: '';
    position: absolute;
    top: 4px; 
    left: 4px;
    right: 4px;
    bottom: 4px;
    pointer-events: none;
    border-radius: 0; 
}

.cptl-theme-anos50 .cptl-image-wrapper::before,
.cptl-theme-anos50 .cptl-timeline-excerpt .wp-block-image::before { 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='transparent'/%3E%3Ccircle cx='1' cy='1' r='0.4' fill='rgba(0,0,0,0.15)'/%3E%3Ccircle cx='3' cy='3' r='0.4' fill='rgba(0,0,0,0.15)'/%3E%3C/svg%3E"); 
    background-size: 2.5px 2.5px; 
    opacity: 0.6; 
    z-index: 2; 
}

.cptl-theme-anos50 .cptl-image-wrapper::after,
.cptl-theme-anos50 .cptl-timeline-excerpt .wp-block-image::after { 
    background-color: rgba(80, 60, 40, 0.12); 
    z-index: 3; 
}

.cptl-theme-anos50 .cptl-timeline-excerpt p > img {
    filter: grayscale(100%);
    opacity: 0.8;
    border: 2px solid #4a3c2d; 
    padding: 3px;
    background-color: #cdc0b0;
    margin-bottom: 10px; 
}

.cptl-theme-anos50 .cptl-timeline-image-placeholder {
    background-color: rgba(205, 192, 176, 0.8); 
    color: #5a4a3a;
    border-radius: 0;
    font-style: italic;
    border: 2px dashed #968472; 
    opacity: 0.85; 
    position: relative;
    padding: 25px; 
}
.cptl-theme-anos50 .cptl-timeline-image-placeholder::before { 
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='transparent'/%3E%3Ccircle cx='1' cy='1' r='0.4' fill='rgba(0,0,0,0.1)'/%3E%3Ccircle cx='3' cy='3' r='0.4' fill='rgba(0,0,0,0.1)'/%3E%3C/svg%3E");
    background-size: 2.5px 2.5px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.cptl-theme-anos50 .cptl-timeline-title {
    font-size: 1.6em; 
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px; 
    border-bottom: 2px solid #b0a088; 
    padding-bottom: 8px; 
    color: #3b2e20; 
}
.cptl-theme-anos50 .cptl-timeline-title a {
    color: inherit; 
}
.cptl-theme-anos50 .cptl-timeline-title a:hover {
    color: #5a4a3a;
    text-decoration: none;
}

.cptl-theme-anos50 .cptl-timeline-excerpt {
    font-size: 0.95em; 
    line-height: 1.55;
    color: #4a3c2d; 
    text-align: left;
    padding-top: 10px; 
}
/* --- FIM TEMA JORNAL ANOS 50 --- */


/* --- TEMA VINTAGE MODERNO (.cptl-theme-vintage) --- */
.cptl-theme-vintage { 
    /* O padding lateral do .cptl-timeline-container já cria o espaçamento */
}
.cptl-theme-vintage .cptl-timeline-container::before { background-color: #e0c3b3; }
.cptl-theme-vintage .cptl-timeline-item::after { border-color: #a87a62; background-color: #fffaf0; width: 20px; height: 20px; }
.cptl-theme-vintage .cptl-timeline-image,
.cptl-theme-vintage .cptl-timeline-content { background-color: #fdf5e6; border: 1px solid #f0e0d0; border-radius: 10px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); padding: 18px; }
.cptl-theme-vintage .cptl-timeline-image img { border-radius: 8px; }
.cptl-theme-vintage .cptl-timeline-image-placeholder { background-color: #faebd7; color: #b89a7c; border-radius: 8px; }
.cptl-theme-vintage .cptl-timeline-title { font-family: "Georgia", "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 1.7em; font-weight: normal; color: #7b5b4c; margin-bottom: 12px; }
.cptl-theme-vintage .cptl-timeline-title a { color: inherit; }
.cptl-theme-vintage .cptl-timeline-title a:hover { color: #5c3a2c; }
.cptl-theme-vintage .cptl-timeline-excerpt { font-family: "Verdana", "Geneva", "DejaVu Sans", sans-serif; font-size: 0.9em; line-height: 1.7; color: #5f5f5f; }
/* --- FIM TEMA VINTAGE MODERNO --- */


/* --- RESPONSIVIDADE --- */
@media screen and (max-width: 768px) {
    .cptl-timeline-container { 
        padding: 20px 20px; /* Reduzir padding lateral em tablets */
        /* max-width: 95%; Removido, pois o padding já controla o espaçamento */
    }
    .cptl-timeline-container::before { 
        left: 35px; /* Ajustar posição da linha: padding-left (20px) + metade da largura da linha (1.5px) + pequeno offset (13.5px) */
                    /* Ou mais simples: um valor fixo menor que o padding do container */
    }
    .cptl-timeline-item { flex-direction: column !important; align-items: flex-start; /* Alinhar itens à esquerda da linha */ margin-bottom: 30px; }
    
    .cptl-timeline-item::after { 
        left: 35px; /* Alinhar com a linha */
        top: -15px; 
        transform: translateX(-50%); 
        width: 18px; height: 18px; 
    }
    .cptl-theme-anos50 .cptl-timeline-item::after { width: 14px; height: 14px; }
    .cptl-theme-vintage .cptl-timeline-item::after { width: 16px; height: 16px; }
    
    .cptl-timeline-image,
    .cptl-timeline-content { 
        width: calc(100% - (35px + 15px)); /* Largura total menos o espaço da linha e um pequeno respiro */
        margin-left: calc(35px + 15px); /* Empurra o conteúdo para a direita da linha */
        margin-bottom: 20px; 
    }
    .cptl-theme-anos50 .cptl-timeline-content { border-left: none; border-right: none; padding-left: 15px; padding-right: 15px; }
    .cptl-timeline-item .cptl-timeline-image:last-child,
    .cptl-timeline-item .cptl-timeline-content:last-child { margin-bottom: 0; }
    .cptl-item-right .cptl-timeline-image { order: -1; }
    .cptl-timeline-title { font-size: 1.4em; }
    .cptl-theme-anos50 .cptl-timeline-title { font-size: 1.4em; }
    .cptl-theme-vintage .cptl-timeline-title { font-size: 1.5em; }
}

@media screen and (max-width: 576px) {
    .cptl-timeline-container {
        padding: 20px 15px; /* Reduzir mais o padding lateral em celulares */
    }
    .cptl-timeline-container::before { 
        left: 25px; /* Ajustar posição da linha */
    }
    .cptl-timeline-item::after { 
        left: 25px; /* Alinhar com a linha */
        width: 16px; height: 16px; 
    }
    .cptl-theme-anos50 .cptl-timeline-item::after { width: 12px; height: 12px; }
    .cptl-theme-vintage .cptl-timeline-item::after { width: 14px; height: 14px; }
    
    .cptl-timeline-image,
    .cptl-timeline-content { 
        width: calc(100% - (25px + 10px)); 
        margin-left: calc(25px + 10px); 
    }
    .cptl-timeline-image img { max-height: 220px; }
}
