/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Maps styles */
@import url("https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.css");

/* Global Application Styles */
body {
  margin: 0 auto;
  line-height: 1.8em;
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: #f6f2e8ff; /* Brand Dark Sand */
  word-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong {
  font-family: "Arial Black", "Arial", sans-serif;
}

a {
  color: black;
  border-bottom: 2px solid #d5a422; /* Brand Bronze */
  padding-bottom: 2px;
  text-decoration: none;
  transition: all 0.1s ease;
  font-weight: bold;
}

a:hover {
  /* border-bottom-width: 3px; */
  transform: scale(1.05);
}

fieldset {
  /* Reset useragent styles */
  border: none;
  margin: 0;
  padding: 0;
}

ol,
ul {
  margin-top: 0;
  margin-bottom: 0;
}

form {
  margin: 0;
}

input[type="search"] {
  width: 200px;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: 12px;
  transition: width 0.3s ease;
}

input[type="search"]:focus {
  outline: 2px solid #d5a422; /* Brand Bronze */
  outline-offset: 2px;
  width: 100%;
}

/* Global Navigation */
nav.global {
  padding: 12px 12px 12px 6px;
  position: sticky;
  top: 0px;
  background-color: white;
  z-index: 1001;
  align-items: center;
  box-shadow: 0px 2px 48px rgba(0, 0, 0, 0.2);
  background-image: url("/assets/mipmaps-curve-5e26afd7.svg");
  background-repeat: no-repeat;
  background-position: left bottom -1px;
  background-size: auto 100%;
}

.global-brand {
  border-bottom: none;
  padding: 0px;
  line-height: 1rem;
}

.global-city {
  border-bottom: 3px solid #d5a422;
  margin-right: -3px;
  font-size: 1.3rem;
  word-spacing: -0.3rem;
}

nav a {
  color: black;
  border-color: black;
}

/************ Main Search Page *************/

#search {
  position: relative;
  height: 70vh;
  overflow-x: hidden;
}

#search form {
  position: absolute;
  z-index: 1;
  bottom: 12px;
  left: 12px;
  right: 12px;
}

#search .search-query {
  width: 100%;
  color: black;
}

#search .map-results {
  position: absolute;

  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
}

#search .search-query input {
  width: 200px;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: 12px;
}

#search .category-option {
  position: relative;
}

#search .category-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 64px;
  font-weight: bold;
  font-size: 0.8rem;
}

#search .category-label:hover {
  /* box-shadow: 0 2px 12px rgba(82, 18, 255, 0.5); */
  border-color: #d5a422; /* Brand Bronze */
}

#search .category-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 2px;
}

#search .category-label span {
  font-weight: bold;
  text-align: center;
  line-height: 1.2;
}

/* Selected state */
#search input[type="radio"]:checked + .category-label {
  border-color: #d5a422; /* Brand Bronze */
  background-color: #d5a422; /* Brand Bronze */
  color: white;
  transition: all 0.2s ease;
}

/* Hover state */
#search input[type="radio"]:hover + .category-label {
  transform: scale(1.03);
}

#search .category-label .category-icon {
  filter: brightness(0) saturate(100%) sepia(100%) hue-rotate(10deg)
    brightness(1.1) contrast(1.2);
}

#search input[type="radio"]:checked + .category-label .category-icon {
  filter: brightness(0) invert(1);
  transition: all 0.2s ease;
}

#search #search-here {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  transition: all 0.2s ease;
}

/************** Helpers *************/
.hide {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.flex {
  display: flex;
  gap: 12px;
}

.flex.reverse {
  flex-direction: row-reverse;
}

.flex.insulated {
  gap: 48px;
}

.flex.vertical {
  flex-direction: column;
}

.expand {
  min-width: 100%;
}

.wrap {
  flex-wrap: wrap;
}

.insulated {
  padding: 48px;
}

.center {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.flex.compact {
  gap: 6px;
}

.constrain {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.glass {
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(5px);
  border: 0.5px solid #a2a2a2;
  border-radius: 12px;
  box-shadow: 0px -4px 12px rgba(0, 0, 0, 0.1);
}

.paper {
  border-top: 1px solid rgba(0, 0, 0, 0);
}

.page {
  background-color: #faf8f2ff;
}

dialog .page {
  background-color: transparent;
}

.rounded {
  border-radius: 12px;
}

.round {
  border-radius: 50%;
}

.subtle {
  filter: opacity(0.3);
}

.col-6 {
  width: 50%;
  flex: 0 0 50%;
}

.primary,
button.primary,
input[type="submit"].primary,
input[type="button"].primary {
  font-size: 1rem;
  font-weight: bold;
  background-color: black;
  border-radius: 12px;
  color: white;
  border: none;
  padding: 12px 24px;
  cursor: pointer;
  display: inline-block;
  line-height: 1.8em;

  /* limit width */
  max-width: 200px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.secondary,
button.secondary,
input[type="submit"].secondary,
input[type="button"].secondary {
  font-size: 1rem;
  font-weight: bold;
  color: black;
  background-color: rgba(255, 255, 255, 0.7);
  border: 0.5px solid #a2a2a2;
  border-radius: 12px;
  padding: 12px 24px;
  cursor: pointer;
  display: inline-block;
  line-height: 1.8em;

  /* limit width */
  max-width: 200px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

ol.table li,
ul.table li {
  padding: 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

ul.table {
  list-style-type: none;
  padding-left: 0;
}

ol > li::marker {
  color: #d5a422;
  font-weight: 400;
}

li.clickable {
  cursor: pointer;
  font-weight: bold;
}

li.clickable:hover {
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 2px;
}

/************** App Specific Styles *************/

button {
  cursor: pointer;
  border: none;
}

.tag,
a.tag {
  display: inline-block;
  background-color: #f6f2e8ff;
  color: rgba(0, 0, 0, 0.6); /* Brand Bronze */
  border-bottom: 0;
  padding: 0px 8px;
  font-size: 0.8rem;
  line-height: 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: bold;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  max-width: 50vw;
  vertical-align: text-bottom;
}

a.tag:hover {
  background-color: #d5a422;
  color: white;
  transform: none;
}
a.tag:hover::after {
  content: "↗";
  margin-left: 4px;
}

/************ Footer *************/
#footer {
  border: 0.5px solid #a2a2a2;
}

@media (max-width: 600px) {
  .insulated {
    padding: 24px;
  }

  .col-6 {
    width: 100%;
    flex: 0 0 100%;
  }

  .flex {
    flex-wrap: wrap;
    gap: 6px;
  }

  .flex.compact {
    gap: 6px;
  }

  .flex.nowrap {
    display: flex;
    box-sizing: border-box;
    width: calc(100vw + 24px);
    margin-left: -24px;
    padding-left: 24px;
    padding-right: 24px;
    flex-wrap: nowrap;
    overflow-x: scroll;
  }
}

#search form {
  padding: 0px;
}

/* Dark Mode, only supported for the map */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #2f2e2b; /* Dark Mode Background */
  }

  #search .glass {
    /* Dark Glass */
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
    border: 0.5px solid #494949;

    color: white;
  }

  #search .secondary,
  #search button.secondary,
  #search input[type="submit"].secondary,
  #search input[type="button"].secondary {
    color: white;
  }
  #search input[type="radio"] + .category-label .category-icon {
    filter: brightness(0) invert(1);
  }

  nav.global {
    background-color: #2f2e2b; /* Dark Mode Background */
    background-image: none;
    color: white;
  }

  img.invertible {
    filter: invert(1);
  }

  #footer {
    background-color: #2f2e2b; /* Dark Mode Background */
    border-color: black;
    color: white;
  }
  #footer a {
    color: white;
  }
}
