@charset "UTF-8";
/* radicals.css */

.radical-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 8px;
  margin-top: 5px;
margin-bottom: 10px;
}

.radical-structure-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0;
  margin-top: 4px;
}

.radical-structure-grid a img {
  width: 40px;
  height: 40px;
}

.kanji-grid a img:hover {
  transform: scale(1.25);
  filter: brightness(1.2);
  cursor: pointer;
}

.radical-search-form {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin: 8px 0;
}

.radical-search-form input[type="text"] {
  width: 80px !important;
  padding: 4px 6px;
  font-size: 0.8em;
  border-radius: 6px;
  border: none;
  outline: none;
  color: #333;
}

.radical-search-form input[type="submit"] {
  padding: 8px 6px;
  font-size: 0.8em;
  background-color: #d2903c;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  min-width: 30px;
}

.kanji-page-label {
  margin: 10px 0;
  font-size: 1.2em;
  text-align: center;
  color: #f6c06e;
}

.radical-search-form input[type="text"] {
  padding: 6px 10px;
  width: 120px;
  font-size: 0.9em;
  border: none;
  border-radius: 6px;
  outline: none;
  color: #333;
}

.radical-search-form input::placeholder {
  color: #aaa;
}

/* --- Grid for Radicals by Structure --- */

.radical-structure-grid {
  display: grid;
  grid-template-columns: repeat(6, 40px);     /* 6 radicals per row */
  gap: 6px 10px;
  justify-content: center;
  margin: 8px auto 12px;
}

.radical-structure-grid a img {
  width: 40px;
  height: 40px;
  border: 1px solid #444;
  background-color: #111;
  border-radius: 6px;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);  /* optional: soft depth */
  transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}

.radical-structure-grid a img:hover {
  transform: scale(1.15);
  filter: brightness(1.2);
  border-color: #aaa;
  cursor: pointer;
}

/* Optional: section headers for each structural category */
.radical-heading {
  font-size: 1.05em;
  font-weight: 600;
  text-align: left;
  margin: 8px 0 4px 0;
  color: #8d6309;
}

.radical-description {
  font-size: 0.85em;
  margin: 0 0 6px 0;
  text-align: left;
  color: #ddd;
}

.radical-divider {
  margin: 4px 0 8px;
  border: none;
  border-top: 1px solid #666;
}

hr {
  margin: 4px 0 2px 0;  /* Tighter spacing above/below line */
  border: none;
  border-top: 1px solid #444;
}

.accordion {
  background-color: #222;
  color: #788c5e;
  cursor: pointer;
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  font-size: 1.1em;
  border-bottom: 1px solid #444;
}

.accordion:hover {
  background-color: #333;
}

.panel {
  padding: 10px 16px;
  display: none;
  background-color: #111;
  overflow: hidden;
}

/* Optional: when open */
.panel.open {
  display: block;
}

.accordion {
  background-color: #222;
  color: #99b477;
  cursor: pointer;
  padding: 12px 12px;
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  font-size: 1.05em;
  border-bottom: 1px solid #444;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion:hover {
  background-color: #333;
}

.accordion-right {
  font-size: 0.85em;
  color: #ccc;
  font-weight: normal;
}

.radical-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px;
}

.radical-item {
  width: 120px;
  border: 1px solid #ccc;
  border-radius: 8px;
  text-align: center;
  padding: 10px;
  background-color: #f9f9f9;
}

.radical-item img {
  display: block;
  margin: 0 auto 8px;
}

#kanji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 12px;
  padding: 20px;
  justify-items: center;
}

.kanji-img {
  width: 60px;
  height: auto;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.kanji-img:hover {
  transform: scale(1.1);
}

.panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}

.panel.open {
  max-height: 500px; /* or large enough for content */
}

.radical-label {
  display: none;
  font-size: 0.75em;
  color: #ccc;
  text-align: center;
  margin-top: 2px;
}

.radical-entry.show-labels .radical-label {
  display: block;
}

.panel {
  display: none;
}

.panel.open {
  display: block;
}

/* Centering container */
#search-results {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px; /* Adjust this value to control spacing between items */
  margin-top: 10px;
}

/* Individual result box */
.radical-result {
  width: 100px;
  margin: 10px;
  background-color: #111;
}