/* Mobile adaptation for ak1325.ru (added 2026).
   Loaded AFTER template.css; all rules live inside media queries,
   so the desktop appearance is completely unchanged. */

/* Tablets and below: let the fixed 1000px sheet shrink fluidly */
@media only screen and (max-width: 1000px) {
  body {
    min-width: 0 !important;
  }
  .art-sheet {
    width: auto !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .art-sheet-body {
    min-width: 0 !important;
  }

  /* Header: keep the scales image visible but fluid */
  div.art-header {
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    margin-bottom: 10px !important;
  }
  div.art-header-center {
    width: 100% !important;
    left: 0 !important;
  }
  div.art-header-jpeg {
    position: relative !important;
    left: 0 !important;
    width: 100% !important;
    height: 0 !important;
    padding-top: 25%; /* keeps the original 1000x250 aspect ratio */
    background-size: cover !important;
    background-position: center top !important;
  }

  /* Logo / phone / cabinet blocks: stack instead of absolute overlay */
  div.art-logo {
    position: static !important;
    width: auto !important;
    padding: 6px 10px !important;
  }
  div.art-links,
  div.art-phone,
  div.art-cabinet {
    float: none !important;
    position: static !important;
    width: auto !important;
    top: auto !important;
    left: auto !important;
    padding: 4px 10px !important;
  }

  /* Top menu: wrap items, always show sub-menus (no hover on touch) */
  .art-nav {
    min-height: 0 !important;
    padding-top: 6px !important;
  }
  .art-nav ul.art-menu {
    text-align: left;
  }
  .art-nav ul.art-menu > li {
    float: none !important;
    display: inline-block !important;
    vertical-align: top;
    margin: 2px 4px 2px 0 !important;
  }
  .art-nav ul.art-menu > li > a {
    height: auto !important;
    min-height: 31px;
    padding: 0 8px;
    white-space: normal !important;
  }
  .art-menu a .l,
  .art-menu a .r {
    display: none !important; /* decorative pill sprites break when wrapping */
  }
  .art-menu a .t,
  .art-menu a,
  .art-menu a:link,
  .art-menu a:visited,
  .art-menu a:hover {
    font-size: 15px !important;
    color: #26394d;
  }
  /* sub-menus: static, visible, compact */
  .art-nav ul.art-menu ul {
    visibility: visible !important;
    position: static !important;
    display: block !important;
    padding: 0 0 0 12px !important;
    margin: 0 !important;
    background: none !important;
  }
  .art-nav ul.art-menu ul li {
    clear: none !important;
    margin: 0 !important;
  }
  .art-menu ul a {
    width: auto !important;
    height: auto !important;
    line-height: 1.4 !important;
    padding: 3px 6px !important;
    white-space: normal !important;
    overflow: visible !important;
    background: none !important;
    border: none !important;
    text-align: left !important;
    font-size: 14px !important;
  }

  /* Content column: fluid */
  .art-content-layout,
  .art-content-layout-row,
  .art-layout-cell,
  .art-content {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
  }
  .art-post,
  .art-post-body,
  .art-post-inner,
  .art-postcontent,
  .art-article {
    width: auto !important;
    max-width: 100% !important;
    overflow: visible !important;
  }
  .art-postcontent {
    font-size: 15px !important;
    line-height: 1.5 !important;
  }

  /* Bottom two/three-column module table: stack */
  table.position,
  table.position tbody,
  table.position tr,
  table.position td {
    display: block !important;
    width: 100% !important;
  }

  /* Generic safety */
  img {
    max-width: 100% !important;
    height: auto !important;
  }
  table {
    max-width: 100% !important;
  }
  input[type="text"],
  input[type="password"],
  textarea {
    max-width: 95% !important;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
  }
  .ckCSSinputnormal {
    width: 95% !important;
  }

  /* Footer */
  .art-footer,
  .art-footer-body,
  .art-footer-text {
    width: auto !important;
    max-width: 100% !important;
  }
}

/* Phones: slightly larger base font for readability */
@media only screen and (max-width: 640px) {
  body {
    font-size: 15px !important;
  }
  h1.art-postheader,
  h2.art-postheader {
    font-size: 20px !important;
    line-height: 1.3 !important;
  }
  div.art-phone,
  div.art-cabinet {
    font-size: 14px !important;
  }
}
