/* Frontend Styles for Dropdown Content Block */

.wp-block-storeink-dropdown-content {
  margin: 1.5rem 0;
  border-radius: max(16px, 1vw);
  box-shadow: 0 0.125rem 0.25rem rgba(48, 47, 47, 0.12);
  overflow: hidden;
  background: #fff;
}

@media screen and (min-width: 768px) {
  .wp-block-storeink-dropdown-content {
    border-radius: min(16px, 1vw);
  }
}

.wp-block-storeink-dropdown-content .dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px clamp(0.75rem, 0.375rem + 1.875vw, 2.625rem);
  background: var(--color, #f8f8f8);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.wp-block-storeink-dropdown-content .dropdown-header:hover {
  background: var(--color-sub, #f0f0f0);
}

.wp-block-storeink-dropdown-content .dropdown-title {
  margin: 0;
  font-size: clamp(1.25rem, 0.975rem + 1.375vw, 2.625rem);
  font-weight: 600;
  color: #fff;
  flex: 1;
  line-height: 1.6;
}

/* Ruby text support */
.wp-block-storeink-dropdown-content .dropdown-title ruby {
  display: ruby;
  ruby-position: over;
}

.wp-block-storeink-dropdown-content .dropdown-title rt {
  display: ruby-text;
  font-size: 0.5em;
  color: #fff;
  font-weight: 400;
  line-height: 1;
}

.wp-block-storeink-dropdown-content .dropdown-toggle {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.wp-block-storeink-dropdown-content .dropdown-icon {
  display: block;
  width: 32px;
  height: 32px;
  background: url(./dropdown-icon.svg) no-repeat center center;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.wp-block-storeink-dropdown-content.is-open .dropdown-icon {
  transform: rotate(180deg);
}

.wp-block-storeink-dropdown-content .dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1.5rem;
}

.wp-block-storeink-dropdown-content.is-open .dropdown-content {
  max-height: fit-content;
  padding: clamp(0.75rem, 0.425rem + 1.625vw, 2.375rem)
    clamp(0.75rem, -0.75rem + 7.5vw, 8.25rem);
  border-top: 1px solid #e0e0e0;
}

/* Inner blocks spacing */
.wp-block-storeink-dropdown-content .dropdown-content > * {
  margin-top: 0;
  margin-bottom: 1rem;
}

.wp-block-storeink-dropdown-content .dropdown-content > h3 {
  font-size: clamp(1.125rem, 0.925rem + 1vw, 2.125rem);
}
.wp-block-storeink-dropdown-content .dropdown-content p {
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.5rem);
}

.wp-block-storeink-dropdown-content .dropdown-content p a {
  color: #ff8100;
  text-decoration: underline;
}

.wp-block-storeink-dropdown-content .dropdown-content > *:last-child {
  margin-bottom: 0;
}

/* Close button */
.wp-block-storeink-dropdown-content .dropdown-close {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  width: 100%;
  max-width: 170px;
  margin-left: auto;
  margin-top: 1.5rem;
  padding: 4px 15px;
  background: var(--color, #edb422);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.5rem);
  font-weight: 700;
  cursor: pointer;
  overflow: visible;
  transition: background-color 0.3s ease;
}

.wp-block-storeink-dropdown-content .dropdown-close:hover {
  background: var(--color-sub, #d0a726);
}

.wp-block-storeink-dropdown-content .dropdown-close .dropdown-close-icon {
  display: block;
  position: absolute;
  right: 0;
  z-index: 2;
  top: 0;
  width: auto;
  aspect-ratio: 1 / 1;
  height: 100%;
  background: url(./dropdown-icon-dark.svg) no-repeat center center;
  background-size: contain;
  flex-shrink: 0;
}

@media screen and (min-width: 768px) {
  .wp-block-storeink-dropdown-content .dropdown-content > * {
    margin-top: 0;
    margin-bottom: 2rem;
  }

  .wp-block-storeink-dropdown-content .dropdown-icon {
    width: 60px;
    height: 60px;
    background-size: cover;
  }

  .wp-block-storeink-dropdown-content .dropdown-close {
    max-width: 250px;
    padding: 8px 20px;
  }
}
