/* Phone / tablet layout. Applies only below the desktop width (900px content + 1000px header),
   so the desktop site stays exactly as it was. */
@media (max-width: 940px) {
  html, body { overflow-x: hidden; }
  body {
    background: #1b2771 linear-gradient(#1b2771, #000) fixed;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
  }

  /* header: logo banner cropped from bg.jpg, menu below it */
  #header {
    width: auto;
    height: auto;
    background: url("../images/header-mobile.jpg") no-repeat center top / 100% auto;
    padding-top: 20.3%; /* 205/1010 = banner aspect ratio */
  }
  #menu { padding: 0; }
  .menu { float: none; margin: 0; padding: 8px 6px; background: rgba(0, 0, 0, .55); }
  .sf-menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
  .menu li, .sf-menu li { float: none; margin: 0; }
  .menu li a:link, .menu li a:visited { float: none; font-size: 14px; padding: 8px 2px; }
  /* touch has no hover: hide the Servicii info list, show Galerie's sub-pages as a second row */
  .sf-menu ul.nonlink { display: none; }
  .sf-menu li:hover ul, .sf-menu li.sfHover ul, .sf-menu ul {
    position: static; top: auto; left: auto; width: auto; padding: 0; background: none;
  }
  .sf-menu li:has(> ul:not(.nonlink)) { flex-basis: 100%; text-align: center; }
  .sf-menu li > ul:not(.nonlink) { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 12px; }
  .sf-menu li > ul:not(.nonlink) a:link, .sf-menu li > ul:not(.nonlink) a:visited {
    font-size: 12px; font-weight: normal; color: #ddd; padding: 4px 2px; border: 0;
  }

  #main { width: auto; min-height: 0; box-shadow: none; }
  #slider { display: none; } /* shortcut: Sliderman is fixed at 900x190px and can't shrink; desktop keeps it */

  #content { background-size: 90% auto; background-position: center 40px; padding-bottom: 20px; }
  #content-left, #content-right {
    float: none; width: auto; min-height: 0; padding: 0 14px;
  }
  #content-right { padding-top: 20px; text-align: center; }
  #content-left p { margin-left: 0; text-align: left; }
  #content-left h1 { margin: 20px 0 15px; }
  #content center { padding-top: 20px !important; min-height: 0 !important; }
  #cnt { font-size: 15px; padding: 0 14px; }

  img { max-width: 100%; height: auto; }
  .fancybox img { margin: 5px; }
  iframe, embed, object, video { max-width: 100%; }
  .applemenu { width: auto; margin: 20px 0 0; }

  /* forms: label above field, fields full width */
  div.contact_form table, div.contact_form tbody, div.contact_form tr,
  div.contact_form th, div.contact_form td { display: block; width: auto; }
  div.contact_form th { padding: 10px 0 3px; }
  div.contact_form div.input { float: none; }
  div.contact_form div.input input, div.contact_form div.input textarea {
    width: 100%; box-sizing: border-box; font-size: 16px; /* 16px stops iOS zooming into the field */
    padding: 6px;
  }
  div.contact_form input[type="checkbox"] { width: 22px; height: 22px; }
  div.contact_form input.submit { width: 100px; height: 34px; background-size: 100% 100%; }

  #footer { padding: 0 14px; border-radius: 0; }
}
