/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    max-width: 40em;
    margin: 0 auto;
    padding: 20px;
    font-family: "Open Sans", "Noto Sans CJK JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    font-size: 18px;
    letter-spacing: 0.4px;
    line-height: 30px;
    background-color: #fff;
    color: #333;
    word-spacing: 0.1em;
}

/* Headers */
header#masthead {
    margin-top: 2em;
    margin-bottom: 1.5em;
    padding-bottom: 1.5em;
    border-bottom: 1px solid #ddd;
    font-family: Georgia, serif;
    font-size: 2.5em;
    line-height: 1.2;
    text-align: center;
}

header#masthead a {
    color: #333;
    text-decoration: none;
}

header#masthead a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    font-family: Georgia, serif;
    font-weight: normal;
    line-height: 1.3;
    margin-bottom: 1em;
}

h1 {
    font-size: 2em;
}

h2 {
    font-size: 1.5em;
    margin-top: 2em;
    margin-bottom: 0.5em;
}

h3 {
    font-size: 1.2em;
    margin-top: 1.5em;
}

/* Links */
a {
    color: #0066cc;
    text-decoration: none;
    word-wrap: break-word;
}

a:hover {
    text-decoration: underline;
}

/* Content sections */
section {
    margin-bottom: 5em;
    clear: both;
}

p {
    margin-bottom: 1em;
    text-align: left;
}

/* Work in progress note */
.work-in-progress {
    font-size: 0.85em;
    color: #888;
    font-style: italic;
    margin-top: 3em;
    padding-top: 1em;
    border-top: 1px dotted #ccc;
}

/* Lists */
ul {
    margin-left: 0;
    padding-left: 0;
    margin-bottom: 1em;
}

ul li {
    list-style-type: none;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    padding-left: 1.5em;
    position: relative;
}

ul li:before {
    content: "|";
    position: absolute;
    left: 0;
    color: #666;
}

/* Small text */
small {
    font-size: 0.9em;
    color: #666;
    margin-left: 1em;
}

/* Footer */
footer {
    margin-top: 4em;
    padding-top: 2em;
    border-top: 1px solid #ddd;
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

footer p {
    text-align: center;
    margin-bottom: 0;
}

/* Simple TTS Button */
.tts-container {
    text-align: center;
    margin-bottom: 2em;
}

.tts-container select {
    margin-right: 10px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.tts-button {
    background: #0066cc;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tts-button:hover {
    background: #0052a3;
}

/* Responsive design */
@media screen and (max-width: 600px) {
    body {
        padding: 15px;
        font-size: 16px;
    }
    
    header#masthead {
        font-size: 2em;
    }
    
    h2 {
        font-size: 1.3em;
    }
    
    section {
        margin-bottom: 2em;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    header#masthead {
        border-bottom: 1px solid #444;
    }
    
    header#masthead a {
        color: #e0e0e0;
    }
    
    a {
        color: #66b3ff;
    }
    
    .work-in-progress {
        color: #aaa;
        border-top: 1px dotted #555;
    }
    
    footer {
        border-top: 1px solid #444;
        color: #999;
    }
    
    ul li:before {
        color: #999;
    }
    
    small {
        color: #999;
    }

    .tts-container select {
        background: #3d3d3d;
        color: #e0e0e0;
        border: 1px solid #555;
    }

    .tts-button {
        background: #66b3ff;
        color: #1a1a1a;
    }

    .tts-button:hover {
        background: #4da6ff;
    }
}