/* ==========================================================================
   TATEGAKI & JAPANESE TYPOGRAPHY SYSTEM (amrul.my.id/jp)
   Comprehensive Vertical Writing Mode & Authentic Layout Architecture
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Master Typography & Base Tokens
   -------------------------------------------------------------------------- */
:root {
    --font-jp-sans: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    --font-jp-serif: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
    --font-jp-mono: 'JetBrains Mono', 'Noto Sans Mono CJK JP', monospace;
}

/* Core Tategaki (Vertical Top-to-Bottom ↓, Lines advance Left ←) */
.tategaki {
    writing-mode: vertical-rl !important;
    -webkit-writing-mode: vertical-rl !important;
    -ms-writing-mode: tb-rl !important;
    text-orientation: upright !important;
    letter-spacing: 0.18em !important;
    line-height: 1.6 !important;
    font-feature-settings: "pkna" 1, "vpal" 1 !important;
    display: inline-block !important;
    vertical-align: top !important;
}

/* Tate-chu-yoko (Horizontal in Vertical for numbers/symbols) */
.tcy {
    text-combine-upright: all;
    -webkit-text-combine: horizontal;
    -ms-text-combine-horizontal: all;
    display: inline-block;
    letter-spacing: 0;
    margin: 0.1em 0;
}

.tategaki-serif,
.jp-serif {
    font-family: var(--font-jp-serif);
}

.tategaki-sans,
.jp-sans {
    font-family: var(--font-jp-sans);
}

.jp-accent {
    font-family: var(--font-jp-serif);
    font-style: italic;
    color: var(--text-muted);
    font-weight: 400;
}

.jp-vertical-badge {
    writing-mode: vertical-rl;
    -webkit-writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
}

/* Language Switcher Pill */
.lang-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    background: var(--bg-alt);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.lang-switch-btn:hover {
    background: #000;
    color: var(--accent-green);
    border-color: #000;
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   2. Compact View / Splash Screen (src/pages/jp/index.astro)
   -------------------------------------------------------------------------- */
.jp-compact-hero-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    margin: 20px 0 30px;
}

.jp-tategaki-hero-group {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 35px;
    height: 380px;
    max-height: 48vh;
    padding: 10px 0;
}

.jp-tategaki-hero-group h1 {
    font-size: clamp(2.6rem, 5.5vh, 4.2rem);
    font-weight: 900;
    line-height: 1.25;
    margin: 0;
    letter-spacing: 0.15em;
}

.jp-tategaki-hero-sub {
    font-size: clamp(0.95rem, 2vh, 1.15rem);
    color: var(--text-muted);
    line-height: 1.8;
    border-left: 1px solid var(--border-color);
    padding-left: 18px;
    height: 100%;
}

.jp-tategaki-desc {
    font-size: clamp(0.85rem, 1.6vh, 0.95rem);
    color: var(--text-muted);
    line-height: 1.9;
    border-left: 1px solid var(--border-color);
    padding-left: 18px;
    height: 100%;
    margin: 0;
}

/* --------------------------------------------------------------------------
   3. Portfolio Hero Tategaki (src/pages/ja/portfolio.astro)
   -------------------------------------------------------------------------- */
.jp-portfolio-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    padding: 70px 0 50px;
}

.jp-portfolio-hero-left {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 35px;
    height: 360px;
    flex-shrink: 0;
}

.jp-portfolio-hero-left h1 {
    font-size: clamp(2.4rem, 4.5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: 0.12em;
    margin: 0;
}

.jp-portfolio-hero-left .jp-hero-vertical-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.9;
    border-left: 1px solid var(--border-color);
    padding-left: 20px;
    height: 100%;
}

.jp-portfolio-hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 25px;
    max-width: 460px;
}

.jp-portfolio-hero-right p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* --------------------------------------------------------------------------
   4. Left-Right Section Split Layout (Portfolio Selected Works & Journey)
   -------------------------------------------------------------------------- */
.jp-section-split {
    display: flex;
    gap: 60px;
    align-items: flex-start;
    margin-top: 100px;
}

.jp-split-title-col {
    position: sticky;
    top: 90px;
    width: 170px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 35px 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    gap: 20px;
    text-align: center;
}

.jp-title-vertical {
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 900;
    letter-spacing: 0.15em;
    line-height: 1.2;
    margin: 0;
}

.jp-title-sub-text {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    font-family: var(--font-sans);
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    width: 100%;
}

.jp-split-content-col {
    flex: 1;
    min-width: 0;
}

.jp-split-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.jp-split-filters .filter-btn {
    width: 100%;
    text-align: center;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 50px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.jp-split-filters .filter-btn.active,
.jp-split-filters .filter-btn:hover {
    background: var(--text-main);
    color: var(--bg-main);
    border-color: var(--text-main);
}

/* --------------------------------------------------------------------------
   5. Archive Page Header Split (Projects & Journey in JP)
   -------------------------------------------------------------------------- */
.jp-page-header-split {
    display: flex;
    align-items: stretch;
    gap: 50px;
    padding: 50px 0 40px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 50px;
}

.jp-header-left-title {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 20px;
    padding: 25px 30px;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    height: 240px;
    flex-shrink: 0;
}

.jp-header-left-title h1 {
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: 0.12em;
    margin: 0;
}

.jp-header-right-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 25px;
}

.jp-archive-lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 650px;
}

/* --------------------------------------------------------------------------
   6. Services Sticky Left Content (src/pages/jp/services.astro)
   -------------------------------------------------------------------------- */
.jp-services-left-tategaki {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 25px;
    margin: 40px 0;
}

.jp-services-tategaki-heading {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 30px;
    height: 380px;
    max-height: 48vh;
}

.jp-services-tategaki-heading h1 {
    font-size: clamp(2.4rem, 4.5vh, 3.8rem);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: 0.12em;
    margin: 0;
}

.jp-services-tategaki-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.9;
    border-left: 1px solid var(--border-color);
    padding-left: 18px;
    height: 100%;
}

/* --------------------------------------------------------------------------
   7. Contact & 404 Tategaki Layouts
   -------------------------------------------------------------------------- */
.jp-contact-card,
.jp-404-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 30px;
    padding: 50px 30px;
    max-width: 800px;
    margin: 0 auto;
}

.jp-contact-tategaki-box,
.jp-404-tategaki-box {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: center;
    gap: 25px;
    height: 280px;
    margin: 10px 0;
}

.jp-contact-tategaki-box h1,
.jp-404-tategaki-box h1 {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: 0.12em;
    margin: 0;
}

.jp-contact-sub-vertical,
.jp-404-sub-vertical {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 2;
    border-left: 1px solid var(--border-color);
    padding-left: 18px;
    height: 100%;
}

/* --------------------------------------------------------------------------
   8. Footer Tategaki Integration (src/components/jp/FooterJP.astro)
   -------------------------------------------------------------------------- */
.footer-jp-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-jp-tategaki-wrap {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 20px;
    height: 220px;
    padding: 20px 25px;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.footer-tategaki-h2 {
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: 0.12em;
    margin: 0;
}

.footer-jp-action-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    text-align: left;
}

.footer-jp-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 400px;
}

/* --------------------------------------------------------------------------
   9. Responsive Breakpoints Matrix
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .jp-section-split {
        flex-direction: column;
        gap: 40px;
    }
    .jp-split-title-col {
        position: static;
        width: 100%;
        flex-direction: column;
        align-items: center;
        padding: 25px 20px;
    }
    .jp-title-vertical {
        writing-mode: horizontal-tb;
        -webkit-writing-mode: horizontal-tb;
    }
    .jp-vertical-badge {
        writing-mode: horizontal-tb;
        -webkit-writing-mode: horizontal-tb;
        transform: none;
    }
    .jp-title-sub-text {
        border-top: none;
        border-left: none;
        padding-top: 0;
        padding-left: 0;
        width: auto;
        text-align: center;
    }
    .jp-split-filters {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        border-top: 1px solid var(--border-color);
        padding-top: 15px;
    }
    .jp-split-filters .filter-btn {
        width: auto;
    }
    .jp-page-header-split {
        flex-direction: column;
        gap: 30px;
    }
    .jp-header-left-title {
        height: auto;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    .jp-header-left-title h1 {
        writing-mode: horizontal-tb !important;
        -webkit-writing-mode: horizontal-tb !important;
    }
    .footer-jp-inner {
        flex-direction: column;
        gap: 30px;
    }
    .footer-jp-tategaki-wrap {
        height: auto;
        width: 100%;
        flex-direction: row;
        justify-content: center;
    }
    .footer-tategaki-h2 {
        writing-mode: horizontal-tb !important;
        -webkit-writing-mode: horizontal-tb !important;
    }
    .footer-jp-action-wrap {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .jp-portfolio-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 35px;
        padding: 40px 0 30px;
    }
    .jp-portfolio-hero-left {
        height: 300px;
        gap: 20px;
    }
    .jp-tategaki-hero-group {
        height: 320px;
        gap: 20px;
    }
    .jp-services-tategaki-heading {
        height: 300px;
        gap: 20px;
    }
    .jp-contact-tategaki-box,
    .jp-404-tategaki-box {
        height: 240px;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .jp-portfolio-hero-left {
        height: 260px;
        gap: 15px;
    }
    .jp-portfolio-hero-left h1 {
        font-size: clamp(2rem, 7vw, 2.6rem);
    }
    .jp-tategaki-hero-group {
        height: 270px;
        gap: 15px;
    }
    .jp-tategaki-hero-group h1 {
        font-size: clamp(2rem, 7vw, 2.6rem);
    }
}
