/* Compact search beside the headline ticker. */
#masthead {
    display: flex;
    align-items: center;
    gap: 12px;
    height: auto;
    min-height: 28px;
    overflow: visible;
}
#masthead .masthead_left {
    float: none;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    padding-top: 0;
    overflow: hidden;
}
#masthead .masthead_caption,
#masthead ul,
#masthead .ticker-wrapper { margin-top: 0; }
#masthead > .clearfix { display: none; }
#masthead .gab_logintools { flex: 0 0 auto; }
#masthead #search {
    float: none;
    flex: 0 0 240px;
    width: 240px;
    height: 28px;
    margin: 0;
}
#masthead #search form { float: none; width: 100%; }
#masthead #search fieldset {
    display: flex;
    align-items: center;
    float: none;
    box-sizing: border-box;
    width: 100%;
    height: 28px;
}
#masthead #search .text {
    float: none;
    flex: 1 1 0;
    box-sizing: border-box;
    min-width: 0;
    width: auto;
    height: 26px;
    padding: 4px 8px;
    line-height: 18px;
}
#masthead #search .submit_style1 {
    flex: 0 0 auto;
    margin: 0 4px;
    padding: 0;
}
@media (max-width: 767px) {
    #masthead { flex-wrap: wrap; gap: 6px 12px; }
    #masthead .masthead_left { flex-basis: 100%; }
    #masthead #search { flex: 1 1 200px; max-width: 100%; }
}

/* Secondary right column: matching compact category cards. */
#secondary-content .secondary-card-media {
    width: 50%;
    margin: 0 auto 10px;
}
#secondary-content .pull-right .secondary-card-media img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
}
#secondary-content .secondary-card-media iframe,
#secondary-content .secondary-card-media video {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}
#secondary-content .secondary-bottom-posts .featuredpost:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}
#secondary-content .secondary-bottom-posts .featuredpost:last-child > p:last-child {
    margin-bottom: 0;
}
@media (min-width: 768px) {
    #secondary-content { display: flex; align-items: stretch; }
    #secondary-content > .span6 { float: none; }
    #secondary-content > .pull-left,
    #secondary-content > .pull-right.span6 { display: flex; flex-direction: column; }
    #secondary-content > .pull-left .innerdiv_tocolor { flex: 1; }
    #secondary-content .secondary-bottom-posts { margin-top: auto; }
}

/* Additional categories following Subnews. */
#extra-category-news { margin-top: 20px; margin-bottom: 20px; }
#extra-category-news .extra-category-section { margin-bottom: 20px; }
#extra-category-news .extra-category-section:last-child { margin-bottom: 0; }
#extra-category-news .featuredpost { overflow: hidden; background: transparent; }
#extra-category-news .extra-category-feature .extra-category-media {
    width: 50%;
    margin: 0 auto 10px;
}
#extra-category-news .extra-category-media img { display: block; width: 100%; height: auto; margin: 0; }
#extra-category-news .extra-category-list .extra-category-media {
    float: left;
    width: 130px;
    max-width: 35%;
    margin: 0 15px 8px 0;
}
#extra-category-news .extra-category-media:empty { display: none; }
@media (min-width: 768px) {
    #extra-category-news { display: flex; align-items: flex-start; }
    #extra-category-news > .span6 { float: none; }
}

/* Centered two-line site title. */
#header #logo-and-search { background: #fff; }
#header #logo-and-search .sitelogo {
    float: none;
    width: 100%;
    box-sizing: border-box;
    padding: 24px 16px !important;
    text-align: center;
}
#header .sitelogo h1 {
    margin: 0;
    font-size: clamp(24px, 4vw, 36px);
    line-height: 1.2;
    color: #000;
}
#header .sitelogo h1 a,
#header .sitelogo h1 a:hover { color: #000 !important; }
#header .sitelogo h1 span a { padding-left: 0; }
#header .sitelogo h1 span a:empty { display: none; }
#header .header-right:has(#social_header ul:empty) { display: none; }

/* Imagotype and two-line title form one centered brand. */
#header .site-brand { display: flex; justify-content: center; align-items: center; gap: 12px; }
#header .site-imagotype { flex: 0 0 104px; display: block; }
#header .sitelogo .site-imagotype img { display: block; float: none; width: 104px; height: auto; }
#header .site-brand h1 { min-width: 0; }
@media (max-width: 767px) {
    #header #logo-and-search .sitelogo { padding: 20px 8px !important; }
    #header .site-brand { gap: 6px; }
    #header .site-imagotype { flex-basis: 64px; }
    #header .sitelogo .site-imagotype img { width: 64px; }
    #header .site-brand h1 { font-size: clamp(18px, 4vw, 30px); }
}
