Files
ebooks/static/styles.css
T
arnefandCopilot e4fe39ecc5 Fix book grid layout with long titles
- static/styles.css: use CSS grid instead of inline-block for .book-list
  so rows align consistently regardless of card content height; add
  overflow-wrap/word-break to titles/authors
- views/pages.templ: truncate long titles/authors server-side
  (truncateTitle helper) instead of relying on CSS line-clamp, which
  behaved inconsistently across browsers (esp. Firefox with flex);
  full title kept in title attribute and on the book detail page
- views/pages_templ.go regenerated via templ generate

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-15 11:12:48 +02:00

263 lines
3.7 KiB
CSS

:root {
color-scheme: light;
}
html, body {
margin: 0;
padding: 0;
background: #fff;
color: #000;
font-family: Arial, sans-serif;
font-size: 18px;
line-height: 1.45;
}
img {
max-width: 100%;
}
.header {
border-bottom: 2px solid #000;
padding: 0.75rem 1rem;
}
.header-bar {
display: flex;
align-items: center;
gap: 0.5rem;
min-height: 1.2rem;
}
.header h1 {
margin: 0;
font-size: 1.2rem;
line-height: 1.2;
}
.header a {
color: inherit;
text-decoration: none;
}
.header-back {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.5rem;
height: 1.5rem;
margin: -0.15rem 0;
font-size: 1.2rem;
line-height: 1;
font-weight: bold;
flex: 0 0 1.5rem;
}
.container {
padding: 1rem;
max-width: 42rem;
}
h2 {
margin-top: 0;
font-size: 1.25rem;
}
.page-head {
margin-bottom: 1rem;
}
.page-subtitle {
margin: 0.25rem 0 0;
font-size: 0.95rem;
}
.book-list {
list-style: none;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0.5rem;
margin: 0;
padding: 0;
}
.book-item {
box-sizing: border-box;
margin: 0;
border: none;
}
.book-card {
display: flex;
flex-direction: column;
height: 100%;
border: 1px solid #000;
padding: 0.5rem;
color: inherit;
text-decoration: none;
box-sizing: border-box;
}
.book-card-cover {
display: block;
margin-bottom: 0.5rem;
}
.book-card-body {
display: block;
}
.book-detail-cover {
display: block;
}
.book-card-cover,
.book-detail-cover {
text-align: center;
}
.book-cover,
.book-cover-placeholder {
display: inline-block;
width: 100%;
max-width: 100%;
aspect-ratio: 2 / 3;
border: 1px solid #000;
object-fit: cover;
vertical-align: top;
}
.book-cover-placeholder {
text-align: center;
font-size: 0.75rem;
font-weight: bold;
line-height: 1.2;
padding-top: 2.3rem;
box-sizing: border-box;
}
.book-cover-detail,
.book-cover-placeholder-detail {
width: 8rem;
height: 11.5rem;
max-width: none;
margin-bottom: 1rem;
}
.book-card .book-title {
font-weight: bold;
font-size: 0.95rem;
line-height: 1.25;
margin-bottom: 0.25rem;
overflow-wrap: break-word;
word-break: break-word;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
.book-author,
.book-author-detail {
display: block;
margin-top: 0.2rem;
overflow-wrap: break-word;
word-break: break-word;
}
.book-author {
font-size: 0.85rem;
line-height: 1.25;
}
.format {
display: block;
margin-top: 0.2rem;
font-size: 0.85rem;
}
.book-detail {
display: block;
}
.book-detail-cover {
margin-bottom: 1rem;
}
.book-meta {
margin: 0 0 1rem;
}
.book-meta div {
margin-bottom: 0.6rem;
}
.book-meta dt {
font-weight: bold;
}
.book-meta dd {
margin: 0.15rem 0 0;
}
.back-link {
color: inherit;
}
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 44px;
padding: 0.7rem 1rem;
border: 2px solid #000;
background: none;
text-decoration: none;
color: #000;
font-family: inherit;
font-size: inherit;
font-weight: bold;
cursor: pointer;
box-sizing: border-box;
}
code {
border: 1px solid #000;
padding: 0.1rem 0.3rem;
}
/* --- Auth & Upload --- */
.btn-logout {
background: none;
border: 1px solid #000;
cursor: pointer;
padding: 0.3rem 0.6rem;
font-size: 0.9rem;
}
.login-box {
max-width: 22rem;
margin-top: 3rem;
}
.login-form,
.upload-form {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.login-form input,
.upload-form input[type="file"] {
padding: 0.5rem;
font-size: 1rem;
border: 1px solid #000;
}
.error {
border: 2px solid #000;
padding: 0.5rem 0.75rem;
margin-bottom: 0.75rem;
font-weight: bold;
}