/**
 * Forgotten Towns Index - Stylesheet
 * Color scheme: White/Grey, Black text, Princeton Orange (#F58025)
 */

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

body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.6;
    color: #000;
    background-color: #f5f5f5;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background-color: #fff;
    border-bottom: 4px solid #F58025;
    padding: 30px 40px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5em;
    font-weight: normal;
    color: #000;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1em;
    font-style: italic;
}

/* Main content area */
main {
    background-color: #fff;
    padding: 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* Search form */
.search-box {
    margin-bottom: 30px;
    padding-bottom: 0;
    border-bottom: none;
}

.search-box input[type="text"] {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid #F58025;
    border-radius: 4px;
    font-family: Georgia, serif;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: #F58025;
}

.search-box button {
    background-color: #F58025;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 15px;
    font-family: Georgia, serif;
}

.search-box button:hover {
    background-color: #d46d1f;
}

/* Filters - single line layout */
.filters {
    margin-top: 25px;
    margin-bottom: 40px;
    padding: 15px 20px;
    background-color: #fafafa;
    border: 2px solid #F58025;
    border-radius: 4px;
}

.filters form {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

.filters label {
    font-weight: bold;
    color: #333;
    font-size: 0.9em;
    white-space: nowrap;
}

.filters select {
    padding: 6px 10px;
    font-size: 0.9em;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: Georgia, serif;
}

.filters button {
    display: none;  /* Hide button, form submits on change */
}

.filters noscript button {
    display: inline-block;  /* Show button if JS disabled */
}

/* Entity type badges */
.entity-type {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 3px;
    margin-left: 10px;
}

.type-PERSON { background-color: #e8f4f8; color: #0066a1; }
.type-PLACE { background-color: #f0e8f4; color: #6a1b9a; }
.type-EVENT { background-color: #fff3e0; color: #e65100; }
.type-OTHER { background-color: #e8f5e9; color: #2e7d32; }

/* Entity list - Two column layout for browse pages */
.entity-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    column-gap: 30px;
}

.entity-list li {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    break-inside: avoid;
}

.entity-list li:hover {
    background-color: #fafafa;
    padding-left: 8px;
    margin-left: -8px;
}

.entity-list a {
    color: #000;
    text-decoration: none;
    font-size: 0.95em;
}

.entity-list a:hover {
    color: #F58025;
}

.entity-meta {
    color: #666;
    font-size: 0.85em;
    margin-top: 3px;
}

/* Pagination */
.pagination {
    text-align: center;
    margin: 40px 0;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    text-decoration: none;
    color: #000;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.pagination a:hover {
    background-color: #F58025;
    color: #fff;
    border-color: #F58025;
}

.pagination .current {
    background-color: #F58025;
    color: #fff;
    border-color: #F58025;
    font-weight: bold;
}

.pagination .disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* A-Z navigation */
.az-nav {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background-color: #fafafa;
    border-top: 2px solid #e0e0e0;
    border-bottom: 2px solid #e0e0e0;
}

.az-nav a {
    display: inline-block;
    padding: 8px 12px;
    margin: 3px;
    text-decoration: none;
    color: #000;
    font-weight: bold;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.az-nav a:hover,
.az-nav a.active {
    background-color: #F58025;
    color: #fff;
    border-color: #F58025;
}

/* Entity detail page */
.entity-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #F58025;
}

.entity-header h1 {
    font-size: 2.2em;
    font-weight: normal;
}

.book-appearances {
    margin-top: 30px;
}

.book-entry {
    margin-bottom: 25px;
    padding: 20px;
    background-color: #fafafa;
    border-left: 4px solid #F58025;
}

.book-entry h3 {
    font-size: 1.3em;
    font-weight: normal;
    margin-bottom: 10px;
}

.page-list {
    color: #666;
    font-size: 1.05em;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9em;
    background-color: #fff;
    border-top: 2px solid #e0e0e0;
}

footer a {
    color: #F58025;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Utility classes */
.text-center { text-align: center; }
.text-muted { color: #666; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    main {
        padding: 20px;
    }
    
    .az-nav a {
        padding: 6px 8px;
        margin: 2px;
        font-size: 0.9em;
    }
    
    /* Single column on mobile */
    .entity-list {
        grid-template-columns: 1fr;
    }
    
    /* Allow filter wrapping on very small screens */
    .filters form {
        flex-wrap: wrap;
    }
}
