/**
 * Project Content Manager Frontend Styles - Material Design 3 Updated
 */

.pcm-home-page-container,
.pcm-container,
.pcm-lightbox-container {
    box-sizing: border-box;
}

.pcm-home-page-container *,
.pcm-container *,
.pcm-lightbox-container *,
.pcm-home-page-container *::before,
.pcm-home-page-container *::after,
.pcm-container *::before,
.pcm-container *::after {
    box-sizing: border-box;
}

:root {
    --pcm-primary-color: #4285f4;
    --pcm-text-color: #1f1f1f; /* MD3 On Surface */
    --pcm-accent-color: #d63638;
    --pcm-hover-color: #3367d6;
    --pcm-light-text-color: #444746; /* MD3 On Surface Variant */
    --pcm-card-bg: #ffffff;
    --pcm-surface-container: #f3f4f9;
    --pcm-outline-variant: #e1e3e1;
    --pcm-card-radius: 12px;
    --pcm-card-shadow: 0 1px 2px rgba(0,0,0,0.08);
    --pcm-card-shadow-hover: 0 4px 8px rgba(0,0,0,0.12);
}

.pcm-home-page-container,
.pcm-container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
    overflow-x: hidden;
    position: relative;
}

.pcm-container {
    margin-top: 24px;
    margin-bottom: 56px;
}

/* Grid Systems */
.pcm-grid-2, .pcm-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    width: 100%;
}

@media (min-width: 992px) {
    .pcm-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Section Titles (Homepage) */
.pcm-section-title {
    text-align: center;
    color: var(--pcm-primary-color);
    margin-bottom: 32px;
    font-size: 2rem;
    font-weight: 600;
}

.pcm-section-title a {
    color: inherit;
    text-decoration: none !important;
    transition: opacity 0.2s;
}

.pcm-section-title a:hover {
    opacity: 0.8;
}

/* Card Styles */
.pcm-card {
    background-color: var(--pcm-card-bg);
    border-radius: var(--pcm-card-radius);
    box-shadow: var(--pcm-card-shadow);
    border: 1px solid var(--pcm-outline-variant);
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%; 
}

.pcm-grid-2 .pcm-card, .pcm-grid-3 .pcm-card {
    margin-bottom: 0;
}

.pcm-container > .pcm-card {
    margin-bottom: 24px;
}

.pcm-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--pcm-card-shadow-hover);
}

/* Link Wrapper for Full Card Click */
.pcm-card-link-wrapper {
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--pcm-text-color);
    flex-grow: 1;
    height: 100%;
}

.pcm-card-link-wrapper:hover,
.pcm-card-link-wrapper:focus,
.pcm-card-link-wrapper:active,
.pcm-card-link-wrapper:visited {
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--pcm-text-color);
}

.pcm-card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

.pcm-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.pcm-card:hover .pcm-card-image img {
    transform: scale(1.03);
}

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

.pcm-card-title {
    font-size: 1.25rem;
    line-height: 1.4;
    margin: 0 0 12px 0;
    font-weight: 600;
    color: var(--pcm-text-color);
    word-wrap: break-word;
    text-decoration: none !important;
    transition: color 0.2s;
}

.pcm-card-link-wrapper:hover .pcm-card-title {
    color: var(--pcm-primary-color) !important;
}

.pcm-card-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--pcm-light-text-color);
    flex-grow: 1;
    margin-top: 8px;
}

.pcm-meta {
    margin-bottom: 12px;
    font-size: 0.875rem;
    color: var(--pcm-light-text-color);
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.pcm-meta span {
    display: inline-flex;
    align-items: center;
}

.pcm-meta span::before {
    font-family: 'dashicons';
    margin-right: 6px;
    vertical-align: middle;
    font-size: 1.1em;
    opacity: 0.7;
}

.pcm-meta-date::before { content: "\f145"; }
.pcm-meta-location::before { content: "\f230"; }
.pcm-meta-signup {
    font-weight: 600;
    color: var(--pcm-primary-color);
}
.pcm-meta-signup .dashicons {
    margin-right: 6px; 
    font-size: 18px; 
    width: 18px;
    height: 18px;
    color: var(--pcm-primary-color);
}

.pcm-card-actions {
    padding: 0 24px 24px 24px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.pcm-card-actions.has-files {
    justify-content: space-between;
}

.pcm-card-files-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.pcm-download-btn-small {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    color: var(--pcm-primary-color);
    background-color: var(--pcm-surface-container);
    padding: 6px 10px;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background-color 0.2s;
    line-height: 1.2;
    max-width: 100%;
}

.pcm-download-btn-small:hover {
    background-color: #e2e7f0;
    color: var(--pcm-hover-color);
}

.pcm-download-btn-small .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

.pcm-read-more {
    color: var(--pcm-primary-color);
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s;
}

.pcm-read-more:hover {
    color: var(--pcm-hover-color, #3367d6) !important;
    text-decoration: none !important;
}

/* Material Button Style */
.pcm-read-more.pcm-read-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    height: 40px;
    background-color: var(--pcm-primary-color);
    color: #fff;
    border-radius: 20px;
    text-decoration: none !important;
    transition: background-color 0.2s, box-shadow 0.2s;
    margin-top: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}
.pcm-read-more.pcm-read-more-btn:hover {
    background-color: var(--pcm-hover-color, #3367d6) !important;
    color: #fff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Signup Button */
.pcm-btn-signup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    height: 40px;
    background-color: var(--pcm-accent-color);
    color: #fff;
    border-radius: 20px;
    text-decoration: none !important;
    transition: background-color 0.2s, box-shadow 0.2s;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin-top: 10px;
}
.pcm-btn-signup:hover {
    background-color: #b92b2d;
    color: #fff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.pcm-buttons-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* LIST VIEW STYLES */
.pcm-list-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pcm-list-view .pcm-card {
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    height: auto;
    min-height: 200px;
}

.pcm-list-view .pcm-card-link-wrapper {
    flex-direction: row;
    align-items: stretch;
    gap: 0;
}

.pcm-list-view .pcm-card-image {
    width: 280px;
    height: auto;
    min-height: 200px;
    flex-shrink: 0;
    border-radius: 0;
}

.pcm-list-view .pcm-card-content {
    /* Increased padding to fix 'too close to left' issue */
    padding: 24px 32px 24px 24px; 
    justify-content: center;
}

.pcm-list-view .pcm-card-actions {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--pcm-outline-variant);
    background-color: #fafafa;
    min-width: 160px;
    gap: 12px;
}
.pcm-list-view .pcm-card-files-list {
    width: 100%;
    align-items: center;
}
.pcm-list-view .pcm-download-btn-small {
    justify-content: center;
    width: 100%;
}

/* Pagination - Material Design 3 Style */
.pcm-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 48px;
}

.pcm-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 20px;
    background-color: transparent;
    border: 1px solid var(--pcm-outline-variant);
    color: var(--pcm-text-color);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pcm-pagination .page-numbers.current {
    background-color: var(--pcm-primary-color);
    color: #ffffff;
    border-color: var(--pcm-primary-color);
}

.pcm-pagination .page-numbers:hover:not(.current) {
    background-color: var(--pcm-surface-container);
    border-color: #bababa;
    color: var(--pcm-primary-color);
}

.pcm-pagination .page-numbers.dots {
    border: none;
    cursor: default;
}
.pcm-pagination .page-numbers.dots:hover {
    background: transparent;
}

/* Status Badge */
.pcm-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pcm-status-planned { background-color: #4285f4; }
.pcm-status-inprogress { background-color: #fbbc05; color: #333; }
.pcm-status-finished { background-color: var(--pcm-accent-color); }
.pcm-status-archived { background-color: #6c757d; }

/* Single Page Elements */
.pcm-single-post-header {
    margin-bottom: 24px;
}

.pcm-top-content-banner img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 32px;
    border-radius: var(--pcm-card-radius);
    box-shadow: var(--pcm-card-shadow);
}

.pcm-single-meta {
    background-color: var(--pcm-surface-container);
    padding: 24px;
    border-radius: var(--pcm-card-radius);
    border-left: 4px solid var(--pcm-primary-color);
    margin-bottom: 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    font-size: 1rem;
    color: var(--pcm-text-color);
}
.pcm-single-meta span {
    display: inline-flex;
    align-items: center;
}
.pcm-single-meta span::before {
    font-family: 'dashicons';
    margin-right: 8px;
    font-size: 1.4em;
    color: var(--pcm-primary-color);
}
.pcm-single-meta-date::before { content: "\f145"; }
.pcm-single-meta-location::before { content: "\f230"; }
.pcm-single-meta-address::before { content: "\f102"; }

.pcm-single-post-attachments {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--pcm-outline-variant);
}

.pcm-single-post-attachments h3 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--pcm-text-color);
}

/* Gallery */
.pcm-single-gallery .pcm-gallery-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.pcm-single-gallery .pcm-gallery-item {
    display: block;
    border-radius: var(--pcm-card-radius);
    overflow: hidden;
    box-shadow: var(--pcm-card-shadow);
    transition: transform 0.2s;
    aspect-ratio: 1;
    cursor: pointer;
}
.pcm-single-gallery .pcm-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.pcm-single-gallery .pcm-gallery-item:hover img {
    transform: scale(1.05);
}

/* Files */
.pcm-attached-files-list li {
    background: var(--pcm-surface-container);
    padding: 16px 20px;
    border-radius: 8px;
    border-left: 4px solid var(--pcm-primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    transition: background 0.2s;
}
.pcm-attached-files-list li:hover { background: #eaecf0; }
.pcm-attached-files-list li::before {
    font-family: 'dashicons';
    content: '\f319';
    color: var(--pcm-primary-color);
    font-size: 1.5em;
}
.pcm-attached-files-list a {
    text-decoration: none;
    font-weight: 500;
    color: var(--pcm-text-color);
}

/* Embeds */
.pcm-embed-card {
    background: #fff;
    border: 1px solid var(--pcm-outline-variant);
    border-radius: var(--pcm-card-radius);
    overflow: hidden;
    box-shadow: var(--pcm-card-shadow);
    margin-bottom: 24px;
}
.pcm-embed-header {
    padding: 12px 16px;
    background: var(--pcm-surface-container);
    border-bottom: 1px solid var(--pcm-outline-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
}
.pcm-embed-body {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.pcm-embed-body iframe {
    max-width: 100%;
    border: none;
}

/* Timeline */
.pcm-timeline-container {
    position: relative;
    padding-left: 48px;
    margin: 40px 0;
}
.pcm-timeline-container::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 8px;
    bottom: 0;
    width: 2px;
    background-color: var(--pcm-outline-variant);
}
.pcm-timeline-item {
    position: relative;
    margin-bottom: 48px;
}
.pcm-timeline-dot {
    position: absolute;
    left: -37px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--pcm-primary-color);
    border: 4px solid #fff;
    box-shadow: 0 0 0 2px var(--pcm-primary-color);
    z-index: 1;
}
.pcm-timeline-date {
    font-weight: 600;
    color: var(--pcm-primary-color);
    margin-bottom: 8px;
    display: inline-block;
    margin-right: 10px;
}

/* Team */
.pcm-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
}
.pcm-team-member-card {
    background-color: var(--pcm-card-bg);
    border-radius: var(--pcm-card-radius);
    box-shadow: var(--pcm-card-shadow);
    border: 1px solid var(--pcm-outline-variant);
    text-align: center;
    padding: 32px 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pcm-team-member-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--pcm-card-shadow-hover);
}
.pcm-team-member-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px auto;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.pcm-team-member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pcm-team-member-role {
    font-size: 0.85rem;
    color: var(--pcm-accent-color);
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.pcm-team-member-name {
    margin: 0 0 5px 0;
    color: var(--pcm-text-color);
}
.pcm-team-link-wrapper {
    text-decoration: none !important;
    color: inherit;
}

/* Slots */
.pcm-slots-container {
    margin-bottom: 30px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}
.pcm-slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.pcm-slot-item {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f0f0f1;
    cursor: default;
}
.pcm-slot-free {
    color: #28a745;
    border: 2px solid #28a745;
    background: #e8f5e9;
}
.pcm-slot-reserved {
    color: #dc3545;
    border: 2px solid #dc3545;
    background: #f8d7da;
}
.pcm-slot-pending {
    color: #ffc107;
    border: 2px solid #ffc107;
    background: #fff3cd;
}

/* Signup Form */
.pcm-signup-wrapper {
    margin-top: 30px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: var(--pcm-card-radius);
    border-top: 4px solid var(--pcm-primary-color);
}
.pcm-button {
    background-color: var(--pcm-primary-color);
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
}
.pcm-msg-success { background-color: #d4edda; color: #155724; padding: 15px; border-radius: 4px; }
.pcm-msg-error { background-color: #f8d7da; color: #721c24; padding: 15px; border-radius: 4px; }

/* Bottom Related */
.pcm-bottom-related-section { margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; }
.pcm-bottom-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pcm-mini-card { display: block; border: 1px solid var(--pcm-outline-variant); border-radius: var(--pcm-card-radius); overflow: hidden; background: #fff; text-decoration: none; }
.pcm-mini-card-img { height: 120px; overflow: hidden; background: #f0f0f1; }
.pcm-mini-card-img img { width: 100%; height: 100%; object-fit: cover; }
.pcm-mini-card-title { padding: 10px; font-weight: 600; color: var(--pcm-text-color); }

/* Mobile */
@media (max-width: 767px) {
    /* Container & Layout Spacing - Reduced margins for mobile */
    .pcm-container {
        margin-top: 10px;
        margin-bottom: 24px;
        padding: 0 8px;
    }
    .pcm-grid-2, .pcm-grid-3 {
        gap: 12px;
    }
    .pcm-container > .pcm-card {
        margin-bottom: 12px;
    }
    .pcm-section-title {
        margin-bottom: 16px;
        font-size: 1.6rem;
    }
    .pcm-pagination {
        margin-top: 24px;
    }

    /* Card adjustments */
    .pcm-card-content {
        padding: 12px;
    }
    .pcm-card-actions {
        padding: 0 12px 12px 12px;
    }

    /* List View specific overrides */
    .pcm-list-view .pcm-card {
        flex-direction: column;
        height: auto;
    }
    .pcm-list-view .pcm-card-link-wrapper {
        flex-direction: column;
    }
    .pcm-list-view .pcm-card-image {
        width: 100%;
        height: 200px;
    }
    .pcm-list-view .pcm-card-content {
        padding: 12px; /* Reduced padding */
    }
    .pcm-list-view .pcm-card-actions {
        padding: 12px; /* Reduced padding */
        text-align: right;
        border-left: none;
        border-top: 1px solid var(--pcm-outline-variant);
        background-color: transparent;
        justify-content: space-between;
        flex-direction: row;
        align-items: center;
    }
    .pcm-list-view .pcm-card-files-list {
        align-items: flex-start;
        width: auto;
        flex: 1;
    }
    
    /* Grid Columns */
    .pcm-grid-2, .pcm-grid-3, .pcm-team-grid, .pcm-bottom-related-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Pagination */
    .pcm-pagination .page-numbers {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 0.85rem;
    }
    
    /* Timeline adjustments for mobile */
    .pcm-timeline-container {
        padding-left: 28px;
        margin: 20px 0;
    }
    .pcm-timeline-container::before {
        left: 11px;
    }
    .pcm-timeline-dot {
        left: -24px;
    }
    .pcm-timeline-item {
        margin-bottom: 24px;
    }
    
    /* Single Meta */
    .pcm-single-meta {
        padding: 12px;
        gap: 10px;
    }
    
    /* Team */
    .pcm-team-member-card {
        padding: 16px 12px;
    }
}

/* LIGHTBOX STYLES (Material Design 3) */
.pcm-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 999999; /* Very high z-index */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: pcmFadeIn 0.25s ease-out forwards;
    touch-action: none; /* Prevent scrolling on mobile */
    backdrop-filter: blur(5px);
}
@keyframes pcmFadeIn { to { opacity: 1; } }

.pcm-lightbox-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.pcm-lightbox-container img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    user-select: none;
}

.pcm-lightbox-caption {
    color: #e3e3e3;
    margin-top: 16px;
    font-size: 1rem;
    text-align: center;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Buttons (Material 3 Style) */
.pcm-lightbox-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
    backdrop-filter: blur(4px);
    z-index: 1000000;
    padding: 0;
    border-radius: 50%;
}

.pcm-lightbox-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.pcm-lightbox-btn:active {
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(0.95);
}

.pcm-lightbox-close {
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
}
.pcm-lightbox-close .dashicons { font-size: 28px; width: 28px; height: 28px; }

.pcm-lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
}
.pcm-lightbox-nav:active { transform: translateY(-50%) scale(0.95); }

.pcm-lightbox-nav .dashicons { font-size: 32px; width: 32px; height: 32px; }

.pcm-lightbox-prev { left: 24px; }
.pcm-lightbox-next { right: 24px; }

@media (max-width: 767px) {
    .pcm-lightbox-btn { background: rgba(0,0,0,0.4); } /* Darker background for visibility on mobile */
    .pcm-lightbox-close { top: 12px; right: 12px; width: 40px; height: 40px; }
    .pcm-lightbox-nav { width: 44px; height: 44px; }
    .pcm-lightbox-prev { left: 12px; }
    .pcm-lightbox-next { right: 12px; }
}
