brewlog/templates/styles.css
Jon Seager 145ddb4765
fix(timeline): centre line behind cards on mobile for full-width layout
- Move timeline line to centre on mobile instead of left gutter
- Remove left padding from cards to maximise horizontal space
- Reposition dots to top-centre of each card border on mobile
- Make card background fully opaque so line doesn't show through
- Desktop alternating layout unchanged
2026-02-03 13:21:55 +00:00

210 lines
4.1 KiB
CSS

:root {
color-scheme: light;
}
body {
font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a {
text-decoration: none;
}
.input-field {
width: 100%;
min-width: 0;
border-radius: 0.5rem;
border: 1px solid rgba(120, 53, 15, 0.3);
background-color: rgba(254, 243, 199, 0.85);
padding: 0.6rem 0.75rem;
color: #4a2f0b;
transition: border-color 150ms ease, box-shadow 150ms ease;
}
.input-field:focus {
outline: none;
border-color: rgba(180, 83, 9, 0.6);
box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.2);
}
.btn-adjust {
display: flex;
height: 2rem;
width: 2rem;
align-items: center;
justify-content: center;
border-radius: 0.375rem;
border: 1px solid rgba(120, 113, 108, 0.3);
background-color: white;
color: rgba(87, 83, 78, 1);
font-weight: 700;
transition: background-color 150ms ease;
}
.btn-adjust:hover {
background-color: rgba(245, 245, 244, 1);
}
/* Timeline layout */
/* Mobile: single column, centred line behind cards */
.timeline-line {
left: 50%;
transform: translateX(-50%);
}
.timeline-item {
padding-left: 0;
}
.timeline-node {
left: 50%;
top: -10px;
transform: translateX(-50%);
z-index: 2;
}
.timeline-heading {
position: sticky;
top: 0;
z-index: 10;
background-color: #fefce8; /* amber-50, matches page background */
padding-top: 1rem;
padding-bottom: 1rem;
border-bottom: 2px solid transparent;
transition: border-color 0.15s ease;
}
.timeline-heading.is-stuck {
border-bottom-color: #b45309; /* amber-700 */
}
.timeline-top-btn {
display: none;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
padding: 0.25rem;
color: #b45309; /* amber-700 */
opacity: 0.7;
transition: opacity 0.15s ease;
}
.timeline-top-btn:hover {
opacity: 1;
}
.timeline-heading.is-stuck .timeline-top-btn {
display: block;
}
/* Responsive tables: convert rows to cards on mobile */
@media (max-width: 767px) {
.responsive-table thead {
display: none;
}
.responsive-table tbody {
display: block;
}
.responsive-table tr {
display: block;
padding: 1rem;
border-bottom: 1px solid rgba(217, 169, 55, 0.35);
}
.responsive-table tr:last-child {
border-bottom: none;
}
.responsive-table td {
display: flex;
justify-content: space-between;
align-items: baseline;
padding: 0.25rem 0;
white-space: normal;
font-size: 0.875rem; /* normalize all values to text-sm */
}
.responsive-table td::before {
content: attr(data-label);
flex-shrink: 0;
min-width: 5.5rem;
font-size: 0.8125rem;
font-weight: 600;
color: #78350f; /* amber-900 */
margin-right: 0.75rem;
}
.responsive-table td[data-label=""]::before {
display: none;
}
.responsive-table td[data-label=""] {
justify-content: flex-end;
padding-top: 0.25rem;
}
.responsive-table td.mobile-hidden {
display: none;
}
.pagination-controls {
display: none;
}
}
/* Desktop: alternating cards with central line */
@media (min-width: 768px) {
.timeline-heading {
text-align: center;
}
.timeline-list {
display: flex;
flex-direction: column;
}
.timeline-item {
width: 50%;
padding-right: 0;
}
/* Reset node to side-of-card positioning on desktop */
.timeline-node {
top: 50%;
transform: translateY(-50%);
}
/* Left side items (odd) - counts only .timeline-item children, skipping month headings */
.timeline-item:nth-child(odd of .timeline-item) {
align-self: flex-start;
padding-right: 2rem;
}
.timeline-item:nth-child(odd of .timeline-item) .timeline-node {
right: -10px;
left: auto;
top: 50%;
transform: translateY(-50%);
}
/* Right side items (even) */
.timeline-item:nth-child(even of .timeline-item) {
align-self: flex-end;
padding-left: 2rem;
}
.timeline-item:nth-child(even of .timeline-item) .timeline-node {
left: -10px;
top: 50%;
transform: translateY(-50%);
}
/* Allow vertical overlap between alternating cards (skip first item) */
.timeline-item + .timeline-item {
margin-top: -4rem;
}
}