/**
 * Product Related Sections Styles
 * For Herbomarais Child Theme
 *
 * Matches the PDL (Product Description Layout) design system:
 * - Colors: #7a9a6a (green), #f8f7f4 (background), #ede8e0 (borders)
 * - Typography: Uppercase labels, readable body text
 * - Border radius: 12px for cards
 *
 * @package Herbomarais_Child
 * @version 1.0.0
 */

/* ========================================
   SECTION CONTAINERS
   ======================================== */

.hbr-similar-products,
.hbr-related-articles {
    margin: 3em 0 2em;
    padding: 0;
}

.hbr-section-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5em;
    text-align: center;
    letter-spacing: 0.02em;
}

/* ========================================
   SIMILAR PRODUCTS GRID
   ======================================== */

.hbr-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5em;
    margin: 0;
}

.hbr-product-card {
    background: #fff;
    border: 1px solid #ede8e0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hbr-product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.hbr-product-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    padding: 1.25em;
}

.hbr-product-image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f7f4;
    margin-bottom: 1em;
}

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

.hbr-product-card:hover .hbr-product-image img {
    transform: scale(1.05);
}

.hbr-product-name {
    font-size: 1em;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.5em 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hbr-product-attribute {
    font-size: 0.88em;
    color: #666;
    margin: 0 0 0.75em 0;
    line-height: 1.5;
    font-style: italic;
}

.hbr-product-price {
    font-size: 1.1em;
    font-weight: 700;
    color: #5a7a4a;
    margin: 0 0 1em 0;
}

.hbr-product-button {
    margin-top: auto;
    display: inline-block;
    padding: 0.6em 1.2em;
    background: #5a7a4a;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.2s ease;
}

.hbr-product-card:hover .hbr-product-button {
    background: #4a6a3a;
}

/* ========================================
   RELATED ARTICLES GRID
   ======================================== */

.hbr-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2em;
    margin: 0;
}

.hbr-article-card {
    background: #fff;
    border: 1px solid #ede8e0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hbr-article-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.hbr-article-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.hbr-article-thumbnail {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f8f7f4;
}

.hbr-article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hbr-article-card:hover .hbr-article-thumbnail img {
    transform: scale(1.05);
}

.hbr-article-title {
    font-size: 1.05em;
    font-weight: 700;
    color: #1a1a1a;
    margin: 1.25em 1em 0.5em 1em;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hbr-article-excerpt {
    font-size: 0.93em;
    color: #555;
    margin: 0 1em 1em 1em;
    line-height: 1.6;
    flex-grow: 1;
}

.hbr-article-button {
    display: inline-block;
    padding: 0.6em 1em;
    margin: 0 1em 1.25em 1em;
    color: #5a7a4a;
    font-weight: 600;
    font-size: 0.88em;
    text-align: center;
    border-radius: 6px;
    background: #f0f4ee;
    transition: background 0.2s ease;
}

.hbr-article-card:hover .hbr-article-button {
    background: #e4efe0;
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */

@media (max-width: 1024px) {
    .hbr-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25em;
    }

    .hbr-articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5em;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 600px) {
    .hbr-section-title {
        font-size: 1.3em;
        text-align: left;
    }

    .hbr-similar-products,
    .hbr-related-articles {
        margin: 2em 0;
    }

    /* Similar Products - 2 per row on mobile */
    .hbr-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1em;
    }

    .hbr-product-link {
        padding: 1em;
    }

    .hbr-product-name {
        font-size: 0.95em;
    }

    .hbr-product-price {
        font-size: 1em;
    }

    .hbr-product-button {
        font-size: 0.85em;
        padding: 0.5em 1em;
    }

    /* Related Articles - 1 per row on mobile */
    .hbr-articles-grid {
        grid-template-columns: 1fr;
        gap: 1.25em;
    }

    .hbr-article-title {
        margin: 1em 1em 0.5em 1em;
    }

    .hbr-article-excerpt {
        margin: 0 1em 1em 1em;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus visible for keyboard navigation */
.hbr-product-link:focus-visible,
.hbr-article-link:focus-visible {
    outline: 3px solid #5a7a4a;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .hbr-product-card,
    .hbr-article-card,
    .hbr-product-image img,
    .hbr-article-thumbnail img,
    .hbr-product-button,
    .hbr-article-button {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hbr-product-card,
    .hbr-article-card {
        border-width: 2px;
    }

    .hbr-product-button,
    .hbr-article-button {
        background: #1a1a1a;
        color: #fff;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .hbr-similar-products,
    .hbr-related-articles {
        page-break-inside: avoid;
    }

    .hbr-product-button,
    .hbr-article-button {
        display: none;
    }
}
