/**
 * Websenter Mine Oppføringer - Base Styles
 *
 * Minimal styling som sikrer funksjonell visning "out of the box".
 * Temaet kan overskrive disse med høyere spesifisitet.
 *
 * @package Websenter_Mine_Oppforinger
 * @version 1.2.0
 */

/* ==========================================================================
   Grid Layout
   ========================================================================== */

.ws-user-posts-wrapper {
    margin-block: 1.5rem;
}

.ws-user-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Alternativ: Enkel liste uten grid */
.ws-user-posts-grid--list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==========================================================================
   Post Cards
   ========================================================================== */

.ws-user-post-card {
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ws-user-post-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Status-spesifikke styles */
.ws-user-post-card--draft {
    border-left: 3px solid #f59e0b;
}

.ws-user-post-card--pending {
    border-left: 3px solid #3b82f6;
}

.ws-user-post-card--private {
    border-left: 3px solid #8b5cf6;
}

.ws-user-post-card--publish {
    border-left: 3px solid #10b981;
}

/* ==========================================================================
   Typography
   ========================================================================== */

.ws-user-post-title {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    line-height: 1.4;
}

.ws-user-post-title a {
    color: inherit;
    text-decoration: none;
}

.ws-user-post-title a:hover {
    text-decoration: underline;
}

.ws-user-post-meta {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

/* Status badges */
.ws-user-post-status {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.ws-user-post-status--draft {
    background: #fef3c7;
    color: #92400e;
}

.ws-user-post-status--pending {
    background: #dbeafe;
    color: #1e40af;
}

.ws-user-post-status--private {
    background: #ede9fe;
    color: #5b21b6;
}

.ws-user-post-status--publish {
    background: #d1fae5;
    color: #065f46;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.ws-user-posts-pagination {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.ws-user-posts-pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    justify-content: center;
}

.ws-user-posts-pagination li {
    margin: 0;
}

.ws-user-posts-pagination a,
.ws-user-posts-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    text-decoration: none;
    color: #334155;
    background: #fff;
    transition: all 0.2s ease;
}

.ws-user-posts-pagination a:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

.ws-user-posts-pagination .current {
    border-color: #3b82f6;
    color: #fff;
    background: #3b82f6;
}

.ws-user-posts-pagination .dots {
    border-color: transparent;
    background: transparent;
}

/* ==========================================================================
   States & Messages
   ========================================================================== */

.ws-user-posts-empty,
.ws-user-posts-login-required,
.ws-user-posts-error {
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
}

.ws-user-posts-empty {
    background: #f8fafc;
    color: #64748b;
}

.ws-user-posts-login-required {
    background: #fefce8;
    color: #854d0e;
    border: 1px solid #fde047;
}

.ws-user-posts-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .ws-user-posts-grid {
        grid-template-columns: 1fr;
    }

    .ws-user-posts-pagination ul {
        gap: 0.25rem;
    }

    .ws-user-posts-pagination a,
    .ws-user-posts-pagination span {
        min-width: 2rem;
        height: 2rem;
        padding: 0 0.5rem;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .ws-user-posts-pagination {
        display: none;
    }

    .ws-user-post-card {
        break-inside: avoid;
        border: 1px solid #000;
        box-shadow: none;
    }
}
