/* Coaley JS Gallery - page styling (loaded on every front-end page)
   Two sections:  1) PHONE LAYOUT   2) VIEW BUTTONS                         */

/* ===== 1) PHONE LAYOUT ==================================================
   Home (search) page and introduction pages on screens up to 700px wide.
   Change the 700px below to move the "phone" breakpoint.                  */
@media (max-width: 700px) {

  /* images and tables never wider than the screen */
  img { max-width: 100%; height: auto; }
  .entry-content table, .page-content table { display: block; overflow-x: auto; }

  /* title */
  h2.text_centre { font-size: 1.5rem; line-height: 1.25; }

  /* intro text under the title */
  .headline { padding-left: 12px; padding-right: 12px; }

  /* search page: stack the two columns (picture, then search box) */
  .search_form_double_column {
    display: block !important;
    grid-template-columns: 1fr !important;
    width: auto !important;
  }
  .search_form_double_column > div {
    width: 100% !important;
    float: none !important;
    box-sizing: border-box;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* cancel the sideways shifts used on the wide layout */
  .cond_shift_right50, .rev_cond_shift_right50 {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    left: 0 !important;
    transform: none !important;
    position: static !important;
    width: auto !important;
  }

  /* search box and buttons: full width, big enough to tap
     (16px text stops iPhones zooming in when the box is selected) */
  #cg_form { width: 100%; box-sizing: border-box; font-size: 16px; padding: 8px; }
  /* Submit / Clear / Browse buttons: left-aligned, side by side, as on a PC */
  .search_buttons {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-start !important;
    gap: 10px;
    margin: 10px 0 !important;
    padding-left: 0 !important;
  }
  .search_buttons > div { margin: 0 !important; padding: 0 !important; }
  .search_buttons input[type="submit"],
  .search_buttons input[type="reset"] { margin: 0 !important; padding: 10px 16px; font-size: 15px; }

  /* introduction pages: a picture floated left squeezes the text into a narrow
     column, so on a phone put the picture (and its caption) above the text */
  .entry-content .alignleft, .entry-content .alignright,
  .entry-content figure.alignleft, .entry-content figure.alignright,
  .entry-content .wp-caption, .entry-content .wp-block-image {
    float: none !important;
    display: block;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 0 1em 0 !important;
  }

  /* results list */
  .image_thumb_item { padding-left: 12px; padding-right: 12px; }
  .image_thumb { max-width: 100%; height: auto; }
  .left_pad20 { padding-left: 0 !important; }
}

/* ===== 2) VIEW BUTTONS in the image lists ===============================
   Size, weight and colours.  (!important is there to beat the theme.)     */
.cjg-root .view1 {
  font-size: 12px !important;            /* size of text */
  font-weight: 400 !important;           /* 400 = normal, 700 = bold */
  padding: 2px 10px !important;          /* button size: up/down, left/right */
  background: #dff0d8 !important;        /* light green  */
  color: #2d5a1e !important;             /* text colour  */
  border: 1px solid #9cc88f !important;  /* outline      */
  border-radius: 3px !important;
  cursor: pointer;
}
.cjg-root .view1:hover { background: #c9e6bd !important; }   /* colour when pointed at */
