/* Expandable Text Block */

.expandable-text-block {
  position: relative;
  color: var(--color-paragraph);
  font-family: var(--typography-family-main);
  font-size: var(--typography-size-body);
  line-height: 1.6;
}

.main-text { margin-bottom: 1rem; }

.expanded-text {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
}

.expanded-text.show {
  opacity: 1;
  max-height: 1000px;
}

.expandable-text-toggle {
  position: absolute;
  bottom: -2rem;
  right: 0;
}

/* Button override */
.expandable-text-block .toggle-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: var(--color-link-text);
  font-family: var(--typography-family-main);
  font-size: var(--typography-size-small);
  font-weight: var(--typography-weight-medium);
  cursor: pointer;
  padding: 0;
  max-width: none;
  overflow: visible;
  white-space: normal;
  transition: color 0.3s ease;
}

.expandable-text-block .toggle-button:hover,
.expandable-text-block .toggle-button:focus {
  background: transparent;
  border: none;
  color: var(--color-link-text-hover);
}

.expandable-text-block .toggle-button:focus {
  outline: 2px solid var(--color-link-text);
  outline-offset: 2px;
}

/* Icons */
.toggle-icon-container {
  position: relative;
  width: 32px;
  height: 32px;
}

.toggle-icon {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.toggle-icon svg {
  fill: currentColor;
  width: 32px;
  height: 32px;
}

.toggle-icon-more { opacity: 1; }
.toggle-icon-less { opacity: 0; }

/* Mobile */
@media (max-width: 768px) {
  .expandable-text-toggle {
    position: relative;
    bottom: auto;
    right: auto;
    margin-top: 1rem;
    text-align: right;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .expandable-text-block {
    font-size: var(--typography-size-small);
  }
  
  .expandable-text-block .toggle-button {
    font-size: var(--typography-size-small);
  }
  
  .toggle-icon-container {
    width: 28px;
    height: 28px;
  }
  
  .toggle-icon svg {
    width: 28px;
    height: 28px;
  }
}

/* Extra small mobile */
@media (max-width: 360px) {
  .expandable-text-block {
    font-size: var(--typography-size-small);
    line-height: 1.5;
  }
  
  .expandable-text-block .toggle-button {
    font-size: var(--typography-size-small);
  }
  
  .toggle-icon-container {
    width: 24px;
    height: 24px;
  }
  
  .toggle-icon svg {
    width: 24px;
    height: 24px;
  }
}

/* Color */
.expandable-text-block.color-standard {
  color: var(--color-paragraph);
}

.expandable-text-block.color-white p {
  color: var(--color-white);
}

/* White version button styling */
.expandable-text-block.color-white .toggle-button {
  color: var(--color-white);
}

.expandable-text-block.color-white .toggle-icon-container {
  color: var(--color-link-text);
}

.expanded-text.show p {
  margin-top: 36px;
}