/* Keep the original desktop canvas unchanged. Only the new mobile control is hidden globally. */
#mobile-menu-toggle { display: none; }

@media (max-width: 1023px) {
  #main { font-size: 16px; line-height: 1.65; }
  #main h1 { font-size: 22px; line-height: 1.35; }
  #main h2 { font-size: 19px; line-height: 1.4; }
  #main h3 { font-size: 17px; line-height: 1.4; }
  #main :focus-visible, #gallery-dialog :focus-visible { outline: 2px solid #bc1724; outline-offset: 3px; }

  #center {
    display: grid;
    grid-template-columns: 156px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 24px;
    width: calc(100% - 48px);
    margin: 28px auto 36px;
    align-items: start;
  }
  #center::after, #container-f-upper::after,
  #container-f-lower .cms_position_array::after,
  #subcontainer-2-right .gallery::after { display: none; }
  #left-column { grid-column: 1; grid-row: 1 / 3; float: none; width: auto; height: auto; margin: 0; padding: 0; min-width: 0; }
  #logo { left: 0; text-align: center; }
  #logo img { width: 144px; height: auto; max-width: 100%; }
  #ime { font-size: 28px; }
  #ime small { font-size: 21px; }
  #side-menu-box a { display: block; padding: 9px 2px; line-height: 1.25; }
  #side-menu-box ul li { margin: 0; }
  #side-menu-box ul li li a { font-size: 18px; padding: 10px 2px; }
  #left-column #dv_search_form { left: 0; margin: 16px 0 0; }
  #main #left-column #dv_search_form .dv_search_input {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 8px;
    font-size: 16px;
  }

  #header { grid-column: 2; float: none; width: 100%; height: auto; aspect-ratio: 763 / 276; margin: 0 0 28px; }
  #header > .gal1 > img, #header .prikaz_headerja img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
  #paper { position: relative; grid-column: 2; float: none; width: 100%; min-width: 0; overflow-wrap: anywhere; }
  #paper img { max-width: 100%; height: auto !important; }
  #paper iframe { max-width: 100%; width: 100%; height: auto; aspect-ratio: 500 / 281; }
  #paper .dv_media_overlay { box-sizing: border-box; max-width: 100%; height: auto !important; aspect-ratio: 500 / 281; }
  #paper table { max-width: 100%; }
  #paper pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  #paper blockquote { margin-left: 20px; margin-right: 20px; }
  #paper a.button { box-sizing: border-box; display: inline-block; padding: 10px 14px; min-height: 44px; line-height: 1.5; }
  #container-12, #container-f-upper, #container-f-lower { width: 100%; background-image: none; }
  #subcontainer-12-left, #subcontainer-f-left { float: none; width: auto; padding: 0; margin: 0; line-height: inherit; }
  #container-3 .galart .artgal1 .artgalP,
  #container-3 .galart .artgal1 .artgalD { box-sizing: border-box; float: none; width: 100%; padding-left: 0; }

  /* Related stories and galleries follow the article instead of squeezing its reading column. */
  #subcontainer-1-right, #subcontainer-2-right {
    box-sizing: border-box;
    float: none;
    width: 100%;
    margin-top: 28px;
    padding: 24px 0 0;
    border-top: 1px dotted #c8baba;
  }
  #subcontainer-1-right .cms_position_array { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  #subcontainer-1-right .cms_position_array::after { display: none; }
  #subcontainer-1-right .SPost3 { margin: 0; font-size: 14px; line-height: 1.5; }
  #subcontainer-2-right { display: flex; flex-wrap: wrap; gap: 20px; }
  #subcontainer-2-right > .gal1 { flex: 0 1 172px; }
  #subcontainer-2-right .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 20px; width: 100%; }
  #subcontainer-2-right .gal1 { margin: 0; min-width: 0; }
  #subcontainer-2-right .gallD { font-size: 12px; line-height: 1.5; }

  #subcontainer-f-right { float: none; width: auto; margin: 24px 0; padding: 20px; background: #f3efec; border-top: 2px solid #bc1724; }
  #SContactFormForm { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 20px; }
  #SContactFormForm > h3, #SContactFormForm > p, #SContactFormForm > noscript { grid-column: 1 / -1; }
  #SContactFormForm > br { display: none; }
  #subcontainer-f-right label { font-size: 13px; line-height: 1.5; }
  #SContactFormForm .input { margin: 0; }
  #subcontainer-f-right #SContactFormForm .input .cms_input { box-sizing: border-box; width: 100% !important; min-height: 44px; font-size: 16px; padding: 8px; margin-top: 8px; }
  #SContactFormForm .cms_button { justify-self: start; min-height: 44px; padding: 8px 20px; font: 16px Georgia, serif; }
  #newsletter-status { font-size: 14px; line-height: 1.5; }

  #container-f-lower { padding-top: 8px; }
  #container-f-lower .cms_position_array { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 22px; }
  #container-f-lower .cms_position_array > div { min-width: 0; }
  #container-f-lower .Fpost, #container-f-lower .cms_first .Fpost { float: none; width: auto; padding: 0; margin: 0; background: none; border: 0; font-size: 13px; line-height: 1.6; }
  #container-f-lower .Fpost .cms_object_title a { float: none; font-size: 18px; line-height: 1.4; }
  #container-f-lower .Fpost .Fexcerpt { margin-top: 12px; }
  #container-f-lower .Fpost .gal1 { left: 0; }
  #container-f-lower .Fpost .Fexcerpt > a { float: none; display: block; }
  #container-f-lower .Fpost .Fexcerpt > a:first-child { min-height: 44px; display: flex; align-items: center; gap: 4px; }

  #content-search { display: flex; flex-wrap: wrap; gap: 10px; }
  #content-search label { flex-basis: 100%; }
  #content-search input { box-sizing: border-box; min-width: 0; width: 60%; flex: 1; }
  #content-search input, #content-search button { min-height: 44px; font-size: 16px; padding: 8px; }
  .cms_list_paging a { display: inline-block; padding: 8px 12px; min-height: 28px; }

  #footer { box-sizing: border-box; width: calc(100% - 48px); height: auto; padding: 20px 0; display: flex; flex-direction: column; gap: 12px; }
  #footer #footer-text-1, #footer #footer-text-2 { float: none; position: static; width: auto; padding: 0; font-size: 12px; line-height: 1.7; }
  #footer #footer-text-1 p, #footer #footer-text-2 p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
  #footer #footer-text-1 p br { display: none; }
  #footer #footer-text-1 p span, #footer #footer-text-1 p img, #footer #footer-text-2 p img { position: static; margin: 0; float: none; }
  #footer #footer-text-2 p strong { margin: 0; }
  #footer a { display: inline-flex; align-items: center; min-height: 44px; }
  .gallery-toolbar { gap: 8px; }
  .gallery-toolbar button { min-height: 44px; min-width: 44px; }
}

@media (max-width: 699px) {
  #center { display: block; width: calc(100% - 32px); margin-top: 16px; }
  #left-column { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px 10px; align-items: center; margin-bottom: 22px; }
  #logo { grid-column: 1; grid-row: 1; }
  #logo img { display: block; width: 64px; height: auto; }
  #ime { grid-column: 2; grid-row: 1; font-size: 26px; line-height: 1.05; }
  #ime p { text-align: left !important; margin: 0; }
  #ime small { font-size: 19px; line-height: 1.2; position: static; }
  #left-column[data-mobile-nav-ready] #mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; grid-column: 3; grid-row: 1; box-sizing: border-box; min-height: 44px; padding: 8px 10px; border: 1px solid #bc1724; border-radius: 4px; background: transparent; color: #bc1724; font: 18px 'PrioriSerBold', Georgia, serif; cursor: pointer; }
  #mobile-menu-toggle[aria-expanded="true"] { background: #bc1724 !important; color: white !important; }
  #side-menu-box { grid-column: 1 / -1; grid-row: 2; margin: 0; border-top: 1px dotted #c8baba; border-bottom: 1px dotted #c8baba; }
  #left-column[data-mobile-nav-ready]:not([data-menu-open]) #side-menu-box { display: none; }
  #side-menu-box #rozica1, #side-menu-box #rozica2 { display: none; }
  #side-menu-box .menu_level1 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; margin: 8px 0; }
  #side-menu-box .menu_level1 > li:has(ul) { grid-column: 1 / -1; }
  #side-menu-box a { box-sizing: border-box; min-height: 44px; font-size: 21px; line-height: 1.25; padding: 10px 4px; }
  #side-menu-box .menu_level2 { display: flex; flex-wrap: wrap; justify-content: center; margin: 0 0 8px; }
  #side-menu-box ul li li a { font-size: 19px; padding: 10px; }
  #left-column #dv_search_form { grid-column: 1 / -1; grid-row: 3; margin: 0; }
  #header { margin-bottom: 24px; }
  #main h1 { font-size: 21px; }
  #paper h1[style*="font-size"] { font-size: clamp(21px, 5vw, 28px) !important; }
  #paper p[style*="justify"] { text-align: left !important; }
  #paper .img_align_left, #paper .img_align_right { float: none; display: block; margin: 16px auto; }
  #subcontainer-f-right { padding: 18px 16px; }
  #footer { width: calc(100% - 32px); }
}

@media (max-width: 459px) {
  #container-f-lower .cms_position_array, #subcontainer-1-right .cms_position_array { grid-template-columns: minmax(0, 1fr); }
  #container-f-lower .Fpost { padding-top: 18px; border-top: 1px dotted #c8baba; }
  #container-f-lower .cms_first .Fpost { padding-top: 0; }
  #subcontainer-12-left .cms_o_page_post > .float_left { float: none; margin-bottom: 12px; }
  #subcontainer-12-left .cms_o_page_post .event_date { margin-bottom: 16px; }
}
