/**
 * IPGC Dynamic Content Styles
 * Styles for content loaded from Firebase CMS
 */

/* ==================== HIDDEN ELEMENTS ==================== */

/* Hide non-functional WordPress search bar (can re-enable later if search is implemented) */
#searchform-dropdown,
#mobile-menu-search,
.search-toggle-li {
    display: none !important;
}

/* ==================== FOOTER STYLES ==================== */

/* Make footer widget text white like the headers */
.footer-widget .textwidget,
.footer-widget .textwidget p,
.footer-widget .textwidget a {
    color: #ffffff !important;
}

.footer-widget .textwidget a:hover {
    color: #dddddd !important;
}

/* ==================== ANNOUNCEMENTS ==================== */

.ipgc-announcements-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ipgc-announcement {
    background: #f8f9fa;
    border-left: 4px solid #1a472a;
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
}

.ipgc-announcement.important {
    background: #fff3e0;
    border-left-color: #f57c00;
}

.ipgc-announcement.urgent {
    background: #ffebee;
    border-left-color: #d32f2f;
}

.ipgc-announcement h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
}

.ipgc-announcement p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

/* ==================== EVENTS ==================== */

.ipgc-events-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ipgc-event {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ipgc-event-date {
    color: #1a472a;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.ipgc-event h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
}

.ipgc-event-time {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.ipgc-event p {
    margin: 0 0 10px 0;
    color: #555;
    line-height: 1.6;
}

.ipgc-event-location {
    color: #888;
    font-size: 14px;
}

.ipgc-no-events {
    color: #888;
    font-style: italic;
    padding: 20px 0;
}

/* ==================== NEWS ==================== */

.ipgc-news-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.ipgc-news-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ipgc-news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.ipgc-news-content {
    padding: 20px;
}

.ipgc-news-category {
    display: inline-block;
    background: #e8f5e9;
    color: #1a472a;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.ipgc-news-item h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 20px;
}

.ipgc-news-date {
    color: #888;
    font-size: 13px;
    margin-bottom: 10px;
}

.ipgc-news-content p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.ipgc-no-news {
    color: #888;
    font-style: italic;
    padding: 20px 0;
}

/* ==================== HOURS ==================== */

.ipgc-hours {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.ipgc-hours-table {
    width: 100%;
    border-collapse: collapse;
}

.ipgc-hours-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.ipgc-hours-table tr:last-child td {
    border-bottom: none;
}

.ipgc-hours-table td:first-child {
    width: 40%;
}

.ipgc-hours-notes {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* ==================== CONTACT ==================== */

.ipgc-contact {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.ipgc-contact p {
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.ipgc-contact p:last-child {
    margin-bottom: 0;
}

.ipgc-contact a {
    color: #1a472a;
    text-decoration: none;
}

.ipgc-contact a:hover {
    text-decoration: underline;
}

/* ==================== PRICING ==================== */

.ipgc-pricing {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.ipgc-pricing h4 {
    margin: 0 0 15px 0;
    color: #1a472a;
    font-size: 16px;
    border-bottom: 2px solid #1a472a;
    padding-bottom: 8px;
}

.ipgc-pricing h4:not(:first-child) {
    margin-top: 25px;
}

.ipgc-pricing-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ipgc-pricing-list li {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
}

.ipgc-pricing-list li:last-child {
    border-bottom: none;
}

.ipgc-pricing-list strong {
    color: #1a472a;
}

.ipgc-pricing-notes {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .ipgc-announcement,
    .ipgc-event,
    .ipgc-news-content,
    .ipgc-hours,
    .ipgc-contact,
    .ipgc-pricing {
        padding: 15px;
    }

    .ipgc-hours-table td {
        padding: 8px 10px;
        font-size: 14px;
    }

    .ipgc-pricing-list li {
        flex-direction: column;
        gap: 5px;
    }
}

/* ==================== CMS POST CARDS ==================== */

/* Ensure Elementor grid displays posts in row order (newest at top-left) */
.elementor-posts-container.elementor-grid {
    grid-auto-flow: row !important;
}

.ipgc-cms-post {
    /* CMS posts styled same as WordPress posts - no special styling */
}

/* ==================== PUBLIC VIEW MODAL ==================== */

.ipgc-public-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ipgc-public-modal.active {
    display: flex;
}

.ipgc-public-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.ipgc-public-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #1a472a;
    color: white;
}

.ipgc-public-modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.ipgc-public-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}

.ipgc-public-modal-close:hover {
    opacity: 1;
}

.ipgc-public-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.ipgc-public-modal-footer {
    padding: 15px 25px;
    background: #f5f5f5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e0e0e0;
}

.ipgc-public-modal-footer button {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: #1a472a;
    color: white;
    transition: background 0.2s;
}

.ipgc-public-modal-footer button:hover {
    background: #2d5a3d;
}

/* ==================== VIEW ALL BUTTON ==================== */

.ipgc-view-all-container {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.ipgc-view-all-btn {
    background: #1a472a;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.ipgc-view-all-btn:hover {
    background: #2d5a3d;
    transform: translateY(-1px);
}

.ipgc-view-all-btn:active {
    transform: translateY(0);
}

/* ==================== ALL POSTS LIST (in modal) ==================== */

.ipgc-all-posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ipgc-all-posts-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.15s;
}

.ipgc-all-posts-item:last-child {
    border-bottom: none;
}

.ipgc-all-posts-item:hover {
    background: #f5f5f5;
}

.ipgc-all-posts-date {
    font-size: 12px;
    color: #888;
}

.ipgc-all-posts-title {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.ipgc-all-posts-item:hover .ipgc-all-posts-title {
    color: #1a472a;
}

/* ==================== CATEGORY/ARCHIVE PAGE STYLES ==================== */

/* Center content on category pages when sidebar is removed */
body.archive #content-wrap {
    max-width: 900px;
    margin: 0 auto;
}

body.archive #primary {
    width: 100%;
    max-width: 100%;
}

body.archive #blog-entries {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

body.archive .blog-entry {
    width: 100%;
    max-width: 800px;
}

/* ==================== BOARD MEMBERS ==================== */

.board-member-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.board-member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.board-member-admin-buttons button:hover {
    opacity: 0.9;
}

#board-members-container {
    min-height: 100px;
}

/* Responsive board member cards */
@media (max-width: 768px) {
    .board-member-card {
        width: 100% !important;
        max-width: 300px;
    }

    #board-members-container {
        padding: 10px !important;
        gap: 20px !important;
    }
}

/* ==================== AFFILIATIONS ==================== */

.affiliation-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.affiliation-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.affiliation-admin-buttons button:hover {
    opacity: 0.9;
}

#affiliations-container {
    min-height: 80px;
}

/* Responsive affiliation cards */
@media (max-width: 768px) {
    #affiliations-container {
        gap: 20px !important;
        padding: 10px !important;
    }

    .affiliation-card img {
        max-width: 120px !important;
        max-height: 120px !important;
    }
}