/* Project Gutenberg mirror - main stylesheet */
:root {
    --bg:       #fafaf8;
    --reader-bg: #f5f1eb;
    --text:     #222;
    --muted:    #666;
    --accent:   #1a5276;
    --accent2:  #154360;
    --border:   #ddd;
    --tag-bg:   #e8eef5;
    --max-w:    860px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font: 1rem/1.65 Georgia, "Times New Roman", serif;
}

a { color: var(--accent); }
a:hover { color: var(--accent2); }

/* ---- Read Online button ---- */
.btn-read {
    display: inline-flex;
    align-items: center;
    padding: .5rem 1.3rem;
    background: #2e7d32;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: .9rem;
    font-family: sans-serif;
    margin-bottom: .5rem;
    transition: background .15s;
}

.btn-read:hover { background: #1b5e20; color: #fff; }

.btn-ext {
    display: inline-flex;
    align-items: center;
    padding: .5rem 1.3rem;
    background: transparent;
    color: var(--accent);
    text-decoration: none;
    border-radius: 4px;
    font-size: .9rem;
    font-family: sans-serif;
    margin-bottom: .5rem;
    border: 1px solid var(--accent);
    transition: background .15s, color .15s;
}

.btn-ext:hover {
    background: var(--accent);
    color: #fff;
}

/* ---- Header ---- */
header {
    background: var(--accent);
    color: #fff;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

header .logo, header a.logo {
    color: #fff;
    font-size: 1.15rem;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: .01em;
}

header nav a {
    color: #aec6e8;
    font-size: .9rem;
    text-decoration: none;
}

header nav a:hover { color: #fff; }

/* ---- Main content ---- */
main {
    max-width: var(--max-w);
    margin: 2rem auto;
    padding: 0 1.25rem;
}

h1 {
    font-size: 1.8rem;
    line-height: 1.2;
    margin-bottom: .5rem;
}

h2 {
    font-size: 1.15rem;
    color: var(--accent);
    margin: 1.75rem 0 .5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: .25rem;
}

/* ---- Book detail page ---- */
.byline {
    color: var(--muted);
    font-style: italic;
    margin-bottom: 1.25rem;
}

table.meta {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    font-size: .95rem;
}

table.meta th, table.meta td {
    padding: .45rem .75rem;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

table.meta th {
    background: #f0f0ee;
    width: 26%;
    font-weight: normal;
    color: var(--muted);
}

/* ---- Subject tags ---- */
.tag-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .5rem;
}

.tag-list li {
    background: var(--tag-bg);
    padding: .2rem .65rem;
    border-radius: 3px;
    font-size: .85rem;
}

/* ---- Download buttons ---- */
.dl-section { margin-top: 1.75rem; }

.dl-links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .5rem;
}

.btn-dl {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1.1rem;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: .9rem;
    font-family: sans-serif;
    transition: background .15s;
}

.btn-dl:hover { background: var(--accent2); color: #fff; }

.sz {
    opacity: .7;
    font-size: .8em;
}

/* ---- Browse pages ---- */
.alpha-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: 1rem 0 1.5rem;
}

.alpha-nav a, .alpha-nav span {
    padding: .3rem .65rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: .9rem;
    font-family: sans-serif;
    text-decoration: none;
}

.alpha-nav a:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.alpha-nav span { color: var(--muted); }

ul.book-list {
    list-style: none;
    margin-top: .5rem;
}

ul.book-list li {
    padding: .55rem 0;
    border-bottom: 1px solid var(--border);
    line-height: 1.4;
}

ul.book-list .author {
    color: var(--muted);
    font-size: .88rem;
    font-style: italic;
    margin-left: .6rem;
}

.book-count {
    font-size: 1rem;
    font-weight: normal;
    color: var(--muted);
    margin-left: .5rem;
}

/* ---- Index / search page ---- */
#search { margin: 1.5rem 0; }

.browse-link {
    margin-top: 1.25rem;
    color: var(--muted);
    font-size: .95rem;
}

/* ---- Footer ---- */
footer {
    margin-top: 3rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
    border-top: 1px solid var(--border);
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    h1 { font-size: 1.4rem; }

    table.meta th, table.meta td {
        display: block;
        width: 100%;
    }

    table.meta th {
        border-bottom: 0;
        background: none;
        padding-bottom: 0;
        color: var(--muted);
    }

    .btn-dl { width: 100%; justify-content: center; }
}
