/**
 * Base styling for TARE
 * License: MIT 
 *
 * Inspired by https://owickstrom.github.io/the-monospace-web/


 * TODO clean up. lots of repetition. 
 
 **/

@font-face {
  font-family: "Commit Mono";
  src:
    url("/assets/fonts/CommitMono-400-Regular.otf");
}


:root {
  --font-family: "Commit Mono", monospace;
  --line-height: 1.20rem;
  --border-thickness: 2px;
  --text-color: #111;
  --text-color-alt: #666;
  --background-color: #f0ece5;
  --section-title-background-color: #f7f5f1;
  --section-background-color: #f7f5f1;
  --section-border-thickness: 1px;
  --border-color: #918165;
  --form-border-color: #918165;
  --light-border-color: #aaa;
  --form-input-background-color: white;
  --section-width-empty: 20px;

  font-family: var(--font-family);
  font-optical-sizing: auto;
  font-weight: normal;
  font-style: normal;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 16px;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "ss05" 1;
  color: #080808;
}

.sr-only:not(:focus):not(:active) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

html {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  flex-direction: column;
  align-items: center;
  background: var(--background-color);
  color: var(--text-color);
  overflow-x: hidden;
  min-width: 320px;
}


body {
  width: 100%;
  max-width: calc(min(100ch, round(down, 100%, 1ch)));
  line-height: var(--line-height);
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

#main-content {
  flex: 1;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: bold;
  margin: calc(0.5* var(--line-height)) 0 calc(var(--line-height));
  line-height: var(--line-height);
}

h1 {
  font-size: 1.5rem;
  line-height: calc(2 * var(--line-height));
}

h2 {
  font-size: 1.20rem;
  margin-top: 1.5rem;
  line-height: calc(1.5 * var(--line-height));
}

h3 {
  font-size: 1.15rem;
  margin: calc(var(--line-height)) 0 calc(1.25* var(--line-height));
}

h1.subtitle,
h1.subtitle-left,
h1.review-list-subtitle {
  font-size: 1.25rem;
  line-height: var(--line-height);
}


.title {
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
}

.minor-title,
.subtitle {
  margin-bottom: 0.5rem;
  margin-top: 0.25rem;
}



.user-trust-section h2 {
  font-size: 1.25rem;
}

.section h1.subtitle,
.section h1.subtitle-left,
.section h1.review-list-subtitle {
  background-color: transparent;
  padding: 0;
}


.title,
.subtitle,
.minor-title {
  text-align: center;
}


.minor-title {
  margin-top: 1rem;
  font-size: 1.3rem;

}

.subtitle-left {
  text-align: left;
}

.review-list-subtitle {
  text-align: left;
  margin-bottom: 2px;

  @media(max-width: 768px) {
    margin-top: 0.5rem;
  }
}

.review-page-title {
  text-align: left;
  margin-bottom: 2px;
  margin-top: 2px;
}



textarea {
  resize: vertical;
  height: 10em;
  width: 100%;
}


input,
textarea {
  padding: 3px;
  box-shadow: none;
  border: 1px solid var(--border-color);
  box-sizing: border-box;
  background: var(--form-input-background-color)
}

textarea:placeholder-shown,
input:placeholder-shown {
  font-style: italic;
}


@media (prefers-color-scheme: dark) {
  button {
    color: var(--text-color);
  }
}

button,
input::file-selector-button {
  width: auto;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 5px;
  padding-right: 5px;
  margin-right: 5px;

  appearance: none;
  font: inherit;
  color: #333;
  border: 1px solid var(--form-border-color);
  border-radius: 4px;
  cursor: pointer;
  background: linear-gradient(to bottom, #fdfdfd 0%, #e8e8e8 50%, #dcdcdc 51%, #f0f0f0 100%);
}

input[type="file"] {
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  background: transparent;
}

.big-button {
  border-radius: 5px;
  font-size: 1.5rem;
  padding: 0.5rem 4rem 0.5rem 4rem;
  display: block;
  margin: auto;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-color);


  @media(max-width: 420px) {
    width: 100%;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }

}

button:hover,
input::file-selector-button:hover,
.big-button:hover,
select:hover {
  background: linear-gradient(to bottom, #eaeaea, #d4d4d4);
}

button:active,
input::file-selector-button:active,
.big-button:active,
select:active {
  background: linear-gradient(to top, #d0d0d0, #c4c4c4);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #cccccc;
  color: #666666;
}


/* Optional: Ensure hover effects don't apply when disabled */
button:disabled:hover {
  background-color: #cccccc;
  color: #666666;
}


select {
  width: auto;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 5px;
  padding-right: 5px;
  color: #333;
  border: 1px solid var(--form-border-color);
  border-radius: 1px;
  cursor: pointer;
  background: linear-gradient(to bottom, #fdfdfd 0%, #e8e8e8 50%, #dcdcdc 51%, #f0f0f0 100%);
}

strong {
  font-weight: bold;
}

i {
  font-style: italic;
}


.croppie-container {
  margin-top: 20px;

  .cr-boundary {
    @media(min-width: 420px) {
      margin: 0;
    }
  }

  .cr-slider-wrap {
    @media(min-width: 420px) {
      margin: 0;
    }

    .cr-slider {
      border: none;
      box-shadow: none;
      margin: 0;
    }
  }
}

.section {
  position: relative;
  width: 100%;
  margin: var(--line-height) 0 var(--line-height) 0;
  border: var(--section-border-thickness) solid var(--border-color);
  border-radius: 1px;
  padding: var(--line-height) 80px calc(2*var(--line-height)) 80px;
  box-sizing: border-box;
  background-color: var(--section-background-color);

  h1 {
    background-color: var(--section-title-background-color);
  }

  @media(max-width: 768px) {

    border-left: none;
    border-right: none;
    margin-top: 5px;
    margin-bottom: 0px;
    padding-top: 5px;
    padding: 8px 4vw calc(2*var(--line-height)) 4vw;
  }

}


.info-section {

  padding: var(--line-height) 110px calc(3*var(--line-height)) 110px;

  @media(max-width: 768px) {
    padding: 8px 4vw calc(3*var(--line-height)) 4vw;

  }


  .title {
    margin-bottom: 1rem;
    margin-top: 1rem;
  }

  .subtitle,
  .subtitle-left {
    margin-bottom: 1rem;
    margin-top: 1.5rem;
  }


  .howto {

    .howto-subtitle {
      font-size: 1.15rem;
    }

    .howto-subsubtitle {
      font-size: 1rem;
    }

    margin-bottom: 1.25rem;

    .howto-subtitle {
      margin-bottom: 0.25rem;
      margin-top: 1rem;
    }

    .howto-subsubtitle {
      margin-top: 1rem;
      margin-bottom: 0.25rem;
    }
  }


  h4 {
    margin-top: 0px;
    margin-bottom: 5px;
  }

  #door-link {
    position: relative;
    display: inline-block;
    width: 120px;
    margin-left: -2vw;
  }

  #door {
    width: 120px;
    transition: opacity 0.2s ease;
  }

  #door-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  #door-link:hover #door {
    opacity: 0;
  }

  #door-link:hover #door-hover {
    opacity: 1;
  }

  #door-link.activating #door {
    opacity: 0;
  }

  #door-link.activating #door-hover {
    opacity: 1;
  }

  .grid {
    display: grid;
    grid-template-columns: auto auto;
  }

  .left-grid-column {
    display: block;
    margin-right: 1vw;
  }

  p {
    margin-top: 0.25rem;
    font-size: 0.95rem;
    text-justify: inter-word;
  }

  ul li {
    margin-top: 1rem;
    font-size: 0.95rem;
    padding-left: 0.5rem;
    margin-top: 0.25rem;
    list-style-type: "⚖";
  }


  aside {
    padding-left: 2rem;
    margin-bottom: 0.5rem;
    font-style: italic;
  }
}

.user-info {
  padding-bottom: 1rem;

  button {
    width: 10ch;
    margin-top: 0.5rem;
  }


  .user-info-inner {

    display: flow-root;
    width: 70%;
    margin-inline: auto;

    @media(max-width: 768px) {
      width: 95%;
    }
  }


  .user-profile-image {
    margin-left: 1rem;
  }

  .user-profile-image img {

    float: left;
    margin-right: 1rem;
    margin-bottom: 0.5rem;

    width: 200px;
    height: 200px;

    aspect-ratio: 1/1;
    border: 2px solid var(--border-color);

    @media(max-width: 768px) {
      width: 150px;
      height: 150px;
    }
  }

  .user-blurb {
    margin-top: 1rem;
    font-style: italic;
  }

  .user-goto {
    margin-top: 0.5rem;
  }

  .user-trust-actions {
    margin-top: 0.5em;

    p {
      font-weight: bold;
    }

  }

  .user-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    /* TODO: bad nesting */
  }
}

#footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5ch;
  margin-top: calc(var(--line-height));
  margin-bottom: calc(2 * var(--line-height));
}

#footer a {
  color: var(--text-color);
}

#navbar {
  display: flex;
  align-items: center;

  #search-section {
    order: 1;
    flex: 1;
    justify-content: right;
    /* Hack to shift logo to centre */
    margin-left: -50px;
  }

  #links-section {
    order: 2;
    flex: 1;

    display: flex;
    align-items: center;
  }
}

@media (max-width: 768px) {
  #navbar {
    flex-direction: column;

    #links-section {
      order: 1;
      flex-direction: row;

      #links-other {
        order: 2;
        justify-content: right;
      }

      #link-logo {
        order: 1;
      }
    }

    #search-section {
      order: 2;
      margin-left: 0px;

    }
  }
}


#navbar {
  width: 100%;
  gap: 1.5ch;
  font-size: 1rem;
  margin-top: 10px;

  @media (max-width: 768px) {
    gap: 0.5ch;
    margin-top: 5px;
  }

  #search-section,
  #links-section {
    display: flex;
    gap: inherit;
    align-items: center;
    font-size: 1em;
    color: black;
  }

  .logo img {
    width: 50px;
    height: 50px;

    @media (max-width: 768px) {
      width: 32px;
      height: 32px;
      margin-right: 1ch;
    }
  }

  #search-section *,
  #links-section * {
    color: black;
  }

  #search-form {
    padding-left: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    display: flex;
    flex-wrap: nowrap;
    border: solid;
    border-width: 1px;
    border-color: var(--form-border-color);
    border-radius: 1px;
    background-color: var(--section-background-color);

    label {
      align-self: center;
      padding-right: 2px;
    }

    .search-info {
      display: flex;
      align-items: center;
      position: relative;
      background: white;

      #search-term {
        border: none;
        padding: 3px;
        margin: 0;
        vertical-align: middle;
      }

      .search-indicator {
        opacity: 0;
        width: 1rem;
        height: 1rem;
        position: absolute;
        top: 50%;
        left: 100%;
        transform: translate(-100%, -50%);
        pointer-events: none;
      }

      .htmx-request .search-indicator,
      .htmx-request.search-indicator {
        transition: opacity 200ms ease-in;
        opacity: 1;
      }
    }

    #search-icon {
      border: none;
      outline: none;
      padding-left: 0.5ch;
      box-shadow: none;
      align-self: center;
    }

    select {
      border-radius: 0;
      border: none;
      border-right: 1px solid var(--form-border-color);
      padding-left: 8px;

    }
  }

}

#search-toggle {
  display: none;
}

#mag-glass-icon {
  width: 1.2em;
  height: 1.2em;
  vertical-align: text-bottom;
}

@media (max-width: 768px) {
  #search-toggle {
    display: inline;
    margin: 0;
    padding-top: 1px;
    padding-bottom: 1px;
    padding-left: 1px;
    padding-right: 2px;
  }

  #navbar #search-section {
    display: none;
  }

  #navbar #search-section.search-expanded {
    display: flex;
  }
}

#search-results {
  position: relative;
  background-color: #ffa;
  border-style: solid;
  border-color: #ecb81f;
  border-width: var(--section-border-thickness);

  ul {
    display: flex;
    flex-wrap: wrap;

    li {
      width: 15vw;
      flex: 0 0 100%;
      margin: 0.5rem;
    }
  }


  @media (min-width: 320px) {
    ul li {
      flex: 0 0 calc(45%);
    }

  }

  @media (min-width: 940px) {
    ul li {
      flex: 0 0 calc(30%);
    }
  }
}

.search-results-close {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 1;
  line-height: 1;
  font-size: 12px;
  padding-left: 10px;
  padding-right: 10px;
}


.search-results-close::before {
  content: "✕";
  font-family: mono;
}

.grid.collapsible {
  @media(max-width: 420px) {

    display: block;

    >* {
      width: 100%;
      margin-bottom: 5px;
    }

    aside {
      text-align: center;
    }

    button {
      margin-top: 5px;
      margin-bottom: 5px;
    }


    fieldset {
      margin-left: 20%;
    }

    .left-grid-column {
      text-align: left;
      width: 100%;
      max-width: 100%;

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

    .right-grid-column {
      text-align: left;
      width: 100%;
      max-width: 100%;

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


.grid {
  --grid-cells: 0;

  display: flex;
  gap: 1ch;
  width: calc(round(down, 100%, (1ch * var(--grid-cells)) - (1ch * var(--grid-cells) - 1)));
  max-width: inherit;
  padding-bottom: 2px;
  margin-top: 5px;

  button {
    height: fit-content;
    width: fit-content;
  }

  aside {
    margin-top: 5px;
  }

  .left-grid-column {
    display: flex;
    flex-direction: column;
    text-align: right;
    padding-right: 0.5rem;
    gap: 5px;
  }

  .right-grid-column {
    display: flex;
    flex-direction: column;
    text-align: left;
    align-content: center;
    gap: 5px;
    flex-grow: 1;
  }



}

.grid>*,
.grid>input {
  flex: 0 0 calc(round(down, (100% - (1ch * (var(--grid-cells) - 1))) / var(--grid-cells), 1ch));
}

.grid:has(> :last-child:nth-child(1)) {
  --grid-cells: 1;
}

.grid:has(> :last-child:nth-child(2)) {
  --grid-cells: 2;
}

.grid:has(> :last-child:nth-child(3)) {
  --grid-cells: 3;
}

.grid:has(> :last-child:nth-child(4)) {
  --grid-cells: 4;
}

.grid:has(> :last-child:nth-child(5)) {
  --grid-cells: 5;
}

.grid:has(> :last-child:nth-child(6)) {
  --grid-cells: 6;
}

.grid:has(> :last-child:nth-child(7)) {
  --grid-cells: 7;
}

.grid:has(> :last-child:nth-child(8)) {
  --grid-cells: 8;
}

.grid:has(> :last-child:nth-child(9)) {
  --grid-cells: 9;
}




.user-free-text {
  width: 100%;
  white-space: pre-wrap;
  word-wrap: anywhere;

}

.form-component {

  margin-top: 5px;

  input:not([type="radio"]):not([type="checkbox"]),
  textarea {
    width: 42ch;
    vertical-align: top;

    @media(max-width: 650px) {
      width: 36ch;
    }

    @media(max-width: 550px) {
      width: 30ch;
    }
  }

  .left-grid-column {
    max-width: 35%;

    @media(max-width: 500px) {
      max-width: 25%;
    }

    @media(max-width: 450px) {
      max-width: 20%;
    }
  }

  label:after {
    content: "\a";
    white-space: pre;
  }

}

.validation-error {
  color: red;
}

.validation-error:empty {
  margin: 0;
}

.form-submit-component {
  margin: auto;
}

.form-submit-response {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.general-form {
  display: flex;
  flex-direction: column;
  gap: 10px;

}

.edit-review-form,
.new-review-form {

  legend {
    background-color: black;
    color: white;
    padding: 3px 18px;
  }
}

.user-trust-section {
  .trust-list {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0.75rem 0.25rem;

    .trust-row {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.25rem;
      padding: 0.25rem;
      min-width: 0;
      overflow-wrap: break-word;

      .trust-name {
        text-align: center;
      }
    }
  }
}


@media (max-width: 768px) {
  .user-trust-section {
    .trust-list {
      grid-template-columns: 1fr 1fr 1fr;
    }
  }
}

.profile-thumb {
  width: 80px;
  height: 80px;
  aspect-ratio: 1/1;
  border: 1px solid var(--form-border-color);
}

.trust-list,
.review-list {
  margin-top: 2rem;
  list-style-type: none;
}


@media(max-width: 768px) {
  .review-list {
    margin-top: 1rem;

  }
}



.inline-trust-chain,
.user-trust-chain {

  .trust-arrow {
    width: 1rem;
    height: 1rem;
  }

  display: flex;
  margin: 0;
  gap: 0.25em;

  ul.trusted-by {
    display: block;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  ul.trusted-by li {
    display: inline;
  }

  ul.trusted-by li:not(:last-child)::after {
    content: ", ";
  }
}

.next-page-button {
  text-align: center;
  grid-column: 1 / -1;

  button {
    width: 8ch;
  }
}


table {
  width: 100%;
  border: 2px solid var(--border-color);
  margin-top: 1rem;
  margin-bottom: 1rem;
}

thead {
  border: 2px solid var(--border-color);
}

tr,
th {
  vertical-align: middle;
}

th {
  padding: 2px;
  flex: 1;
  justify-content: center;
  align-items: center;
}


.rating-icon {
  width: 3rem;
  height: 3rem;
  margin-top: 0.5rem;
}


.focused {
  margin-top: 1rem;
  margin-bottom: 1rem;
  background-color: #ffa;
  border-style: solid;
  padding-top: 1rem;
  padding-bottom: 1rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  border: solid;
  border-color: #ecb81f;
  box-shadow: 3px 3px 0px #c0b742;
  border-width: 2px;

}

.unfocused {
  opacity: 40%;
}

.review-list {

  >li:not(:last-child) {
    border-bottom: 1px solid var(--light-border-color);
  }

  .review-row {
    /* display: flex; */
    margin-bottom: 5px;
    margin-top: 5px;
    padding-top: 5px;
    padding-bottom: 5px;


    .review-row-header {
      display: flex;

      .review-row-icon {
        width: 3rem;
        height: 3rem;
        margin-right: 1rem;
      }

      flex-grow: 1;

      .review-row-entity-address {
        font-style: italic;
      }

      .review-row-title {
        flex-grow: 1;
        display: flex;
        justify-content: space-between;
        font-style: italic;

        .reviewer,
        .entity-name {
          padding: 0 0 0 0;
          margin-right: 5px;
        }

        .review-time {
          text-align: right;
        }
      }
    }

    .review-row-body {

      .review-notes p {
        margin-top: 0.5rem;
        font-size: 0.95rem;
      }

      .review-notes {
        p:empty {
          display: none;
        }
      }

      .review-row-footer {
        display: flex;
        align-items: flex-end;
        gap: 2ch;
        margin-top: 0.5em;
        margin-bottom: 0.5rem;
      }

      .review-row-actions {
        margin-left: auto;
        white-space: nowrap;
      }

      @media (min-width: 640px) {
        margin-left: 4rem;
      }

      flex-grow: 1;

    }
  }
}


.review-image-grid {

  display: grid;
  gap: 10px;
  margin-top: 1em;
  margin-bottom: 1em;
  width: 100%;

  @media (min-width: 320px) {
    grid-template-columns: repeat(2, 1fr);
  }

  @media (min-width: 640px) {
    grid-template-columns: repeat(4, 1fr);
  }
}


.review-image-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  display: block;
  border: 1px solid var(--border-color);
}

.image-upload-part {

  #imageInput {
    display: none;
  }

  #selectBtn {
    margin-bottom: 5px;
    cursor: pointer;
  }

  #selectBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
  }

  .preview-item {
    position: relative;
    aspect-ratio: 1;
  }

  .preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid var(--border-color);
  }

  .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
    padding: 4px 8px;
  }

}

.notification:not(:empty) {
  border: solid var(--border-color);
  border-radius: 2px;
  padding: 1rem;
  text-align: center;
  background: #ffdc95;
  margin-top: 1rem;
}

.map-container button:not(.tag-option) {
  margin: 0;
}

.review-map-container {
  padding: 0;
  margin-bottom: calc(-2*var(--line-height) + 16px);
}

.section .review-map-container {
  margin-left: -80px;
  margin-right: -80px;
  margin-bottom: calc(-2 * var(--line-height));
  width: calc(100% + 160px);
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-top: 1px solid var(--light-border-color);

  @media (max-width: 768px) {
    margin-left: -4vw;
    margin-right: -4vw;
    width: calc(100% + 8vw);
  }
}

.review-map-container canvas {
  border-radius: 2px;
}

#review-map {
  width: 100%;
  height: calc(min(800px, 70vh));
}

.review-map-popup {
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--text-color);
  line-height: var(--line-height);
  margin-top: 8px;
  padding-right: 8px;
}

.review-map-popup-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}

.review-map-popup-row:last-child {
  border-bottom: none;
}

.review-map-popup-row img {
  width: auto;
  height: 22px;
  flex-shrink: 0;
}


.maplibregl-popup-close-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 3px !important;
  border: 1px solid var(--form-border-color) !important;
  margin-right: 2px !important;
  margin-top: 2px !important;
  font-size: 0 !important;
  line-height: 1 !important;
  padding-left: 10px;
  padding-right: 10px;
}

.maplibregl-popup-close-button::before {
  content: "✕";
  font-size: 12px;
  font-family: mono;
}

.maplibregl-popup-content {
  background: var(--section-background-color) !important;
  border: 1px solid var(--form-border-color) !important;
  opacity: 88%;
  border-radius: 5px !important;
  max-width: 320px !important;
}

/* Expand map container to fill the bottom of the screen on mobile */
@media (max-width: 768px) {
  #main-content:has(#reviews-page-section) {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  #reviews-page-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0;
  }

  #reviews-page-section .review_view {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  #reviews-page-section .review-map-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  #reviews-page-section #review-map {
    flex: 1;
    min-height: 0;
    height: auto;
  }
}



.links-section {
  display: flex;
  gap: 1.5ch;
  align-items: center;
  justify-content: center;
  font-size: 1em;
}

.links-section a {
  color: black;
}

.review-options {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  margin-bottom: 1rem;
  margin-left: 4rem;

  @media (max-width: 768px) {
    margin-left: 0rem;
    margin-bottom: 0.5rem;

  }

}

.review-options-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.review-options-header-right {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.review-options-tags {
  align-self: flex-start;
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;

  span {
    display: flex;
    align-items: center;
    gap: 0.5ch;
  }

  @media (max-width: 768px) {
    grid-template-columns: repeat(2, 1fr);
  }
}

.entity-map-nav-links {
  text-align: center;
  margin-top: 5px;
}

#entity-review-heading {
  font-style: italic;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}


.entity-visibility-selector {
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 18px;

  input {
    margin-right: 3px;
  }

  margin-bottom: 2rem;
}

.tag-picker {
  min-width: 18ch;
  background: var(--form-input-background-color);
}

@media (max-width: 420px) {
  #reviews-options-tags-reviews-page {
    width: 100%;

    #tag-picker {
      width: 100%;
    }
  }
}

.tag-input-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid var(--form-border-color);
  background: var(--form-input-background-color);
  position: relative;
  gap: 1px;
}

.tag-filter-input {
  padding-left: 5px;
  border: none;
  outline: none;
  flex: 1;
  width: 11ch;
}

.tag-dropdown {
  position: absolute;
  top: calc(100% + 1px);
  left: calc(-0.5 * var(--border-thickness));
  right: 0;
  z-index: 20;
  background: var(--form-input-background-color);
  border-left: 1px solid var(--form-border-color);
  border-right: 1px solid var(--form-border-color);
  border-bottom: 1px solid var(--form-border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  max-height: 180px;
  overflow-y: auto;
  min-width: 100%;
  display: none;
}

.tag-dropdown.visible {
  display: block;
}

.tag-option {
  display: block;
  width: 100%;
  padding: 3px 8px;
  border: none;
  border-radius: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-family);
  color: var(--text-color);
  box-shadow: none;
  margin: 0;
}

.tag-option:hover,
.tag-option.highlighted {
  background: rgba(0, 0, 0, 0.06);
}


.tag-option.hidden {
  display: none;
}

.selected-tags,
.review-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1px;
}

.tag-chip {
  font-size: 0.8em;
  border: 1px solid var(--border-color);
  padding: 0 3px 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  background: var(--border-color);
  color: var(--section-background-color);
  line-height: var(--line-height);
  white-space: nowrap;
  cursor: pointer;
}

button.tag-chip {
  margin-right: 0;
  border-radius: 0;
}

.review-tag,
.tag-label {
  font-size: 0.8em;
  padding: 1px 3px;
  line-height: var(--line-height);
  white-space: nowrap;
  background: var(--border-color);
  color: var(--section-background-color);
  border: 1px solid var(--border-color);
}

:is(.review-tag, .tag-chip, .tag-label)[data-tag="fave"] {
  background: #c9a825;
}

:is(.review-tag, .tag-chip, .tag-label)[data-tag="fave"]::before {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  background: url(/assets/img/star.gif) center/contain no-repeat;
  margin-right: 2px;
  vertical-align: middle;
}

:is(.review-tag, .tag-chip, .tag-label)[data-tag="vegan"] {
  background: #206e32;
}

:is(.review-tag, .tag-chip, .tag-label)[data-tag="vegetarian"] {
  background: #3d8233;
}

:is(.review-tag, .tag-chip, .tag-label)[data-tag="halal"] {
  background: #1a6e7a;
}

:is(.review-tag, .tag-chip, .tag-label)[data-tag="economical"] {
  background: #b86422;
}

:is(.review-tag, .tag-chip, .tag-label)[data-tag="fancy"] {
  background: #6b2a7d;
}

:is(.review-tag, .tag-chip, .tag-label)[data-tag="bar"] {
  background: #4a0a00;
}

:is(.review-tag, .tag-chip, .tag-label)[data-tag="cafe"] {
  background: #783b01;
}

:is(.review-tag, .tag-chip, .tag-label)[data-tag="unique"] {
  background: #00454a;
}

#edit-user-profile-image,
#new-user-profile-image {
  display: flex;
  flex-direction: column;
  gap: 5px;
}


.highlighted {
  background-color: #ff8;
}