/* Bewonersverhalen Manager Frontend Styles */

/* Hide Gutenberg blocks/sections for verhaal pages on subsites - very aggressive */
body.verhaal-page-template .gbp-section:not(.verhaal-details .gbp-section):not(.verhaal-article .gbp-section),
body.main-site-verhaal .gbp-section:not(.verhaal-details .gbp-section):not(.verhaal-article .gbp-section),
body.verhaal-page-template .gb-element:not(.verhaal-details .gb-element):not(.verhaal-article .gb-element),
body.main-site-verhaal .gb-element:not(.verhaal-details .gb-element):not(.verhaal-article .gb-element),
body.verhaal-page-template .gb-container:not(.verhaal-details .gb-container):not(.verhaal-article .gb-container),
body.main-site-verhaal .gb-container:not(.verhaal-details .gb-container):not(.verhaal-article .gb-container),
body.verhaal-page-template [class*="gb-element-"]:not(.verhaal-details [class*="gb-element-"]):not(.verhaal-article [class*="gb-element-"]),
body.main-site-verhaal [class*="gb-element-"]:not(.verhaal-details [class*="gb-element-"]):not(.verhaal-article [class*="gb-element-"]),
body.verhaal-page-template [class*="gbp-section"]:not(.verhaal-details [class*="gbp-section"]):not(.verhaal-article [class*="gbp-section"]),
body.main-site-verhaal [class*="gbp-section"]:not(.verhaal-details [class*="gbp-section"]):not(.verhaal-article [class*="gbp-section"]),
body.verhaal-page-template div[class*="gb-element"]:not(.verhaal-details div):not(.verhaal-article div),
body.main-site-verhaal div[class*="gb-element"]:not(.verhaal-details div):not(.verhaal-article div) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Hide Gutenberg sections that come before verhaal content in content area */
body.verhaal-page-template .content-area > .gbp-section:first-child,
body.main-site-verhaal .content-area > .gbp-section:first-child,
body.verhaal-page-template .content-area > div[class*="gb-element"]:first-child,
body.main-site-verhaal .content-area > div[class*="gb-element"]:first-child,
body.verhaal-page-template .main-content > .gbp-section:first-child,
body.main-site-verhaal .main-content > .gbp-section:first-child,
body.verhaal-page-template .main-content > div[class*="gb-element"]:first-child,
body.main-site-verhaal .main-content > div[class*="gb-element"]:first-child,
body.verhaal-page-template .site-main > .gbp-section:first-child,
body.main-site-verhaal .site-main > .gbp-section:first-child,
body.verhaal-page-template .site-main > div[class*="gb-element"]:first-child,
body.main-site-verhaal .site-main > div[class*="gb-element"]:first-child {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Hide "Nieuws" header and other post headers for verhaal pages */
body.verhaal-page-template h1:not(.verhaal-title),
body.main-site-verhaal h1:not(.verhaal-title),
body.verhaal-page-template .page-title:not(.verhaal-title),
body.main-site-verhaal .page-title:not(.verhaal-title),
body.verhaal-page-template .entry-title:not(.verhaal-title),
body.main-site-verhaal .entry-title:not(.verhaal-title) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Hide featured images outside verhaal container */
body.verhaal-page-template .wp-post-image:not(.verhaal-featured-image img),
body.main-site-verhaal .wp-post-image:not(.verhaal-featured-image img),
body.verhaal-page-template .attachment-post-thumbnail:not(.verhaal-featured-image img),
body.main-site-verhaal .attachment-post-thumbnail:not(.verhaal-featured-image img),
body.verhaal-page-template .post-thumbnail:not(.verhaal-featured-image),
body.main-site-verhaal .post-thumbnail:not(.verhaal-featured-image),
body.verhaal-page-template .entry-thumbnail:not(.verhaal-featured-image),
body.main-site-verhaal .entry-thumbnail:not(.verhaal-featured-image) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.verhalen-list {
    margin: 20px 0;
}

.verhalen-filter {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.filter-title {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #333;
    font-weight: 600;
}

.filter-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 200px;
}

.filter-group label {
    font-weight: bold;
    color: #333;
    font-size: 14px;
    margin: 0;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select:hover {
    border-color: #0073aa;
}

.filter-select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.clear-filter-btn {
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.clear-filter-btn:hover {
    background: #005a87;
}

/* No results message */
.verhalen-no-results {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
    display: none;
    width: 100%;
    max-width: 100%;
}

.verhalen-no-results p {
    margin: 0;
    font-size: 1.1em;
    color: #666;
    font-style: italic;
}

.verhalen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.verhaal-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-align: center;
    display: block;
    text-decoration: none;
    color: inherit;
}

.verhaal-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.verhaal-thumbnail {
    margin-bottom: 15px;
}

.verhaal-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.verhaal-content {
    text-align: center;
}

.verhaal-title {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
}

.verhaal-title {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.verhaal-plaats {
    margin: 5px 0 15px 0;
    color: #666;
    font-size: 0.9em;
}

.verhaal-onderwerpen {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    margin-bottom: 10px;
}

.onderwerp-tag {
    display: inline-block;
    padding: 4px 8px;
    background: #e9ecef;
    color: #495057;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.onderwerp-tag:hover {
    background: #0073aa;
    color: #fff;
}

.verhaal-excerpt {
    margin-top: 10px;
    color: #666;
    font-size: 0.9em;
    line-height: 1.5;
}

/* Verhalen Archive Page */
.verhalen-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.verhalen-archive .page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: #f8f9fa;
    border-radius: 8px;
}

.verhalen-archive .page-title {
    font-size: 2.5em;
    color: #333;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.verhalen-archive .page-description {
    font-size: 1.1em;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.verhalen-archive .verhalen-content {
    margin-top: 30px;
}

/* Verhaal Details Page */
.verhaal-details {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Ensure consistent width for both single verhaal and main site verhaal templates */
.single-verhaal .verhaal-details,
.page .verhaal-details,
.main-site-verhaal-details {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Override theme layout for verhaal pages */
.single-verhaal .content-area,
.single-verhaal .main-content,
.single-verhaal .entry-content,
.single-verhaal article {
    max-width: 800px !important;
    margin: 0 auto !important;
    width: 100% !important;
}

/* Force full width for verhaal content */
.single-verhaal .container,
.single-verhaal .wrapper,
.single-verhaal .site-content {
    max-width: 100% !important;
    padding: 0 20px !important;
}

/* Specific styling for single verhaal details */
.single-verhaal-details {
    max-width: 800px !important;
    margin: 0 auto !important;
    width: 100% !important;
}

.verhaal-article {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.verhaal-featured-image {
    margin-bottom: 20px;
    text-align: center;
}

.verhaal-featured-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.verhaal-details .verhaal-title {
    font-size: 2em;
    margin-bottom: 20px;
    color: #333;
    padding-left: 20px;
}

.verhaal-meta {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.verhaal-meta .verhaal-plaats,
.verhaal-meta .verhaal-onderwerpen-detail {
    font-size: 1.1em;
    margin: 10px 0;
    color: #333;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.verhaal-meta .verhaal-plaats strong,
.verhaal-meta .verhaal-onderwerpen-detail strong {
    color: #0073aa;
    min-width: 100px;
    flex-shrink: 0;
    margin-right: 10px;
}

.verhaal-meta a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.verhaal-meta a:hover {
    color: #005a87;
    text-decoration: underline;
}

.verhaal-excerpt {
    margin: 10px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #333;
}

.verhaal-onderwerpen-detail {
    margin: 10px 0;
}

.verhaal-onderwerpen-detail h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.onderwerpen-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.onderwerp-tag-detail {
    display: inline-block;
    padding: 6px 12px;
    background: #0073aa;
    color: #fff;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.onderwerp-tag-detail:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.verhaal-description {
    margin-top: 20px;
    line-height: 1.8;
    color: #333;
}

.verhaal-description h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.verhaal-gerelateerde-paginas {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.verhaal-gerelateerde-paginas h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.verhaal-gerelateerde-paginas ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.verhaal-gerelateerde-paginas li {
    margin: 10px 0;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

.verhaal-gerelateerde-paginas li a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.verhaal-gerelateerde-paginas li a:hover {
    color: #005a87;
    text-decoration: underline;
}

.external-link-icon {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.9em;
    opacity: 0.7;
    vertical-align: middle;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.error-message h2 {
    color: #dc3545;
    margin-bottom: 15px;
}

.error-message a {
    color: #0073aa;
    text-decoration: none;
}

.error-message a:hover {
    text-decoration: underline;
}

/* Verhalen Pagination */
.verhalen-pagination {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.load-more-verhalen {
    display: inline-block;
    padding: 12px 24px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.load-more-verhalen:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.load-more-verhalen:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .verhalen-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .verhaal-item {
        padding: 15px;
    }
    
    .verhaal-thumbnail img {
        max-width: 100%;
    }
    
    .verhaal-title {
        font-size: 1.2em;
    }
    
    .verhaal-details .verhaal-title {
        font-size: 1.6em;
    }
    
    .verhaal-details {
        padding: 15px;
    }
    
    .verhalen-archive {
        padding: 15px;
    }
    
    .verhalen-archive .page-title {
        font-size: 2em;
    }
    
    .filter-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        min-width: auto;
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .clear-filter-btn {
        width: 100%;
    }
    
    .verhalen-no-results {
        padding: 20px;
        margin: 15px 0;
    }
    
    .verhalen-no-results p {
        font-size: 1em;
    }
    
    .verhalen-pagination {
        margin-top: 20px;
        padding: 15px 0;
    }
    
    .load-more-verhalen {
        width: 100%;
        padding: 15px 20px;
        font-size: 16px;
    }
}

@media screen and (max-width: 480px) {
    .verhaal-item {
        padding: 12px;
    }
    
    .verhaal-title {
        font-size: 1.1em;
    }
    
    .verhaal-details .verhaal-title {
        font-size: 1.4em;
    }
    
    .onderwerp-tag {
        font-size: 0.75em;
        padding: 3px 6px;
    }
    
    .onderwerp-tag-detail {
        font-size: 0.8em;
        padding: 4px 8px;
    }
}

