/**
 * Segmented Control Styles (Apple-inspired)
 * Shared base for Language Selector & Theme Toggle
 */

/* ============================================ */
/* BASE SEGMENTED CONTROL                       */
/* ============================================ */

.seg-control {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.seg-control__option {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary, #6b7280);
  text-decoration: none;
  border-radius: 17px;
  user-select: none;
  cursor: pointer;
  transition: color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.seg-control__option.active {
  color: var(--color-text-primary, #1a1a1a);
  font-weight: 700;
}

.seg-control__slider {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: #ffffff;
  border-radius: 17px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08),
              0 1px 2px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  pointer-events: none;
}

.seg-control.active-right .seg-control__slider {
  transform: translateX(100%);
}

/* ============================================ */
/* THEME TOGGLE VARIANT                         */
/* ============================================ */

.theme-seg-control {
  font-size: 0;
  line-height: 0;
}

.theme-seg-control .seg-control__option {
  padding: 0 10px;
  color: var(--color-text-secondary, #6b7280);
  transition: color 0.25s ease;
}

.theme-seg-control .seg-control__option svg {
  width: 14px;
  height: 14px;
}

/* Light mode: sun active (left) */
[data-theme="light"] .theme-seg-control .seg-control__option--light {
  color: var(--color-text-primary, #1a1a1a);
}

/* Dark mode: moon active (right), slide pill */
[data-theme="dark"] .theme-seg-control .seg-control__slider {
  transform: translateX(100%);
}

[data-theme="dark"] .theme-seg-control .seg-control__option--dark {
  color: #ffffff;
}

/* ============================================ */
/* DARK MODE                                    */
/* ============================================ */

[data-theme="dark"] .seg-control {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .seg-control__slider {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .seg-control__option {
  color: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .seg-control__option.active {
  color: #ffffff;
}

/* ============================================ */
/* MOBILE MENU VARIANTS                         */
/* ============================================ */

.seg-control--mobile {
  display: none;
}

.seg-control--mobile-menu {
  display: none;
  margin: 16px auto;
}

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */

@media (max-width: 1149.98px) {
  .lang-seg-control:not(.seg-control--mobile) {
    display: none;
  }

  .seg-control--mobile {
    display: inline-grid;
    margin: 20px auto;
  }

  .seg-control--mobile-menu {
    display: inline-grid;
  }
}

@media (min-width: 1150px) {
  .seg-control--mobile {
    display: none;
  }

  .seg-control--mobile-menu {
    display: none;
  }
}

/* ============================================ */
/* TRANSLATION BADGE (unchanged)                */
/* ============================================ */

.translation-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin-left: 8px;
  background: linear-gradient(135deg, #0478b2 0%, #06a8ff 100%);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.translation-badge i {
  font-size: 10px;
}

/* Language indicator in post header */
.post-language-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 16px;
  background: rgba(4, 120, 178, 0.1);
  border-radius: 8px;
  border-left: 3px solid var(--color-primary, #0478b2);
}

.post-language-indicator .lang-text {
  font-size: 13px;
  color: var(--color-text-secondary, #6b7280);
}

.post-language-indicator .lang-switch {
  font-size: 13px;
  color: var(--color-primary, #0478b2);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-language-indicator .lang-switch:hover {
  color: #06a8ff;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .post-language-indicator {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Animation for language switch */
@keyframes langSwitch {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.lang-switching .entry-content,
.lang-switching .post-hero-content h1 {
  animation: langSwitch 0.3s ease-out forwards;
}
