:root {
  font-family: 'Base', monospace;
  font-size: calc(11px + 0.390625vw);
  font-weight: 400;
  --text: #111;
  --bg: #fff;
  --link: rgb(0 98 255);
  --danger: #ff3333;
  --grey: #f0f0f0;
  --paper: #fff1ddbd;
  --accent: #e38d1e;
}

@font-face {
  font-family: 'Base';
  src: url('/assets/fonts/TT2020Base-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Base';
  src: url('/assets/fonts/TT2020Base-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem 0; line-height: 1.3; }
.headline { font-size: 4rem; line-height: 1.1; display: inline-block; margin: 0 0 1rem 0; }
p { margin: 0 0 1rem 0; }
a { color: var(--link); }
li { list-style-position: inside; }
ol, ul { margin-bottom: .5rem; }

html { height: 100%; }

@keyframes fadeIn { to { opacity: 1; } }

body {
  animation: fadeIn 0.2s ease-in forwards;
  opacity: 0;
  background-color: var(--bg);
  color: var(--text);
  height: 100vh;
  display: grid;
  grid-template-columns: auto;
  grid-template-rows: auto 1fr auto;
  line-height: 1.4;
}

.admin, .danger { color: var(--danger); text-decoration: none; }

footer {
  max-width: 980px;
  padding: 1rem 2rem;
  font-size: smaller;
  margin: 0 auto;
  text-align: center;
  border-top: 1px solid var(--grey);
}
footer a { text-decoration: none; }

nav {
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2vw;
}
nav a {
  white-space: nowrap;
  text-decoration: none;
  font-weight: 400;
}
nav .active { font-weight: bold; }
nav .logo {
  display: flex;
  justify-content: center;
  padding: .5rem 1rem;
  background: var(--link);
  color: var(--bg);
  text-decoration: none;
  border-radius: 3rem;
}
nav .spin::before { content: '🎲'; }
nav .tagline {
  flex-grow: 1;
  font-style: italic;
}

/* Hamburger Menu */
.hamburger { display: none; margin: 0px;}
.menu-toggle { display: none; }
nav div {
    display: flex;
    flex-direction: row;
    gap: 2vw;
    align-items: center;
}
nav div a { font-size: inherit; color: var(--text); text-decoration: none; }

@media (max-width: 768px) {
  body { min-width: 300px; }
  nav { justify-content: space-between; }
  nav .logo { order: 1; }
  nav .tagline { display: none; }
  .hamburger {
        display: block;
        order: 2;
        background: #ffffff;
        width: 36px;
        border-radius: 31px;
        /* border: none; */
        font-size: 2rem;
        cursor: pointer;
        position: fixed;
        top: 2rem;
        right: 2rem;
        z-index: 2000;
        text-align: center;
        /* filter: opacity(0.5); */
        box-shadow: 0px 0px 10px rgba(55, 55, 55, .2);
    &::before { content: '≡'; }
  }
  nav div { display: none; }
  .menu-toggle:checked ~ header nav div {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--text);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: .9;
  }
  .menu-toggle:checked ~ main {
    filter: grayscale(1) blur(10px);
  }
  .menu-toggle:checked ~ header nav div a {
    font-size: 2rem;
    margin: 1rem 0;
    text-decoration: none;
    color: var(--bg);
  }
  .menu-toggle:checked ~ header nav .hamburger {
    z-index: 3000;
    &::before { content: '⨯'; }
  }
  .menu-toggle:checked ~ header nav div a.spin::before { content: 'Random'; }
}

.spin {
  display: inline-block;
  transform-origin: center;
  transition: transform .5s ease-in-out;
}
.spin:hover { animation: spin-scale 1s linear infinite; }

@keyframes spin-scale {
  from { transform: scale(1.5) rotate(0deg); }
  to { transform: scale(1.5) rotate(360deg); }
}

#map {
  height: 70vh;
  border-radius: 1rem;
  box-shadow: 1px 0px 2px rgba(104, 23, 23, .3);
  margin: 0 0 1rem 0;
}

#mapWidget {
  width: 100%;
  height: 100%;
  border: 1px solid #ddd;
  display: block;
  min-height: 300px;
  margin-bottom: 1rem;
}

#wrapper {
  overflow-x: auto;
  max-width: 980px;
  height: 100%;
  margin: 0 auto;
  padding: 0 2rem 2rem 2rem;
}
#wrapper.fullWidth { max-width: 100vw; }

#placeDesc {
  white-space: pre-wrap;
  text-align: left;
  margin: 0 0 1rem 0;
  padding: 2rem 3rem;
  border: 1px var(--grey) solid;
  background: var(--bg);
  overflow-wrap: anywhere;
}

#placeMeta { color: #aaa; }

button { margin-right: .3rem; }

textarea, input:not([type="checkbox"]), select { width: 100%; }

textarea, input, select, button {
  font-size: .75rem;
  padding: .5rem;
  border: 1px solid var(--grey);
  border-radius: 4px;
  font-family: inherit;
  background-color: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea[readonly], input[readonly], select[readonly] {
  opacity: .6;
  cursor: not-allowed;
}

textarea:required, input:required, select:required { border: 1px red solid; }

button {
  background: var(--link);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 500;
}
button:hover { filter: brightness(1.1); }
button[name="delete"] { background: var(--danger); }

img { max-width: 100%; height: auto; }

.mapPin {
  background-color: var(--bg);
  opacity: .9;
  border-radius: 16px;
  font-size: 1rem;
  mix-blend-mode: multiply;
  box-shadow: 0px 0px 20px var(--link);
  border: 1px solid var(--link);
}

.meta {
  background: var(--grey);
  border-radius: 1px;
  color: var(--text);
  padding: 1px 2px;
  font-size: x-small;
  display: inline-block;
  margin: 0 0 .2rem 0;
  text-decoration: none;
}

#placesGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  margin: 0 0 2rem 0;
  align-items: center;
  gap: 1rem;
}
#placesGrid figure {
  display: inline-block;
  aspect-ratio: 4/3;
  position: relative;
}
#placesGrid figcaption {
  font-size: .8rem;
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#placesGrid figure.unpublished { border: 2px dashed var(--danger); }
#placesGrid div.labels {
  position: absolute;
  top: 6px;
  right: 5px;
  display: flex;
  gap: .5rem;
}
#placesGrid img {
  display: block;
  border-radius: .5rem;
}
#placesGrid.latest {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

img#imagePreview {
  border: 1px solid grey;
  width: 100%;
  aspect-ratio: 4/3;
  display: none;
  object-fit: contain;
}

#categoryFilterMap {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 30vw;
}

#filterMenu {
  margin: 0 auto 2rem auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  width: max-content;
  align-content: flex-start;
  max-width: 100%;
}

#filterMenu select {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

#filterMenu button {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 4px;
}

#filterMenu input[type="checkbox"] { margin-left: 0.5rem; }

@media (max-width: 768px) {
  #filterMenu {
    font-size: .75rem;
    gap: 0.5rem;
    padding: 0.25rem;
  }
}

#pagination.pages {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
#pagination.places {
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  justify-items: center;
  margin: 0 1.5rem .5rem 1.5rem;
}

.submit-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-section {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.section-info {
  flex: 0 0 250px;
  font-size: 0.9rem;
}
.section-info h3 { margin-bottom: 0.5rem; }

.section-form {
  flex: 1;
  width: 100%;
}

@media (max-width: 768px) {
  .form-section {
    flex-direction: column;
    gap: 1rem;
  }
  .section-info {
    flex: none;
    width: 100%;
  }
}

.coord-inputs {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.coord-inputs > * {
  flex: 1;
  min-width: 120px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

label { display: block; margin-bottom: 0.5rem; }

textarea { min-height: 100px; resize: vertical; }

#imagePreview {
  max-width: 100%;
  margin: 1rem 0;
  border: 1px solid #ddd;
}

.message {
  padding: 1em;
  margin: 1rem;
  border-radius: 1rem;
  color: var(--bg);
}
.message.ok { background-color: var(--link); }
.message.error { background-color: var(--danger); }

@media (max-width: 768px) {
  .headline { font-size: 2rem !important; }
}

#card {
  position: relative;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 2vw;
  padding: 3vw;
  background: linear-gradient(var(--paper), var(--paper)), url('/img/noise.svg');
  border-radius: 1.5rem;
  box-shadow: 1px 0px 2px rgba(104, 23, 23, .3);
}

.card-tab {
  min-width: max-content;
  height: 3rem;
  z-index: 1;
  padding: 1rem 2rem;
  margin: 0 auto;
}

.card-tab-title {
  font-size: 1rem;
  letter-spacing: 3px;
  font-weight: 400;
  text-transform: uppercase;
  display: inline-block;
  line-height: 1;
  transform: rotate(var(--random-number));
}

.image {
  flex: 1 1 45%;
  position: relative;
  display: inline-block;
  padding: 2vw;
  background-color: #f5f5f5;
  border-radius: .25rem;
  box-shadow: 0px 3px 5px rgba(0,0,0,0.1);
  max-height: max-content;
}
.image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5.5rem;
  height: 5.5rem;
  background: rgb(204 205 203 / 39%);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  filter: blur(5px) drop-shadow(2px 2px 7px white);
}
.image::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 5.5rem;
  height: 5.5rem;
  background: rgb(204 205 203 / 39%);
  clip-path: polygon(100% 100%, 0 100%, 100% 0);
  filter: blur(5px) drop-shadow(2px 2px 7px white);
}
.image .timestamp {
  position: absolute;
  right: 2.5rem;
  bottom: 2.5rem;
  font-size: .75rem;
  letter-spacing: .08em;
  color: #ff8044;
  font-family: monospace;
  text-shadow: 0px 0px 2px #ff7433;
  mix-blend-mode: color-dodge;
}

.table {
  min-width: 300px;
  width: 100%;
  flex: 1 1 45%;
  border-collapse: collapse;
  overflow: hidden;
}

.r1 { grid-template-columns: 5fr minmax(max-content, 1fr); }
.r1 .cell:first-child span { font-weight: bold; letter-spacing: -2px; font-size: 2rem; }
.r1 .cell:last-child span { font-weight: bold; color: #ff0000; font-size: 2rem; letter-spacing: -2px; }


.r2 { grid-template-columns: repeat(2, 1fr); }
.r3 { grid-template-columns: 1fr; }
.r4 { grid-template-columns: repeat(2, 1fr); }

.row { display: grid; }

.cell {
  padding: 1rem;
  border-top: 1px solid #ccc;
  border-right: 1px solid #ccc;
}
.cell span { line-height: 1; }

.row > .cell:last-child { border-right: none; }
.row.r1 > .cell { border-top: none; }

.map {
  flex: 0 0 100%;
  min-width: 100%;
  height: 300px;
}

hr { margin: 1rem 0; }