/**
 * Custom Sticky Notices - Common Styles
 * Shared styles for all layouts (masonry & pinboard)
 * Version: 3.0.41 - Simplified instant search (no dropdown)
 */

/* ===================================
   CONTAINER & STRUCTURE
   =================================== */

.csn-wrapper,
.csn-wrapper-v2,
.csn-pinboard-wrapper {
    width: 100%;
    max-width: 100%;
}

.csn-wrapper .csn-container,
.csn-wrapper-v2 .csn-container,
.csn-pinboard-wrapper .csn-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ===================================
   SECTION TITLES
   =================================== */

.csn-section {
    margin-bottom: 50px;
}

.csn-section-title {
    font-size: 28px;
    font-weight: 700;
    color: #20342E;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #116914;
    display: flex;
    align-items: center;
    gap: 10px;
}

.featured-section .csn-section-title {
    color: #116914;
}

.unfeatured-section {
    margin-top: 60px;
}

.unfeatured-section .csn-section-title {
    color: #20342E;
}

/* ===================================
   SEARCH & FILTER CONTROLS
   =================================== */

.csn-controls {
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.csn-search {
    flex: 1;
    min-width: 250px;
}

.csn-search input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.csn-search input:focus {
    outline: none;
    border-color: #116914;
    box-shadow: 0 0 0 3px rgba(17, 105, 20, 0.1);
}

/* ===================================
   CATEGORY FILTER
   =================================== */

.csn-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.csn-filter-btn {
    padding: 10px 20px;
    border: 2px solid #20342E; /* Brand: Mid Green */
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #20342E; /* Brand: Mid Green */
}

.csn-filter-btn:hover {
    background: #F3F8F7; /* Brand: Pale Honeydew */
    border-color: #116914; /* Brand: Green */
    color: #116914; /* Brand: Green */
    transform: translateY(-2px);
}

.csn-filter-btn.active {
    background: #116914; /* Brand: Green */
    color: white;
    border-color: #116914; /* Brand: Green */
}

/* ===================================
   CARD CONTENT & STRUCTURE
   =================================== */

.csn-card-content {
    padding: 60px 30px 40px 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* min-height: 350px; REMOVED: Let content determine height */
    height: auto;
}

.csn-card-back .csn-card-content {
    padding: 40px 30px 30px 30px;
}

.csn-card-icon {
    font-size: 48px;
    margin-bottom: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.csn-card-heading {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
}

.csn-card-html {
    line-height: 1.6;
    font-size: 15px;
    width: 100%;
    font-weight: normal;
}

.csn-card-html strong,
.csn-card-html b {
    font-weight: bold;
    display: inline;
    line-height: inherit;
}

.csn-card-html p {
    margin-bottom: 15px;
}

.csn-card-html p:last-child {
    margin-bottom: 0;
}

.csn-card-html h1,
.csn-card-html h2,
.csn-card-html h3,
.csn-card-html h4,
.csn-card-html h5,
.csn-card-html h6 {
    margin-bottom: 10px;
    margin-top: 10px;
}

.csn-card-html a {
    text-decoration: underline;
    transition: opacity 0.3s ease;
}

.csn-card-html a:hover {
    opacity: 0.8;
}

.csn-card-html ul,
.csn-card-html ol {
    text-align: left;
    margin: 15px 0;
    padding-left: 30px;
    color: inherit; /* Inherit text color from parent */
}

.csn-card-html li {
    margin-bottom: 8px;
    color: inherit; /* Inherit text color from parent */
}

/* Make sure list bullets/numbers inherit color */
.csn-card-html ul li::marker,
.csn-card-html ol li::marker {
    color: inherit;
}

/* Make links inside lists inherit or use specified color */
.csn-card-html ul a,
.csn-card-html ol a,
.csn-card-html li a {
    color: inherit;
    text-decoration: underline;
}

/* Handle strong tags in both front and back card content */
.csn-card-front-v2 strong,
.csn-card-back-v2 strong,
.csn-card-front-v2 b,
.csn-card-back-v2 b,
.csn-card-content strong,
.csn-card-content b {
    font-weight: bold;
    display: inline;
    line-height: inherit;
}

/* ===================================
   BADGES & FEATURED STAR
   =================================== */

.csn-featured-star {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 28px;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: csn-pulse 2s ease-in-out infinite;
}

@keyframes csn-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.csn-top-right-badges {
    position: relative; /* FIXED: Changed from absolute to relative */
    right: 0px; /* ADDED: Align to right */
    z-index: 10;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px; /* ADDED: Space below badges */
    max-width: 100%; /* ADDED: Full width */
    flex-wrap: wrap;
}

.csn-badge {
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 42px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    margin: 0;
    flex-shrink: 0;
    display: inline-block;
}

.csn-category-badge {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 42px;
    white-space: nowrap;
    margin: 0;
    flex-shrink: 0;
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ===================================
   BUTTONS & LINKS
   =================================== */

.csn-flip-link {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    color: inherit;
}

.csn-flip-link:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.csn-button {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid white;
    color: inherit;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.csn-button:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ===================================
   FLIP SIDE IMAGES
   =================================== */

.csn-flip-images-grid {
    width: 100%;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .csn-flip-images-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

.csn-flip-image-item {
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.csn-flip-images-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.csn-flip-images-grid img:hover {
    transform: scale(1.05);
}

.csn-single-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.csn-single-image img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center;
    border-radius: 8px;
}

/* ===================================
   SIMPLE SLIDER (for multiple images)
   =================================== */

.csn-simple-slider {
    position: relative;
    width: 100%;
    height: 200px !important;
    min-height: 200px !important;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 8px;
}

.csn-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csn-slide.active {
    opacity: 1;
    z-index: 1;
}

.csn-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center;
    border-radius: 8px;
    background: #f5f5f5;
}

/* Slider Navigation Buttons */
.csn-slider-prev,
.csn-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.csn-slider-prev:hover,
.csn-slider-next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.csn-slider-prev {
    left: 10px;
}

.csn-slider-next {
    right: 10px;
}

/* Slider Dots */
.csn-slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.csn-slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.csn-slider-dot.active {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

.csn-slider-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

/* ===================================
   IMAGE CONTAINER (Front side)
   =================================== */

.csn-image-container {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
    margin-top: 5px;
}

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

/* ===================================
   LOADING & NO RESULTS STATES
   =================================== */

.csn-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.csn-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.csn-no-results-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.csn-no-results-text {
    font-size: 18px;
    font-weight: 600;
}

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

@media (max-width: 768px) {
    .csn-controls {
        flex-direction: column;
    }
    
    .csn-search {
        width: 100%;
    }
    
    .csn-filter {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .csn-card-content {
        /* min-height: 300px; REMOVED: Let JavaScript determine height on mobile too */
        padding: 60px 20px 20px 20px;
    }
    
    .csn-card-icon {
        font-size: 36px;
    }
    
    .csn-card-heading {
        font-size: 20px;
    }
}

/* ===================================
   REDUCED MOTION SUPPORT
   =================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
