/* Container */
.pfg-wrapper, .pfg-latest-wrapper {
    /* max-width removed to take full width */
    width: 100%;
    font-family: inherit; /* Inherit theme font */
}

/* Filters Section */
.pfg-filters {
    margin-bottom: 40px;
}

.pfg-section-title {
    font-size: 25px !important; /* Increased from 14px */
    text-transform: none; /* Removed uppercase */
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 700 !important; /* Increased from 600 */
    color: #fff !important;
}

/* Categories (Large Chips) */
.pfg-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%; /* Full width */
}

.pfg-chip-large {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start; /* Left align */
    padding: 20px; /* Uniform padding */
    gap: 20px; /* Increased gap between indicator and text */
    background: transparent;
    border: 1px solid #FFFFFF; /* Custom border */
    border-radius: 8px; /* Slightly rounded */
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: inherit;
    transition: all 0.2s ease;
    min-height: 44px; /* Mobile tap target */
    appearance: none;
    -webkit-appearance: none;
    flex: 1 1 0px; /* Distribute space equally, min-width 0 */
    text-align: left; /* Left align text */
    width: auto; /* Let flex handle width */
}

.pfg-chip-large:hover {
    border-color: #FFFFFF;
    background: rgba(255,255,255,0.1);
}

.pfg-chip-large.active {
    border-color: #E42313;
    background: #E42313;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pfg-chip-indicator {
    width: 36px;
    height: 36px;
    background-color: #E42313; /* Default color (not active) */
    margin-right: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.pfg-chip-large.active .pfg-chip-indicator {
    background-color: #FFFFFF; /* Active color match theme or dynamic */
}

.pfg-chip-text {
    font-size: 20px;
    font-weight: 600;
}

/* Divider */
.pfg-divider {
    height: 1px;
    background-color: rgba(255,255,255,0.5); /* Updated color */
    margin: 30px 0; /* Top and Bottom 30px */
    border: none;
}

/* Tags (Small Pills - Filter List) */
.pfg-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pfg-pill-small {
    /* Styles from user snippet */
    background-color: rgba(255,255,255,0.29); /* Opacity 0.29 */
    padding: 5px 10px;
    color: rgba(255,255,255,0.57); /* Text opacity 0.57 */
    transition: all 0.3s ease-in-out;
    
    /* Reset button styles */
    border: none;
    border-radius: 4px; 
    font-size: 16px; /* Increased from 13px */
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.pfg-pill-small:hover,
.pfg-pill-small.active {
    /* Hover/Active styles from user snippet */
    background-color: #FFF;
    color: #00121D;
    transition: all 0.3s ease-in-out;
}

/* Card Tags */
.pfg-card-tag {
    font-size: 13px;
    /* text-transform: uppercase; Removed */
    font-weight: 400;
    padding: 4px 8px;
    border-radius: 4px;
    
    /* New requested styles */
    color: #1A2A35;
    background-color: rgba(84, 113, 140, 0.12); /* #54718C @ 12% */
    border: 1px solid rgba(84, 113, 140, 0.13); /* #54718C @ 13% */
}

/* No specific hover requested for card tags now, removing previous hover logic */
.pfg-card-tag:hover {
    background-color: rgba(84, 113, 140, 0.2); /* Slight darken on hover just for UX feedback */
}

/* Reset Button */
.pfg-controls {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end; /* Align right */
    align-items: center;
    min-height: 20px;
}

.pfg-reset {
    /* Style matching small pills filters */
    background-color: rgba(255,255,255,0.29); /* Opacity 0.29 */
    padding: 5px 10px;
    color: rgba(255,255,255,0.57); /* Text opacity 0.57 */
    transition: all 0.3s ease-in-out;
    border: none;
    border-radius: 4px; 
    font-size: 16px; 
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    text-decoration: none; /* Removed underline */
}

.pfg-reset:hover {
    background-color: #FFF;
    color: #00121D;
    transition: all 0.3s ease-in-out;
}

.pfg-count {
    display: none; /* Hide count if only aligning button right, or move it elsewhere if needed */
}

/* Grid Layout - Masonry */
.pfg-grid {
    display: block; /* Masonry uses absolute positioning */
    width: 100%;
}

/* Latest Grid - Flexbox */
.pfg-grid-latest {
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping */
    gap: 30px;
    width: 100%;
}

.pfg-grid-latest .pfg-card {
    width: auto;
    margin-bottom: 0;
    flex: 1 1 0; /* Grow, shrink, equal width */
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent overflow with flex items */
}

/* Responsive for Latest Grid */
.pfg-grid-latest .pfg-card-image-wrap {
    height: 250px !important;
    aspect-ratio: auto !important;
}

@media (max-width: 768px) {
    .pfg-grid-latest {
        flex-wrap: wrap; /* Allow wrapping on smaller screens for usability */
    }
    
    .pfg-grid-latest .pfg-card {
        flex: 1 1 100%; /* Full width on mobile */
    }
}

.pfg-grid-sizer {
    width: 23%; /* 4 columns minus gap approx */
}

/* Card Style */
.pfg-card {
    width: 23%;
    margin-bottom: 30px;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    /* transition: transform 0.3s ease, box-shadow 0.3s ease; REMOVED transition on transform */
    transition: box-shadow 0.4s ease-in-out, top 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
    position: relative; /* Ensure position relative is set for top transition */
    top: 0; /* Default top value */
}

/* Add transition ONLY for hover transform, but be careful with Masonry */
.pfg-card:hover {
    /* transform: translateY(-5px); REMOVED to avoid conflict with Masonry absolute positioning */
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    /* margin-top: -5px; Alternative way to move up without transform? No, margin affects layout. */
    position: relative; 
    top: -5px; /* Use top with relative? Masonry uses absolute top/left. Mixing relative top might work if positioning is handled well */
    /* If top causes issues, remove movement entirely */
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .pfg-grid-sizer, .pfg-card {
        width: 31%; /* 3 cols */
    }
}

@media (max-width: 768px) {
    .pfg-grid-sizer, .pfg-card {
        width: 48%; /* 2 cols */
    }
}

@media (max-width: 480px) {
    .pfg-grid-sizer, .pfg-card {
        width: 100%; /* 1 col */
    }
}

/* Mobile Filters - Keep this block */
@media (max-width: 480px) {
    .pfg-categories-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px; /* Scrollbar space */
        -webkit-overflow-scrolling: touch;
        gap: 10px;
    }
    
    .pfg-chip-large {
        white-space: nowrap;
    }
}

.pfg-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.pfg-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pfg-card-category {
    display: flex;
    align-items: center;
    padding: 20px 20px 10px 20px; /* Adjust padding as needed */
    gap: 10px;
}

.pfg-cat-indicator {
    width: 15px;
    height: 15px;
    background-color: #E42313;
    flex-shrink: 0;
    border-radius: 2px; /* Optional rounded corners */
}

.pfg-cat-name {
    font-size: 10px; /* Reduced from 14px */
    font-weight: 600;
    text-transform: uppercase;
    color: #00121D;
}

.pfg-card-image-wrap {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 4/3; /* Consistent height */
    overflow: hidden;
    background: #FFFFFF;
    padding: 20px;
}

.pfg-card-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.5s ease;
}

.pfg-card:hover .pfg-card-image {
    transform: scale(1.05);
}

.pfg-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.pfg-card-title {
    font-size: 16px !important;
    font-weight: 700;
    margin-bottom: 0 !important; /* Removed bottom margin */
    text-transform: uppercase;
    line-height: 1.3 !important;
    color: #00121D; /* Custom color */
}

.pfg-card-divider {
    border: none;
    height: 1px;
    background-color: rgba(84, 113, 140, 0.35); /* #54718C @ 35% */
    margin: 20px 0;
}

.pfg-card-tags {
    margin-top: auto; /* Push to bottom */
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pfg-card-tag {
    font-size: 13px;
    /* text-transform: uppercase; Removed */
    font-weight: 400;
    padding: 4px 8px;
    border-radius: 4px;
    
    /* New requested styles */
    color: #1A2A35;
    background-color: rgba(84, 113, 140, 0.12); /* #54718C @ 12% */
    border: 1px solid rgba(84, 113, 140, 0.13); /* #54718C @ 13% */
}

/* No specific hover requested for card tags now, removing previous hover logic */
.pfg-card-tag:hover {
    background-color: rgba(84, 113, 140, 0.2); /* Slight darken on hover just for UX feedback */
}

/* Carousel Styles */
.pfg-carousel-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.pfg-swiper {
    width: 100%;
    height: 100%;
}

.pfg-slide {
    width: 100%;
    height: 100%; /* Force full height */
}

.pfg-slide-inner {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    background: #fff; /* or transparent based on theme */
    min-height: 600px; /* Increased fixed height for uniformity */
    height: 100%; /* Fill slide height */
    padding: 40px; /* Added padding */
}

/* Hide Pagination */
.pfg-swiper .swiper-pagination {
    display: none !important;
}

.pfg-slide-image-col {
    width: 50%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 500px; /* Fixed height to prevent box expansion */
}

.pfg-slide-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

.pfg-slide-content-col {
    width: 50%;
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.pfg-slide-content-wrapper {
    /* max-width: 500px; REMOVED */
    width: 100%;
}

.pfg-slide-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.pfg-slide-cat {
    display: inline-block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1A2A35; /* Darker text for readability on light bg */
    font-weight: 600;
    
    /* Box Styles */
    background-color: rgba(84, 113, 140, 0.12); /* #54718C @ 12% */
    padding: 5px 10px;
    border-radius: 4px;
}

.pfg-slide-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #000;
    line-height: 1.2;
}

.pfg-slide-abstract {
    /* font-size: 16px; REMOVED */
    line-height: 1.6;
    color: #555;
    margin-bottom: 30px;
}

.pfg-slide-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #E42313;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.pfg-slide-btn:hover {
    background: #c11c0e;
    color: #fff;
}

/* Swiper Navigation Customization */
.pfg-swiper .swiper-button-next,
.pfg-swiper .swiper-button-prev {
    color: #E42313;
}

.pfg-swiper .swiper-pagination-bullet-active {
    background: #E42313;
}

/* Responsive */
@media (max-width: 768px) {
    .pfg-slide-inner {
        flex-direction: column;
    }
    
    .pfg-slide-image-col,
    .pfg-slide-content-col {
        width: 100%;
    }
    
    .pfg-slide-image-col {
        height: 300px; /* Fixed height for mobile image */
    }
    
    .pfg-slide-content-col {
        padding: 40px 20px;
    }
    
    .pfg-slide-title {
        font-size: 24px;
    }
}
