/* 
  Academic / Serious Document Styling 
  Focused on readability, structure, and zero-distraction.
*/

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --border-color: #000000;
    --highlight-bg: #f5f5f5;
    --link-color: #0000ee;

    --font-heading: 'Libre Baskerville', serif;
    --font-body: 'Open Sans', sans-serif;
}

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

body {
    font-family: var(--font-body);
    font-size: 11pt;
    /* Document-like sizing */
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
    max-width: 8.5in;
    /* A4/Letter roughly */
    margin: 0 auto;
    padding: 0.75in 1in;
}

/* Layout */
.container {
    width: 100%;
}

/* Typography & Hero */
.hero {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
}

h1 {
    font-family: var(--font-heading);
    font-size: 18pt;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.authors {
    font-size: 12pt;
    font-weight: 400;
}

/* Hero Action Buttons */
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: nowrap;
}

.hero-btn {
    font-family: var(--font-body);
    font-size: 10pt;
    font-weight: 600;
    color: var(--text-color);
    background-color: transparent;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.hero-btn:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}

.hero-btn.disabled {
    color: #777777;
    border-color: #777777;
    cursor: not-allowed;
    opacity: 0.65;
}

.hero-btn.disabled:hover {
    color: #777777;
    background-color: transparent;
}

.section {
    margin-bottom: 2rem;
}

h2 {
    font-family: var(--font-heading);
    font-size: 14pt;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid var(--border-color);
}

h3 {
    font-family: var(--font-heading);
    font-size: 12pt;
    font-weight: 700;
    margin: 1.5rem 0 0.5rem;
}

/* Citation Box */
.citation-box {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--highlight-bg);
}

/* Typography styles inside blocks */
.content-block p {
    text-align: justify;
    margin-bottom: 1rem;
}

.content-block ul,
.content-block ol {
    margin: 0.5rem 0 1rem 2rem;
}

.content-block li {
    margin-bottom: 0.25rem;
}

/* Table Header & Search */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.5rem;
}

.table-header h2 {
    margin-bottom: 0;
    border-bottom: none;
}

.search-container input {
    width: 200px;
    padding: 0.25rem 0.5rem;
    font-family: var(--font-body);
    font-size: 10pt;
    border: 1px solid var(--border-color);
    background: transparent;
}

/* Table Styles */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
}

th,
td {
    padding: 0.5rem;
    vertical-align: top;
}

th {
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

th.sortable {
    cursor: pointer;
}

th.sortable:hover {
    background-color: var(--highlight-bg);
}

tbody tr:nth-child(even) {
    background-color: var(--highlight-bg);
}

td {
    font-size: 10pt;
}

td:first-child {
    font-weight: 600;
}

.actions-col {
    text-align: center;
    white-space: nowrap;
}

a {
    color: var(--link-color);
    text-decoration: underline;
}

.action-btn {
    font-family: var(--font-body);
    font-size: 9pt;
    color: var(--text-color);
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.1rem 0.3rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.action-btn:hover {
    background-color: #e0e0e0;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    font-size: 10pt;
    font-style: italic;
}

.loading-state,
.empty-state {
    text-align: center;
    padding: 2rem !important;
}

/* Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .search-container input {
        width: 100%;
    }
}
