/**
 * Pulmad Nouanded - Public CSS
 * Single article (vendor-style), Gallery grid, Lightbox, Polls
 */

/* ==========================================================================
   Single Article (vendor-style layout)
   ========================================================================== */

.pn-single-article {
    max-width: 800px;
    margin: 0 auto;
}

/* When inside kataloog layout, remove max-width constraint */
.kataloog-layout .pn-single-article {
    max-width: none;
    margin: 0;
}

.pn-article-header {
    margin-bottom: 30px;
}

.pn-article-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.pn-badge {
    display: inline-block;
    padding: 4px 14px;
    background: var(--pulmad-blue, #276FAB);
    color: #fff;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}

.pn-badge:hover {
    background: #1d5a8f;
    color: #fff;
}

.pn-article-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pn-article-title {
    flex: 1;
    font-size: 2em;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.pn-article-title-row .pvd-favorite-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
}

.pn-article-meta-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 12px;
    font-size: 0.92em;
}

.pn-article-meta-inline span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #666;
}

.pn-article-meta-inline i {
    font-size: 16px;
    color: var(--pulmad-blue, #276FAB);
}

/* Hero image */
.pn-article-hero {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
}

.pn-article-hero-img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
}

/* Content area */
.pn-article-content {
    font-size: 1.05em;
    line-height: 1.75;
    color: #333;
}

.pn-article-content h2,
.pn-article-content h3 {
    margin-top: 2em;
    margin-bottom: 0.5em;
}

.pn-article-content p {
    margin-bottom: 1.2em;
}

.pn-article-content ul,
.pn-article-content ol {
    margin-bottom: 1.2em;
    padding-left: 1.5em;
}

/* Footer with tags/categories */
.pn-article-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pn-article-tags,
.pn-article-categories {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pn-article-tags-label {
    font-size: 0.85em;
    color: #666;
    font-weight: 500;
}

.pn-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 0.85em;
    text-decoration: none;
    transition: all 0.2s;
}

.pn-tag:hover {
    background: var(--pulmad-blue, #276FAB);
    color: #fff;
}

@media (max-width: 768px) {
    .pn-article-title {
        font-size: 1.5em;
    }

    .pn-article-hero-img {
        height: 220px;
    }
}

/* Gallery styles moved to theme: components/_gallery.css (shared .pulmad-gallery component) */

/* ==========================================================================
   Lightbox
   ========================================================================== */

.pn-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pn-lightbox__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.pn-lightbox__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

.pn-lightbox__image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.pn-lightbox__close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}

.pn-lightbox__close:hover {
    color: #ccc;
}

.pn-lightbox__prev,
.pn-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 24px;
    padding: 16px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.pn-lightbox__prev:hover,
.pn-lightbox__next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pn-lightbox__prev {
    left: -60px;
}

.pn-lightbox__next {
    right: -60px;
}

@media (max-width: 768px) {
    .pn-lightbox__prev {
        left: 10px;
    }

    .pn-lightbox__next {
        right: 10px;
    }
}

body.pn-lightbox-open {
    overflow: hidden;
}

/* ==========================================================================
   Poll
   ========================================================================== */

.pn-poll {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.pn-poll__question {
    font-size: 1.15em;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a202c;
}

.pn-poll__options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.pn-poll__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.pn-poll__option:hover {
    border-color: var(--pulmad-blue, #276FAB);
    background: #f0f7ff;
}

.pn-poll__option input:checked + .pn-poll__option-label {
    font-weight: 600;
}

.pn-poll__option-label {
    flex: 1;
}

.pn-poll__preview-count {
    color: #718096;
    font-size: 0.85em;
}

.pn-poll__submit {
    display: inline-block;
    padding: 10px 24px;
    background: var(--pulmad-blue, #276FAB);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pn-poll__submit:hover {
    background: #1d5a8f;
}

.pn-poll__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Results bars */
.pn-poll__results-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.pn-poll__result-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pn-poll__result-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #2d3748;
}

.pn-poll__result-pct {
    font-weight: 600;
    color: var(--pulmad-blue, #276FAB);
}

.pn-poll__result-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.pn-poll__result-fill {
    height: 100%;
    background: var(--pulmad-blue, #276FAB);
    border-radius: 4px;
    transition: width 0.6s ease;
    min-width: 0;
}

.pn-poll__footer {
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.pn-poll__total {
    font-size: 0.85em;
    color: #718096;
}

/* ==========================================================================
   Static Poll Results (migrated from Drupal)
   ========================================================================== */

.pn-poll-results-static {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.pn-poll-results-static h4 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #1a202c;
}

.pn-poll-results-static ol {
    margin: 0 0 12px 0;
    padding-left: 1.5em;
    counter-reset: none;
}

.pn-poll-results-static li {
    padding: 6px 0;
    line-height: 1.5;
    border-bottom: 1px solid #edf2f7;
}

.pn-poll-results-static li:last-child {
    border-bottom: none;
}

.pn-poll-results-static li strong {
    color: #2d3748;
}

.pn-poll-results-static__total {
    font-size: 0.85em;
    color: #718096;
    margin: 8px 0 0 0;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

/* ==========================================================================
   Listing Shortcode [pn_listing]
   Mirrors vendor [pvd_vendor_listing] layout
   ========================================================================== */

.pn-listing-wrapper {
    margin: 20px 0;
}

/* Sidebar layout */
.pn-listing-wrapper.pn-has-sidebar {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    align-items: start;
}

.pn-listing-main {
    min-width: 0;
}

/* Sidebar */
.pn-listing-sidebar {
}

.pn-sidebar-widget {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
}

.pn-sidebar-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.pn-category-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pn-category-menu li {
    margin-bottom: 2px;
}

.pn-category-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    font-size: 0.95em;
}

.pn-category-menu a:hover {
    background: #f1f5f9;
    color: var(--pulmad-blue, #276FAB);
}

.pn-category-menu li.is-active a {
    background: var(--pulmad-blue, #276FAB);
    color: #fff;
    font-weight: 500;
}

.pn-cat-count {
    font-size: 0.85em;
    color: #999;
}

.pn-category-menu li.is-active .pn-cat-count {
    color: rgba(255, 255, 255, 0.8);
}

/* Filters */
.pn-listing-filters {
    margin-bottom: 30px;
}

.pn-filter-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.pn-filter-item--search {
    flex: 1;
}

.pn-filter-item--search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 0.95em;
}

.pn-filter-submit {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pn-button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--pulmad-blue, #276FAB);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}

.pn-button:hover {
    background: #1d5a8f;
    color: #fff;
}

.pn-reset-filters {
    color: #666;
    font-size: 0.9em;
    text-decoration: none;
}

.pn-reset-filters:hover {
    color: var(--pulmad-blue, #276FAB);
}

/* Article grid */
.pn-article-grid {
    display: grid;
    gap: 30px;
}

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

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

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

/* Article card */
.pn-article-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pn-article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.pn-article-card__image {
    position: relative;
    height: 200px;
    background: #f5f5f5;
    overflow: hidden;
}

.pn-article-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pn-article-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #999;
    text-decoration: none;
}

.pn-article-card__placeholder i {
    font-size: 3rem;
}

.pn-article-card__content {
    padding: 20px;
}

.pn-article-card__category {
    display: inline-block;
    font-size: 0.75em;
    font-weight: 500;
    color: var(--pulmad-blue, #276FAB);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.pn-article-card__title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.pn-article-card__title a {
    color: #1a202c;
    text-decoration: none;
}

.pn-article-card__title a:hover {
    color: var(--pulmad-blue, #276FAB);
}

.pn-article-card__excerpt {
    font-size: 0.9em;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.pn-article-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: #999;
}

.pn-article-card__meta i {
    color: var(--pulmad-blue, #276FAB);
}

/* Type badge (gallery/poll) */
.pn-article-card__type {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.pn-article-card__type i {
    font-size: 16px;
    color: var(--pulmad-blue, #276FAB);
}

/* ==========================================================================
   Promoted Article Card
   Full-width, 2-column layout (same as vendor promoted)
   ========================================================================== */

.pn-article-card--promoted {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 2px solid var(--pulmad-blue, #276FAB);
    box-shadow: 0 4px 12px rgba(39, 111, 171, 0.15);
}

.pn-article-card--promoted:hover {
    box-shadow: 0 6px 20px rgba(39, 111, 171, 0.25);
}

.pn-article-card--promoted .pn-article-card__image {
    height: auto;
    min-height: 280px;
}

.pn-article-card--promoted .pn-article-card__content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pn-article-card--promoted .pn-article-card__title {
    font-size: 1.35em;
}

.pn-article-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--pulmad-blue, #276FAB);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

/* Pagination */
.pn-pagination {
    margin-top: 40px;
    text-align: center;
}

.pn-pagination .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 3px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.pn-pagination .page-numbers:hover,
.pn-pagination .page-numbers.current {
    background: var(--pulmad-blue, #276FAB);
    border-color: var(--pulmad-blue, #276FAB);
    color: #fff;
}

/* No results */
.pn-no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.pn-no-results p {
    color: #666;
    margin-bottom: 20px;
}

/* Responsive */
@media screen and (max-width: 992px) {
    .pn-listing-wrapper.pn-has-sidebar {
        grid-template-columns: 1fr;
    }

    .pn-listing-sidebar {
        position: static;
        order: -1;
    }
}

@media screen and (max-width: 768px) {
    .pn-article-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .pn-article-card--promoted {
        grid-template-columns: 1fr;
    }

    .pn-article-card--promoted .pn-article-card__image {
        min-height: 200px;
    }

    .pn-filter-row {
        flex-direction: column;
    }

    /* Hide sidebar on mobile — replaced by dropdown */
    .kataloog-sidebar {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .pn-article-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   Vendor Blog Form (mirrors pad-vendor__ pattern)
   ========================================================================== */

.pn-vendor__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pn-vendor__header .pulmad-account__panel-title {
    margin: 0;
}

.pn-vendor__form {
    max-width: 720px;
}

.pn-vendor__field {
    margin-bottom: 20px;
}

.pn-vendor__label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #1e293b;
}

.pn-vendor__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.pn-vendor__input:focus {
    outline: none;
    border-color: #276FAB;
    box-shadow: 0 0 0 3px rgba(39, 111, 171, 0.1);
}

textarea.pn-vendor__input {
    resize: vertical;
}

.pn-vendor__checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
}

.pn-vendor__checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.pn-vendor__image-upload {
    margin-top: 4px;
}

.pn-vendor__image-preview {
    position: relative;
    display: inline-block;
    max-width: 400px;
    margin-bottom: 8px;
}

.pn-vendor__image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.pn-vendor__image-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pn-vendor__image-remove:hover {
    background: rgba(239, 68, 68, 0.9);
}

.pn-vendor__file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.pn-vendor__help {
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

.pn-vendor__actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.pn-vendor__note {
    margin-top: 16px;
    font-size: 13px;
    color: #64748b;
    font-style: italic;
}

.pn-vendor__message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.pn-vendor__message--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.pn-vendor__message--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.pn-vendor__action-link {
    font-size: 13px;
    color: #276FAB;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.pn-vendor__action-link:hover {
    text-decoration: underline;
}

.pn-vendor__action-link--delete {
    color: #ef4444;
    margin-left: 8px;
}

/* TinyMCE editor wrapper inside vendor form */
.pn-vendor__form .wp-editor-wrap {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.pn-vendor__form .wp-editor-wrap .mce-toolbar-grp {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

@media (max-width: 640px) {
    .pn-vendor__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .pn-vendor__actions {
        flex-direction: column;
    }
}
