/* ============================================================
   Foxco Blog Posts Widget — foxco-blog-posts.css  v1.0.0
   ============================================================ */

/* ---------- Reset / Base ---------- */
.foxco-bp-wrap *,
.foxco-bp-wrap *::before,
.foxco-bp-wrap *::after {
    box-sizing: border-box;
}

.foxco-bp-no-posts {
    padding: 2em;
    text-align: center;
    opacity: .6;
}

/* ============================================================
   IMAGE WRAP — aspect-ratio technique
   ============================================================ */
.foxco-bp-image-wrap {
    display: block;
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: var(--foxco-bp-ratio, 56.25%);
    background: #eee;
}

.foxco-bp-image-wrap .foxco-bp-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.4s ease;
}

/* --- Hover Effects --- */
.foxco-img-hover-zoom:hover .foxco-bp-img  { transform: scale(1.07); }
.foxco-img-hover-fade:hover .foxco-bp-img  { opacity: .75; }
.foxco-img-hover-slide:hover .foxco-bp-img { transform: translateY(-6%); }

/* ============================================================
   LAYOUT: GRID
   ============================================================ */
.foxco-bp-grid {
    display: grid;
    grid-template-columns: repeat(var(--foxco-bp-cols, 3), 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .foxco-bp-grid { grid-template-columns: repeat(var(--foxco-bp-cols-tablet, 2), 1fr); }
}
@media (max-width: 767px) {
    .foxco-bp-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   LAYOUT: LIST
   ============================================================ */
.foxco-bp-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.foxco-bp-list .foxco-bp-item {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    border-bottom: 1px solid rgba(0,0,0,.1);
}

.foxco-bp-list .foxco-bp-item:last-child { border-bottom: none; }

.foxco-bp-list .foxco-bp-image-wrap {
    padding-top: 0;
    height: 100%;
    min-height: 200px;
}

.foxco-bp-list .foxco-bp-content {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 767px) {
    .foxco-bp-list .foxco-bp-item { grid-template-columns: 1fr; }
    .foxco-bp-list .foxco-bp-image-wrap { padding-top: 56.25%; height: auto; min-height: auto; }
}

/* ============================================================
   LAYOUT: MASONRY (CSS columns fallback)
   ============================================================ */
.foxco-bp-masonry {
    column-count: var(--foxco-bp-cols, 3);
    column-gap: 24px;
}

.foxco-bp-masonry .foxco-bp-item {
    break-inside: avoid;
    margin-bottom: 24px;
}

.foxco-bp-masonry .foxco-bp-image-wrap {
    padding-top: 0;
}

.foxco-bp-masonry .foxco-bp-image-wrap .foxco-bp-img {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
}

@media (max-width: 1024px) { .foxco-bp-masonry { column-count: 2; } }
@media (max-width: 767px)  { .foxco-bp-masonry { column-count: 1; } }

/* ============================================================
   LAYOUT: CARDS (Overlay)
   ============================================================ */
.foxco-bp-cards .foxco-bp-item {
    position: relative;
    overflow: hidden;
}

.foxco-bp-cards .foxco-bp-image-wrap {
    padding-top: 120%;
}

.foxco-bp-cards .foxco-bp-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 28px 24px 24px;
    background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,0) 100%);
    color: #fff;
    z-index: 2;
}

.foxco-bp-cards .foxco-bp-title a,
.foxco-bp-cards .foxco-bp-excerpt,
.foxco-bp-cards .foxco-bp-meta,
.foxco-bp-cards .foxco-bp-meta a { color: #fff; }

.foxco-bp-cards .foxco-bp-cat a { color: #fff; }

/* ============================================================
   LAYOUT: MAGAZINE (Hero + grid)
   ============================================================ */
.foxco-bp-magazine {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: var(--foxco-mag-gap, 24px);
}

.foxco-bp-magazine .foxco-bp-hero {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 0;
    overflow: hidden;
}

.foxco-bp-magazine .foxco-bp-hero .foxco-bp-image-wrap {
    padding-top: 0;
    height: 100%;
    min-height: 340px;
}

.foxco-bp-magazine .foxco-bp-hero .foxco-bp-content {
    padding: 36px 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #f7f7f7;
}

.foxco-bp-magazine .foxco-bp-hero .foxco-bp-title {
    font-size: 1.75em;
}

.foxco-bp-magazine .foxco-bp-item:not(.foxco-bp-hero) {
    grid-column: span 1;
}

@media (max-width: 900px) {
    .foxco-bp-magazine { grid-template-columns: 1fr; }
    .foxco-bp-magazine .foxco-bp-hero { grid-template-columns: 1fr; }
    .foxco-bp-magazine .foxco-bp-hero .foxco-bp-image-wrap { min-height: 240px; padding-top: 56.25%; height: auto; }
    .foxco-bp-magazine .foxco-bp-item:not(.foxco-bp-hero) { grid-column: span 1; }
}

/* ============================================================
   LAYOUT: MINIMAL / TEXT ONLY
   ============================================================ */
.foxco-bp-minimal {
    display: flex;
    flex-direction: column;
}

.foxco-bp-minimal .foxco-bp-item {
    display: flex;
    align-items: baseline;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(0,0,0,.1);
}

.foxco-bp-minimal .foxco-bp-item:first-child { border-top: 1px solid rgba(0,0,0,.1); }

.foxco-bp-minimal .foxco-bp-meta {
    flex-shrink: 0;
    min-width: 110px;
    font-size: 0.82em;
    opacity: .65;
}

.foxco-bp-minimal .foxco-bp-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.foxco-bp-minimal .foxco-bp-title { margin: 0; }
.foxco-bp-minimal .foxco-bp-excerpt { margin: 4px 0 0; }

.foxco-bp-minimal .foxco-bp-image-wrap { display: none; }

@media (max-width: 600px) {
    .foxco-bp-minimal .foxco-bp-item { flex-direction: column; gap: 6px; }
}

/* ============================================================
   CONTENT ELEMENTS — shared
   ============================================================ */
.foxco-bp-content {
    padding: 20px;
}

/* Category Badge */
.foxco-bp-cat {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 3px;
    background-color: #e63946;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.4;
}

.foxco-bp-cat a {
    color: inherit;
    text-decoration: none;
}

/* Title */
.foxco-bp-title {
    margin: 0 0 10px;
    line-height: 1.3;
    font-size: 1.1em;
}

.foxco-bp-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.25s ease;
}

.foxco-bp-title a:hover {
    color: #e63946;
}

/* Meta */
.foxco-bp-meta {
    font-size: 0.78em;
    opacity: .7;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.foxco-bp-meta a {
    color: inherit;
    text-decoration: none;
}

.foxco-bp-meta a:hover { text-decoration: underline; }

.foxco-bp-sep { opacity: .5; }

/* Excerpt */
.foxco-bp-excerpt {
    margin: 0 0 16px;
    font-size: 0.9em;
    line-height: 1.65;
    opacity: .85;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.foxco-bp-btn {
    display: inline-block;
    text-decoration: none;
    font-size: 0.83em;
    font-weight: 600;
    letter-spacing: .04em;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: auto;
    line-height: 1;
}

/* Filled */
.foxco-btn-filled {
    background-color: #e63946;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    border: 2px solid transparent;
}

.foxco-btn-filled:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    color: #fff;
}

/* Outline */
.foxco-btn-outline {
    background: transparent;
    padding: 9px 18px;
    border-radius: 4px;
    border: 2px solid currentColor;
}

.foxco-btn-outline:hover {
    background: currentColor;
}

/* Text Arrow */
.foxco-btn-text {
    padding: 0;
    background: transparent;
    border: none;
    color: #e63946;
}

.foxco-btn-text:hover {
    letter-spacing: .06em;
}

/* Underline */
.foxco-btn-underline {
    padding: 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid currentColor;
    padding-bottom: 2px;
    color: #e63946;
}

.foxco-btn-underline:hover { opacity: .75; }

/* ============================================================
   PAGINATION
   ============================================================ */
.foxco-bp-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 40px;
}

.foxco-bp-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,.15);
    text-decoration: none;
    font-size: 0.88em;
    color: inherit;
    transition: all .2s ease;
}

.foxco-bp-pagination .page-numbers.current,
.foxco-bp-pagination .page-numbers:hover {
    background: #e63946;
    border-color: #e63946;
    color: #fff;
}

/* ============================================================
   ANIMATIONS — Entrance
   ============================================================ */
@keyframes foxcoBpFadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

.foxco-bp-item {
    animation: foxcoBpFadeUp 0.5s ease both;
}

.foxco-bp-grid .foxco-bp-item:nth-child(1)  { animation-delay: 0.05s; }
.foxco-bp-grid .foxco-bp-item:nth-child(2)  { animation-delay: 0.12s; }
.foxco-bp-grid .foxco-bp-item:nth-child(3)  { animation-delay: 0.19s; }
.foxco-bp-grid .foxco-bp-item:nth-child(4)  { animation-delay: 0.26s; }
.foxco-bp-grid .foxco-bp-item:nth-child(5)  { animation-delay: 0.33s; }
.foxco-bp-grid .foxco-bp-item:nth-child(6)  { animation-delay: 0.40s; }
.foxco-bp-grid .foxco-bp-item:nth-child(n+7){ animation-delay: 0.45s; }

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
    .foxco-bp-item { animation: none; }
    .foxco-bp-image-wrap .foxco-bp-img { transition: none; }
}

/* ============================================================
   WOOCOMMERCE PRODUCT ELEMENTS
   ============================================================ */

/* Sale badge — absolute over image */
.foxco-bp-image-wrap {
    position: relative;
}

.foxco-bp-sale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    background-color: #e63946;
    color: #fff;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 3px;
    line-height: 1.4;
    pointer-events: none;
}

/* Price */
.foxco-bp-price {
    font-size: 1.05em;
    font-weight: 700;
    margin: 6px 0 10px;
    line-height: 1.3;
}

.foxco-bp-price del {
    opacity: .5;
    font-weight: 400;
    font-size: 0.88em;
    margin-right: 4px;
    text-decoration: line-through;
}

.foxco-bp-price ins {
    text-decoration: none;
}

/* Star rating */
.foxco-bp-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 1em;
    margin-bottom: 6px;
    line-height: 1;
}

.foxco-bp-rating .filled {
    color: #f4a700;
}

.foxco-bp-rating .empty {
    color: #ddd;
}

.foxco-bp-rating-count {
    font-size: 0.76em;
    opacity: .6;
    margin-left: 4px;
}

/* Stock badge */
.foxco-bp-stock {
    display: inline-block;
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 3px;
    margin-bottom: 8px;
}

.foxco-bp-stock-instock {
    background: #d4edda;
    color: #155724;
}

.foxco-bp-stock-outofstock {
    background: #f8d7da;
    color: #721c24;
}

.foxco-bp-stock-onbackorder {
    background: #fff3cd;
    color: #856404;
}

/* Add to Cart button */
.foxco-bp-atc {
    display: inline-block;
    background-color: #2c6fad;
    color: #fff;
    font-size: 0.83em;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease;
    margin-top: auto;
    line-height: 1;
    border: none;
}

.foxco-bp-atc:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
    color: #fff;
}

.foxco-bp-atc.loading {
    opacity: .7;
    pointer-events: none;
}

.foxco-bp-atc.added {
    background-color: #28a745;
}

/* Product card — push price + button to bottom */
.foxco-bp-product .foxco-bp-content {
    display: flex;
    flex-direction: column;
}

.foxco-bp-product .foxco-bp-price {
    margin-top: auto;
}
