/* =====================================================
   Denwakan Wado-Ryu Reference
   Version 0.8 Sprint 1
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f4f4;
    color: #222;
}

/* =====================================================
   Main Layout
   ===================================================== */

#app {
    display: flex;
    height: 100vh;
}

/* =====================================================
   Sidebar
   ===================================================== */

#sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #cfcfcf;
    overflow-y: auto;
}

.sidebar-header {

    padding: 22px 18px;

    background-image: url("../images/header_background.png");
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;

}

.sidebar-header h1 {
    font-size: 1.4rem;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,.8);
    margin-bottom: 2px;
}

.sidebar-header h2 {
    font-size: .95rem;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,.8);
    font-weight: normal;
    margin-bottom: 18px;
}

/* =====================================================
   Search Box
   ===================================================== */

#searchBox {
    width: 90%;
    padding: 8px 10px;
    font-size: .95rem;
    border: 1px solid #bbb;
    border-radius: 4px;
}

/* =====================================================
   Navigation
   ===================================================== */

#navigation {
    padding: 0 10px 20px 10px;
}

/* Navigation will be generated by JavaScript */

.nav-section {
    margin-bottom: 14px;
}

.nav-header {
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    padding: 8px 6px;
    border-bottom: 2px solid #000;
    user-select: none;
}

.nav-header.expanded {
    background: #ececec;
}

.nav-items {
    padding-top: 8px;
}

.nav-item {
    padding: 6px 0 6px 20px;
    cursor: pointer;
}

.nav-item:hover {
    background: #f5f5f5;
}

.nav-item.selected {
    background: #dde8ff;
    border-left: 4px solid #2d5fb3;
    padding-left: 16px;
}

/* =====================================================
   Main Content
   ===================================================== */

#content {
    flex: 1;
    overflow-y: auto;
    padding: 35px;
    background: white;
}

#pageContainer {
    max-width: 900px;
}

#pageContainer h2 {
    margin-bottom: 20px;
}

#pageContainer p {
    margin-bottom: 14px;
    line-height: 1.5;
}

/* =====================================================
   Future Reference Pages
   ===================================================== */

.section {
    margin-top: 30px;
}

.section-title {
    font-weight: bold;
    border-bottom: 1px solid #bbb;
    margin-bottom: 10px;
    padding-bottom: 6px;
}

.edit-link {
    float: right;
    font-size: .9rem;
    color: #2d5fb3;
    cursor: pointer;
}

.footer {
    margin-top: 50px;
    border-top: 1px solid #ccc;
    padding-top: 12px;
    color: #777;
    font-size: .85rem;
}

/* ===========================
   ONE-STEP SPARRING
   =========================== */

.one-step-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.one-step-card {
    overflow: hidden;
    border: 2px solid #9a9a9a;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.one-step-card h3 {
    margin: 0;
    padding: 8px 12px;
    border-bottom: 2px solid #000;
    font-weight: bold;
    text-align: center;
}

.one-step-detail {
    padding: 10px 15px;
    border-bottom: 1px solid #d6d6d6;
}

.one-step-detail:last-child {
    border-bottom: none;
}

.one-step-detail > strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1rem;
}

.one-step-row {
    display: grid;
    grid-template-columns: 110px auto;
    column-gap: 18px;
}

.one-step-row .label {
    display: block;
    font-size: .85rem;
    font-weight: bold;
    color: #666;
    margin-bottom: 3px;
}

.one-step-row div div {
    line-height: 1.2;
}

.one-step-section-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px;
}

.kata-movement-reference {
    font-size: 0.88rem;
    font-weight: normal;
    color: #666;
}

.navigation-page-link {
    display: flex;
    align-items: center;
    gap: 7px;
}

.belt-level-square {
    width: 12px;
    height: 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: #FFD700;
    font-size: 9px;
    font-weight: bold;
    line-height: 1;

    flex-shrink: 0;
}

.reference-rank-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 30px;
    width: 30px;
    height: 18px;

    border: 1px solid #000;
    border-radius: 2px;

    font-size: 0.75rem;
    font-weight: bold;
    line-height: 1;
}

.reference-video {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =====================================================
   Three-Step Kumite
   ===================================================== */

.three-step-attacker {
    margin-bottom: 18px;
    padding: 14px 18px;
    border: 2px solid #9a9a9a;
    border-radius: 8px;
    background: #ffffff;
}

.three-step-attacker h3 {
    margin-bottom: 10px;
}

.three-step-attacker ol {
    margin: 8px 0 0 24px;
}

.three-step-attacker li {
    margin-bottom: 5px;
}


/* Two defender groups */

.three-step-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.three-step-column {
    min-width: 0;
}


/* Defender sequence */

.three-step-defender {
    margin-bottom: 12px;
    padding: 14px 18px;
    border: 2px solid #9a9a9a;
    border-radius: 8px;
    background: #ffffff;
}

.three-step-defender h3 {
    margin-bottom: 10px;
}

.three-step-defender ol {
    margin: 8px 0 0 24px;
}

.three-step-defender li {
    margin-bottom: 5px;
}


/* Individual techniques */

.three-step-techniques {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.three-step-card {
    overflow: hidden;
    border: 2px solid #9a9a9a;
    border-radius: 8px;
    background: #ffffff;
}

.three-step-card h3 {
    margin: 0;
    padding: 8px 12px;
    border-bottom: 2px solid #000;
    background: #eeeeee;
    text-align: center;
    font-size: 1.05rem;
}

.three-step-counter {
    padding: 10px 12px;
}

.three-step-counter p {
    margin: 4px 0 0;
}

/* =====================================================
   Belt Requirements
   ===================================================== */

.belt-requirements {
    margin-top: 0;

    border-left: 10px solid var(--rank-color);
    padding-left: 16px;
    padding-top: 18px;
}

.belt-requirement-section {
    margin-bottom: 18px;
}

.belt-requirement-section h3 {
    margin: 0 0 6px 0;

    font-size: 1.05rem;
    font-weight: bold;
}

.belt-requirement-section ul {
    margin: 0;
    padding-left: 30px;
}

.belt-requirement-section li {
    margin: 4px 0;
}

.belt-page-title {
    padding-bottom: 10px;
    border-bottom: 5px solid var(--rank-color);
}

.belt-page-title {
    display: flex;
    align-items: center;
    gap: 10px;

    padding-bottom: 10px;
    border-bottom: 5px solid var(--rank-color);
}

.belt-rank-marker {
    display: inline-block;

    width: 32px;
    height: 18px;
    flex-shrink: 0;

    border: 1px solid #000;
    border-radius: 2px;
}

/* remove the burger menu on desktop */
.mobile-menu-button {
    display: none;
}

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 768px) {

    #app {
        flex-direction: column;
        height: 100dvh;
        overflow: hidden;
    }

    #sidebar {
        width: 100%;
        flex: 0 0 auto;
        min-height: 0;

        border-right: none;
        border-bottom: 2px solid #000;

    }

    .sidebar-header {
        padding: 10px 14px 6px;
    }

    .sidebar-header h1,
    .sidebar-header h2 {
        color: #ffffff;
    }

    #content {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding: 12px;
    }

    .one-step-grid {
        grid-template-columns: 1fr;
    }

    .one-step-card {
        margin: 6px 0;
    }

    .one-step-card h3 {
        padding: 8px 12px;
    }

    .one-step-detail {
        padding: 10px 12px;
    }

    .one-step-detail p {
        margin: 4px 0 0;
    }

    .one-step-section-heading {
        display: block;
        margin-bottom: 6px;
    }

    .one-step-row {
        gap: 10px;
    }

    .one-step-row > div {
        min-width: 0;
    }

    .three-step-columns {
        grid-template-columns: 1fr;
    }

    .three-step-column {
        margin-bottom: 14px;
    }

    /* Belt Requirements mobile spacing */

    .belt-requirement-section {
        margin-bottom: 10px;
    }

    .belt-requirement-section h3 {
        margin-bottom: 3px;
    }

    .belt-requirement-section li {
        margin: 2px 0;
    }

    .mobile-menu-button {
        display: block;

        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);

        background: transparent;
        border: none;

        color: #ffffff;
        font-size: 32px;
        line-height: 1;

        cursor: pointer;
    }

    .sidebar-header {
        position: relative;
        padding-left: 60px;
    }

    #navigation {
    display: none;
    }

    #navigation.mobile-menu-open {
        display: block;

        max-height: 50vh;
        overflow-y: auto;
    }
}