body {
  background-color: #315a66;
  font-family:
    "Lucida Sans", "Lucida Sans Regular", "Lucida Grande",
    "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
  color: ivory;
}

#logo {
  width: 100px;
  height: 100px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px;
  margin: 0;
  background-color: #264653;
  color: #fff8e7;
}
#title {
  text-align: center;
  font-size: 2em;
  color: #f28482;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}
h3 {
  text-align: center;
  font-size: 1.2em;
  color: #f28482;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}
#name-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}
#logo {
  border-radius: 50%;
  border: 5px solid ivory;
}
.firstLetter {
  font-family: serif;
  font-size: 1.5em;
  font-weight: bold;
  color: #f28482;
}
nav {
  width: 100%;
  height: 5%;
  background-color: #264653;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  margin-right: auto;
  margin-left: auto;
}
nav ul li {
  display: inline-block;
  margin: 0 15px;
}
nav ul li a {
  text-decoration: none;
  color: #fff8e7;
  font-weight: bold;
  transition: color 0.3s ease;
  font-family:
    "Lucida Sans", "Lucida Sans Regular", "Lucida Grande",
    "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
}
ul li {
  margin: 10px 0;
  padding: 8px 12px;
  border-radius: 8px;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}
ul li:hover {
  background-color: #f4c95d;
  transform: translateX(6px);
}
#name-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}
#map-container {
  display: block;
  width: min(100%, 1000px);
  height: auto;
  margin: 0 auto;
}

.state {
  fill: #75a8c7;
  stroke: #ffffff;
  stroke-width: 1.5;
  cursor: pointer;
  transition:
    fill 0.2s ease,
    filter 0.2s ease;
}

.state:hover,
.state:focus {
  fill: #f4c95d;
  filter: brightness(1.05);
  outline: none;
}

#map-container path {
  fill: #75a8c7 !important;
}

#map-container path:hover {
  fill: #f4c95d !important;
}

#state-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#statename {
  color: #f28482;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
  font-weight: bold;
  font-size: 60px;
  display: block;
}

#emblem {
  width: 300px;
  height: 300px;
  margin-right: auto;
  margin-left: auto;
}

a {
  color: lightgreen;
  text-decoration: none;
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
}

a:hover {
  color: #75a8c7;
  transition: ease-in 0.3s;
}

#backbtn {
  width: auto;
  padding: 10px 16px;
  background-color: lightgreen;
  color: black;
  border: 3px solid black;
  border-radius: 4px;
  cursor: pointer;
}

#backbtn:hover {
  transform: scale(110%);
  background-color: black;
  color: lightgreen;
  transition: ease 0.2s;
  border: 3px solid lightgreen;
  border-radius: 10px;
  font-weight: bold;
}

#backbtncontainer {
  position: sticky;
  top: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: row-reverse;
  margin-right: 30px;
}

.hidden {
  display: none;
}

#map-container.hidden,
#page-label.hidden,
#state-info-display.hidden {
  display: none;
}

#state-info-display {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto 64px;
}

.accordion-group {
  margin: 38px 0;
}

.accordion-group-heading {
  margin-bottom: 14px;
  padding-left: 4px;
}

.accordion-group-heading h3 {
  margin: 0 0 5px;
  color: #f28482;
  text-align: left;
  font-size: 1.45rem;
}

.accordion-group-heading p {
  margin: 0;
  color: #d8e6e9;
  font-size: 0.95rem;
}

.accordion-list {
  display: grid;
  gap: 12px;
}

.accordion-item {
  overflow: hidden;
  border: 1px solid rgba(255, 248, 231, 0.2);
  border-radius: 12px;
  background: #264653;
  box-shadow: 0 6px 18px rgba(18, 41, 48, 0.18);
}

.accordion-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 0;
  background: #264653;
  color: #fff8e7;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 220ms ease,
    color 220ms ease;
}

.accordion-trigger:hover {
  background: #2f5966;
  color: #f4c95d;
}

.accordion-trigger:focus-visible {
  outline: 3px solid #f4c95d;
  outline-offset: -4px;
}

.accordion-item.is-open .accordion-trigger {
  background: #3b7180;
  color: #fff8e7;
}

.accordion-icon {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 300ms ease;
}

.accordion-item.is-open .accordion-icon {
  transform: rotate(225deg) translate(-2px, -2px);
}

.accordion-panel-shell {
  display: grid;
  grid-template-rows: 0fr;
  background: #fff8e7;
  color: #264653;
  transition: grid-template-rows 340ms ease;
}

.accordion-item.is-open .accordion-panel-shell {
  grid-template-rows: 1fr;
}

.accordion-panel {
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  padding: 0 22px;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 220ms ease,
    transform 300ms ease,
    padding 340ms ease;
}

.accordion-item.is-open .accordion-panel {
  padding: 20px 22px 24px;
  opacity: 1;
  transform: translateY(0);
}

.accordion-panel a {
  color: #315a66;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.accordion-panel a:hover {
  color: #b95359;
}

@media (max-width: 640px) {
  #state-info-display {
    width: min(100% - 20px, 1100px);
  }

  #statename {
    font-size: 2.5rem;
  }

  #emblem {
    width: 200px;
    height: 200px;
  }

  #backbtncontainer {
    top: 10px;
    margin-right: 4px;
  }

  .accordion-trigger {
    padding: 16px;
  }

  .accordion-item.is-open .accordion-panel {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .accordion-trigger,
  .accordion-icon,
  .accordion-panel-shell,
  .accordion-panel {
    transition: none;
  }
}
