/**
 * Preggie Blog Hub Styling
 * Plugin: Preggie Blog Hub
 * Version: 1.0.0
 * 
 * Fargepalett:
 * Originale farger: #dd9193 (rosa), #91b9dd (blå)
 * Pastell utvidelser: 
 * - Gul: #f2e29b (lys), #e8d77b (dempet)
 * - Grønn: #a8d5b2 (mint), #8fc9a3 (salvie)  
 * - Lilla: #c3a6d8 (lavendel), #b395c9 (pastell)
 */

/* Hovedcontainer */
.preggie-blog-hub {
    margin: 20px 0;
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
}

/* Grid layout */
.preggie-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin: 0;
}

/* Bloggkort */
.preggie-blog-item {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 0;
}

.preggie-blog-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Fremhevet bilde */
.preggie-blog-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.preggie-blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.preggie-blog-image:hover img {
    transform: scale(1.05);
}

/* Innholdsområde */
.preggie-blog-content {
    padding: 20px;
}

/* Kategorier */
.preggie-blog-categories {
    margin-bottom: 12px;
}

.preggie-blog-category {
    display: inline-block;
    background: #91b9dd;
    color: #2d4c76;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 15px;
    margin-right: 8px;
    margin-bottom: 5px;
}

/* Tittel */
.preggie-blog-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    line-height: 1.3;
}

.preggie-blog-title a {
    color: #2d4c76;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.preggie-blog-title a:hover {
    color: #91b9dd;
    text-decoration: none;
}

/* Utdrag */
.preggie-blog-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Tom tilstand */
.preggie-blog-hub-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background-color: #f9f9f9;
    border-radius: 8px;
}

/* Tablet responsivt design (2 kolonner) */
@media screen and (max-width: 1024px) and (min-width: 768px) {
    .preggie-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .preggie-blog-hub {
        padding: 25px;
    }
}

/* Mobil responsivt design (1 kolonne) */
@media screen and (max-width: 767px) {
    .preggie-blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .preggie-blog-hub {
        padding: 20px 15px;
    }
    
    .preggie-blog-image {
        height: 180px;
    }
    
    .preggie-blog-content {
        padding: 15px;
    }
    
    .preggie-blog-title {
        font-size: 16px;
    }
    
    .preggie-blog-excerpt {
        font-size: 13px;
    }
}

/* Ekstra små skjermer */
@media screen and (max-width: 480px) {
    .preggie-blog-hub {
        margin: 15px -15px;
        border-radius: 0;
    }
    
    .preggie-blog-image {
        height: 160px;
    }
}

/* =================================================================
   SØKE- OG FILTERBANNER STYLING
   ================================================================= */

/* Søkebanner container */
.preggie-search-banner {
    background: linear-gradient(135deg, #f9f9f9 0%, #f2f2f2 100%);
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 40px 25px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 300px;
    justify-content: center;
}

/* Søkekontroller */
.preggie-search-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 600px;
}

/* Søkeinput wrapper */
.preggie-search-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
}

/* Søkeinput */
.preggie-search-input {
    width: 100%;
    padding: 18px 55px 18px 25px;
    border: 2px solid #e5e5e5;
    border-radius: 30px;
    font-size: 18px;
    background: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.preggie-search-input:focus {
    border-color: #91b9dd;
    box-shadow: 0 0 0 4px rgba(145, 185, 221, 0.2), 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Søkeikon */
.preggie-search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #91b9dd;
    font-size: 20px;
    pointer-events: none;
}


/* Søkeresultater info */
.preggie-search-results-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

.preggie-clear-search {
    background: #dd9193;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.preggie-clear-search:hover {
    background: #d17a7c;
}

/* =================================================================
   KLIKKBARE KATEGORIPILLER
   ================================================================= */

/* Container for kategoripiller */
.preggie-categories-pills {
    margin-bottom: 30px;
}

/* Tittel for kategorier */
.preggie-categories-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d4c76;
    margin-bottom: 15px;
    text-align: center;
}

/* Liste med kategori-piller */
.preggie-categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

/* Basis styling for alle piller */
.preggie-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.preggie-category-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.preggie-category-pill:active {
    transform: translateY(0);
}

/* Aktiv tilstand */
.preggie-category-pill.active {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

/* Pill-tekst */
.preggie-pill-text {
    white-space: nowrap;
}

/* Antall posts i kategori */
.preggie-pill-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* Farger for pillene */
.preggie-pill-yellow {
    background: linear-gradient(135deg, #f2e29b 0%, #e8d77b 100%);
    color: #8b7355;
}

.preggie-pill-yellow:hover {
    background: linear-gradient(135deg, #eedd91 0%, #dfd271 100%);
}

.preggie-pill-green {
    background: linear-gradient(135deg, #a8d5b2 0%, #8fc9a3 100%);
    color: #4a6b4f;
}

.preggie-pill-green:hover {
    background: linear-gradient(135deg, #9dd0a8 0%, #84c398 100%);
}

.preggie-pill-purple {
    background: linear-gradient(135deg, #c3a6d8 0%, #b395c9 100%);
    color: #6b4a7a;
}

.preggie-pill-purple:hover {
    background: linear-gradient(135deg, #bc9dd3 0%, #ab8cc4 100%);
}

.preggie-pill-blue {
    background: linear-gradient(135deg, #91b9dd 0%, #7da8d1 100%);
    color: #2d4c76;
}

.preggie-pill-blue:hover {
    background: linear-gradient(135deg, #87b4d8 0%, #739ed0 100%);
}

.preggie-pill-pink {
    background: linear-gradient(135deg, #dd9193 0%, #d17a7c 100%);
    color: #7a3c3e;
}

.preggie-pill-pink:hover {
    background: linear-gradient(135deg, #d88789 0%, #cc7072 100%);
}

/* =================================================================
   LOADING INDIKATOR
   ================================================================= */

.preggie-loading {
    text-align: center;
    padding: 30px;
    color: #91b9dd;
}

.preggie-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(145, 185, 221, 0.3);
    border-radius: 50%;
    border-top-color: #91b9dd;
    animation: preggie-spin 1s ease-in-out infinite;
    margin-bottom: 10px;
}

@keyframes preggie-spin {
    to { transform: rotate(360deg); }
}

/* =================================================================
   RESPONSIVT DESIGN FOR SØKEBANNER
   ================================================================= */

/* Tablet */
@media screen and (max-width: 1024px) and (min-width: 768px) {
    .preggie-search-banner {
        padding: 20px;
    }
    
    .preggie-categories-list {
        gap: 8px;
    }
    
    .preggie-category-pill {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Mobil */
@media screen and (max-width: 767px) {
    .preggie-search-banner {
        padding: 30px 15px;
        margin-bottom: 20px;
        min-height: 280px;
    }
    
    .preggie-search-controls {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        max-width: 100%;
    }
    
    .preggie-search-input-wrapper {
        max-width: 100%;
    }
    
    .preggie-search-input {
        font-size: 16px;
        padding: 16px 50px 16px 20px;
    }
    
    .preggie-categories-title {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .preggie-categories-list {
        gap: 6px;
        justify-content: flex-start;
    }
    
    .preggie-category-pill {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .preggie-pill-count {
        font-size: 10px;
        padding: 1px 4px;
        min-width: 16px;
    }
}

/* Ekstra små skjermer */
@media screen and (max-width: 480px) {
    .preggie-search-input {
        font-size: 16px; /* Forhindre zoom på iOS */
    }
    
    .preggie-categories-list {
        justify-content: center;
    }
    
    .preggie-category-pill {
        font-size: 10px;
        padding: 4px 8px;
    }
}