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.
 
 
 
 
 
 

417 lines
7.3 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__nav {
max-width: 44rem;
}
.site-footer__syndication-list {
display: flex;
flex-wrap: wrap;
align-items: baseline;
row-gap: 0.4rem;
list-style: none;
margin: 0;
padding: 0;
font-size: 0.95rem;
line-height: 1.5;
}
.site-footer__syndication-list > li {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.4rem 0.45rem;
}
.site-footer__syndication-list > li + li::before {
content: "·";
color: var(--color-text-mid, #666);
font-weight: 300;
align-self: center;
padding: 0 0.1rem 0 0;
}
.site-footer__link {
color: var(--color-footer-link);
text-decoration: underline;
text-underline-offset: 2px;
font-weight: 400;
}
.site-footer__link:hover {
color: var(--color-text);
}
.site-footer__link:focus-visible {
outline: 2px solid var(--color-focus-ring);
outline-offset: 2px;
}
/* RSS + category feed links in one cell */
.site-footer__syndication-list__feeds {
display: inline-flex;
flex-wrap: wrap;
align-items: center;
gap: 0.4rem 0.45rem;
max-width: 100%;
}
/* Dots between feed links (skip first <a> = "All articles"). */
.site-footer__syndication-list__feeds a:not(:first-of-type)::before {
content: "·";
color: var(--color-text-mid, #666);
font-weight: 300;
margin-right: 0.45rem;
text-decoration: none;
display: inline;
}
.site-footer__feeds-icon {
display: flex;
flex-shrink: 0;
line-height: 0;
color: var(--color-text-mid, #666);
opacity: 0.72;
}
.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;
}
.featured-authors {
max-width: 48rem;
margin: 0 auto;
padding: 0 0.5rem 2rem;
}
.featured-authors__intro {
margin-bottom: 2rem;
}
.featured-authors__intro h1 {
margin-top: 0;
}
.featured-authors__card {
margin-bottom: 2.5rem;
padding-bottom: 1.5rem;
border-bottom: 1px solid var(--color-border);
}
.featured-authors__card:last-of-type {
border-bottom: none;
}
.author-profile--featured .author-profile__title {
font-size: 1.5rem;
}
.featured-authors__more {
margin: 0.75rem 0 0;
}
.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;
}