/**
 * PDP Sections - Database Content Styling
 *
 * @author Diploc IT-Services Team
 * @copyright Copyright (c) Diploc IT-Services (https://www.diploc.com)
 * @package Maatstudio_Base for Magento 2
 *
 * IMPORTANT: This CSS is for content that comes from the database
 * (CMS blocks, product attributes). DO NOT convert to Tailwind.
 *
 * The WYSIWYG editor applies these classes to content.
 *
 * CSS Variables available from tailwind.config.js :root:
 * - --color-maatstudio-blue
 * - --color-maatstudio-blue-dark
 * - --color-maatstudio-gray
 * - --color-maatstudio-gray-medium
 * - --color-maatstudio-gray-darker
 * - --color-maatstudio-gray-light-medium
 * - --color-maatstudio-gray-light-medium-dark
 * - --color-maatstudio-gray-dark-light
 * - --color-maatstudio-v2-cream-yellow
 */

/* ==========================================================================
   CMS Block: pdp_infoblock_right-of-withdrawal
   ========================================================================== */

.info-block .cms-content h4 {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 0.5em;
}

.info-block .cms-content p {
    font-size: 14px;
    line-height: 1.5;
}

/* ==========================================================================
   CMS Block: pdp_infoblock_questions
   ========================================================================== */

.info-block .contact-info a {
    color: var(--color-maatstudio-blue);
    text-decoration: underline;
}

.info-block .contact-info a:hover {
    color: var(--color-maatstudio-blue-dark);
}

/* ==========================================================================
   Tab Content - Database HTML styling
   General styles for content from WYSIWYG editor
   ========================================================================== */

.tab-content h2,
.tab-content h3,
.tab-content h4 {
    color: var(--color-maatstudio-gray-darker);
    margin-bottom: 0.5em;
}

.tab-content h2 {
    font-size: 22px;
    font-weight: 400;
}

.tab-content h3 {
    font-size: 18px;
    font-weight: 400;
}

.tab-content h4 {
    font-size: 16px;
    font-weight: 400;
}

.tab-content p {
    margin-bottom: 1em;
    line-height: 1.6;
}

.tab-content ul,
.tab-content ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.tab-content ul {
    list-style-type: disc;
}

.tab-content ol {
    list-style-type: decimal;
}

.tab-content li {
    margin-bottom: 0.25em;
    line-height: 1.5;
}

.tab-content img {
    max-width: 100%;
    height: auto;
}

.tab-content a {
    color: var(--color-maatstudio-blue);
    text-decoration: underline;
}

.tab-content a:hover {
    color: var(--color-maatstudio-blue-dark);
}

/* ==========================================================================
   Tables in tab content
   ========================================================================== */

.tab-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.tab-content table th,
.tab-content table td {
    border: 1px solid var(--color-maatstudio-gray-medium);
    padding: 0.5em 0.75em;
    text-align: left;
}

.tab-content table th {
    background: var(--color-maatstudio-gray-light-medium-dark);
    font-weight: bold;
}

.tab-content table tr:nth-child(even) td {
    background-color: var(--color-maatstudio-gray-light-medium);
}

/* ==========================================================================
   FAQ specific styling (database content often has this structure)
   Supports both .faq-question/.faq-answer AND .FAQQuestion/.FAQAnswer classes
   Matches LIVE site styling - no +/- icons, uses .show class for toggle
   ========================================================================== */

/* FAQ question styling - !important required to override:
   1. Tailwind prose plugin link styles (blue color, underline)
   2. Database inline styles that may be present on <a> tags */
.tab-content-faq .faq-question,
.tab-content-faq .FAQQuestion {
    font-weight: bold;
    margin-bottom: 0.5em;
    color: #333333 !important;
    cursor: pointer;
    text-decoration: none !important;
}

/* Hover state - !important to override prose link hover styles */
.tab-content-faq .faq-question:hover,
.tab-content-faq .FAQQuestion:hover {
    color: #333333 !important; /* No color change on hover */
}

/* Answer styling - hidden by default, shown with .show class (matches LIVE)
   Uses !important to override database inline display:none */
.tab-content-faq .faq-answer,
.tab-content-faq .FAQAnswer {
    margin-bottom: 1.5em;
    display: none !important;
    color: #333333;
}

.tab-content-faq .faq-answer.show,
.tab-content-faq .FAQAnswer.show {
    display: block !important;
}

/* ==========================================================================
   Technical details specific styling
   ========================================================================== */

.tab-content-techdetails dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5em 1em;
    margin-bottom: 1em;
}

.tab-content-techdetails dt {
    font-weight: 600;
    color: var(--color-maatstudio-gray-darker);
}

.tab-content-techdetails dd {
    margin: 0;
}

/* ==========================================================================
   Inspiration specific styling
   ========================================================================== */

.tab-content-inspiration .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1em;
}

.tab-content-inspiration .gallery img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* ==========================================================================
   Delivery/Warranty text styling in info cards
   ========================================================================== */

.delivery-costs-text,
.warranty-time-text {
    font-size: 14px;
    line-height: 1.5;
}

.delivery-costs-text p,
.warranty-time-text p {
    margin-bottom: 0.5em;
}

.delivery-costs-text p:last-child,
.warranty-time-text p:last-child {
    margin-bottom: 0;
}

/**
 * Inspiration tab — horizontal image grid (Email-2 #8c)
 *
 * Customer reported images stacking vertically in the Inspiratie tab.
 * Force inline images to lay out side-by-side with responsive columns.
 * Targets ALL <img> elements directly inside the tab content (whether
 * wrapped in <p> or standalone, common WYSIWYG output patterns).
 */
.tab-content-inspiration {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.tab-content-inspiration > * {
    flex: 1 1 100%;
}

.tab-content-inspiration img,
.tab-content-inspiration p > img,
.tab-content-inspiration figure {
    flex: 0 0 calc(50% - 0.5rem);
    max-width: calc(50% - 0.5rem);
    height: auto;
    object-fit: cover;
    margin: 0;
}

@media (min-width: 768px) {
    .tab-content-inspiration img,
    .tab-content-inspiration p > img,
    .tab-content-inspiration figure {
        flex: 0 0 calc(33.333% - 0.667rem);
        max-width: calc(33.333% - 0.667rem);
    }
}

.tab-content-inspiration p > img {
    display: inline-block;
    flex: none;
    max-width: 100%;
    vertical-align: baseline;
    margin: 0;
}

/* Headings, paragraphs without images, and full-text content keep full width */
.tab-content-inspiration h1,
.tab-content-inspiration h2,
.tab-content-inspiration h3,
.tab-content-inspiration h4,
.tab-content-inspiration h5,
.tab-content-inspiration h6 {
    flex: 1 1 100%;
    width: 100%;
}
