/* Phone stack and a wider program table. Above 960px the 2012 frame stays. */

#program {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#program .table_program {
  width: 100%;
}

#program .table_program tr th {
  padding: 14px 8px;
  line-height: 1.25;
  height: auto;
  white-space: normal;
  vertical-align: middle;
}

#program .talk_media {
  float: left;
  width: 70px;
  margin: 5px 10px 5px 0;
}

#program .talk_thumb {
  display: block;
}

#program .talk_media img {
  display: block;
  width: 70px;
  max-width: none;
  height: auto;
  border-radius: 5px;
}

#program .talk_copy {
  overflow: hidden;
  padding-right: 5px;
}

#program .talk_title,
#program .talk_author {
  overflow-wrap: break-word;
}

/* L, MD, S, and XS: photo above the title. Full width (1200px up) keeps it beside. */
@media (max-width: 1199px) {
  #program .talk_media {
    float: none;
    margin: 5px 0;
  }

  #program .talk_copy {
    overflow: visible;
    padding-right: 0;
  }
}

@media (min-width: 961px) {
  body.page-template-page-festival-program-php > .grid.grid_960px {
    width: auto;
    max-width: none;
    padding-left: 48px;
    padding-right: 48px;
    box-sizing: border-box;
  }

  body.page-template-page-festival-program-php #program .table_program {
    table-layout: fixed;
  }

  body.page-template-page-festival-program-php #program .table_program tr .talk_title {
    font-size: 18px;
  }
}

@media (max-width: 960px) {
  html,
  body {
    overflow-x: hidden;
  }

  body {
    padding-bottom: 0;
  }

  .grid_960px,
  .grid_962px,
  .grid_940px {
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  img,
  video,
  embed,
  object {
    max-width: 100%;
  }

  img {
    height: auto;
  }

  iframe {
    max-width: 100%;
  }

  #header_wrapper,
  .homepage #header_wrapper,
  .subpage #header_wrapper,
  #header_wrapper.withoutBoard,
  .single-prednasky #header_wrapper,
  .single-post #header_wrapper,
  .page-template-page-advertising-and-travel-seeking-php #header_wrapper,
  .single-prednasejici #header_wrapper,
  .archive #header_wrapper,
  .page-template-page-festival-archive-php #header_wrapper,
  .page-template-page-iframe-php #header_wrapper,
  .page-template-default #header_wrapper {
    display: flex;
    flex-direction: column;
    height: auto !important;
  }

  #header_wrapper > .slideshow_wrapper {
    order: 2;
  }

  #header_wrapper > .grid_962px:has(#top),
  #header_wrapper > .grid:has(#archive_navigation) {
    order: 1;
  }

  #header_wrapper > .grid_962px:has(.board),
  #header_wrapper > .board {
    order: 3;
  }

  #header_wrapper .slideshow_wrapper,
  #header_wrapper #slideshow,
  #header_wrapper #slideshow .slide,
  #header_wrapper #slideshow img {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    width: 100%;
    min-width: 0;
    height: 280px;
    max-height: 280px;
  }

  #header_wrapper #slideshow .slide {
    background-size: cover;
    background-position: center center;
  }

  #header_wrapper:has(.board.no_title) .slideshow_wrapper::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 58%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
    z-index: 1;
    pointer-events: none;
  }

  #header_wrapper #battlements {
    z-index: 2;
  }

  #header_wrapper #top,
  #header_wrapper #top #logo,
  #header_wrapper #top #navigation {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    width: auto;
    height: auto;
    min-height: 0;
    max-width: 100%;
  }

  #header_wrapper #top {
    padding-bottom: 8px;
    background-color: #e5e2d5;
    background-image: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  }

  #header_wrapper #top h1 {
    margin: 0;
    height: auto;
  }

  #header_wrapper #top #logo {
    display: block;
    float: none;
    width: 240px;
    height: 64px;
    max-width: 100%;
    margin: 8px 0 0;
    background-size: 200px 39px;
    background-position: left center;
  }

  #header_wrapper #top #navigation {
    text-align: left;
  }

  #header_wrapper #top #navigation ul {
    display: block;
    line-height: normal;
    width: 100%;
  }

  #header_wrapper #top #navigation ul > li {
    display: block;
    width: 100%;
    float: none;
    line-height: normal;
  }

  #header_wrapper #top #navigation ul > li {
    background-image: none !important;
  }

  #header_wrapper #top #navigation #menu-hlavni-menu > .current-page-ancestor,
  #header_wrapper #top #navigation #menu-hlavni-menu > .current_page_parent,
  #header_wrapper #top #navigation #menu-hlavni-menu > .current_page_item,
  #header_wrapper #top #navigation #menu-hlavni-menu > .current-menu-item,
  #header_wrapper #top #navigation #menu-hlavni-menu > .current-menu-parent {
    background-image: none !important;
    background-color: #581a3f !important;
  }

  #header_wrapper #top #navigation ul > li > a {
    display: block;
    font-size: 20px;
    line-height: 1.3;
    min-width: 0;
    margin-left: 0;
    padding: 12px 14px;
    white-space: normal;
    box-sizing: border-box;
  }

  #header_wrapper #top #navigation ul > li > a span {
    position: static;
    display: block;
    line-height: 1.2;
    margin-bottom: 2px;
  }

  #header_wrapper #top #navigation ul ul {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    width: 100%;
    max-width: 100%;
    max-height: none !important;
    height: auto !important;
    margin: 0;
    padding: 4px 0;
    line-height: normal;
    box-sizing: border-box;
    background-color: #53143a;
    background-image: none !important;
    border-radius: 8px;
  }

  #header_wrapper #top #navigation ul ul li,
  #header_wrapper #top #navigation ul ul li a {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    width: 100%;
    max-height: none !important;
    height: auto !important;
    line-height: 1.35;
    box-sizing: border-box;
  }

  #header_wrapper #top #navigation ul ul li {
    display: block;
    float: none;
  }

  #header_wrapper #top #navigation ul ul li a,
  #header_wrapper #top #navigation ul ul li:last-child a {
    display: block !important;
    position: static !important;
    width: 100%;
    max-width: 100%;
    max-height: none !important;
    height: auto !important;
    line-height: 1.35 !important;
    padding: 10px 16px !important;
    text-align: left !important;
    white-space: normal !important;
    opacity: 1;
  }

  #archive_navigation,
  #archive_navigation li,
  #archive_navigation li a {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    width: 100%;
    max-width: 100%;
    max-height: none !important;
    height: auto !important;
    line-height: 1.35;
    box-sizing: border-box;
  }

  #archive_navigation {
    margin-top: 8px;
    padding: 8px 0;
    background-color: #53143a;
    background-image: none !important;
    border-radius: 8px;
  }

  #archive_navigation li {
    display: block;
    float: none;
  }

  #archive_navigation > a,
  #archive_navigation > span,
  #archive_navigation li a {
    display: block;
    padding: 10px 16px !important;
    text-align: left;
    opacity: 1;
  }

  #header_wrapper .board,
  #header_wrapper .board.with_title,
  #header_wrapper .board.no_title,
  #header_wrapper .board .wrapper,
  #header_wrapper .board .wrapper .col,
  #header_wrapper .board.with_title .title,
  #header_wrapper .board.no_title .title,
  #header_wrapper .board.no_title .title h1,
  #header_wrapper .board.no_title .title .h1,
  #header_wrapper .board.no_title .title p {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    float: none;
    width: auto;
    max-width: 100%;
    height: auto;
    margin-left: 0;
  }

  #header_wrapper .board,
  #header_wrapper .board.with_title,
  #header_wrapper .board.no_title,
  #header_wrapper.withoutBoard .board.only_bg {
    margin-top: -24px;
    background-image: none;
    background-color: #e5e2d5;
    border-radius: 16px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.16);
    padding-bottom: 12px;
    z-index: 3;
  }

  #header_wrapper .board .wrapper {
    padding: 0 12px 8px;
  }

  #header_wrapper .board .wrapper .col {
    padding-top: 16px;
  }

  #header_wrapper .board .wrapper .col img {
    width: auto;
    max-width: 100%;
    height: auto;
  }

  #header_wrapper .board.with_title .title {
    padding: 14px 16px 0;
  }

  #header_wrapper .board.no_title .title {
    position: absolute;
    top: auto;
    bottom: calc(100% + 8px);
    left: 12px;
    right: 12px;
    width: auto;
    z-index: 4;
  }

  #header_wrapper .board.no_title .title .h1,
  #header_wrapper .board.no_title .title h1 {
    font-size: 34px;
    line-height: 1.05;
  }

  #header_wrapper .board.no_title .title p {
    font-size: 18px;
    line-height: 1.3;
  }

  #header_wrapper .board.no_title .title * {
    text-shadow: 0 2px 8px #000000, 0 1px 2px #000000;
  }

  .wrapper.cols_2 .col,
  .wrapper.cols_3 .col,
  .fa_col_1,
  .fa_col_2,
  .fa_col_3,
  .continent {
    float: none;
    display: block;
    width: auto;
    max-width: 100%;
    margin-left: 0;
  }

  .fest_overview_box.big .col_1,
  .fest_overview_box.big .col_2,
  .fest_overview_box.big .col_3 {
    float: none;
    width: auto;
    max-width: 100%;
    margin: 0 0 16px;
    padding: 12px 16px 12px 74px;
    box-sizing: border-box;
    background-position: 14px 16px;
    background-size: 50px 56px;
  }

  .fest_overview_box.big .col_3 {
    padding-left: 16px;
    background-image: none;
  }

  .fest_overview_box.big .col_3 iframe {
    width: 100%;
    max-width: 100%;
    height: 180px;
  }

  .fest_bookmarks .fen_left,
  .fest_bookmarks .fen_right,
  .fest_overview_box.small_left .left,
  .fest_overview_box.small_left .right,
  .wolf {
    float: none;
    width: auto;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .fest_bookmarks li {
    display: inline-block;
    margin: 0 12px 12px 0;
    vertical-align: middle;
  }

  .fest_bookmarks.general a img,
  .fest_bookmarks.main a img,
  .fest_bookmarks.partners a img {
    width: auto;
    height: auto !important;
    max-height: 72px;
    max-width: 100%;
  }

  #content {
    display: block;
    max-width: 100%;
  }

  #content #main,
  #content #sidebar,
  #content.no_sidebar #main {
    float: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  h2.h_box.h_news,
  .h2.h_box.h_news,
  h2 *.h_box.h_news {
    width: auto;
    height: auto;
    margin: 0 0 8px;
    padding: 12px 18px;
    background: #acc2b9;
    border-radius: 24px;
  }

  .post a,
  .post .old_link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    overflow: visible;
  }

  .post a span.thumbnail,
  .post .old_link span.thumbnail {
    float: none;
    flex: 0 0 112px;
    width: 112px;
    max-width: 40%;
    height: auto;
    max-height: none;
  }

  .post a span.thumbnail img,
  .post .old_link span.thumbnail img {
    width: 100%;
    height: auto;
    margin: 0;
  }

  .post h3,
  .post .h3,
  .post h3 *,
  .post a h3,
  .post .old_link h3,
  .post a .h3,
  .post .old_link .h3 {
    float: none;
    width: auto;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    flex: 1 1 auto;
  }

  .post .post_header,
  .post .post_content {
    float: none;
    width: auto;
    max-width: 100%;
    margin-left: 124px;
  }

  .post .post_excerpt {
    max-height: none;
  }

  .post_thumbnail,
  .post_thumbnail img {
    float: none;
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 0 12px;
  }

  #content #sidebar #sidemenu li {
    float: none;
    display: block;
  }

  #content #sidebar #sidemenu li a,
  #content #sidebar #sidemenu li:first-child a,
  #content #sidebar .a_btn,
  .a_btn.btn_big,
  .a_btn.btn_small {
    margin-bottom: 8px;
    max-width: 100%;
  }

  #content #sidebar .textwidget,
  #content #sidebar .textwidget * {
    max-width: 100% !important;
    box-sizing: border-box;
  }

  #content .gallery {
    display: flex;
    flex-wrap: wrap;
  }

  #content .gallery-item {
    width: 50% !important;
    max-width: 50%;
    float: none;
  }

  #content .gallery-item img {
    width: 100%;
    height: auto;
  }

  #program {
    max-width: 100%;
  }

  #program .table_program {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
  }

  #program .table_program th,
  #program .table_program td {
    min-width: 160px;
  }

  #program .table_program tr .talk_title {
    font-size: 16px;
    line-height: 1.25;
  }

  #program #program_days ul li {
    display: inline-block;
    margin-bottom: 6px;
  }

  #footer {
    position: relative;
    height: auto;
    background-color: #acc2b9;
  }

  #footer .l,
  #footer .r {
    float: none;
    width: auto;
    max-width: 100%;
    padding: 16px 0;
    text-align: left;
    background-position: left top;
  }

  #footer .l {
    padding-top: 72px;
  }

  #footer .l ul li {
    display: block;
  }
}
