/* Phase 11: mobile/responsive fixes for the public website. No framework upgrades. */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; }
body { overflow-x: hidden; }

img, svg, video, iframe { max-width: 100%; }
iframe { border: 0; }

/* Header / navigation */
#top-header .logo img,
#top-header .logo figure img {
  max-width: 150px;
  width: auto;
  height: auto !important;
}
#main-menu .navbar-nav > li > a { white-space: nowrap; }
.cbp-spmenu { max-width: 86vw; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.cbp-spmenu a { line-height: 1.35; }

/* Hero / slider */
#main-slider .item {
  min-height: 430px;
  background-position: center center;
}
#main-slider .slider-inner { min-height: inherit; }
#main-slider .carousel-content {
  max-width: 100%;
  word-break: normal;
  overflow-wrap: anywhere;
}
#main-slider .slider-inner h2 { line-height: 1.18; }
#posts-header-box,
.posts-header-box-cover { min-height: 260px; overflow: hidden; }
.posts-header-box-cover img.img-wide { width: 100%; height: auto; }

/* Sections and content */
section { max-width: 100%; }
.section-header { margin-bottom: 30px; }
.section-header .section-title { line-height: 1.2; }
.entry-content,
.blog-post,
.blog .blog-post,
.media-body { overflow-wrap: anywhere; }
.entry-content img,
.blog-post img { max-width: 100%; height: auto !important; }
.entry-content table,
.blog-post table { width: 100%; max-width: 100%; }
.bb-responsive-table { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bb-responsive-table table { min-width: 640px; }

/* Cards: news, articles, libraries */
.ultra-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 24px;
  align-items: stretch;
}
.ultra-article-card { min-width: 0; }
.ultra-article-cover { display: block; overflow: hidden; }
.ultra-article-cover img { width: 100%; height: auto; display: block; }
.ultra-article-title { overflow-wrap: anywhere; }
.ultra-article-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Detail pages and related topics */
.entry-header .column-title { line-height: 1.2; overflow-wrap: anywhere; }
.entry-thumbnail img { width: 100%; height: auto; }
.related-post,
.related-library,
.widget,
.sidebar .widget { max-width: 100%; overflow: hidden; }
.related-post img,
.related-library img,
.widget img { width: 100%; height: auto; }

/* Forms */
.form-control,
input,
select,
textarea { max-width: 100%; font-size: 16px; }
textarea.form-control { min-height: 130px; }
.btn, .btn-color, .btn-wide { white-space: normal; }
.g-recaptcha { transform-origin: 0 0; }
html[dir="rtl"] .g-recaptcha { transform-origin: 100% 0; }
.captcha-wrap,
.g-recaptcha { max-width: 100%; overflow: hidden; }

/* Contact blocks */
.media.service-box { min-height: 0; }
.media.service-box .pull-left { flex: 0 0 auto; }
.media.service-box .media-body { width: auto; }

/* Subscription area */
.subscribe-ultra-omega .subscribe-card,
#subscribe .subscribe-card { max-width: 100%; }
.subscribe-ultra-omega .subscribe-wrap,
#subscribe .subscribe-wrap { max-width: 100%; }
.subscribe-ultra-omega .ultra-control { min-width: 0; }

/* Footer */
#footer { overflow: hidden; }
#footer .social-icons { white-space: normal; }

@media (max-width: 1199px) {
  #main-menu.navbar-default .navbar-nav > li > a { padding-left: 12px; padding-right: 12px; }
  #main-slider .item { min-height: 390px; }
}

@media (max-width: 991px) {
  .container { width: 100%; max-width: 100%; padding-left: 18px; padding-right: 18px; }
  #main-slider .item { min-height: 340px; }
  #main-slider .carousel-content { padding: 25px 18px; }
  #main-slider .slider-inner h2 { font-size: 34px; }
  .blog .row > [class*="col-md-"] + [class*="col-md-"] { margin-top: 28px; }
  .ultra-articles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}

@media (max-width: 767px) {
  body { font-size: 14px; }
  .container { padding-left: 14px; padding-right: 14px; }
  #top-header { position: relative; z-index: 1000; }
  #top-header .logo img,
  #top-header .logo figure img { max-width: 112px; }
  #main-menu.navbar { min-height: 52px; }
  #main-menu .navbar-header { min-height: 52px; }
  #main-menu .navbar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 2px 10px;
    border: 0;
    cursor: pointer;
  }
  #main-menu .collapse.navbar-collapse { display: none !important; }

  #main-slider .item { min-height: 285px; background-position: center center; }
  #main-slider .slider-inner { display: flex; align-items: center; }
  #main-slider .carousel-content {
    margin: 0;
    padding: 20px 16px;
    max-width: 92%;
  }
  #main-slider .slider-inner h2 { font-size: 25px; line-height: 1.22; }
  #main-slider .owl-prev,
  #main-slider .owl-next { display: none !important; }

  #posts-header-box,
  .posts-header-box-cover { min-height: 190px; }
  .section-header { margin-bottom: 22px; }
  .section-header .section-title { font-size: 27px; }
  .section-header .section-title:before,
  .section-header .section-title:after { max-width: 70px; }

  .ultra-articles-grid { grid-template-columns: 1fr; gap: 16px; }
  .ultra-article-card { width: 100%; }
  .ultra-article-actions .btn { width: 100%; }
  .ultra-article-arrow { display: none; }

  .blog .blog-post { padding: 18px; }
  .blog .blog-post.blog-media .entry-title,
  .entry-header .column-title { font-size: 25px; }
  .entry-content { font-size: 15px; line-height: 1.75; }

  .contact-form .row > [class*="col-"] { margin-bottom: 0; }
  .contact-form .btn-wide,
  .contact-form button[type="submit"] { width: 100%; }
  .media.service-box { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
  .media.service-box .pull-left { float: none !important; margin: 0; }

  .subscribe-ultra-omega .subscribe-card,
  #subscribe .subscribe-card { display: block; padding: 20px 16px; }
  .subscribe-ultra-omega .left,
  .subscribe-ultra-omega .right,
  #subscribe .left,
  #subscribe .right { width: 100%; max-width: 100%; }
  .subscribe-ultra-omega .right,
  #subscribe .right { margin-top: 18px; }

  #footer { text-align: center; padding-left: 12px; padding-right: 12px; }
  #footer .pull-left,
  #footer .pull-right { float: none !important; display: block; width: 100%; }
}

@media (max-width: 520px) {
  .container { padding-left: 12px; padding-right: 12px; }
  #main-slider .item { min-height: 245px; }
  #main-slider .carousel-content { max-width: 96%; padding: 16px 14px; }
  #main-slider .slider-inner h2 { font-size: 21px; }
  .section-header .section-title { font-size: 23px; }
  .blog .blog-post { padding: 14px; }
  .blog .blog-post.blog-media .entry-title,
  .entry-header .column-title { font-size: 22px; }
  .btn-lg { padding-left: 16px; padding-right: 16px; font-size: 15px; }
  .g-recaptcha { transform: scale(.88); max-width: 304px; }
}

@media (max-width: 380px) {
  .g-recaptcha { transform: scale(.80); }
  #main-slider .slider-inner h2 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .wow, .animated { animation: none !important; visibility: visible !important; }
  * { scroll-behavior: auto !important; }
}
