/*
 * ProcessWire integration styles.
 * Complements style.css / responsive.css from the front-end package (do not edit those here).
 * Mostly: rich text coming from CKEditor, form states, listings, small CMS-only components.
 */

[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* style.css uses root-absolute /assets/ urls (static HTML package); re-point them to the template assets folder */
.message-ceo-body { background-image: url("../img/pasha-layer.svg"); }
.csr-articles_filter select,
.news-filter select { background-image: url("../svg/arrow-bottom-select.svg"); }

/* style.css asks for "Exemplar TRIAL" (only installed on the designer's machine); use the bundled @font-face family */
.development-path-slide .quote { font-family: "Exemplar", serif; }

/* group structure blocks are link targets from the home slider: keep them clear of the fixed header */
.group-company_item { scroll-margin-top: 120px; }

/* CMS-uploaded logos (often SVG without intrinsic size): keep them inside their boxes */
.our-companies_item img,
.content-partner .items .item img { max-width: 100%; max-height: 56px; width: auto; height: auto; object-fit: contain; }
/* Group structure: logo files carry their Figma size (width/height attributes), show them 1:1.
   Several Figma logos are photos with a white background: multiply blends it into the grey tile. */
.company-item_body_item img { width: auto; height: auto; max-width: 100%; max-height: 60px; object-fit: contain; mix-blend-mode: multiply; }
.group-vacancies_item img { max-width: 100%; object-fit: contain; }
.company-item_head img { width: auto; height: auto; max-width: 100%; max-height: 56px; aspect-ratio: auto; object-fit: contain; }
.company-item_body .title img { max-height: 40px; width: auto; max-width: 160px; object-fit: contain; }
.history-item_brand img { object-fit: contain; }
.portfolio-slide_logo { max-height: 51px; object-fit: contain; object-position: left center; }
.content-partner .items .item .image { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.message-ceo-body .image img { object-fit: cover; }
/* CMS photos have different ratios: lock the card to the design size (321x380) */
@media (min-width: 1025px) {
    .management-board-team .image { flex: 0 0 329px; width: 329px; }
    .management-board-team .image img { display: block; width: 100%; height: 380px; object-fit: cover; object-position: center top; }
    .management-board-team .text { flex: 1 1 auto; min-width: 0; }
}

/* ---------- rich text (CKEditor content) ---------- */
.rich-text { display: flex; flex-direction: column; gap: 12px; color: var(--Text, #70706F); font-family: var(--second-font), sans-serif; font-size: 16px; line-height: 24px; font-feature-settings: 'ss01' on; }
.rich-text > * { margin: 0; }
.rich-text p, .rich-text li { color: var(--Text, #70706F); font-family: var(--second-font), sans-serif; font-size: 16px; line-height: 24px; }
.rich-text h2, .rich-text h3, .rich-text h4, .rich-text h5 { color: var(--Title, #333); font-weight: 400; margin-top: 12px; }
.rich-text h2 { font-size: 32px; line-height: 40px; font-weight: 300; }
.rich-text h3 { font-size: 24px; line-height: 32px; }
.rich-text h4 { font-size: 20px; line-height: 28px; }
.rich-text strong, .rich-text b { color: var(--Title, #333); font-weight: 500; }
.rich-text ul, .rich-text ol { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.rich-text a { color: var(--Primary, #007658); text-decoration: underline; text-underline-offset: 2px; }
.rich-text img { max-width: 100%; height: auto; border-radius: 8px; }
.rich-text iframe, .rich-text video { max-width: 100%; width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: 8px; }
.rich-text table { width: 100%; border-collapse: collapse; font-size: 15px; }
.rich-text table td, .rich-text table th { border: 1px solid var(--Stroke, #E4E4E4); padding: 10px 12px; text-align: left; vertical-align: top; }
.rich-text blockquote { border-left: 3px solid var(--Primary, #007658); padding-left: 16px; color: var(--Title, #333); }
.content-inner .text .desc.rich-text { gap: 12px; }

/* content page title when there is no hero */
.content-inner .page-title { color: var(--Title, #333); font-size: 48px; font-weight: 300; line-height: 56px; margin-bottom: 24px; }
.content-inner .article-meta { display: flex; align-items: center; gap: 16px; margin-top: 16px; color: var(--Text, #70706F); font-family: var(--second-font), sans-serif; font-size: 14px; }
.content-inner .back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--Primary, #007658); font-family: var(--second-font), sans-serif; font-size: 14px; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 24px; }
.content-inner .back-link svg { transform: rotate(90deg); }
.content-inner .text + .rich-text, .content-inner .block { margin-top: 32px; }
.content.no-hero { padding-top: 180px; }

/* gallery under articles */
.article-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 40px; }
.article-gallery a { display: block; aspect-ratio: 4/3; overflow: hidden; border-radius: 8px; }
.article-gallery img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.article-gallery a:hover img { transform: scale(1.04); }

/* prev / next navigation */
.article-nav { display: flex; justify-content: space-between; gap: 24px; margin-top: 60px; padding-top: 32px; border-top: 1px solid var(--Stroke, #E4E4E4); }
.article-nav a { display: flex; flex-direction: column; gap: 6px; max-width: 45%; color: var(--Title, #333); font-family: var(--second-font), sans-serif; }
.article-nav a span { color: var(--Text, #70706F); font-size: 13px; text-transform: uppercase; }
.article-nav a.next { text-align: right; margin-left: auto; }

/* listings */
.listing-empty { color: var(--Text, #70706F); font-family: var(--second-font), sans-serif; padding: 40px 0; }
.news-filter form, .csr-articles_filter form { display: contents; }

/* ---------- forms ---------- */
.form-cell.is-error input, .form-cell.is-error select, .form-cell.is-error textarea, .is-error .radio-pill { border-color: #D92D20 !important; }
.form-message { margin-top: 16px; padding: 12px 16px; border-radius: 8px; background: #FEF3F2; color: #B42318; font-family: var(--second-font), sans-serif; font-size: 14px; }
.form-message.is-success { background: #ECFDF3; color: #027A48; }
.form-success { padding: 40px 0; }
.form-success h2 { color: var(--Title, #333); font-size: 32px; font-weight: 300; }
.form-success p { margin-top: 12px; color: var(--Text, #70706F); font-family: var(--second-font), sans-serif; }
button[type="submit"][disabled] { opacity: .6; pointer-events: none; }
.other-field { display: block; width: 100%; max-width: 420px; margin-top: 12px; padding: 20px 24px; border: none; outline: none; background: #fff; font-family: var(--second-font), sans-serif; font-size: 14px; line-height: 20px; color: var(--Title, #333); }
.other-field::placeholder { color: #A8A8A8; opacity: 1; }
.other-field[hidden] { display: none; }

/* ---------- leadership "read more" ---------- */
.leadership .item .more { margin-top: 16px; }
.leadership .item .more ul { padding-left: 18px; }

/* ---------- management: grouped person cards ---------- */
.management-board-team .text .desc .rich-text ul { padding-left: 18px; }

/* ---------- video dialog ---------- */
.video-dialog { border: 0; padding: 0; background: transparent; width: min(1100px, 92vw); max-width: none; overflow: visible; }
.video-dialog::backdrop { background: rgba(0, 0, 0, .8); }
.video-dialog_body { aspect-ratio: 16/9; background: #000; border-radius: 8px; overflow: hidden; }
.video-dialog_body iframe, .video-dialog_body video { width: 100%; height: 100%; border: 0; display: block; }
.video-dialog_close { position: absolute; top: -44px; right: 0; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fff; color: #333; font-size: 24px; line-height: 1; cursor: pointer; }
[data-video] { cursor: pointer; }

/* ---------- search ---------- */
.search-form { display: flex; gap: 12px; margin: 24px 0 40px; }
.search-form input { flex: 1; height: 52px; padding: 0 20px; border: 1px solid var(--Stroke, #E4E4E4); border-radius: 0; background: #fff; outline: none; font: inherit; font-family: var(--second-font), sans-serif; }
.search-results { display: flex; flex-direction: column; gap: 24px; }
.search-results a h3 { color: var(--Title, #333); font-size: 22px; font-weight: 400; }
.search-results p { margin-top: 6px; color: var(--Text, #70706F); font-family: var(--second-font), sans-serif; font-size: 15px; }

/* ---------- article detail: content-width photo / inline video ---------- */
.article-media { position: relative; margin: 32px 0; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; background: #F4F4F4; }
.article-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.article-media.article-video { cursor: pointer; }
.article-media .icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border: 0; border-radius: 50%; background: #fff; color: var(--Title, #333); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.article-media iframe, .article-media video { display: block; width: 100%; height: 100%; border: 0; background: #000; }

/* ---------- 404 ---------- */
.error-page .news-body { padding-bottom: 80px; }
.error-page .error-text { margin-top: 24px; max-width: 640px; color: var(--Text, #70706F); font-family: var(--second-font), sans-serif; font-size: 18px; line-height: 28px; }
.error-page .search-form { max-width: 640px; margin: 48px 0 24px; }
.search-page .search-form { margin: 56px 0 16px; }
.search-page .news_item > .text:nth-child(2):last-child { max-width: 800px; }
.search-page .section-title h1 { word-break: break-word; }
@media (max-width: 1024px) {
    .search-page .search-form { margin-top: 32px; }
}

@media (max-width: 1024px) {
    .content.no-hero { padding-top: 120px; }
    .content-inner { padding: 0 20px; }
    .content-inner .page-title { font-size: 32px; line-height: 40px; }
    .article-nav { flex-direction: column; }
    .article-nav a { max-width: 100%; }
    .article-nav a.next { text-align: left; margin-left: 0; }
}

/* ---------- header search: icon next to the language switcher, input opens below ---------- */
.header-search { position: relative; display: inline-flex; }
.header-search_toggle { display: inline-flex; padding: 0; border: 0; background: none; cursor: pointer; }
.theme-dark .header-search_toggle { color: var(--Title, #333); }
.theme-light .header-search_toggle { color: #FAFAFA; }
.header-search_form { position: absolute; top: calc(100% + 18px); right: -12px; z-index: 30; width: 360px; }
.header-search_form[hidden] { display: none; }
.header-search_form input { width: 100%; height: 52px; padding: 0 20px; border: 1px solid var(--Stroke, #E4E4E4); border-radius: 0; outline: none; background: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .08); font-family: var(--second-font), sans-serif; font-size: 14px; color: var(--Title, #333); }
.header-search_form input::placeholder { color: #A8A8A8; }
.mobile-menu_search { padding: 0 20px 16px; }
.mobile-menu_search input { width: 100%; height: 48px; padding: 0 16px; border: 1px solid var(--Stroke, #E4E4E4); outline: none; background: #fff; font-family: var(--second-font), sans-serif; font-size: 14px; color: var(--Title, #333); }

/* ---------- AZ/EN stable alignment: columns must not depend on text length ---------- */
/* news & search list: fixed date column, title always starts at the same x */
.news_item { grid-template-columns: 160px minmax(0, 1fr) 330px; }
.news_item > .text:nth-child(2):last-child { grid-column: 2 / -1; }
/* CEO message: photo stays centred even when the role line is wider than the photo */
.message-ceo-body_inner .image { display: flex; flex-direction: column; align-items: center; }
.message-ceo-body_inner .image img { display: block; object-fit: cover; }
/* management board: group heading column has a fixed width, cards line up in every group/language */
@media (min-width: 1025px) {
    .management-board_item > h2 { flex: 0 0 200px; }
    .management-board-teams { flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 767px) {
    .news_item { grid-template-columns: minmax(0, 1fr); }
    .news_item .text, .news_item .text h2, .news_item .text p { min-width: 0; overflow-wrap: anywhere; }
    .news_item .image img { width: 100%; height: auto; }
    .news_item > .text:nth-child(2):last-child { grid-column: auto; }
}

/* ---------- basic page (COP29): green hero + rich text with tables ---------- */
.content.basic-page { padding: 80px 0 100px; }
.rich-text table { width: 100% !important; border-collapse: collapse; margin: 0 0 24px; font-family: var(--second-font), sans-serif; font-size: 15px; line-height: 22px; color: var(--Title, #333); }
.rich-text table td, .rich-text table th { padding: 14px 16px; border: 0; border-bottom: 1px solid var(--Stroke, #E4E4E4); text-align: left; vertical-align: top; }
.rich-text table tr:first-child td, .rich-text table th { color: var(--Text, #70706F); font-size: 14px; border-bottom-color: var(--Title, #333); }
.rich-text table tr:not(:first-child):hover td { background: rgba(228, 228, 228, .35); }
@media (max-width: 767px) {
    .content.basic-page { padding: 40px 0 60px; }
    .rich-text table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* header: items with a dropdown are not links */
.nav > ul > li > a:not([href]) { cursor: default; }
/* COP29 / basic page: centred title like the CEO page */
.basic-page-hero .section-title h1 { text-align: center !important; margin: 0 auto; }
/* search page: button same height as the input */
.search-form input, .header-search_form input, .mobile-menu_search input { -webkit-appearance: none; appearance: none; box-sizing: border-box; margin: 0; }
.search-form input::-webkit-search-decoration { -webkit-appearance: none; }
.search-form { align-items: stretch; }
.search-form .btn { box-sizing: border-box; height: 52px; margin: 0; padding: 0 28px; flex: 0 0 auto; }
@media (min-width: 768px) and (max-width: 1024px) {
    .news_item { grid-template-columns: 130px minmax(0, 1fr) 220px; }
}
/* management board: "read more" keeps its own width (design size), not stretched by the flex column */
.management-board-team .text .action { align-self: flex-start; }
.management-board-team .text .action .btn { display: inline-flex; }
/* leadership DNA: button disappears once the text is open */
.leadership .item.is-expanded .action { display: none; }
.leadership .desc.more:focus { outline: none; }
