/*
 * Cleaned and Simplified Accordion Menu CSS
 * Contains only the necessary styles.
 * Icons and bullet points have been removed.
*/

/* --- Root Variables --- */
:root {
  /* Colors */
  --cd-color-1: hsl(218, 7%, 32%); /* Main Background Color */
  --cd-color-1-h: 218;
  --cd-color-1-s: 7%;
  --cd-color-1-l: 32%;
  --color-white: hsl(0, 0%, 100%);

  /* Spacing */
  --space-sm: 0.75em;
  --space-md: 1.25em;

  /* Font */
  --font-primary: 'Open Sans', sans-serif;
}


/* --- Main Accordion Styles --- */

.cd-accordion {
  background: var(--cd-color-1);
  font-family: var(--font-primary, sans-serif);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .1), 0 16px 48px rgba(0, 0, 0, .1), 0 24px 60px rgba(0, 0, 0, .1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* --- FIX: Removes bullet points --- */
  list-style: none !important;
  padding: 0;
  margin: 0;
}

.cd-accordion__sub {
  display: none;
  overflow: hidden;
  
  /* --- FIX: Removes bullet points from sub-menus --- */
  list-style: none;
  padding: 0;
  margin: 0;
}

.cd-accordion__sub--is-visible {
  display: block;
}

.cd-accordion__item {
  user-select: none;
  list-style: none !important;
  margin-left: 5px !important;
}

.cd-accordion__input {
  /* Hide the native checkbox */
  position: absolute;
  opacity: 0;
}

.cd-accordion__label {
  position: relative;
  display: flex;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--cd-color-1);
  box-shadow: inset 0 -1px hsl(218, 7%, 38.4%); /* Slightly lighter border */
  color: var(--color-white);
  cursor: pointer;
  text-decoration: none;
}

.cd-accordion__label:hover {
  background: hsl(218, 7%, 35.2%);
}

/* Show submenu when the checkbox is checked */
.cd-accordion__input:checked ~ .cd-accordion__sub {
  display: block;
}


/* --- Sub-menu Level Styles --- */

.cd-accordion__sub--l1 > .cd-accordion__item > .cd-accordion__label {
  background: hsl(218, 7%, 20.8%);
  box-shadow: inset 0 -1px hsl(218, 7%, 27.2%);
  
  /* FIX: Simplified padding for clean indentation */
  padding-left: 2.25em;
}

.cd-accordion__sub--l1 > .cd-accordion__item > .cd-accordion__label:hover {
  background: hsl(218, 7%, 24%);
}

.cd-accordion__sub--l2 > .cd-accordion__item > .cd-accordion__label {
  /* FIX: Simplified padding for clean indentation */
  padding-left: 3.25em;
}

.cd-accordion__sub--l3 > .cd-accordion__item > .cd-accordion__label {
  /* FIX: Simplified padding for clean indentation */
  padding-left: 4.25em;
}

/* Remove bottom border from the very last item in any list */
.cd-accordion__item:last-child > .cd-accordion__label {
  box-shadow: none;
}

/* 1. Base style for the arrow icon */
.cd-accordion__item--has-children > .cd-accordion__label::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 0.75em; /* Adds space between arrow and text */

  /* Points to the icon sprite file */
  background-image: url("../img/cd-icons.svg"); 
  background-repeat: no-repeat;
  
  /* Selects the arrow from the sprite */
  background-position: 0 0; 
  
  /* Animation for rotation */
  transition: transform 0.3s;
}