/*
Theme Name: TRUBA GeneratePress Child
Theme URI: https://www.truba.gov.tr/
Description: TRUBA institutional child theme built on GeneratePress; legacy Total visual baseline recreated without WPBakery.
Author: TRUBA / ULAKBIM
Template: generatepress
Version: 1.6.2
Text Domain: truba-generatepress-child
*/

:root {
    --truba-blue: #455b72;
    --truba-blue-dark: #394d61;
    --truba-text: #333333;
    --truba-muted: #777777;
    --truba-border: #e8e8e8;
    --truba-accent: #f3cb20;
    --truba-white: #ffffff;
    --truba-container: 980px;
}

html { scroll-behavior: smooth; }
body.truba-header-active { color: var(--truba-text); }

/* Legacy Total 3.6.0 container: 980px with responsive 90% width. */
.truba-container {
    width: 90%;
    max-width: var(--truba-container);
    margin-left: auto;
    margin-right: auto;
}

/* -------------------------------------------------------------------------
 * Top bar
 * ------------------------------------------------------------------------- */
.truba-topbar {
    width: 100%;
    min-height: 70px;
    background: #ffffff;
    color: #777777;
    font-size: 11px;
    line-height: 1.5;
    border-bottom: 1px solid #f0f0f0;
}

.truba-topbar .truba-container {
    min-height: 70px;
    padding-top: 7px;
    padding-bottom: 7px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.truba-topbar-contact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
}

.truba-topbar-contact > span,
.truba-topbar-contact > a {
    display: inline-block;
    margin-right: 20px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.truba-topbar-contact > span:last-child,
.truba-topbar-contact > a:last-child { margin-right: 0; }
.truba-topbar-contact a:hover { color: #333333; }

.truba-institutional-logo {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    text-decoration: none;
}

.truba-institutional-logo img {
    display: block;
    width: 365px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* -------------------------------------------------------------------------
 * Main header
 * ------------------------------------------------------------------------- */
.truba-site-header {
    position: relative;
    z-index: 10000;
    background: #ffffff;
}

.truba-main-header {
    position: relative;
    z-index: 10000;
    background: #ffffff;
    border-bottom: 1px solid var(--truba-border);
}

.truba-main-header .truba-container {
    position: relative;
    min-height: 138px;
    padding-top: 30px;
    padding-bottom: 30px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 16px;
}

.truba-brand {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.truba-brand img {
    display: block;
    width: 240px;
    max-width: 240px;
    height: auto;
    max-height: 78px;
    object-fit: contain;
}

/* Legacy Total header-one / navbar-style-one geometry. */
.truba-navigation {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.truba-navigation-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.truba-header-desktop-tools {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.truba-primary-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    list-style: none;
    margin: 0;
    padding: 0;
}

.truba-primary-menu > li {
    position: relative;
    margin: 0;
    padding: 0;
}

.truba-primary-menu > li > a {
    display: flex;
    align-items: center;
    height: 50px;
    line-height: 50px;
    padding: 0 8px;
    color: #555555;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    transition: color 160ms ease, background-color 160ms ease;
}

.truba-primary-menu > li > a:hover,
.truba-primary-menu > li.current-menu-item > a,
.truba-primary-menu > li.current_page_item > a {
    color: #222222;
}

.truba-primary-menu .sub-menu {
    display: none;
}

/* -------------------------------------------------------------------------
 * Polylang language switcher - mirrors old 16x11 flag treatment.
 * ------------------------------------------------------------------------- */
.truba-languages {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 2px;
}

.truba-languages ul {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.truba-languages li {
    margin: 0;
    padding: 0;
}

.truba-languages a {
    display: inline-flex;
    align-items: center;
    height: 24px;
    text-decoration: none;
    opacity: 0.72;
}

.truba-languages a:hover,
.truba-languages .current-lang a {
    opacity: 1;
}

.truba-languages img {
    display: block;
    width: 16px;
    height: 11px;
    object-fit: cover;
}

/* -------------------------------------------------------------------------
 * Search - legacy dropdown treatment.
 * ------------------------------------------------------------------------- */
.truba-search {
    position: relative;
    flex: 0 0 auto;
}

.truba-search-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 50px;
    padding: 0 4px 0 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #555555;
    font-size: 14px;
    cursor: pointer;
}

.truba-search-toggle:hover,
.truba-search-toggle:focus-visible {
    color: #222222;
    background: transparent;
}

.truba-search-toggle svg {
    width: 15px;
    height: 15px;
}

.truba-search-panel {
    position: absolute;
    top: 50px;
    right: 0;
    z-index: 10050;
    width: 260px;
    padding: 15px;
    box-sizing: border-box;
    background: #ffffff;
    border-top: 3px solid transparent;
    box-shadow: 0 2px 7px rgba(0,0,0,0.1);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.truba-search.is-open .truba-search-panel {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.truba-search-panel form {
    display: flex;
    gap: 5px;
    margin: 0;
}

.truba-search-panel input[type="search"] {
    width: 190px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #e4e4e4;
    background: #f7f7f7;
    font-size: 13px;
    box-sizing: border-box;
}

.truba-search-panel button[type="submit"] {
    width: 35px;
    height: 32px;
    padding: 0;
    border: 0;
    background: #f7f7f7;
    color: #555555;
    cursor: pointer;
    font-size: 12px;
}

.truba-search-panel button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.truba-search-panel button[type="submit"] svg {
    width: 15px;
    height: 15px;
}

.truba-mobile-tools {
    display: none;
}

.truba-mobile-languages ul {
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.truba-mobile-languages li { margin: 0; }

.truba-mobile-languages a {
    display: inline-flex;
    align-items: center;
    opacity: 0.78;
}

.truba-mobile-languages a:hover,
.truba-mobile-languages .current-lang a { opacity: 1; }

.truba-mobile-languages img {
    display: block;
    width: 16px;
    height: 11px;
}

.truba-mobile-search {
    display: flex;
    gap: 8px;
    margin: 0;
}

.truba-mobile-search input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #e4e4e4;
    background: #ffffff;
    box-sizing: border-box;
}

.truba-mobile-search button {
    flex: 0 0 auto;
    min-width: 72px;
    height: 38px;
    border: 0;
    background: #455b72;
    color: #ffffff;
    cursor: pointer;
}

/* -------------------------------------------------------------------------
 * Sticky / shrink behavior inspired by legacy Total.
 * ------------------------------------------------------------------------- */
.truba-main-header {
    position: sticky;
    top: 0;
}

.truba-site-header.is-shrunk .truba-main-header .truba-container {
    min-height: 70px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.truba-site-header.is-shrunk .truba-brand img {
    max-height: 50px;
}

.truba-site-header.is-shrunk .truba-primary-menu > li > a,
.truba-site-header.is-shrunk .truba-search-toggle {
    height: 50px;
    line-height: 50px;
}

/* -------------------------------------------------------------------------
 * Mobile
 * ------------------------------------------------------------------------- */
.truba-mobile-toggle {
    display: none;
    margin-left: auto;
    width: 40px;
    height: 40px;
    border: 1px solid #eeeeee;
    border-radius: 3px;
    background: #f7f7f7;
    color: #666666;
    cursor: pointer;
}

.truba-mobile-toggle span,
.truba-mobile-toggle span::before,
.truba-mobile-toggle span::after {
    content: "";
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: currentColor;
}

.truba-mobile-toggle span::before { transform: translateY(-6px); }
.truba-mobile-toggle span::after { transform: translateY(4px); }

/* -------------------------------------------------------------------------
 * Page baseline - CA pages are not given special visual treatment here.
 * ------------------------------------------------------------------------- */
body.truba-header-active {
    font-family: "Open Sans", Arial, Helvetica, sans-serif;
}

body.truba-header-active .site-content,
body.truba-header-active .content-area,
body.truba-header-active .site-main,
body.truba-header-active .elementor {
    width: 100%;
}

body.truba-header-active .inside-article { box-sizing: border-box; }

/* Shared non-CA Elementor baseline. */
body.truba-non-ca-page .elementor-widget-text-editor,
body.truba-non-ca-page .elementor-widget-heading,
body.truba-non-ca-page .elementor-widget-image,
body.truba-non-ca-page .elementor-widget-table-of-contents {
    color: var(--truba-text);
}

body.truba-non-ca-page .elementor-widget-heading .elementor-heading-title {
    color: #333333;
    font-weight: 400;
}

body.truba-non-ca-page .elementor-widget-text-editor a {
    color: #455b72;
}

body.truba-non-ca-page .elementor-widget-text-editor a:hover {
    color: #222222;
}

body.truba-page-home .elementor,
body.truba-page-truba-olusumu .elementor,
body.truba-page-kaynaklar .elementor,
body.truba-page-isbirlikleri .elementor,
body.truba-page-uygulamalar .elementor,
body.truba-page-yayinlar .elementor,
body.truba-page-arastirmacilarimiz .elementor,
body.truba-page-basari-olcutleri .elementor {
    max-width: 100%;
}

/* -------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------- */
.truba-footer {
    background: #ffffff;
    color: #666666;
    margin-top: 0;
    border-top: 2px solid var(--truba-accent);
    border-bottom: 2px solid var(--truba-accent);
}

.truba-footer-inner {
    box-sizing: border-box;
    padding-top: 26px;
    padding-bottom: 28px;
}

.truba-footer-widgets {
    display: grid;
    grid-template-columns: 1.15fr 1fr 0.7fr;
    gap: 34px;
    align-items: start;
}

.truba-footer-box {
    min-height: 0;
    font-size: 12px;
    line-height: 1.55;
}

.truba-footer-box p {
    margin: 0 0 10px;
}

.truba-footer-box strong {
    color: #666666;
}

.truba-footer-address p + p {
    margin-top: 2px;
}

.truba-footer-socials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding-top: 6px;
}

.truba-footer-socials a {
    display: inline-flex;
    width: 28px;
    min-width: 28px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--truba-blue);
    text-decoration: none;
}

.truba-social-twitter {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    transform: skewX(-8deg);
}

.truba-social-linkedin {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.truba-social-youtube,
.truba-social-youtube svg {
    width: 30px;
    height: 24px;
    display: block;
}

.truba-footer-bottom {
    background: #455b72;
    color: #ffffff;
    padding: 15px 0;
}

.truba-copyright {
    color: #ffffff;
    font-size: 10px;
    line-height: 1.5;
    text-align: center;
}

/* Legacy homepage blocks converted from the old WPBakery icon-boxes. */
.truba-migration-icon-box {
    min-height: 150px;
    color: #455b72;
}

.truba-migration-icon-box > div:first-child {
    line-height: 1;
}

.truba-migration-icon-box > div:last-child {
    color: #455b72;
    font-size: 13px !important;
    line-height: 1.35;
}

/* -------------------------------------------------------------------------
 * Institutional header / footer responsive adjustments
 * ------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .truba-topbar .truba-container {
        min-height: 62px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .truba-institutional-logo img {
        width: 290px;
    }

    .truba-main-header .truba-container {
        min-height: 100px;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .truba-footer-widgets {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .truba-footer-socials {
        justify-content: flex-start;
        padding-top: 0;
    }
}

/* -------------------------------------------------------------------------
 * Accessibility
 * ------------------------------------------------------------------------- */
.truba-skip-link {
    position: fixed;
    left: 12px;
    top: -100px;
    z-index: 99999;
    padding: 10px 14px;
    background: #111111;
    color: #ffffff;
    text-decoration: none;
}

.truba-skip-link:focus { top: 12px; }

/* -------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------- */
@media (max-width: 1088px) {
    .truba-main-header .truba-container,
    .truba-topbar .truba-container,
    .truba-footer .truba-container {
        width: 90%;
        max-width: 980px;
    }
}

@media (max-width: 900px) {
    .truba-main-header { position: relative; }
    .truba-header-desktop-tools { display: none; }

    .truba-main-header .truba-container {
        min-height: 84px;
        padding-top: 15px;
        padding-bottom: 15px;
        gap: 12px;
    }

    .truba-brand img {
        width: 210px;
        max-width: 210px;
        max-height: 64px;
    }

    .truba-mobile-toggle { display: inline-block; }

    .truba-navigation {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        display: none;
        padding: 0 20px 18px;
        background: #ffffff;
        border-bottom: 1px solid #eeeeee;
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    }

    .truba-navigation.is-open { display: block; }

    .truba-navigation-inner {
        display: block;
    }

    .truba-primary-menu {
        display: block;
    }

    .truba-primary-menu > li > a {
        height: auto;
        line-height: 1.4;
        padding: 12px 0;
        border-bottom: 1px solid #eeeeee;
    }

    .truba-mobile-tools {
        display: block;
        padding-top: 14px;
    }

    .truba-languages { margin-left: 0; }

    .truba-topbar .truba-container {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .truba-container,
    .truba-topbar .truba-container,
    .truba-main-header .truba-container,
    .truba-footer .truba-container {
        width: calc(100% - 28px);
        max-width: none;
    }

    .truba-topbar { font-size: 11px; }
    .truba-topbar-contact { gap: 8px; }

    .truba-main-header .truba-container { min-height: 76px; }

    .truba-brand img {
        width: 185px;
        max-width: 185px;
    }

    .truba-search-panel {
        right: -8px;
        width: min(300px, calc(100vw - 28px));
    }

    .truba-footer-widgets {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------------------------
 * TRUBA non-CA page layout milestone 1.3.0
 * ------------------------------------------------------------------------- */

body.truba-non-ca-page .entry-content,
body.truba-non-ca-page .elementor,
body.truba-non-ca-page .elementor-widget-text-editor,
body.truba-non-ca-page .elementor-widget-html {
    color: var(--truba-text);
}

body.truba-non-ca-page .elementor-widget-text-editor p {
    margin-bottom: 1.15em;
}

body.truba-non-ca-page .elementor-widget-image img {
    height: auto;
    max-width: 100%;
}

body.truba-non-ca-page .elementor-widget-divider .elementor-divider-separator {
    border-color: var(--truba-border);
}

body.truba-non-ca-page .elementor-widget-button .elementor-button {
    border-radius: 2px;
    background: var(--truba-blue);
    color: #ffffff;
}

body.truba-non-ca-page .elementor-widget-button .elementor-button:hover {
    background: var(--truba-blue-dark);
}

body.truba-non-ca-page .elementor-widget-image-gallery img,
body.truba-non-ca-page .elementor-image-box-img img {
    border-radius: 0;
}

body.truba-bucket-home .entry-title,
body.truba-bucket-home .page-header,
body.truba-page-home .page-header {
    display: none;
}

body.truba-bucket-truba_olusumu .elementor-widget-heading:first-child,
body.truba-bucket-kaynaklar .elementor-widget-heading:first-child,
body.truba-bucket-isbirlikleri .elementor-widget-heading:first-child,
body.truba-bucket-uygulamalar .elementor-widget-heading:first-child,
body.truba-bucket-yayinlar .elementor-widget-heading:first-child,
body.truba-bucket-arastirmacilar .elementor-widget-heading:first-child,
body.truba-bucket-basari_olcutleri .elementor-widget-heading:first-child {
    margin-bottom: 22px;
}

body.truba-bucket-kaynaklar .elementor-widget-table-of-contents,
body.truba-bucket-isbirlikleri .elementor-widget-table-of-contents,
body.truba-bucket-uygulamalar .elementor-widget-table-of-contents,
body.truba-bucket-yayinlar .elementor-widget-table-of-contents {
    margin-bottom: 28px;
}

body.truba-bucket-yayinlar .elementor-posts-container,
body.truba-bucket-uygulamalar .elementor-posts-container {
    gap: 24px;
}

body.truba-bucket-yayinlar .elementor-post__card,
body.truba-bucket-uygulamalar .elementor-post__card {
    border: 1px solid var(--truba-border);
    border-radius: 0;
    box-shadow: none;
}

body.truba-bucket-basari_olcutleri .elementor-widget-text-editor table {
    font-size: 14px;
}

body.truba-bucket-basari_olcutleri .elementor-widget-text-editor table tr:first-child th,
body.truba-bucket-basari_olcutleri .elementor-widget-text-editor table tr:first-child td {
    background: #f7f7f7;
    font-weight: 600;
}

body.truba-bucket-arastirmacilar .elementor-image-box-content,
body.truba-bucket-isbirlikleri .elementor-image-box-content {
    text-align: left;
}

@media (max-width: 768px) {
    body.truba-non-ca-page .elementor-widget-text-editor p {
        margin-bottom: 1em;
    }

    body.truba-non-ca-page .elementor-widget-heading h1 {
        font-size: 26px;
    }

    body.truba-non-ca-page .elementor-widget-heading h2 {
        font-size: 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .truba-search-panel,
    .truba-primary-menu > li > a,
    .truba-mobile-toggle { transition: none !important; }
}

body.admin-bar .truba-main-header { top: 32px; }

@media (max-width: 782px) {
    body.admin-bar .truba-main-header { top: 46px; }
}

/* ============================================================
 * TRUBA CHILD THEME — LANGUAGE FLAGS
 * Canonical implementation in child-theme style.css
 * ============================================================ */

/*
 * Language links
 */
.truba-main-menu li.lang-item > a,
.truba-main-menu li.language-item > a,
.truba-main-menu li.menu-item-language > a,
.truba-main-menu li.pll-parent-menu-item > a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    gap: 7px !important;

    line-height: 1 !important;
}

/*
 * Flag container
 */
.truba-main-menu li.lang-item .pll-switcher-flag,
.truba-main-menu li.language-item .pll-switcher-flag,
.truba-main-menu li.menu-item-language .pll-switcher-flag,
.truba-main-menu li.pll-parent-menu-item .pll-switcher-flag {
    display: inline-block !important;

    width: 29px !important;
    min-width: 29px !important;
    max-width: 29px !important;

    height: 19px !important;
    min-height: 19px !important;
    max-height: 19px !important;

    flex: 0 0 29px !important;

    overflow: hidden !important;

    margin: 0 !important;
    padding: 0 !important;

    border-radius: 3px !important;

    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: cover !important;

    vertical-align: middle !important;
}

/*
 * Disable broken inline/data URI Polylang image.
 * The flag is supplied by the local child-theme SVG.
 */
.truba-main-menu li.lang-item .pll-switcher-flag img,
.truba-main-menu li.language-item .pll-switcher-flag img,
.truba-main-menu li.menu-item-language .pll-switcher-flag img,
.truba-main-menu li.pll-parent-menu-item .pll-switcher-flag img {
    display: none !important;
    visibility: hidden !important;
}

/*
 * Turkish
 */
.truba-main-menu li.lang-item-tr .pll-switcher-flag,
.truba-main-menu li.language-item-tr .pll-switcher-flag {
    background-image: url("assets/flags/tr.svg") !important;
}

/*
 * English
 */
.truba-main-menu li.lang-item-en .pll-switcher-flag,
.truba-main-menu li.language-item-en .pll-switcher-flag {
    background-image: url("assets/flags/en.svg") !important;
}

/*
 * URL fallback for English
 */
.truba-main-menu li.lang-item a[href*="/en/"] .pll-switcher-flag,
.truba-main-menu li.language-item a[href*="/en/"] .pll-switcher-flag {
    background-image: url("assets/flags/en.svg") !important;
}

/*
 * URL fallback for Turkish
 */
.truba-main-menu li.lang-item a[href="/"] .pll-switcher-flag,
.truba-main-menu li.language-item a[href="/"] .pll-switcher-flag {
    background-image: url("assets/flags/tr.svg") !important;
}

/*
 * Hover
 */
.truba-main-menu li.lang-item > a:hover .pll-switcher-flag,
.truba-main-menu li.language-item > a:hover .pll-switcher-flag,
.truba-main-menu li.menu-item-language > a:hover .pll-switcher-flag,
.truba-main-menu li.pll-parent-menu-item > a:hover .pll-switcher-flag {
    opacity: 0.90 !important;
}

/*
 * Keyboard focus
 */
.truba-main-menu li.lang-item > a:focus-visible .pll-switcher-flag,
.truba-main-menu li.language-item > a:focus-visible .pll-switcher-flag,
.truba-main-menu li.menu-item-language > a:focus-visible .pll-switcher-flag,
.truba-main-menu li.pll-parent-menu-item > a:focus-visible .pll-switcher-flag {
    outline: 2px solid currentColor !important;
    outline-offset: 2px !important;
}




/* TRUBA language switcher semantic fix */
.truba-languages {
    list-style: none;
    margin: 0;
    padding: 0;
}

.truba-languages > li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.truba-languages > li::marker {
    content: "";
}
