/*
 * SPDX-FileCopyrightText: 2023 Håvard Moen <post@haavard.name>
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

:root {

  --bgColor: #7FA490;
  --bgAltColor: #DB7076;

	--headerColor:#000;
	--headerBgColor: #C3C4C6;
	--headerAnchorNormal:var(--headerColor);
	--headerAnchorVisited:var(--headerColor);
	--headerAnchorHover:#369;

	--headingColor:#E04C52;

  --tableEvenColor: #8C9EAA;
  --tableOddColor: #C3C4C6;

  --textColor: #black;
  --textAltColor: white;

	--horzPad:clamp(0.5rem, 4vw, 2rem);
	--vertPad:clamp(0.5rem, min(2vw, 1vh), 2rem);
	--standardPad:var(--vertPad) var(--horzPad);

}

/* reset */
html,body,div,p,h1,h2,h3,h4,h5,h6,
ul,ol,li,dl,dt,dd,form,fieldset,caption,
table,tr,td,th,address,blockquote,img {
  margin:0;
  padding:0;
}img, fieldset, object {
  border:none;
}*, *:after, *:before {
  flex:1 0 auto; /* safari bugfix */
  box-sizing:border-box;
}button, label {
  cursor:pointer;
}html, body {
  height:100%;
}
/* reset end */

button, input, table, textarea, select {
  font-size:1rem;
  line-height:1.75;
  font-family:flowtext,sans-serif;
}

button.switch {
  margin: 0;
  padding: 0;
  border: 2px solid black;
  display: inline-block;
  display: inline-block;
  margin-right: 0.25em;
  line-height: 20px;
  vertical-align: middle;
  text-align: center;
}

button.switch span {
  padding: 0 4px;
  pointer-events: none;
}

[role="switch"][aria-checked="false"] :first-child,
[role="switch"][aria-checked="true"] :last-child {
  background: #262;
  color: #eef;
}

[role="switch"][aria-checked="false"] :last-child,
[role="switch"][aria-checked="true"] :first-child {
  color: #bbd;
}

label.switch {
  vertical-align: middle;
  user-select: none;
}

select {
  color: var(--textColor);
  background: white;
}

body {
  margin: 0 auto;
  font-size:1rem;
  line-height:1.75;
  font-family:flowtext,sans-serif;
  color: var(--textColor);
  background: var(--bgColor);
  background-image: url("/static/2031353-f44336.svg");
  background-blend-mode: luminosity;
}

main {
  padding: var(--standardPad);
}

a {
  text-decoration: none;
}

.modal,
#top,
#menu{
	position:relative;
	display:flex;
	flex-wrap: wrap;
	align-items:center;
	justify-content:center;
}

#top {
	margin:0 auto;
	padding: 0.5rem var(--horzPad);
	background:var(--headerBgColor);
	color:var(--headerColor);
  justify-content: start;
  gap:2rem;
}

#top h1 {
  display: block;
  flex: 0 0 auto;
}

h1 {
  color: var(--headingColor);
}

h2, h3, h4, h5, h6 {
  color: var(--textAltColor);
}

#mainMenu {
  display: flex;
  justify-content: space-evenly;
}

#mainMenu li a:focus,
#mainMenu li a:hover {
	color:var(--headerAnchorHover);
	scale:1.2;
}

#mainMenu ul {
  display: flex;
}

#mainMenu ul li {
  list-style: none;
  flex: 0 0 auto;
  background: #8C9EAA;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
  margin-right: 0.5rem;
}

#mainMenu ul li a[aria-current="page"] {
  color: lightgrey;
}

#mainMenu a,
#mainMenu form {
  display: block;
  text-align: right;
}

#mainMenu label {
  margin-right: 0.5rem;
}

#mainMenu select {
  margin-right: 0.5rem;
}

#mainMenu button {
  text-align: center;
}

#mainMenu a {
  color: white;
}

#mainMenu a:visited {
  color: white;
}

summary {
  color: var(--textAltColor);
  font-size: 1.17em;
}

.inlineMenu ul li:has(a:focus),
.inlineMenu ul li:has(a:hover) {
  scale: 1.1;
}

inlineMenu ul {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin: 0.5em;
}

.inlineMenu ul li {
  display: inline-block;
  list-style: none;
  background: #8C9EAA;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
  margin: 0.3em;
}

.inlineMenu a {
  color: white;
}

.inlineMenu a:visited {
  color: white;
}

#fauxBody > .messages {
  margin: 1em;
}

.messages {
  display: flex;
  justify-content: start;
  flex-wrap: wrap;
}

.messages > div {
  display: inline;
  border-radius: 8px;
  height: auto;
  width: 10em;
  flex: 0 1 auto;
  overflow: hidden;
  margin: 0.2em;
  padding: 0.5em;
}

.messages div label {
  display: inline;
  float: right;
  line-height: 1em;
  margin: 0;
  padding: 0 0.1em 0 0;
  font-size: 80%;
  border: none;
}

/*
.messages div label:after {
  content:"\1F5D9";
}
*/

.messages div:has(input:checked) {
  display: none;
}

.messages p span {
  padding-right: 0.5em;
}

#fauxBody,
.modal,
.modal > .modalClose {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow:auto;
	scroll-behavior: smooth;
}

.modal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  left: -200vw;
  opacity: 0;
  transition:left 0s 0.5s, opacity 0.5s;
}

.modalClose span {
	position:fixed;
	right:999em;
	top:0;
	opacity:0;
}

.modal:target {
  left: 0;
  opacity: 1;
  transition:opacity 0.5s;
}

.modal > div {
  position: relative;
  width: 100%;
  max-width: 32rem;
  margin: auto 1rem;
  padding: var(--standardPad);
	align-items:center;
	justify-content:center;
  overflow: hidden;
  border: solid 2px black;
  background-color: var(--bgColor);
}

.modal:target > div {
	scale:1;
}

.modal h2 {
  border-bottom: solid 2px black;
  margin-bottom: 1em;
  margin-top: 1em;
}

.modal .modalClose {
  position: absolute;
  display: block;
  text-decoration: none;
}

.modal > * > .modalClose {
	top:0.5rem;
	right:0.5rem;
	font-size:1.5rem;
	line-height:1;
	color:var(--flowColor);
}


.modal > * > .modalClose:focus,
.modal > * > .modalClose:hover {
	scale:1.2;
}

.info {
  background-color: #EEE;
  border: 1px solid #DDD;
  color: #999;
}

.success {
  background-color: #EFE;
  border: 1px solid #DED;
  color: #9A9;
}

.warning {
  background-color: #FDF7DF;
  border: 1px solid #FEEC6F;
  color: #C9971C;
}

.error {
  background-color: #FEE;
  border: 1px solid #EDD;
  color: #A66;
}

#tastings ol {
  display: flex;
  list-style: none;
  flex-direction: column;
  width: 20rem;
  flex-wrap: wrap;
}

#tastings ol li {
  margin: 0.5em;
  padding: var(--standardPad);
  border-radius: 8px;
  border: 2px solid black;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

#tastings ol li ul {
  padding: 0;
}

#tastings ol li ul li {
  padding: 0;
  border: 2px solid black;
  list-style: none;
  background: #8C9EAA;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
  margin-right: 0.5rem;
}

#tastings ol li ul li a {
  color: var(--textAltColor);
}

#tastings ol li ul li a:visited {
  color: var(--textAltColor);
}

#tastings ol li ul li:has(a:hover) {
	scale:1.1;
}

#tastings ol li ul li:has(a:focus) {
	scale:1.1;
}

#notes ul {
  margin-left: 1em;
}

#notes ul li {
  color: var(--textAltColor);
}

table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

table td, table th {
  padding: var(--standardPad);
}

table thead tr {
  border-bottom: 2px solid black;
}

table thead th div {
  padding-right: 0.5em;
}

table th {
  color: var(--headingColor);
}

table tr:nth-child(even) {
  background-color: var(--tableEvenColor);
}

table tr:nth-child(odd) {
  background-color: var(--tableOddColor);
}

table,
table a,
table a:visited {
  color: var(--textColor);
}

table a {
  text-decoration: underline;
}

table a:hover,
table a:focus {
  font-size: 105%;
}

table td {
  text-align: center;
}

#resulttable thead th,
#participantResulttable thead th {
  width: 4em;
}

#resulttable thead th:nth-child(2),
#participantResulttable thead th:nth-child(2) {
  width: 30%;
}

#resulttable tbody td:nth-child(2),
#participantResulttable tbody td:nth-child(2) {
  text-align: left;
}

#resulttable thead th:nth-child(7) {
  width: 6em;
}

#resulttable thead th:nth-child(8),
#participantResulttable thead th:nth-child(10) {
  width: 20%;
}

#resulttable a.fa-info,
#resulttable a.fa-comment,
#participantResulttable a.fa-info,
#participantResulttable a.fa-comment {
  padding-left: 0.5em;
  padding-right: 0.5em;
}
#resulttable a.fa-info span,
#resulttable a.fa-comment span,
#participantResulttable a.fa-info span,
#participantResulttable a.fa-comment span {
  display: none;
}

.beerInfo table {
  width: 20em;
}

.beerInfo img {
  height: 12em;
  max-width: 5em;
  float: left;
  margin-right: 2em;
}

#rateBeer {
  display: flex;
  flex-direction: column;
}

#rateBeer form {
  display: flex;
  flex-direction: column;
  padding-top: 1em;
  color: var(--textAltColor);
  border-radius: 5px;
  border: 2px solid black;
  width: 32em;
  margin-bottom: 0.3em;
  padding: 0.5em;
}

#rateBeer form:nth-child(even) {
  background-color: var(--tableEvenColor);
}

#rateBeer form:nth-child(odd) {
  background-color: var(--tableOddColor);
}

#rateBeer form label {
  padding-bottom: 0.5em;
}

#rateBeer button {
  margin-top: 1em;
  margin-bottom: 1em;
  width: 10em;
}

#rateBeer form input {
  accent-color: var(--bgAltColor);
}

#rateBeer form input#look,
#rateBeer form input#smell,
#rateBeer form input#xmas {
  width: 12em;
}

#rateBeer form input#taste {
  width: 30em;
}

#rateBeer form input#aftertaste {
  width: 18em;
}

#rateBeer form output {
  position: relative;
  background-color: var(--bgAltColor);
  font-size: 0.8em;
  width: 2em;
  border-radius: 100%;
  text-align: center;
}

#rateBeer a {
  color: var(--textColor);
  text-decoration: none;
  background-color: var(--headerBgColor);
  margin-top: 1em;
  margin-bottom: 1em;
  padding: var(--standardPad);
  width: 10em;
}

#rateBeer a:visited {
  color: var(--textColor);
  text-decoration: none;
}

#rateBeer + nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}

#rateBeer + nav ul li {
  display: inline;
  background: var(--bgAltColor);
  margin: 0.1em;
  text-align: center;
  border: 1px ridge black;
}

#rateBeer + nav a {
  color: white;
}

#rateBeer + nav a:visited {
  color: white;
}

.beerComment form {
  display: flex;
  flex-direction: column;
  padding-top: 1em;
  color: var(--textAltColor);
}

#beerComment label {
  margin-bottom: 1em;
}

@media (max-width:48rem) {

  body > header a[href^="#"] {
    display:block; /* undo hidden states */
  }

  h1 + input ~ label {
    display:block;
    position:absolute;
    top:1.25rem;
    right:1rem;
    width:1.75rem;
    height:1.5rem;
    --gradColor:#FFF;
    background:linear-gradient(
      0deg,
      var(--gradColor) 0% 20%,
      transparent 20% 40%,
      var(--gradColor) 40% 60%,
      transparent 60% 80%,
      var(--gradColor) 80% 100%
    );
  }

  #top {
    flex-direction: column;
    align-items: start;
  }


  #mainMenu,
  #mainMenu ul {
    flex-direction: column;
    align-items: left;
  }

  #mainMenuToggle ~ nav ul li {
    padding: 0;
    margin: 0;
    height: 0;
    transition: height 400ms cubic-bezier(0.23, 1, 0.32, 1);
  }

  #mainMenuToggle ~ nav ul li a {
    visibility: hidden;
  }

  #mainMenuToggle ~ nav a,
  #mainMenuToggle ~ nav form{
    position: absolute;
    top: -100%;
  }

  #mainMenuToggle:checked ~ nav ul li  {
    height: 3rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: height 400ms cubic-bezier(0.23, 1, 0.32, 1);
  }

  #mainMenuToggle:checked ~ nav ul li a {
    visibility: visible;
  }

  #mainMenuToggle:checked ~ nav a,
  #mainMenuToggle:checked ~ nav form {
    position: static;
    top: 0;
  }

  .beerInfo img {
    height: 10em;
    float: left;
    margin-right: 2em;
  }

  #fauxBody tr {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    border: 2px solid black;
    margin-bottom: 0.2em;
  }

  #fauxBody td {
    display: inline;
    text-align: left;
  }

  /*
  #fauxBody thead {
    display: none;
  }
  */

  #fauxBody thead tr {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin-bottom: 1em;;
  }

  #fauxBody thead tr th {
    display: block;
    width: 20%;
    border: 3px groove black;
    padding: 0;
    margin: 2px;
  }

  #fauxBody thead th:first-child {
    display: none;
  }

  #fauxBody td::before {
    float: left;
    padding-right: 1em;
    content: attr(data-title);
    color: var(--headingColor);
    white-space: nowrap;
    padding-right: 0.5em;
    font-weight: bold;
	}
}

@media (max-width:32rem) {
  .modal > div {
    max-width: 24rem;
  }
  .beerInfo table {
    width: 18em;
  }
  .beerInfo img {
    height: 8em;
    max-width: 3em;
    float: left;
    margin-right: 0.5em;
  }
  #rateBeer form {
    width: 100%;
  }

  #rateBeer form input#look,
  #rateBeer form input#smell,
  #rateBeer form input#xmas {
    width: 8em;
  }

  #rateBeer form input#taste {
    width: 20em;
  }

  #rateBeer form input#aftertaste {
    width: 12em;
  }
}
