/* Dot Definitions — shares tools-page shell, hero, and surface colors from tools.css */

.theory-page-main {
  padding-inline: 18px;
}

.theory-page-lede {
  max-width: 62ch;
}

.theory-glossary-mount {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.theory-glossary-card,
.theory-section-drawer {
  border-radius: 20px;
  border: 1px solid rgba(214, 223, 238, 0.18);
  background: linear-gradient(180deg, rgba(33, 54, 92, 0.9) 0%, rgba(27, 46, 81, 0.92) 100%);
  box-shadow: 0 10px 24px rgba(4, 10, 24, 0.18);
}

.theory-glossary-card {
  padding: 18px 18px 16px;
}

.theory-glossary-card-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #f7fbff;
  letter-spacing: 0.01em;
}

.theory-glossary-card-short {
  margin: 0 0 10px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(245, 247, 251, 0.9);
}

.theory-glossary-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold, #f0c45b);
}

.theory-glossary-card-fretboard,
.theory-glossary-card-detail {
  margin: 0 0 10px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(225, 236, 250, 0.84);
}

.theory-glossary-card-impact {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(214, 223, 238, 0.14);
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(210, 224, 245, 0.82);
}

.theory-glossary-fun-fact {
  margin-top: 12px;
  padding: 14px 18px 16px 16px;
  border-radius: 8px;
  border: 1px solid rgba(42, 157, 181, 0.28);
  border-left: 4px solid rgba(42, 157, 181, 0.55);
  background: rgba(42, 157, 181, 0.06);
}

.theory-glossary-fun-fact-label {
  margin: 0 0 6px;
  color: var(--teal, #2a9db5);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.theory-glossary-fun-fact-text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.62;
  color: rgba(185, 200, 222, 0.88);
}

.theory-section-drawer {
  margin: 0;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.theory-section-drawer:not([open]) {
  box-shadow: 0 6px 18px rgba(4, 10, 24, 0.14);
}

.theory-section-drawer:not([open]):hover {
  border-color: color-mix(in srgb, var(--gold, #f0c45b) 34%, transparent);
  transform: translateY(-1px);
}

.theory-section-drawer[open] {
  border-color: color-mix(in srgb, var(--gold, #f0c45b) 28%, transparent);
  box-shadow: 0 14px 30px rgba(4, 10, 24, 0.24);
}

.theory-section-drawer-summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 0;
  border: 1px solid rgba(149, 198, 255, 0.15);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(22, 40, 72, 0.7) 0%, rgba(14, 30, 56, 0.8) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.theory-section-drawer-summary::-webkit-details-marker {
  display: none;
}

.theory-section-drawer-summary::marker {
  content: '';
}

.theory-section-drawer-summary::after {
  content: '\25B8';
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 1rem;
  line-height: 1;
  color: color-mix(in srgb, var(--gold, #f0c45b) 88%, transparent);
  transition: color 0.2s ease;
}

.theory-section-drawer[open] .theory-section-drawer-summary::after {
  content: '\25BE';
  color: var(--gold, #f0c45b);
}

.theory-section-drawer[open] .theory-section-drawer-summary {
  border-color: rgba(149, 198, 255, 0.18);
}

.theory-section-drawer-summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold, #f0c45b) 72%, transparent);
  outline-offset: -2px;
}

.theory-section-drawer-summary-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  padding-right: 24px;
}

.theory-section-drawer-title {
  margin: 0;
  font-size: clamp(1.12rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: #f7fbff;
}

.theory-section-drawer-count {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(91, 196, 229, 0.3);
  background: rgba(91, 196, 229, 0.15);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  color: #5bc4e5;
}

.theory-section-drawer-lede {
  flex: 1 1 100%;
  margin: 0;
  max-width: 62ch;
  font-size: 0.88rem;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(225, 236, 250, 0.84);
}

.theory-section-drawer:not([open]) .theory-section-drawer-lede {
  display: block;
}

.theory-section-drawer-body {
  padding: 16px 16px 18px;
}

.theory-glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

/* Light mode — match tools.css tool-card / hub surfaces */
:root[data-theme='light'] body.tools-page.theory-page .theory-glossary-card,
:root[data-theme='light'] body.tools-page.theory-page .theory-section-drawer {
  background: linear-gradient(180deg, #F7F1E4 0%, #F7F1E4 100%) !important;
  border-color: rgba(180, 169, 149, 0.32) !important;
  box-shadow: 0 10px 24px rgba(46, 43, 34, 0.10) !important;
}

:root[data-theme='light'] body.tools-page.theory-page .theory-glossary-card-title,
:root[data-theme='light'] body.tools-page.theory-page .theory-section-drawer-title {
  color: #1f2d4f !important;
}

:root[data-theme='light'] body.tools-page.theory-page .theory-glossary-card-short,
:root[data-theme='light'] body.tools-page.theory-page .theory-glossary-card-detail,
:root[data-theme='light'] body.tools-page.theory-page .theory-glossary-card-impact,
:root[data-theme='light'] body.tools-page.theory-page .theory-section-drawer-lede {
  color: #4f6180 !important;
}

:root[data-theme='light'] body.tools-page.theory-page .theory-glossary-label {
  color: var(--gold-deep, #d69425) !important;
}

:root[data-theme='light'] body.tools-page.theory-page .theory-section-drawer-count {
  background: rgba(91, 196, 229, 0.15);
  border-color: rgba(91, 196, 229, 0.3);
  color: #1483b5 !important;
}

:root[data-theme='light'] body.tools-page.theory-page .theory-section-drawer-summary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(246, 250, 255, 0.82) 100%);
  border-color: rgba(31, 45, 79, 0.12);
}

:root[data-theme='light'] body.tools-page.theory-page .theory-glossary-card-impact,
:root[data-theme='light'] body.tools-page.theory-page .theory-section-drawer[open] .theory-section-drawer-summary {
  border-top-color: rgba(180, 169, 149, 0.28);
  border-bottom-color: rgba(180, 169, 149, 0.28);
}

:root[data-theme='light'] body.tools-page.theory-page .theory-glossary-fun-fact-label {
  color: #1483b5 !important;
}

:root[data-theme='light'] body.tools-page.theory-page .theory-glossary-fun-fact {
  border-color: rgba(20, 131, 181, 0.35) !important;
  border-left-color: #1483b5 !important;
  background: transparent !important;
}

:root[data-theme='light'] body.tools-page.theory-page .theory-glossary-fun-fact-text {
  color: #4f6180 !important;
}

@media (max-width: 640px) {
  .theory-page-main {
    padding-inline: 14px;
  }

  .theory-section-drawer-summary {
    padding: 14px 14px 13px;
  }

  .theory-section-drawer-body {
    padding: 12px 12px 14px;
  }

  .theory-section-drawer-summary::after {
    align-self: flex-start;
    margin-top: 4px;
  }
}
