:root {
    --timeline-rotation: -20deg;
    --timeline-text-width: 12em;
}

body {
    font-family: sans-serif;
    margin: 0 1rem;
    color: #333;
    background: #fff;
    line-height: 1.6;
}
header {
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    border-bottom: 1px solid #000;
    padding: 1rem 0;
    margin-bottom: 1rem;
}
header a {
    color: #000;
    text-decoration: none;
}

h1 {
    justify-content: space-between;
    font-size: 2rem;
}

h1 .ja {
    color: #666;
    font-size: 1rem;
    font-weight: normal;
}

article h2 {
    font-size: 1.2rem;
}

main {
    max-width: 50rem;
    margin: 0 auto;
}


ul.pages {
    list-style: none;
    padding: 0;
}

ul.pages li {
    padding: 1rem 0;
}

footer {
    max-width: 50rem;
    margin: 1rem auto;

    font-size: 0.8rem;
    border-top: 1px solid #000;
    padding: 1rem 0;
}

table {
    width: 100%;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        font-size: 1.2rem;
    }

    header .ja {
        margin-top: 0.4rem;
    }

    h1 {
        font-size: 1.5rem;
    }
}

.pages span.header {
    display: none;
}

table.pages {
    position: relative;
}

table.pages th {
    position: sticky;
    top: 0;
    text-align: left;
    padding-bottom: 1rem;
    background-image: linear-gradient(to bottom, #fff, #fff 50%, rgba(255, 255, 255, 0));
}

@media (max-width: 480px) {
    header {
        font-size: 1.2rem;
        padding: 0.8rem 0;
    }

    h1 {
        font-size: 1.2rem;
    }

    ul.pages li {
        padding: 0.8rem 0;
    }

    .pages thead {
        display: none;
    }

    .pages td {
        display: block;
    }

    .pages span.header {
        display: inline;
    }

    .pages td:last-child {
        padding-bottom: 1rem;
    }
}

.bar {
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 0.8rem;
    color: white;
    white-space: nowrap;
    min-width: fit-content;
}

#index article {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

#index h2 {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    margin: 0;
    padding: 0;
}

#index h2 a {
    text-decoration: none;
    color: inherit;
}

#index .article-link {
    display: block;
    text-decoration: none !important;
    color: inherit;
    position: relative;
    padding-right: 2rem;
}

#index .article-link::after {
    content: "›";
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1.2rem;
}

#index .article-link:hover,
#index .article-link:active,
#index .article-link:focus {
    text-decoration: none !important;
}

#index .article-link h2 {
    color: #333;
}

.page-metadata {
    margin: 0.2rem 0 0.8rem 0;
    font-size: 0.8rem;
    color: #666;
    position: relative;
}

/* Rotate each li individually rather than the ul, because CSS transform
   doesn't change the element's bounding box - a rotated ul would still
   occupy its pre-rotation space and cause overlap with surrounding content. */
.page-metadata .changes-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: calc(abs(sin(var(--timeline-rotation))) * var(--timeline-text-width)) 0 0 0;
    list-style: none;
    align-items: flex-end;
}

.page-metadata .changes-items li {
    transform: rotate(var(--timeline-rotation));
    transform-origin: bottom left;
    white-space: nowrap;
    margin-right: -6rem;
    font-size: 0.8rem;
}

.page-metadata .changes-items li::before {
    content: '●';
    margin-right: 0.4rem;
    font-size: 1.2rem;
    line-height: 0;
    vertical-align: middle;
}

.language-ratio {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.ratio-bars {
    display: flex;
    flex-direction: row;
    gap: 0;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
}

.ratio-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    transition: all 0.3s ease;
    min-width: fit-content;
}

.ratio-bar:hover {
    opacity: 0.8;
}

.ja-bar {
    background: #2c3e50;
}

.en-bar {
    background: #3498db;
}

.ratio-label {
    color: white;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.lang-name {
    font-size: 0.8rem;
}

.lang-percent {
    font-size: 0.8rem;
    opacity: 0.9;
}

.lang-tag {
    display: inline-block;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    vertical-align: baseline;
}

.lang-tag.lang-ja {
    background: #2c3e50;
}

.lang-tag.lang-en {
    background: #3498db;
}

.directory-tag {
    display: inline-block;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    background: #95a5a6;
    white-space: nowrap;
    margin-right: 0.4rem;
}

.language-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.language-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.headlines {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    list-style: none;
    margin: 0.4rem 0 0 0;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1.2;
    color: #666;
}

.headlines li::before {
    content: "/";
    margin-right: 0.2rem;
    color: #999;
}

.headlines li:first-child::before {
    content: none;
}

@media (max-width: 480px) {
    .ratio-bars {
        height: 35px;
    }

    .ratio-bar {
        padding: 0 0.4rem;
    }

    .lang-name {
        font-size: 0.8rem;
    }

    .lang-percent {
        font-size: 0.8rem;
    }
}
