/**
 * Media Page Frontend Styles
 * 2-column layout, breadcrumb, callout tips, sidebar, promo badges
 * Clean design that inherits from theme
 */

/* ========================================
    Container
   ======================================== */
.dpwp-media-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 40px;
}

/* ========================================
    Breadcrumb
   ======================================== */
.dpwp-breadcrumb {
    margin-bottom: 24px;
    font-size: 0.85em;
}

.dpwp-breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

.dpwp-breadcrumb li {
    display: flex;
    align-items: center;
}

.dpwp-breadcrumb li:not(:last-child)::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid rgba(0, 0, 0, 0.35);
    border-top: 1.5px solid rgba(0, 0, 0, 0.35);
    transform: rotate(45deg);
    margin: 0 10px;
    flex-shrink: 0;
}

.dpwp-breadcrumb a {
    color: var(--dpwp-accent-color, #2271b1);
    text-decoration: none;
}

.dpwp-breadcrumb a:hover {
    text-decoration: underline;
}

.dpwp-breadcrumb .current {
    opacity: 0.6;
}

/* ========================================
    Header
   ======================================== */
.dpwp-media-page-header {
    text-align: center;
    margin-bottom: 32px;
}

.dpwp-media-page-title {
    margin-bottom: 12px;
}

.dpwp-image-meta {
    font-size: 0.9em;
    opacity: 0.65;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ========================================
    2-Column Layout
   ======================================== */
.dpwp-media-page-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

.dpwp-media-page-main {
    min-width: 0;
}

/* ========================================
    Main Image
   ======================================== */
.dpwp-media-page-image-wrapper {
    margin-bottom: 24px;
}

.dpwp-media-page-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

/* ========================================
    Description Section
   ======================================== */
.dpwp-media-description {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.dpwp-media-description h2 {
    font-size: 1.35em;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dpwp-media-description p {
    line-height: 1.7;
    margin-bottom: 16px;
}

/* ========================================
    Tips Callout Block (inside the_content)
   ======================================== */
.dpwp-tips-callout {
    background: rgba(var(--dpwp-accent-rgb, 34, 113, 177), 0.05);
    border: 1px solid rgba(var(--dpwp-accent-rgb, 34, 113, 177), 0.12);
    border-left: 4px solid var(--dpwp-accent-color, #2271b1);
    border-radius: 8px;
    padding: 28px 28px 20px;
    margin-top: 8px;
}

.dpwp-tips-title {
    font-size: 1.15em;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
}

.dpwp-tips-title-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232271b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a7 7 0 0 1 4 12.7V17a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1v-2.3A7 7 0 0 1 12 2z'/%3E%3Cline x1='9' y1='21' x2='15' y2='21'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.dpwp-tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dpwp-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dpwp-tip:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dpwp-tip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    margin-top: 1px;
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: center;
}

.dpwp-tip-text {
    flex: 1;
    line-height: 1.6;
    padding-top: 3px;
}

/* Tip type: conseil (advice) — lightbulb */
.dpwp-tip--conseil .dpwp-tip-icon {
    background-color: rgba(251, 191, 36, 0.15);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a7 7 0 0 1 4 12.7V17a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1v-2.3A7 7 0 0 1 12 2z'/%3E%3Cline x1='9' y1='21' x2='15' y2='21'/%3E%3C/svg%3E");
}

/* Tip type: astuce (trick) — star */
.dpwp-tip--astuce .dpwp-tip-icon {
    background-color: rgba(139, 92, 246, 0.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/%3E%3C/svg%3E");
}

/* Tip type: avantage (benefit) — check */
.dpwp-tip--avantage .dpwp-tip-icon {
    background-color: rgba(16, 185, 129, 0.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

/* Tip type: mesure (measurement) — ruler */
.dpwp-tip--mesure .dpwp-tip-icon {
    background-color: rgba(59, 130, 246, 0.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 3L3 21'/%3E%3Cpath d='M21 3v6'/%3E%3Cpath d='M21 3h-6'/%3E%3Cpath d='M3 21v-6'/%3E%3Cpath d='M3 21h6'/%3E%3C/svg%3E");
}

/* Tip type: entretien (maintenance) — wrench */
.dpwp-tip--entretien .dpwp-tip-icon {
    background-color: rgba(107, 114, 128, 0.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E");
}

/* Tip type: style (design/deco) — palette */
.dpwp-tip--style .dpwp-tip-icon {
    background-color: rgba(236, 72, 153, 0.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23db2777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='13.5' cy='6.5' r='0.5' fill='%23db2777'/%3E%3Ccircle cx='17.5' cy='10.5' r='0.5' fill='%23db2777'/%3E%3Ccircle cx='8.5' cy='7.5' r='0.5' fill='%23db2777'/%3E%3Ccircle cx='6.5' cy='12.5' r='0.5' fill='%23db2777'/%3E%3Cpath d='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.93 0 1.5-.63 1.5-1.5 0-.39-.15-.74-.39-1.02-.24-.28-.38-.63-.38-1.02 0-.83.67-1.5 1.5-1.5H16c3.31 0 6-2.69 6-6 0-5.17-4.03-9-10-9z'/%3E%3C/svg%3E");
}

/* ========================================
    Tags
   ======================================== */
.dpwp-media-tags {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.dpwp-media-tags h3 {
    font-size: 1.1em;
    margin-bottom: 12px;
    opacity: 0.8;
}

.dpwp-tag-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dpwp-tag-list li a {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.05);
    color: inherit;
    transition: background 0.2s;
}

.dpwp-tag-list li a:hover {
    background: rgba(var(--dpwp-accent-rgb, 34, 113, 177), 0.12);
    color: var(--dpwp-accent-color, #2271b1);
}

/* ========================================
    Reference Card (Product / Article)
   ======================================== */
.dpwp-media-reference {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.dpwp-media-reference h3 {
    font-size: 1.05em;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.dpwp-reference-card,
.dpwp-product-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.reference-thumbnail,
.product-thumbnail {
    position: relative;
    flex-shrink: 0;
}

.reference-thumbnail img,
.product-thumbnail img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
}

.reference-content,
.product-content {
    flex: 1;
    min-width: 0;
}

.reference-content h4,
.product-content h4 {
    margin: 0 0 6px 0;
    font-size: 1.15em;
}

.reference-content h4 a,
.product-content h4 a {
    text-decoration: none;
}

.reference-excerpt,
.product-description {
    font-size: 0.93em;
    opacity: 0.75;
    margin-bottom: 8px;
    padding: 0;
    line-height: 1.5;
}

.reference-meta {
    font-size: 0.85em;
    opacity: 0.55;
    margin-bottom: 8px;
}

/* Price styling */
.product-price {
    margin-bottom: 8px;
    font-size: 1.05em;
}

.dpwp-price-old {
    text-decoration: line-through;
    opacity: 0.5;
    font-size: 0.9em;
}

.dpwp-price-new {
    color: #dc2626;
    font-weight: 700;
}

/* Sale badge */
.dpwp-sale-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background: #dc2626;
    color: #fff;
    font-size: 0.72em;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    line-height: 1;
    z-index: 1;
}

.dpwp-sale-badge--small {
    font-size: 0.65em;
    padding: 2px 5px;
}

/* Stock */
.product-stock {
    font-size: 0.82em;
    margin-bottom: 8px;
}

.product-stock.in-stock {
    color: #059669;
}

.product-stock.out-of-stock {
    color: #dc2626;
}

/* Buttons */
.dpwp-read-more,
.dpwp-product-button {
    display: inline-block;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9em;
    color: var(--dpwp-accent-color, #2271b1);
    padding: 6px 16px;
    border: 1px solid var(--dpwp-accent-color, #2271b1);
    border-radius: 4px;
    transition: all 0.2s;
}

.dpwp-read-more:hover,
.dpwp-product-button:hover {
    background: var(--dpwp-accent-color, #2271b1);
    color: #fff;
    text-decoration: none;
}

/* ========================================
    Other Views (sibling images)
   ======================================== */
.dpwp-other-images {
    margin-bottom: 28px;
}

.dpwp-other-images h3 {
    font-size: 1.05em;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.dpwp-other-images-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.dpwp-sibling-link {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dpwp-sibling-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.dpwp-sibling-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

/* ========================================
    Sidebar
   ======================================== */
.dpwp-media-page-sidebar {
    position: sticky;
    top: 40px;
}

.dpwp-sidebar-section {
    margin-bottom: 28px;
}

.dpwp-sidebar-title {
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(var(--dpwp-accent-rgb, 34, 113, 177), 0.2);
}

.dpwp-sidebar-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dpwp-sidebar-card:last-child {
    border-bottom: none;
}

.dpwp-sidebar-thumb {
    flex-shrink: 0;
    position: relative;
}

.dpwp-sidebar-thumb img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

.dpwp-sidebar-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: #f0f0f0;
    border-radius: 4px;
    color: #999;
    text-decoration: none;
    font-size: 24px;
}

.dpwp-sidebar-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dpwp-sidebar-name {
    font-size: 0.88em;
    font-weight: 600;
    text-decoration: none;
    color: inherit;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.dpwp-sidebar-name:hover {
    color: var(--dpwp-accent-color, #2271b1);
}

.dpwp-sidebar-price {
    font-size: 0.85em;
    font-weight: 600;
}

.dpwp-sidebar-date {
    font-size: 0.8em;
    opacity: 0.55;
}

/* CTA button */
.dpwp-sidebar-cta {
    text-align: center;
}

.dpwp-cta-button {
    display: block;
    width: 100%;
    padding: 12px 24px;
    background: var(--dpwp-accent-color, #2271b1);
    color: #fff;
    text-decoration: none;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95em;
    transition: opacity 0.2s;
}

.dpwp-cta-button:hover {
    opacity: 0.9;
    color: #fff;
    text-decoration: none;
}

/* ========================================
   Comments
   ======================================== */
.dpwp-media-page-comments {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
    .dpwp-media-page-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .dpwp-media-page-sidebar {
        position: static;
        margin-top: 30px;
        padding-top: 30px;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }
}

@media (max-width: 600px) {
    .dpwp-media-page-container {
        padding: 20px 15px;
    }

    .dpwp-media-page-header {
        margin-bottom: 20px;
    }

    .dpwp-breadcrumb {
        font-size: 0.8em;
    }

    .dpwp-reference-card,
    .dpwp-product-card {
        flex-direction: column;
    }

    .reference-thumbnail img,
    .product-thumbnail img {
        width: 100%;
        height: auto;
        max-height: 200px;
    }

    .dpwp-other-images-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dpwp-sibling-img {
        height: 100px;
    }

    .dpwp-tips-callout {
        padding: 20px 18px 14px;
    }

    .dpwp-sidebar-thumb img {
        width: 60px;
        height: 60px;
    }
}