/* The original desktop layout remains untouched above 1129px. */
#mobileMenuToggle { display: none; }

@media (max-width: 1129px) {
  *, *::before, *::after { box-sizing: border-box; }
  body { min-width: 0; }
  #wrapper { width: 100%; max-width: 1130px; padding: 5px 24px 24px; }
  #header { display: flex; align-items: center; justify-content: space-between; height: auto; min-height: 100px; }
  #sitename, #sitename_bak, #ad728x90h, #ad468x60 { float: none; }
  #ad728x90h { max-width: calc(100% - 260px); }
  #featuredPost, #otherFeaturedPosts { width: calc(50% - 5px); }
  #featuredPost { margin-right: 10px; }
  #featuredWrapper img, #gallery img, #entry img, #archiveEntries img,
  #photoNewsBlock img, #photoReceptsBlock img, #subNews img,
  #subNewsN img, #singleContent img, #singlePostSidebarRight img {
    max-width: 100%; height: auto;
  }
  .wp-caption, .wp-caption img, iframe, video, embed, object { max-width: 100%; }
  #gallery { width: 100%; }
  #gallery ul { display: flex; overflow-x: auto; gap: 10px; scroll-snap-type: x proximity; }
  #gallery ul li { float: none; flex: 0 0 126px; scroll-snap-align: start; }
  #subNews, #subNewsN { width: 68%; }
  #mainPageSidebar { width: 30%; }
  #singleContent { width: 82%; }
  #singlePostSidebarRight { width: 16%; }
  #entry, #archiveEntries { width: calc(100% - 290px); }
  #singlePostSidebarLeft { width: 270px !important; }
  #entry .related-post, #pNewsRelated { max-width: 100%; }
  #photoNewsBlock .photoNewsBlock1,
  #photoNewsBlock .photoNewsBlock3,
  #photoNewsBlock .photoNewsBlock5 { width: 25%; }
  #photoNewsBlock .photoNewsBlock2,
  #photoNewsBlock .photoNewsBlock4 { width: 10%; }
  #photoNewsBlock .photoNewsBlock-text { width: 100%; }
  .YandexDirect728x90, #ad728 { max-width: 100%; }
}

@media (max-width: 900px) {
  #wrapper { padding: 5px 20px 24px; }
  #ad728x90h, #ad468x60 { display: none; }
  #header { min-height: 96px; justify-content: center; }
  #sitename, #sitename_bak { width: auto; padding-top: 4px; }
  #topBar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 6px 8px; }
  #subscribe, #date, #search, #twitter { float: none; width: auto; margin: 0; }
  #date { flex: 1 1 130px; }
  #twitter { display: none; }
  #categories { background: #f0f0f0; }
  #mobileMenuToggle {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; min-height: 46px; padding: 8px 14px;
    border: 0; border-bottom: 3px solid #dcddde; background: #f0f0f0;
    color: #111; font: 21px 'Ubuntu Condensed', sans-serif;
    text-align: left; cursor: pointer;
  }
  #mobileMenuToggle span { color: #cd1713; font-size: 24px; }
  #categories.menu-ready:not(.menu-open) #navcatlist { display: none; }
  #categories.menu-open #navcatlist { display: block; }
  #navcatlist { padding: 4px 0 8px; }
  ul#navcatlist > li { float: none; width: 100%; }
  ul#navcatlist > li > a { min-height: 44px; padding: 12px 14px; border-bottom: 1px solid #ddd; line-height: 20px; }
  ul#navcatlist li ul, ul#navcatlist li:hover ul, ul#navcatlist li ul:hover {
    position: static; display: block; width: 100%; border: 0;
  }
  ul#navcatlist li li { float: none; width: 100%; }
  ul#navcatlist li li a { width: 100% !important; min-height: 40px; padding: 10px 16px 10px 30px; font-size: 16px; letter-spacing: 0; }
  #featuredPost, #otherFeaturedPosts { width: 100%; float: none; margin-right: 0; }
  #featuredPost { margin-bottom: 18px; }
  #featuredWrapper, #subNews, #subNewsN { font-size: 16px; line-height: 1.45; }
  #featuredWrapper, #subNews, #subNewsN, #mainPageSidebar,
  #singleContent, #singlePostSidebarRight { width: 100%; float: none; }
  #subNews, #subNewsN { background: none; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  #subNews > [class$="Container"], #subNewsN > [class$="Container"] { float: none; width: 100%; }
  #subNews [class^="subNewsPost"], #subNewsN [class^="subNewsPost"] { height: auto; padding: 0; }
  #subNews [class^="subNewsPost"] img, #subNewsN [class^="subNewsPost"] img { position: static; display: block; margin-top: 10px; }
  .entrySubNews { width: 100%; }
  #mainPageSidebar { margin-top: 25px; }
  #singlePostSidebarRight { margin-top: 22px; padding: 12px; background: #f4f4f4; }
  #innerSidebarRight { width: 100%; }
  #entry, #archiveEntries { width: calc(100% - 290px); }
  .PhotoNews #entry #writeComment textarea { max-width: 100%; width: 100%; }
  #photoNewsBlock { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
  #photoNewsBlock h3, #photoReceptsBlock h3 { grid-column: 1 / -1; }
  #photoNewsBlock > [class^="photoNewsBlock"] { float: none; width: 100%; padding: 0; border: 0; }
  #photoNewsBlock .photoNewsBlock-text { height: auto; }
  #photoReceptsBlock .tj_container, #photoReceptsBlock .tj_wrapper,
  #photoReceptsBlock .tj_gallery { width: 100% !important; height: auto !important; }
  #photoReceptsBlock .tj_wrapper { overflow: visible; }
  #photoReceptsBlock .tj_gallery { display: grid !important; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
  #photoReceptsBlock .tj_gallery li { position: static !important; float: none !important; width: auto !important; height: auto !important; display: block !important; opacity: 1 !important; }
  #photoReceptsBlock .tj_nav { display: none; }
  #photoReceptsBlock .tj_gallery .desc { display: none !important; }
  #photoReceptsBlock .tj_gallery img { width: 100%; height: auto; }
  #horoGPanel { height: auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
  #horoGPanel a.ico_goro { float: none; }
  #socialBookmark { display: none; }
  #footerPages {
    clear: both; margin-top: 24px; padding: 16px;
    border-top: 3px solid #222; background: #f8f6f6;
    font-size: 14px; line-height: 1.45; text-align: left;
  }
  #footerPageInner { padding: 0; }
  #footerPageInner ul { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px 12px; }
  #footerPageInner li { display: block; margin: 0; font-size: 0; text-transform: none; }
  #footerPageInner li a {
    display: flex; align-items: center; min-height: 44px; padding: 7px 0;
    border-bottom: 1px solid #ddd; font-size: 14px; line-height: 1.3;
  }
  #footerPageInner li:last-child { grid-column: 1 / -1; }
  #themeInfo {
    margin-top: 14px; padding-top: 12px; border-top: 1px solid #ddd;
    color: #555; font-size: 13px; line-height: 1.5; text-align: left;
  }
  #counters { display: none; }
}

@media (max-width: 620px) {
  body { font-size: 16px; line-height: 1.5; padding-bottom: 0; }
  #wrapper { padding: 5px 15px 22px; box-shadow: none; }
  #topBar { justify-content: space-between; }
  #subscribe { font-size: 12px; }
  #subscribe a { display: inline-block; min-height: 32px; padding: 5px 3px; font-size: 14px; }
  #date { font-size: 12px; text-align: right; }
  #search { flex: 1 1 100%; }
  #search form { display: flex; }
  #s { flex: 1 1 auto; width: auto !important; height: 34px !important; font-size: 16px; background-size: 100% 100%; }
  #searchSubmit { flex: 0 0 53px; height: 34px; background-position: center; }
  #header { min-height: 88px; }
  #name1stRow { font-size: 26px; line-height: 1; }
  #name2ndRow { font-size: 46px; line-height: 1; padding-top: 8px; padding-bottom: 8px; }
  h2#featuredTitle { font-size: clamp(27px, 8vw, 38px); line-height: 1.12; letter-spacing: -1px; }
  h2.innerPostTitle { font-size: 23px; line-height: 1.18; letter-spacing: 0; }
  h2.singlePageTitle { font-size: 28px; line-height: 1.18; }
  h2.archiveTitles, h2.pageTitle { font-size: 22px; line-height: 1.2; }
  h3.cat-title, h3.cat-title a { font-size: 22px !important; line-height: 1.2; }
  #featuredWrapper, #subNews, #subNewsN, #entry, #archiveEntries { font-size: 16px; line-height: 1.5; }
  #featuredPost, #otherFeaturedPosts, .innerPost, .archivePost { text-align: left; }
  #featuredPost > img { display: block; width: 100%; height: auto; }
  #featuredWrapper .innerPost { padding: 0 0 16px; margin: 0 0 16px; border-left: 0; border-bottom: 1px solid #eee; }
  #featuredWrapper .innerPost img { max-width: 42%; height: auto; }
  .featuredDetails { line-height: 1.4; }
  #ad728 { overflow: hidden; }
  #slidingBar { height: auto; }
  #gallery ul { padding-top: 12px; padding-bottom: 10px; }
  #photoNewsBlock { display: block; }
  #photoNewsBlock h3 { margin-left: 0; margin-right: 0; }
  #photoNewsBlock > [class^="photoNewsBlock"] {
    display: flex; flex-direction: column; width: 100%;
    padding: 0 0 16px; margin-bottom: 16px; border-bottom: 1px solid #eee;
  }
  #photoNewsBlock > [class^="photoNewsBlock"] > a { display: block; align-self: flex-start; }
  #photoNewsBlock .photoNewsBlock3 > a { order: -1; }
  #photoNewsBlock .photoNewsBlock-text { height: auto; padding: 6px 0; text-align: left; }
  #photoNewsBlock h5 { font-size: 19px; line-height: 1.2; text-align: left; }
  #photoNewsBlock p { font-size: 15px; line-height: 1.45; text-align: left; }
  #photoNewsBlock .photoNewsBlock2 img,
  #photoNewsBlock .photoNewsBlock4 img { max-height: 200px; width: auto; }
  #photoNewsBlock .photoNewsBlock2 > a,
  #photoNewsBlock .photoNewsBlock4 > a { display: flex; align-items: center; gap: 12px; width: 100%; }
  #photoNewsBlock .photoNewsBlock2 > a::after,
  #photoNewsBlock .photoNewsBlock4 > a::after {
    content: attr(title); display: block; flex: 1;
    font-size: 19px; line-height: 1.2; font-weight: bold;
  }
  #photoReceptsBlock .tj_gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #photoReceptsBlock .tj_wrapper ul li a::after {
    content: attr(title); display: block; padding: 6px 0 10px;
    color: #222; font-size: 14px; line-height: 1.3;
  }
  #subNews, #subNewsN { grid-template-columns: 1fr; gap: 22px; }
  #subNews > [class$="Container"], #subNewsN > [class$="Container"] { padding-bottom: 15px; border-bottom: 1px solid #ddd; }
  #subNews [class^="subNewsPost"] img, #subNewsN [class^="subNewsPost"] img { max-width: 160px; }
  #mainPageSidebar { width: 100%; }
  #sidebarTabs { overflow-x: auto; white-space: nowrap; }
  #singleContent, #entry, #archiveEntries, #singlePostSidebarLeft { width: 100% !important; float: none; }
  #entry { text-align: left; padding-top: 15px; overflow-wrap: anywhere; }
  #entryMeta { padding-left: 16px; }
  #entryMeta p { font-size: 14px; line-height: 1.45; }
  #entry p, #archiveEntries p { line-height: 1.55; }
  #entry .alignleft, #entry .alignright { float: none; display: block; margin: 8px auto; }
  #entry img, #entry figure, #entry .wp-caption { max-width: 100% !important; height: auto !important; }
  #entry .related-post { width: 100%; height: auto; min-height: 103px; }
  #entry .related-post-text { width: auto; height: auto; overflow: visible; }
  #singlePostSidebarLeft { margin-top: 24px; }
  #pNewsRelated, #pNewsSidebarLeft, #pNewsSidebarRight { float: none; width: 100%; }
  .PhotoNews #entry #writeComment textarea { width: 100%; }
  #writeComment textarea, #author, #email, #url { max-width: 100%; width: 100%; font-size: 16px; }
  #writeComment label { font-size: 14px; }
  #contactbody, .contactform input, .contactform textarea, .contactform .button { max-width: 100%; width: 100%; margin-left: 0; }
  .contactform label { float: none; width: auto; text-align: left; }
  #singleContent.photoRecept .ingredients { width: 100%; float: none; padding: 12px 0; }
  #footerPages, #footerCategories { overflow-wrap: anywhere; }
  #footerPageInner ul { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #nPager .wp-pagenavi a, #nPager .wp-pagenavi span { display: inline-block; min-width: 34px; min-height: 34px; }
  #smart-archives-menu li { line-height: 1.35; margin-bottom: 10px; }
  #smart-archives-menu li a { display: inline-block; min-height: 34px; padding: 5px 4px; }
}
