@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");

:root {
  --color-white: hsl(0, 0%, 95%);
  --color-black: hsl(0, 0%, 10%);

  --color-bg: hsl(0, 0%, 75%);
  --color-accordion-bg: hsl(0, 0%, 85%);
  --color-accordion--tab-hover-bg: hsl(0, 0%, 90%);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Poppins";
  background-color: var(--color-bg);
  color: var(--color-black);
}

/* core style / functionality */
.tab {
  width: 100%;
  position: relative;
  border-bottom: 1px solid var(--color-black);
}

.tab input {
  position: absolute;
  opacity: 0;
  z-index: -1;
}

.tab .tab-content {
  max-height: 0;
  overflow: hidden;
  transition: all 0.5s ease-in;
}

.tab input:checked ~ .tab-content {
  max-height: 500px;
}

/* visual style  */
.accordion {
  width: min(80%, 700px);
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  border: none;
  border-radius: 1rem;
  background-color: var(--color-accordion-bg);
}
.section-header {
  width: 100%;
}
.tab-wrapper {
  width: 100%;
  height: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 0.5rem 0.5rem 0 0;
  transition: background-color 0.25s ease-in;
}
.tab-wrapper:hover {
  background-color: var(--color-accordion--tab-hover-bg);
}
.tab label {
  width: 100%;
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 1.25rem;
}

.tab__label::after {
  content: "\276F";
  width: 1em;
  height: 1em;
  text-align: center;
  transform: rotate(90deg);
  transition: all 0.5s;
}
.tab input:checked + .tab__label::after {
  transform: rotate(270deg);
}
