/* =============================================================================
   Zulma EN — Language Switcher Stylesheet
   language.css — supports EN / JA / ID
   Reference pattern: SAOIF gog_calculator language switcher
   ============================================================================= */

#lang-switcher {
    position: fixed;
    bottom: 24px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 9999;
}

.lang-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.lang-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
    border: 2px solid transparent;
    text-decoration: none !important;
    overflow: hidden;
    cursor: pointer;

    opacity: 0;
    transform: translateY(12px) scale(0.65);
    pointer-events: none;

    transition: opacity 0.20s ease,
                transform 0.20s ease,
                border-color 0.15s ease,
                box-shadow 0.15s ease;
}

#lang-switcher:not(.open) .lang-options .lang-btn:nth-child(1) { transition-delay: 0.00s; }
#lang-switcher:not(.open) .lang-options .lang-btn:nth-child(2) { transition-delay: 0.05s; }
#lang-switcher:not(.open) .lang-options .lang-btn:nth-child(3) { transition-delay: 0.10s; }

#lang-switcher.open .lang-options .lang-btn:nth-child(3) { transition-delay: 0.04s; }
#lang-switcher.open .lang-options .lang-btn:nth-child(2) { transition-delay: 0.10s; }
#lang-switcher.open .lang-options .lang-btn:nth-child(1) { transition-delay: 0.16s; }

#lang-switcher.open .lang-btn {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.lang-btn:hover {
    transform: translateY(0) scale(1.13) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.30);
}

.lang-btn img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 50%;
}

.lang-btn.active {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.30);
}

.lang-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #1a73e8;
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 16px rgba(26, 115, 232, 0.50);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.22s ease, transform 0.18s ease, box-shadow 0.22s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.lang-toggle:hover {
    background: #1558b0;
    transform: scale(1.08);
    box-shadow: 0 5px 20px rgba(26, 115, 232, 0.60);
}

.lang-toggle:active { transform: scale(0.93); }

#lang-switcher.open .lang-toggle {
    background: #e53935;
    box-shadow: 0 3px 16px rgba(229, 57, 53, 0.50);
}

#lang-switcher.open .lang-toggle:hover {
    background: #b71c1c;
    box-shadow: 0 5px 20px rgba(229, 57, 53, 0.60);
}

.lang-toggle .icon-translate,
.lang-toggle .icon-close {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.20s ease, transform 0.20s ease;
    pointer-events: none;
}

.lang-toggle .icon-translate {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #fff;
}

.lang-toggle .icon-close {
    opacity: 0;
    transform: rotate(-70deg) scale(0.55);
    color: #fff;
    font-size: 26px;
    font-weight: 200;
    line-height: 1;
    font-family: system-ui, sans-serif;
}

#lang-switcher.open .lang-toggle .icon-translate {
    opacity: 0;
    transform: rotate(70deg) scale(0.55);
}

#lang-switcher.open .lang-toggle .icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

@media (max-width: 600px) {
    #lang-switcher { bottom: 16px; right: 14px; }
}

/* Posts listing: category + tag dropdowns sit side by side on wider
   screens (mirrors the single .select used on Portfolio/Certificate/
   Research, just doubled), stacking on mobile like everything else. */
#posts-category-filter,
#posts-tag-filter {
    display: inline-block;
    vertical-align: top;
    margin-right: 1rem;
}
@media (max-width: 768px) {
    #posts-category-filter,
    #posts-tag-filter {
        display: block;
        margin-right: 0;
    }
}
/* No margin here on purpose: the tag links are already joined with ", "
   (comma + space) in post-detail-loader.js's tagsHtml(), so an extra
   margin-right on the anchor pushed that gap in front of the comma
   instead of after it ("Hometown , Autumn" instead of "Hometown, Autumn"). */
#post-tags a {
    margin-right: 0;
}


/* Keep the translate FAB the same diameter as the theme toggle button
   (see theme-dark.css .theme-toggle mobile breakpoint, 768px/42px) at
   every screen width, so the two floating buttons always look paired. */
@media only screen and (max-width: 768px) {
    .lang-toggle {
        width: 42px;
        height: 42px;
    }
}
