/*
For nav:
-menu-container
-top-menu
  --"Family Photo Challenge" (left)
  --user (right)
    --username
    --login/logout
-main-menu
  --index (home)
  --Galleries
  --Challenges
  --About

for galleries
-photo-challenge-gallery
  -- gallery name
  -- gallery challenge (collapsible)
-photo-grid
  -imagebox
  -description

forms
-- form title
-- for elements
  -- Success
  -- error

other
-clearfix


*/

body{
  font-family: Arial, Helvetica, sans-serif;
  background-color: #f2f2f2;
}

/* use box sizing -- withds are full box width (not box+padding+border) */
html {
  box-sizing: border-box;
  text-size-adjust: 100%; /* prevents mobile devices from auto zooming text */
}
*, *::before, *::after{
  box-sizing: inherit;
}

/*helps make things more mobile friendly */
@viewport { width:device-width; scale:1;}

/* ---------------------- navigation stuff ------------------ */
.menu-container{
  background-color: #d9d9d9; /* grey */
  padding: 0.5em;
  border-radius: 0.5em;
}

.top-menu{
  display: flex;
  justify-content: space-between;
  text-decoration-color: #000;
}

.site-name{
  font-size: 1.6em;
  font-weight: bold;
  font-family: serif;
  display: flex-wrap;
  justify-content: flex-start;
}

.top-menu-user-and-login {
 display: flex;
 justify-content: flex-start;
 margin-right: 25px;
 color: #000;
}

.user {
  color: #444;
  font-size: 1.2em;
  text-align: center;
}
.login-logout {
  padding: 0.25em 0.5em;
  margin-left: 10px;
  background-color: #000;
  border-radius: 0.25em;
  text-align: center;
}

.main-menu{
  padding: 0.5em;
}


nav ul{
  margin: 0;
  padding: 0;
  list-style-type: none;
  /*background-color: #ccc;*/
}
nav li {
  display: inline-block;
  background-color: #000;
  padding: 0.5em 0.5em;
  margin: 0em 0em;
  border-radius: 0.5em;
  text-decoration: none;
}
nav a:link, a:visited, ul {
  color: #ccc;
  display: inline-block;
  text-align: center;
  text-decoration: none;
}
nav a:hover{
  text-decoration:underline;
}

.dropdown:hover .galleries-menu {
  display: flex;
  flex-direction: column;
  background: #eee;
  color: #fff;
  border-radius: 0.5em;
  padding-top: 1.5em;

  position: absolute;
  top: +1em;
  left: 0px;
  z-index: 1;
}
.galleries-menu {
  display: none;
}
.galleries-menu li{
  list-style: none;
  padding: 0 1em 0em 0.5em;
  margin: 0.25em;
}
.dropdown {
  position: relative;
}

.dropdown > span {
  z-index: 2;
  position: relative;  /* This is important! */
  cursor: pointer;
}

header {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  color: #556;
}

.gallery-name {
  display: flex;
  justify-content: flex-start;
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 0px;
  margin-top: 0.2em;
  background-color: none;
}


/* Change the background color on mouse-over */
.gallery-name:hover {
  background-color: #ddd;
  color: black;
}

.photo-grid {
  padding: 0 6px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.imagebox {
  background: #fff; /*white*/
  border: 2px solid #ccc;
  margin: 2px;
  max-width: 300px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.imagebox-the-img {
  /*background: #eee; */
  max-width: 300px;
  max-height: 500px;
  padding: 5px;
}

.imagebox-the-img img {
  width: 100%;
  height: auto;
}


div.description {
  padding: 5px;
  text-align: center;
}



/* ------- main index page ------- */

.main_index_gallery_list{
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  flex-direction: row;
}
.main_index_imagebox{
    display:flex;
    flex-wrap: wrap;
    background: #fff; /*white */
    border: 2px solid #ccc;
    border-radius: 0.2em;
    margin: 6px;
    width: 40%;
}
.main_index_imagebox:hover{
  background: #e6f2ff;
    border: 2px solid #777;
}
.main_index_imagebox img{
  max-width: 100px;
  max-height: 100px;
  border-radius: 4px;
  overflow: hidden;
  object-fit: cover;
  margin: 4px
}
.active-gallery{
  border: 4px #1a8cff;
}
.active_challenge_text{
  font-weight: bold;
  color: #cc0000;
}
.main-index-gallery-name-and-description {
  /*display: inline-block;*/
  float: left;
  font-weight: bold;
}
.main-index-gallery-name{
  display: inline;
  /* background-color: #b3b3ff; */
  font-weight: bold;
}
.main-index-gallery-description{
  display: block;
  /* background-color: #a32414; */
  font-weight: normal;
  font-style: oblique;
}


/* -------  Forms ------- */

form {
  background-color: #0099e6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 100%
  padding: 1.5em 0em;
  margin: 1.2em 0em;
  border-radius: 0.5em;
}

form .form_error, .error {
  color: #dd2222;
  margin-left: 1em;
  font-weight: bold;
}

form span .success {
  color: #0000ff;
  margin-left: 1em;
  font-weight: bold;
}

label {
  display: flex;
  max-width: 50%;
  margin-top: 1.2em;
  margin-left: 1em;
}

input[type=inputarea], .inputarea, input[type=password], input[type=text]{
  display: flex;
  max-width: 70%;
  margin-left: 1.4em;
  margin-bottom: 1.2em;
}

textarea{
  height: 10em;
}

input[type=button], input[type=submit], input[type=file]{
  display: flex;
  max-width: 50%;
  padding: 1.2em 1.4em;
  margin: 1.4em 1.4em;
}
input[type=submit]:hover {
  background-color: #ccc;
}



@media screen and (max-width: 400px) {
  nav li{
    display: none;
    display: block;
  }
  .site-name{
    font-size: 1em;
  }

  header .gallery-name {
    font-size: 1.2em;
    font-weight: bold;
    color: "green";
  }
  .inputarea {
    display: flex;
    width: 100%;
    margin-top: 1em;
  }
  .imagebox {
      max-width: 100%;
      box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  }
  .main_index_imagebox{
      display:flex;
      flex-wrap: wrap;
      background: #fff; /*white*/
      width: 100%;
  }
  .imagebox-the-img {
    /*background: #eee; */
    max-width: 50%;
    padding: 5px;
  }
  .main_index_imagebox img{
    max-width: 50px;
    max-height: 50px;
  }

  .main_index_imagebox{
      display:flex;
      flex-wrap: wrap;
      border: 2px solid #ccc;
      margin: 4px;
      max-width: 100%;
  }
  .main_index_gallery_list{
    flex-direction: column;
  }
}




/* --------- Image Rotation ----------------- */
/*
Doesn't work well with image boxes...
.mirror {
        -moz-transform: scaleX(-1);
        -o-transform: scaleX(-1);
        -webkit-transform: scaleX(-1);
        transform: scaleX(-1);
        filter: FlipH;
        -ms-filter: "FlipH";
}


.rotateimg90{
  -webkit-transform: rotate(90deg);
  -moz-transform: rotate(90deg);
  -ms-transform: rotate(90deg);
  -o-transform: rotate(90deg);
  transform: rotate(90deg);
}

.rotateimg180{
  -webkit-transform:rotate(180deg);
  -moz-transform: rotate(180deg);
  -ms-transform: rotate(180deg);
  -o-transform: rotate(180deg);
  transform: rotate(180deg);
}
.rotateimg270{
  -webkit-transform:rotate(270deg);
  -moz-transform: rotate(270deg);
  -ms-transform: rotate(270deg);
  -o-transform: rotate(270deg);
  transform: rotate(270deg);
}
*/


/*
@media only screen and (max-width: 700px) {
  .imagebox {
    max-width: 25%;
    margin: 6px 0;
  }
}
@media only screen and (max-width: 500px) {
  .imagebox {
    max-width: 100%;
    margin: 2px 0;
  }
}
*/
/* how clarfix helps with floats: https://learn-the-web.algonquindesign.ca/topics/float-clear/ */
.clearfix:after {
  content: "";
  display: table;
  clear: both;
}
