/* Phone overrides for the legacy orwell.ru stylesheets (desktop layout is unchanged).
   Loaded on every page by build/lib/mobile-head.mjs together with the viewport meta. */
@media screen and (max-width: 760px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  body {
    overflow-wrap: break-word;
    line-height: 1.45;
  }

  /* Media never wider than the screen */
  img, video, object, embed, iframe {
    max-width: 100% !important;
  }
  /* Only images and video keep their proportions; iframes (ads, embeds) keep their own height */
  img, video {
    height: auto;
  }
  pre {
    white-space: pre-wrap;
  }
  input, textarea, select {
    max-width: 100%;
    box-sizing: border-box;
  }
  /* Wide data tables (charset charts, download listings) scroll inside themselves */
  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
  a, nobr {
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  dl dl, ul ul, ol ol, dd dl {
    margin-left: .5em !important;
    padding-left: .5em !important;
  }
  dt, dd {
    width: auto !important;
  }
  /* Fixed-width page wrappers (site map, archive pages) */
  #cont, .top, .text2, #sdbarscrolp {
    width: auto !important;
    max-width: 100%;
  }

  /* Text columns: the desktop side margins (3-6em, fixed percentages) eat a phone screen */
  #read, #infos, #main, #bdoc, #bdoc_end, #idx, #content, #book_data, #si_data {
    margin-left: 14px !important;
    margin-right: 14px !important;
  }
  blockquote, .bq_def, .bq_stih, ol, ul, dl, dd {
    margin-left: 1em !important;
    margin-right: 0 !important;
  }
  /* Shorter paragraph indent only where the desktop CSS indents every p (read templates) */
  :where(html:has(link[href$="/styles/read/default.css"])) p, .tekst p, p.txt {
    text-indent: 1.5em;
  }
  /* Justified text in a narrow column leaves wide gaps between words
     (selectors that set text-align: justify in the site stylesheets) */
  .jus, .djus, .tekst, .t_txt, .t_xttime, .t_xttimes, .jus p, .t_txt p, #about p, [align="justify"] {
    text-align: left !important;
  }
  /* ...but centred blocks inside the text stay centred (1984: party slogans, Goldstein's book) */
  .t_txt .slogan p, .t_txt .iloveyou p, .t_txt .goldstein_heading {
    text-align: center !important;
    text-indent: 0;
  }
  .bib_d, .source, .b_lnk, .etxt_a, #intro, .s_tit, .s_list {
    width: auto !important;
  }
  /* Nested section margins (readex landing pages, book cards) */
  #rx_data {
    margin-right: 14px !important;
  }
  #rx_data .sct_1, #rx_data .sct_2, #rx_data .sct_3, .bib_d {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Navigation and footer links: comfortable tap targets */
  #crumbs, #f_nav, #f_main {
    line-height: 2;
  }
  #crumbs {
    text-align: left !important;
    margin: 0 14px;
  }
  #f_nav, #f_main, #sdag {
    margin-left: 14px;
    margin-right: 14px;
  }
  /* Footnote back-links */
  .an_lbk a {
    display: inline-block;
    min-height: 24px;
    padding: 0 4px;
  }
  /* Site map: layout tables stay tables, readable link size */
  #cont td, #cont .lhead {
    overflow-wrap: anywhere;
  }
  #cont .lbullet {
    padding: 0;
    font-size: 9px;
  }
  #cont .lpage, #cont .lpage a {
    font-size: 15px !important;
  }
  /* Readex landing pages: the cover strip on the left covers the first breadcrumb */
  body:has(#rx_data) #crumbs {
    margin-left: 44px;
  }
  /* Novel landing pages: the fixed caricature logo sits under the centred heading */
  body:has(#nov_data) {
    background-image: none;
  }
}
