@import url('normalize.css');

:root
{
  --accentbg: #ded;
}

body
{
  background: white;
  color: black;
  width: 100%;
  margin: auto;
  font-family: Helvetica, Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6
{
  margin: 5px 0 5px;
  text-align: center;
  font-weight: normal;
}

h1 { font-size: 300% }
h2 { font-size: 200% }
h3 { font-size: 180% }
h4 { font-size: 150%; }
h5 { font-size: 130%; }
h6 { font-size: 110%; }


header div.headings
{
  margin: 0 auto;
  width: max-content;
  background: rgba(255,255,255,60%);
  border-radius: 10px;
  padding: 0 10px;
  color: #030;
}

header h1 
{ 
  font-size: clamp(20px, 4vw, 100px); 
  font-weight: normal;
  line-height: 1.0;
}

header h2
{
  font-size: 110%;
  margin: auto;
  width: max-content;
}

@media (max-width: 800px)
{
  header h2 { display: none }
  header h1 
  {
    padding: 5px 0;    
  }
}


/*
 * Overall page layout
 *   +-----------------body-----------------------+
 *   | +-----------------header-----------------+ |
 *   | |                                        | | 
 *   | +----------------------------------------+ |
 *   | +-------------------nav------------------+ |
 *   | |                                        | |
 *   | +--------------------------------------- + |            
 *   | +------------------main------------------+ |
 *   | |                                        | |
 *   | +----------------------------------------+ |
 *   +--------------------------------------------+
 *  nav and main side by side on wider screens 
 */


/* contains nav information, full width, colour background or images */
header
{
  width: 90%;
  max-width: 1200px;
  margin: auto;
  background: white url(images/banner-semitrans2.jpg) 100%;
  background-size: 100%;
  height: clamp(50px, 10vw, 200px);
  text-align: center;
  font-size: 150%;
  padding: 1px 0 0;
}

/* contains nav menu and main content, either sadie by side or in small
   screen format */
div.nav_main
{
  display: grid;
  grid-template-columns: 1fr 3fr;
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

@media (max-width: 800px)
{
  div.nav_main { width: 100% }
}

@media (max-width: 600px)
{
  header {width: auto}
  div.nav_main 
  { 
    display: block;
    width: auto;
    margin-top: 0;
  }
}


/* contains nav buttons or icon, set positioning */
nav
{
  background: white;
  padding: 5px;
  border: 1px solid #ccc;
  margin: 50px 20px 20px 0;
  padding: 10px;
  height: max-content;
  max-width: 200px;
}

/* under nav header, all page content between header and footer */
main
{
  max-width: 700px;
  padding: 5px;
  background: white;
  color: #040;
  overflow: auto;
}


/* buttons for wide screen menu */
nav a
{
  display: block;
  text-decoration: none;
  width: 120px;
  color: #040;
  background: none;
  line-height: 2.0;
  border-radius: 5px;
  padding: 5px;
}

nav a:hover
{
  background: #eee;
}

nav a.selflink, nav a.selflink:hover
{
  color: white;
  background: #060;
}

nav img.logo 
{ 
  display: block; 
  width: 50%;
  margin: auto;
}

/* hide small menu and icon for wide screen */
nav.small { display: none }
div.menuicon { display: none }
div.menuiconcontainer { display: none }

/* Nav menu changes for small screen */

@media ( max-width: 600px )
{
  nav { display: none }
  /* contains site name/logo and hamburger icon */
  nav.small 
  { 
    display: block; 
    text-align: center;
    margin: 0;
    padding: 0;
    border: none;
    max-width: 100%;
  }
  /* styles for dropdown menu */
  nav a 
  { 
    display: block;
    line-height: initial;
    margin: 5px auto;
    width: auto;
  }

  nav a.selflink, nav a:hover
  {
    color: #444;
    background: #eee;
  }

  /* menu icon ("hamburger") and 'menu' text if shown */
  div.menuiconcontainer, div.menuiconcontainer a
  { 
    background: none;
    display: block; 
    color: black;
    text-decoration: none;
    font-size: 90%;
  }


  div.menuicon
  {
    background: none;
    display: inline-block;
    vertical-align: middle;
    text-align: center;
    height: 20px;
  }

  div.menuicon div.menuline
  {
    display: block;
    margin: 3px;
    height: 3px;
    width: 18px;
    background: black;
  }
}

div.loginstate
{
  color: #999;
  font-style: italic;
}

/* captioned images */
div.caption 
{ 
  font-family: 'Times New Roman', serif; 
  font-style: italic; 
  text-align: center;
  color: black;
  background: white;
}

img.fwpic
{
  display: block;
  width: 100%;
  margin: 10px 0;
}

/*********** reqvars debug info *******/
table.reqvars { margin: 5px 0 }
table.reqvars tr td
{
  font-size: 90%;
  font-family: monospace;
  vertical-align: top;
  background: white;
  color: black;
  border: 1px solid #ccc;
  padding: 2px;
}


/*********** message and error boxes ***********/
div.errorbox, div.msgbox
{
  width: max-content;
  max-width: 90%;
  padding: 10px;
  background: white;
  margin: 20px 0 20px;
}

div.errorbox
{
  border: 2px solid #900;
  color: #900;
  background: #fee;
}
div.msgbox
{
  border: 2px solid #090;
  color: #060;
}

/***************** navigation and action buttons **********/

/*
 * actionbutton and navbutton are implemented as a form
 * default form is display:block with no margins 
 */

/* vertical space between buttons */
form.spacedbutton
{
  margin-top: 10px;
  margin-bottom: 10px;
}

/* inline with 10px gap */
form.inlinebutton 
{ 
  display: inline-block; 
  width: max-content; 
  margin-right: 20px;
}

form.delbutton { margin: 10px 0 }
form.delbutton input[type=submit]
{ background: linear-gradient(white, #f99); }
form.delbutton input[type=submit]:hover
{ background: linear-gradient(#fee, #f00); }


form.greenbutton input[type=submit],
form.datarec_form input[type=submit]
{ background: linear-gradient(white, lightgreen) }

form.addbutton input[type=submit]
{ background: linear-gradient(white, lightgreen) }

/* adapt the examples above for other coloured buttons */

form.centrebutton
{
  margin-left: auto;
  margin-right: auto;
  width: max-content;
}


/**** text boxes ****/

div.panel
{
  background: white;
  max-width: 600px;
  padding: 10px;
  margin: 10px;
  border-radius: 5px;
}

div.panel.centred
{
  margin: 10px auto;
}

/********** DataRec class and derivatives: form components ********/

/* forms */
form.datarec_form 
{ 
  background: var(--accentbg); 
  margin: 20px 0; 
  padding: 5px; 

}
div.form_input_pair 
{ 
  display: grid;
  grid-template-columns: 1fr 8fr;
  background: var(--accentbg);
  margin: 10px 0;
}

form.datarec_form.mail div.form_input_pair 
{ 
  grid-template-columns: 80px 1fr;
}

div.form_input_pair div.input input[type=text],
div.form_input_pair div.input textarea { width: 98% }

div.form_input_pair div.info,
div.form_input_pair div.error
{
  grid-column-start: 2;
  grid-column-end: 3;
}


@media (max-width: 500px)
{

  div.form_input_pair 
  { 
    grid-template-columns: 1fr;
  }
  
}

input.escode  {display: none}



/********************** Authenticator (login) forms ***************/

div.auth_form 
{ 
  width: 90%; 
  max-width: 500px;
  margin: 20px auto; 
  padding: 10px;
  background: #e8f0e0;
  border-radius: 5px;
} 
div.auth_form input { width: 90%}
div.auth_form input[type="submit"] { width: max-content }
div.auth_form table tr td { padding: 0 2px }
div.auth_error { color: red; background: white; padding: 5px }