:root {
  --header-height: 4em;
  --background-main-colour: #1a1f2c;
  --dark-background-colour: #040410;
  --light-background-colour: #1d222f;
  --secondary-dark-background-colour: #101522;
  --link-colour: deepskyblue;
  --link-hover-colour: yellow;
  --text-colour: white;
  --darker-text-colour: gray;
  --box-border-colour: gray;
  --form-border-colour: dimgray;
  --column-width: 360px;
  --wide-column-width: 800px;
  --column-gap: 1rem;
  --full-image-min-width: 800px;
  --full-image-max-width: 1600px;
  --image-interaction-min-width: 600px;
  --image-title-height: 3em;
  --text-area-height: 12rem;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--background-main-colour);
  color: var(--text-colour);
  font-family: Tahoma, sans-serif;
  margin: 0;
  padding-top: var(--header-height);
}

form fieldset {
  border: 2px solid var(--form-border-colour);
}

form .form-row {
  display: grid;
  grid-template-columns: 25% minmax(0, 1fr);
  align-items: center;
  gap: var(--column-gap);
  padding-top: 0.5em;
  padding-bottom: 0.5em;
}

form .form-row label {
  text-align: right;
}

form .form-row label:after {
  content: ':';
}

form .form-row textarea {
  box-sizing: border-box;
  width: 100%;
  height: var(--text-area-height);
  resize: none;
}

form fieldset legend {
  padding-left: 1em;
  padding-right: 1em;
  font-weight: bold;
}

form input[type='submit'] {
  display: block;
  margin-inline: auto;
  font-size: larger;
  padding: 1em;
  background: var(--secondary-dark-background-colour);
  color: white;
  font-weight: bold;
  border: none;
}

form input[type='submit']:hover {
  color: var(--link-hover-colour);
  cursor: pointer;
}

p.explanation {
  font-size: smaller;
  color: var(--darker-text-colour);
  margin-left: 1em;
  margin-right: 1em;
  line-height: 110%;
}

a {
  color: var(--link-colour);
  font-weight: bold;
  text-decoration: none;
}

a:hover {
  color: var(--link-hover-colour);
  text-decoration: underline;
}

.has-icon::before {
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  margin-right: 0.5em;
}

a.admin-login-link::before {
  content: "\f4fe";
}

a.visitor-login-link::before {
  content: "\f007";
}

a.visitor-register-link::before {
  content: "\f4ff";
}

a.collection-edit-link::before {
  content: "\f013";
}

a.gallery-edit-link::before {
  content: "\f1de";
}

a.image-edit-link::before {
  content: "\f1c5";
}

a.create-collection-link::before {
  content: "\f302";
}

a.edit-setup-link::before {
  content: "\f1de";
}

ul.icons {
  padding: 0;
}

ul.icons li {
  display: inline;
  margin-left: 0.5em;
  margin-right: 0.5em;
}

ul.icons li::before {
  display: none;
}

ul.reactions li {
  padding: 0;
  margin: 0;
}

.reaction-button {
  cursor: pointer;
}

/* main site header */
#main #header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  background: var(--dark-background-colour);
}

@media (max-width: 600px) {
  #main #header {
    font-size: smaller;
  }

  #main #header a {
    font-weight: normal;
  }
}

.breadcrumbs {
  list-style-type: none;
}

.breadcrumbs li {
  display: inline;
}

.breadcrumbs li::before {
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  margin-right: 0.5em;
  content: '\f0da';
}

.breadcrumbs li:first-child::before {
  content: none;
}

.breadcrumbs li:last-child {
  font-size: larger;
}

#main #header #visitor-panel {
  margin-right: 0.5em;
}

/* main site footer */
#main #footer {
  margin-top: 1em;
  width: 100%;
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  background: var(--dark-background-colour);
}

#main #footer ul {
  list-style-type: none;
}

#main #footer ul.copyright {
  font-size: smaller;
  color: var(--darker-text-colour);
}

#main #footer a {
  color: var(--darker-text-colour);
  font-weight: bold;
}

#main #footer ul.copyright li {
  display: inline;
}

#main #footer ul.copyright li:after {
  content: ' |';
}

#main #footer ul.copyright li:last-child:after {
  content: '';
}

/* styles for a nice-looking box */
#main .nice-box.with-border {
  margin: 1em;
  padding: 1em;
  border: 1px solid var(--box-border-colour);
}

#main .nice-box header {
  text-align: center;
}

#main .nice-box .description {
  padding: 0.5em;
}

#main .nice-box .description.has-thumbnail {
  text-align: center;
}

#main .nice-box footer {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  background: var(--secondary-dark-background-colour);
}

#main .nice-box footer:not(.normal-size) {
  font-size: smaller;
}

#main .nice-box footer.centred {
  justify-content: center;
}

#main .nice-box footer:not(.centred) :last-child {
  margin-left: auto;
}

#main .nice-box footer ul.actions {
  list-style: none;
}

#main section.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--column-width)), var(--column-width)));
  gap: var(--column-gap);
  justify-content: center;
  align-items: stretch;
}

#main section.grid.wide {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--wide-column-width)), var(--wide-column-width)));
}

#main .nice-image-box {
  display: flex;
  flex-direction: column;
}

#main .nice-image-box > div {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
}

#main .nice-image-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* full image page */
#main .full-image .image-display header {
  position: fixed;
  left: 0;
  top: var(--header-height);
  width: 100%;
  z-index: 50;
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  background: var(--secondary-dark-background-colour);
  height: var(--image-title-height);
  text-align: center;
}

#main .full-image .image-display .image-reactions {
  margin-top: var(--image-title-height);
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
}

#main .full-image .image-display .image-reactions span,
#main .full-image .image-display .image-reactions .link-to-comments,
#main .full-image .image-display .image-reactions .download-link {
  font-size: xx-large;
}

#main .full-image .image-display .image-reactions .link-to-comments:hover,
#main .full-image .image-display .image-reactions .download-link:hover {
  text-decoration: none;
}

#main .full-image .image-display .image-with-navigation {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

#main .full-image .image-display .image-with-navigation img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(min(100dvh - var(--image-title-height) - var(--header-height)));
  object-fit: contain;
}

#main .full-image .image-display .image-with-navigation a {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10%;
  display: flex;
  align-items:center;
  justify-content: center;
  color: transparent;
}

#main .full-image .image-display .image-with-navigation a:hover,
#main .full-image .image-display .image-with-navigation a:focus-visible {
  background: rgb(0 0 0 / 30%);
  color: var(--link-hover-colour);
}

#main .full-image .image-display .image-with-navigation a.navigate-previous-image {
  left: 0;
}

#main .full-image .image-display .image-with-navigation a.navigate-next-image {
  right: 0;
}

#main .full-image #image-description {
  max-width: var(--wide-column-width);
  display: block;
  margin-inline: auto;
  border-bottom: 2px solid var(--darker-text-colour);
  padding-left: 1em;
  padding-right: 1em;
}

#main .full-image #image-description p::before {
  content: '\f05a';
}

#main .comment {
  background: var(--secondary-dark-background-colour);
}

#main .comment header {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 1em;
}

#main .comment header .comment-author {
  font-size: larger;
  font-weight: bold;
}

#main .comment header .comment-timestamp {
  font-size: smaller;
  color: var(--darker-text-colour);
}

#main .comment .comment-content {
  font-style: italic;
  padding-bottom: 1em;
}

#main #new-comment {
  max-width: calc(var(--column-width) * 2 + var(--column-gap));
  display: flex;
  margin-top: 1em;
  margin-left: auto;
  margin-right: auto;
  background: var(--light-background-colour);
}
