You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
317 lines
5.4 KiB
317 lines
5.4 KiB
/** |
|
* Layout styles |
|
* This file contains the layout styles for the application |
|
* Layout has 5 main parts: |
|
* - Header (header) |
|
* - Left menu (nav) |
|
* - Main content (main) |
|
* - Right sidebar (aside) |
|
* - Footer (footer) |
|
**/ |
|
|
|
|
|
|
|
|
|
/* Layout Container */ |
|
.layout { |
|
max-width: 100%; |
|
width: 1200px; |
|
margin: 0 auto; |
|
display: flex; |
|
flex-grow: 1; |
|
} |
|
|
|
nav { |
|
width: 21vw; |
|
min-width: 150px; |
|
max-width: 280px; |
|
flex-shrink: 0; |
|
padding: 1em; |
|
overflow-y: auto; /* Ensure the menu is scrollable if content is too long */ |
|
} |
|
|
|
nav ul { |
|
list-style-type: none; |
|
padding: 0; |
|
} |
|
|
|
nav li { |
|
margin: 0.5em 0; |
|
} |
|
|
|
nav a { |
|
color: var(--color-primary); |
|
text-decoration: none; |
|
} |
|
|
|
nav a:hover { |
|
color: var(--color-text-mid); |
|
text-decoration: none; |
|
} |
|
|
|
header { |
|
position: fixed; |
|
width: 100vw; |
|
top: 0; |
|
left: 0; |
|
box-sizing: border-box; |
|
} |
|
|
|
/* Desktop: breathing room under the browser chrome. Mobile gets inset via |
|
.header__logo padding in the max-width block below. */ |
|
@media (min-width: 1025px) { |
|
header { |
|
padding-top: max(0.65rem, env(safe-area-inset-top, 0px)); |
|
} |
|
} |
|
|
|
/* Hamburger button */ |
|
.hamburger { |
|
cursor: pointer; |
|
display: none; /* Hidden on desktop */ |
|
font-size: 26px; |
|
} |
|
|
|
.header__logo { |
|
display: flex; |
|
width: 100%; |
|
justify-content: center; |
|
} |
|
|
|
#progress-bar { |
|
position: absolute; |
|
left: 0; |
|
bottom: 0; |
|
height: 4px; |
|
width: 0; |
|
transform-origin: left center; |
|
background: var(--color-primary); |
|
transition: width 0.4s ease; |
|
z-index: 1000; |
|
} |
|
|
|
/* In-flight navigation: loops until the next page fires `load`, then the bar completes. */ |
|
#progress-bar.pb-indeterminate { |
|
transition: none; |
|
animation: pb-indeterminate 0.9s ease-in-out infinite; |
|
} |
|
|
|
@keyframes pb-indeterminate { |
|
0% { |
|
width: 20%; |
|
} |
|
|
|
50% { |
|
width: 55%; |
|
} |
|
|
|
100% { |
|
width: 28%; |
|
} |
|
} |
|
|
|
/* Mobile Styles */ |
|
@media (max-width: 1024px) { |
|
.header__logo { |
|
box-sizing: border-box; |
|
justify-content: space-between; |
|
align-items: center; |
|
gap: 0.5rem; |
|
padding: 0.4rem max(0.65rem, env(safe-area-inset-left)) 0.4rem max(0.65rem, env(safe-area-inset-right)); |
|
} |
|
|
|
.header__brand { |
|
flex: 1; |
|
min-width: 0; |
|
display: block; |
|
text-align: left; |
|
} |
|
|
|
.header__categories { |
|
display: none; |
|
flex-direction: column; |
|
padding-top: 10px; |
|
} |
|
|
|
.header__categories.active { |
|
display: flex; |
|
} |
|
|
|
.hamburger { |
|
display: block; |
|
align-self: center; |
|
} |
|
|
|
.header__categories ul { |
|
flex-direction: column; |
|
gap: 10px; |
|
} |
|
} |
|
|
|
/* Main content */ |
|
main { |
|
margin-top: 140px; |
|
flex-grow: 1; |
|
min-width: 0; /* flex item: allow shrinking below wide images / intrinsic min-content */ |
|
padding: 1em; |
|
word-break: break-word; |
|
} |
|
|
|
.user-menu { |
|
position: fixed; |
|
top: 150px; |
|
width: calc(21vw - 10px); |
|
min-width: 150px; |
|
max-width: 270px; |
|
} |
|
|
|
@media (min-width: 1025px) { |
|
/* Match extra header padding-top so content and menu clear the fixed bar */ |
|
main { |
|
margin-top: 152px; |
|
} |
|
|
|
.user-menu { |
|
top: 162px; |
|
} |
|
} |
|
|
|
.user-nav { |
|
padding: 10px; |
|
margin: 10px 0; |
|
} |
|
|
|
/* Right sidebar */ |
|
aside { |
|
width: 190px; |
|
min-width: 150px; |
|
flex-shrink: 0; |
|
flex-grow: 0; |
|
padding: 1em; |
|
} |
|
|
|
table { |
|
width: 100%; |
|
margin: 20px 0; |
|
} |
|
|
|
pre, code { |
|
text-wrap: wrap; |
|
padding: 3px; |
|
background-color: var(--color-bg-light); |
|
font-size: 1rem; |
|
} |
|
|
|
hr { |
|
margin: 20px 0; |
|
} |
|
|
|
dt { |
|
margin-top: 10px; |
|
} |
|
|
|
/* Responsive adjustments */ |
|
@media (max-width: 1024px) { |
|
nav, aside { |
|
display: none; /* Hide the sidebars on small screens */ |
|
} |
|
main { |
|
margin-top: 90px; |
|
width: 100%; |
|
} |
|
} |
|
|
|
/* Footer */ |
|
footer { |
|
background-color: var(--color-footer-bg); |
|
color: var(--color-footer-text); |
|
padding: 1.25rem 1rem 1.5rem; |
|
position: relative; |
|
width: 100%; |
|
border-top: 1px solid var(--color-border); |
|
} |
|
|
|
.site-footer { |
|
max-width: 1200px; |
|
margin: 0 auto; |
|
display: flex; |
|
flex-direction: column; |
|
align-items: stretch; |
|
gap: 1.75rem; |
|
text-align: left; |
|
} |
|
|
|
.site-footer__syndication-title { |
|
font-size: 1.1rem; |
|
font-weight: 600; |
|
margin: 0 0 0.35rem; |
|
} |
|
|
|
.site-footer__syndication-hint { |
|
margin: 0 0 0.75rem; |
|
font-size: 0.9rem; |
|
color: var(--color-text); |
|
opacity: 0.9; |
|
max-width: 40rem; |
|
} |
|
|
|
.site-footer__syndication-actions { |
|
display: flex; |
|
flex-wrap: wrap; |
|
gap: 0.5rem 0.6rem; |
|
} |
|
|
|
.site-footer__main { |
|
text-align: center; |
|
} |
|
|
|
.site-footer__legal { |
|
margin: 1rem 0 0; |
|
font-size: 0.95rem; |
|
} |
|
|
|
@media (min-width: 900px) { |
|
.site-footer { |
|
flex-direction: row; |
|
align-items: flex-start; |
|
justify-content: space-between; |
|
gap: 2rem 3rem; |
|
} |
|
|
|
.site-footer__syndication { |
|
flex: 0 1 50%; |
|
} |
|
|
|
.site-footer__main { |
|
flex: 0 1 auto; |
|
min-width: min(20rem, 100%); |
|
text-align: right; |
|
} |
|
|
|
.site-footer__legal { |
|
text-align: right; |
|
} |
|
} |
|
|
|
footer .footer-links { |
|
margin: 0 0 0.5rem; |
|
} |
|
|
|
.footer-links a { |
|
color: var(--color-footer-link); |
|
text-decoration: underline; |
|
text-underline-offset: 2px; |
|
} |
|
|
|
.footer-links a:hover { |
|
color: var(--color-text); |
|
} |
|
|
|
.footer-links a:focus-visible { |
|
outline: 2px solid var(--color-focus-ring); |
|
outline-offset: 3px; |
|
} |
|
|
|
.search input { |
|
flex-grow: 1; |
|
}
|
|
|