/* ===========================================================================
   PlanaMayor Home Sections - Custom Styles
   Estilos para secciones personalizables del home
   =========================================================================== */

/* ===========================================================================
   Section Base Styles
   =========================================================================== */

.pm-section {
    padding: 3rem 0;
    margin: 0;
    width: 100%;
}

.pm-section-inner {
    width: 100%;
}

.pm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===========================================================================
   Section Header
   =========================================================================== */

.pm-section-header {
    margin-bottom: 2rem;
}

.pm-section-title-wrap {
    display: inline-block;
    padding: 0;
    margin-bottom: 0.25rem;
    background: none !important;
    background-color: transparent !important;
}

.pm-section-title {
    font-family: 'Hind Vadodara', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #000000;
    border-bottom: 4px solid var(--color-primary, #f70d28);
    padding-bottom: 8px;
    display: inline-block;
}

.pm-section-divider {
    height: 2.5px;
    background-color: #EBEBEB;
    margin-top: -4px;
}

/* Dark sections divider */
.pm-section-dark .pm-section-divider {
    background-color: #535353;
}

/* ===========================================================================
   Posts Wrapper Base
   =========================================================================== */

.pm-posts-wrapper {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ===========================================================================
   Layout: Grid 2 Columns
   =========================================================================== */

.pm-posts-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
    .pm-posts-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ===========================================================================
   Layout: Grid 3 Columns
   =========================================================================== */

.pm-posts-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
    .pm-posts-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .pm-posts-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ===========================================================================
   Layout: Grid 4 Columns
   =========================================================================== */

.pm-posts-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .pm-posts-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .pm-posts-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ===========================================================================
   Layout: Cards with Badges
   =========================================================================== */

.pm-posts-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {
    .pm-posts-cards {
        grid-template-columns: 1fr;
    }
}

.pm-posts-cards .pm-post-item {
    background-color: transparent;
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pm-posts-cards .pm-post-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ===========================================================================
   Layout: List
   =========================================================================== */

.pm-posts-list {
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.pm-posts-list .pm-post-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #EBEBEB;
}

.pm-section-dark .pm-posts-list .pm-post-item {
    border-bottom-color: #535353;
}

@media (max-width: 640px) {
    .pm-posts-list .pm-post-item {
        grid-template-columns: 1fr;
    }
}

/* ===========================================================================
   Layout: Mixed (1 grande + lista)
   =========================================================================== */

.pm-posts-mixed {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.pm-posts-mixed .pm-post-1 {
    grid-column: 1;
    grid-row: 1 / span 3;
}

@media (max-width: 768px) {
    .pm-posts-mixed {
        grid-template-columns: 1fr;
    }
    
    .pm-posts-mixed .pm-post-1 {
        grid-column: 1;
        grid-row: auto;
    }
}

/* ===========================================================================
   Post Item Base Styles
   =========================================================================== */

.pm-post-item {
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ===========================================================================
   Post Thumbnail
   =========================================================================== */

.pm-post-thumbnail {
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
    aspect-ratio: 16 / 10;
}

.pm-post-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.pm-post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pm-post-item:hover .pm-post-image {
    transform: scale(1.05);
}

/* Post Badge (for cards layout) */
.pm-post-badge {
    position: absolute;
    top: 1.25rem;
    right: 0;
    padding: 0.375rem 1rem;
    /* Color se aplica via inline style */
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0;
}

/* ===========================================================================
   Post Content
   =========================================================================== */

.pm-post-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Post Title */
.pm-post-title {
    font-family: 'Hind Vadodara', sans-serif;
    font-size: 1.067rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.pm-post-title a {
    color: #2D2D2A;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pm-section-dark .pm-post-title a {
    color: #ffffff;
}

.pm-post-title a:hover {
    color: var(--color-primary, #f70d28);
}

/* Larger title for first post in mixed layout */
.pm-posts-mixed .pm-post-1 .pm-post-title {
    font-size: 1.5rem;
}

/* Post Meta */
.pm-post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #959595;
}

.pm-section-dark .pm-post-meta {
    color: #C2C2C2;
}

.pm-post-date {
    font-weight: 400;
}

/* Post Excerpt */
.pm-post-excerpt {
    font-size: 0.938rem;
    line-height: 1.6;
    color: #62625F;
}

.pm-section-dark .pm-post-excerpt {
    color: #C2C2C2;
}

/* Post Read More */
.pm-post-readmore {
    display: inline-block;
    margin-top: auto;
    color: var(--color-primary, #f70d28);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.pm-post-readmore:hover {
    color: var(--color-secondary, #d00a22);
}

/* ===========================================================================
   List Layout Specific Styles
   =========================================================================== */

.pm-posts-list .pm-post-thumbnail {
    margin-bottom: 0;
    aspect-ratio: 4 / 3;
}

.pm-posts-list .pm-post-excerpt {
    display: none;
}

.pm-posts-list .pm-post-title {
    font-size: 1rem;
}

/* ===========================================================================
   Section Footer (Ver más button)
   =========================================================================== */

.pm-section-footer {
    text-align: center;
    margin-top: 2rem;
}

.pm-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-family: 'Hind Vadodara', sans-serif;
    font-size: 0.938rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid;
    border-radius: 0;
    transition: all 0.3s ease;
    background-color: transparent;
}

.pm-btn-more:hover {
    background-color: var(--color-primary, #f70d28);
    border-color: var(--color-primary, #f70d28) !important;
    color: #ffffff !important;
}

/* ===========================================================================
   Responsive Adjustments
   =========================================================================== */

@media (max-width: 1024px) {
    .pm-section {
        padding: 2.5rem 0;
    }
    
    .pm-section-title {
        font-size: 1.333rem;
    }
}

@media (max-width: 768px) {
    .pm-section {
        padding: 2rem 0;
    }
    
    .pm-section-header {
        margin-bottom: 1.5rem;
    }
    
    .pm-section-title {
        font-size: 1.2rem;
    }
    
    .pm-posts-wrapper {
        gap: 1.25rem;
    }
}

@media (max-width: 480px) {
    .pm-container {
        padding: 0 0.75rem;
    }
    
    .pm-section {
        padding: 1.5rem 0;
    }
    
    .pm-section-title-wrap {
        padding: 0.375rem 1rem;
    }
    
    .pm-section-title {
        font-size: 1.067rem;
    }
    
    .pm-post-title {
        font-size: 0.938rem;
    }
    
    .pm-post-badge {
        top: 0.75rem;
        padding: 0.25rem 0.75rem;
        font-size: 0.688rem;
    }
}

/* ===========================================================================
   Dark Mode Enhancements
   =========================================================================== */

.pm-section-dark a:not(.pm-btn) {
    color: #ffffff;
}

.pm-section-dark a:not(.pm-btn):hover {
    color: var(--color-primary, #f70d28);
}

/* ===========================================================================
   Animations & Transitions
   =========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pm-post-item {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.pm-post-item:nth-child(1) { animation-delay: 0.05s; }
.pm-post-item:nth-child(2) { animation-delay: 0.1s; }
.pm-post-item:nth-child(3) { animation-delay: 0.15s; }
.pm-post-item:nth-child(4) { animation-delay: 0.2s; }
.pm-post-item:nth-child(5) { animation-delay: 0.25s; }
.pm-post-item:nth-child(6) { animation-delay: 0.3s; }

/* Reduce animations on mobile for performance */
@media (prefers-reduced-motion: reduce) {
    .pm-post-item {
        animation: none;
    }
}
