/* cbrn-e.hu additions on top of the cbrne.cz theme (styles.css):
   components produced by the markdown shortcodes, the client-side search,
   the cookie banner, forms and the Hungarian-site-specific footer parts. */

/* ---- header: partner logo next to the CBRNe wordmark ---- */
.cbrne-brand .brand-partner { display: flex; align-items: center; }
.cbrne-brand img { width: 150px; }
.cbrne-header.scrolled .cbrne-brand img { width: 110px; }
.main-nav a.active { color: var(--primary-color); }

/* ---- header search (client-side, search-index.json) ---- */
.header-search-form.site-search { position: relative; flex-wrap: wrap; }
.site-search-status { flex-basis: 100%; color: var(--text-on-dark-muted); font-size: 13px; }
.site-search-status:empty { display: none; }
.site-search-results {
    flex-basis: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    background: var(--white);
    border-radius: 8px;
    max-height: 60vh;
    overflow: auto;
}
.site-search-results[data-open="true"] { display: block; }
.site-search-results li { border-bottom: 1px solid var(--border-color); }
.site-search-results li:last-child { border-bottom: 0; }
.site-search-results a,
.site-search-results li > small {
    display: block;
    padding: 10px 14px;
    color: var(--text-dark);
    text-decoration: none;
    line-height: 1.35;
}
.site-search-results a:hover,
.site-search-results a:focus-visible { background: var(--surface-download-hover); }
.site-search-results small { color: var(--text-light); }

/* ---- footer: Memtech primary, RMI as partner ---- */
.footer-brand img { width: 190px; }
.footer-partner {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-on-dark-subtle);
    font-size: 14px;
    line-height: 1.5;
}
.footer-partner-label {
    display: block;
    color: var(--text-on-dark-muted);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.footer-partner-logo { display: inline-block; }
.footer-partner-logo img {
    width: 110px;
    display: block;
    filter: grayscale(1) brightness(0) invert(1);
    margin-bottom: 8px;
}
.footer-partner-name { display: block; font-weight: 700; }
.footer-legal-links { margin-left: 14px; }
.footer-legal-links a { color: inherit; }
.footer-legal-links a:hover { color: var(--primary-color); }

/* ---- catalogue ---- */
.catalog-block-title {
    font-size: clamp(1.3rem, 2vw, 1.7rem);
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 22px;
}
.catalog-sectors { padding-top: 0; }
.catalog-empty { color: var(--text-light); }
.catalog-detail-sep { font-weight: 400; color: #c92a2a; }
.catalog-detail-cta { margin: 34px 0 0; }
.catalog-category-content p:last-child { margin-bottom: 0; }

/* product / article body written in markdown */
.product-body h2 { font-size: clamp(1.6rem, 2.45vw, 2.4rem); font-weight: 500; }
.product-body h3 { font-size: clamp(1.25rem, 1.8vw, 1.7rem); margin: 36px 0 16px; }
.product-body ol { margin: 0 0 30px; padding-left: 1.4em; }
.product-body ol li { padding-left: 4px; }
.product-body ol li::before { content: none; }
.product-body::after, .page-body::after { content: ""; display: block; clear: both; }
.article-content { padding-top: 10px; }
.newsletter-detail-cover img { max-height: 340px; width: auto; max-width: 100%; }

/* magazine cards reuse the product card */
.magazine-card .product-image img { object-fit: cover; width: 100%; height: 100%; }
.magazine-card .product-manufacturer { margin-bottom: 6px; }
.magazine-cover img { background: #fff; }

/* ---- downloads page ---- */
.downloads-group { margin-top: 38px; }
.downloads-group h2 { margin-bottom: 14px; }
.catalog-file-button.catalog-file-preview[href] { display: inline-grid; }

/* ---- markdown shortcodes: images, galleries, video, tables, buttons ---- */
.md-fig { margin: 22px auto 26px; max-width: 100%; }
.md-fig img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.md-fig figcaption, .md-gallery figcaption, .md-video figcaption, .md-table figcaption {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 8px;
    text-align: center;
}
.md-fig--center { text-align: center; }
.md-fig--left { float: left; max-width: 42%; margin: 6px 28px 18px 0; }
.md-fig--right { float: right; max-width: 42%; margin: 6px 0 18px 28px; }
.catalog-detail-richtext .md-fig img, .catalog-detail-richtext .md-gallery img { margin: 0 auto; }

.md-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
    margin: 24px 0 30px;
    clear: both;
}
.md-gallery__item {
    margin: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.md-gallery__item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform .25s ease;
}
.md-gallery__item img:hover { transform: scale(1.03); }
.md-gallery__item figcaption { padding: 8px 10px 10px; margin: 0; }

.md-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .86);
    padding: 24px;
}
.md-lightbox.is-open { display: flex; }
.md-lightbox img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 6px; }
.md-lightbox__close {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--text-controls);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.md-video { margin: 26px auto 30px; max-width: 860px; clear: both; }
.md-video__frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-md); overflow: hidden; }
.md-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.md-table { margin: 24px 0 30px; }
.table-wrap { overflow-x: auto; }
.md-table table, .product-body table { width: 100%; border-collapse: collapse; font-size: .95em; }
.md-table th, .md-table td, .product-body th, .product-body td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
}
.md-table th, .product-body th { background: var(--surface-gray-250); font-weight: 600; }
.md-table .right, .md-table .align-right { text-align: right; }
.md-table .center, .md-table .align-center { text-align: center; }

.md-cta { margin: 24px 0; clear: both; }
.md-cta--center { text-align: center; }
.md-cta--right { text-align: right; }
main a.btn, .text-content a.btn:not(.btn-outline), .catalog-detail-richtext a.btn:not(.btn-outline) {
    display: inline-flex;
    align-items: center;
    border-radius: 50px;
    padding: 10px 24px;
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: var(--text-controls);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s ease;
}
main a.btn:hover { background: var(--primary-hover); }
main .pill-button, main .outline-button { color: var(--text-controls); }
.text-content a.pill-button, .catalog-detail-richtext a.pill-button { color: var(--text-controls); }

/* ---- contact page ---- */
.contact-items { display: flex; gap: 30px; flex-wrap: wrap; margin: 30px 0; }
.contact-item { flex: 1 1 260px; }
.contact-item h3 { margin-top: 0; }
.partner-logo img { width: 150px; margin: 6px 0 14px; }
.page-body h2 { font-size: clamp(1.35rem, 2vw, 1.8rem); margin: 44px 0 18px; }
.page-body h3 { font-size: clamp(1.1rem, 1.5vw, 1.35rem); margin: 28px 0 12px; }
.page-body { font-size: clamp(0.95rem, 1.15vw, 1.08rem); line-height: 1.55; }
.page-body p { margin-bottom: 18px; }
.map-section iframe { display: block; border-radius: var(--radius-md); }
.not-found .outline-button { margin-left: 12px; }

/* ---- MiniCRM request form ---- */
.crm-form { max-width: 760px; margin-top: 26px; }
.crm-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 16px; }
.crm-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.crm-form .InputBlock { display: grid; gap: 6px; }
.crm-form label { font-weight: 600; font-size: 14px; color: var(--text-dark); }
.crm-form label.Required::after { content: " *"; color: var(--action-hover-color); }
.crm-form label h4 { display: inline; font-size: inherit; margin: 0; }
.crm-form input[type="text"], .crm-form input[type="email"], .crm-form input[type="tel"], .crm-form textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border-light);
    border-radius: 5px;
    background: var(--white);
    color: var(--text-dark);
    padding: 10px 12px;
    font: inherit;
}
.crm-form .SetLabel { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.crm-form .SetLabel::after, .crm-form .DataHandling > label::after { content: none; }
.crm-form input[type="Submit"], .crm-form input[type="submit"] { cursor: pointer; font: inherit; font-weight: 600; margin-top: 18px; padding: 10px 28px; }
.crm-form .Response { margin-top: 12px; }

/* ---- newsletter (Mailchimp) ---- */
.newsletter-form .newsletter-subscription-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.newsletter-form .pill-button { justify-self: start; cursor: pointer; font-family: inherit; margin-top: 0; }
.mc-status { margin-top: 12px; font-weight: 500; }
.mc-status--error { color: var(--action-hover-color); }
.mc-status--success { color: #1d7a3a; }
.newsletter-subscription-note a { color: inherit; }

/* ---- cookie banner ---- */
.cookie-consent {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1500;
    background: var(--surface-dark);
    color: var(--white);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, .25);
    padding: 16px 0;
}
.cookie-consent[hidden] { display: none; }
.cookie-consent__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cookie-consent__text { margin: 0; font-size: 14px; max-width: 760px; }
.cookie-consent__text a { color: var(--primary-color); }
.cookie-consent__actions { display: flex; gap: 12px; align-items: center; }
.cookie-consent__actions .pill-button, .cookie-consent__actions .outline-button { margin: 0; cursor: pointer; font-family: inherit; gap: 0; }
.cookie-consent__actions .outline-button { color: var(--white); background: transparent; }

@media (max-width: 760px) {
    .md-fig--left, .md-fig--right { float: none; max-width: 100%; margin: 20px auto; }
    .crm-row, .newsletter-form .newsletter-subscription-fields { grid-template-columns: 1fr; }
    .cbrne-brand img { width: 96px; }
    .footer-legal-links { display: block; margin: 6px 0 0; }
}

/* ---- home page fixes for longer Hungarian texts ---- */
.sector-card h2 { hyphens: auto; overflow-wrap: break-word; }
/* keep the featured product name clear of the overlapping product photo */
.featured-card > div { padding-top: 122px; }
