Template:Main Page redesign/editorial feature/styles.css
From A Wiki of Ice and Fire
/*
* AWOIAF Main Page editorial feature treatment
* Project stylesheet for the live Main Page redesign draft.
*/
.mp-redesign__hero {
background: transparent;
border-bottom: 0;
}
/* Safe default: a clean, matte-free stack. Browsers without container-query
* support keep this readable layout rather than risking overlap. */
.mp-redesign__hero-art {
display: flex;
flex-direction: column;
margin: 0;
text-align: center;
}
.mp-redesign__hero-media {
align-items: center;
background: transparent;
display: flex;
justify-content: center;
margin: 0;
min-height: 0;
overflow: hidden;
position: static;
width: 100%;
}
.mp-redesign__hero-media > a,
.mp-redesign__hero-media > span[typeof~='mw:File'],
.mp-redesign__hero-media > span[typeof~='mw:File'] > a {
display: block;
max-width: 100%;
}
.mp-redesign__hero-art img {
display: block;
height: auto;
margin: 0 auto;
max-height: 420px;
max-width: 100%;
object-fit: contain;
width: auto;
}
.mp-redesign__hero-caption {
background: transparent;
border-bottom: 1px solid var( --mp-rule-soft );
color: var( --mp-ink );
padding: .65rem .75rem .75rem;
position: static;
text-align: center;
transform: none;
width: 100%;
}
.mp-redesign__hero-caption::before {
content: none;
}
.mp-redesign__hero-title {
font-size: clamp( 1.45rem, 1.2rem + .8vw, 1.8rem );
line-height: 1.15;
margin: 0;
}
.mp-redesign__hero-title a {
color: var( --mp-link );
}
.mp-redesign__hero-credit {
border-top: 1px solid var( --mp-rule-soft );
color: var( --mp-muted );
font-size: .72rem;
line-height: 1.35;
margin-top: .4rem;
padding-top: .35rem;
}
/* Marginal-colophon mode. The artwork plane remains centered independently
* of the colophon, so title length cannot push the image off axis. */
/* TemplateStyles does not admit container queries on the live wiki. Live
* breakpoint measurement puts the lowest clean marginal layout at 1280px;
* narrower layouts retain the safe stack. */
@media ( min-width: 1280px ) {
.mp-redesign__hero-art {
display: block;
min-height: 420px;
position: relative;
text-align: initial;
}
.mp-redesign__hero-media {
height: 420px;
left: 50%;
position: absolute;
top: 0;
transform: translateX( -50% );
width: 578px;
}
.mp-redesign__hero-caption {
border-bottom: 0;
left: 0;
max-width: 250px;
padding: .75rem .25rem;
position: absolute;
text-align: left;
top: 50%;
transform: translateY( -50% );
width: clamp( 174px, calc( ( 100% - 578px ) / 2 - 24px ), 250px );
}
.mp-redesign__hero-caption::before {
color: var( --mp-link );
content: 'Featured illustration';
display: block;
font-size: .72rem;
font-weight: 700;
letter-spacing: .14em;
margin-bottom: 1.5rem;
text-transform: uppercase;
}
.mp-redesign__hero-caption::after {
background: var( --mp-accent );
content: '';
display: block;
height: 2px;
left: .25rem;
position: absolute;
top: 2.8rem;
width: 44px;
}
.mp-redesign__hero-title {
font-size: clamp( 1.9rem, 2.5vw, 2.55rem );
letter-spacing: -.035em;
line-height: 1.02;
}
.mp-redesign__hero-title a {
color: var( --mp-ink );
}
.mp-redesign__hero-credit {
font-size: .76rem;
line-height: 1.55;
margin-top: 1.5rem;
padding-top: .85rem;
}
}
/* Restore a compact editorial masthead: search sits above the artwork, while
* the desktop ad reservation keeps its full size with less surrounding air. */
.mp-redesign__find {
margin-bottom: -1rem;
margin-inline: auto;
max-width: 54rem;
width: 100%;
}
@media screen and ( min-width: 1360px ) {
.mp-redesign__banner {
margin-block: -.75rem;
}
}
@media screen and ( max-width: 800px ) {
.mp-redesign__masthead {
margin-bottom: -.75rem;
}
.mp-redesign__site-subtitle {
display: block;
font-size: .78rem;
line-height: 1.35;
margin: .2rem auto 0;
max-width: 27rem;
}
.mp-redesign__find {
margin-bottom: -.75rem;
}
.mp-redesign__search .mw-ui-input,
.mp-redesign__search .mw-searchInput,
.mp-redesign__search input[name='search'],
.mp-redesign__search input[type='submit'] {
min-height: 2.5rem;
}
}
/* Use a quiet, theme-aware wash to separate selected editorial sections
* without returning to bordered cards or the former tan matte. */
@media screen and ( min-width: 801px ) {
.mp-redesign__hero,
.mp-redesign__regions {
isolation: isolate;
position: relative;
}
.mp-redesign__hero::before,
.mp-redesign__regions::before {
background: var( --mp-ink );
content: '';
bottom: 0;
left: 0;
opacity: .03;
position: absolute;
right: 0;
top: 0;
z-index: -1;
}
.mp-redesign__regions {
margin-inline: -1.25rem;
padding: 1.15rem 1.25rem 1.35rem;
}
.mp-redesign__books > .mp-redesign__section-head,
.mp-redesign__regions > .mp-redesign__section-head {
border-bottom: 1px solid var( --mp-rule-soft );
margin-bottom: 1.15rem;
padding-bottom: .8rem;
}
.mp-redesign__reading {
padding-top: .35rem;
}
.mp-redesign__hero-media {
overflow: visible;
}
.mp-redesign__hero-art img {
box-shadow: 0 2px 5px rgba( 0, 0, 0, .16 ), 0 14px 28px rgba( 0, 0, 0, .22 );
position: relative;
z-index: 1;
}
}
/* On wide screens, let the centered artwork and marginal colophon determine
* the hero height, with a compact 24px wash above and below. */
@media screen and ( min-width: 1280px ) {
.mp-redesign__hero-art {
align-items: center;
column-gap: clamp( 40px, 4vw, 72px );
display: grid;
grid-template-columns: minmax( 210px, 250px ) minmax( 0, 1fr );
min-height: 0;
padding-block: 24px;
}
.mp-redesign__hero-media {
grid-column: 2;
grid-row: 1;
height: auto;
justify-content: flex-end;
left: auto;
position: static;
top: auto;
transform: none;
width: 100%;
}
.mp-redesign__hero-caption {
grid-column: 1;
grid-row: 1;
left: auto;
max-width: 250px;
position: static;
top: auto;
transform: none;
width: 100%;
}
.mp-redesign__hero-art img {
max-height: 480px;
}
}
/* Give the colophon more editorial presence on wide desktop screens without
* reducing the illustration or crowding the established 1280px layout. */
@media screen and ( min-width: 1440px ) {
.mp-redesign__hero-art {
column-gap: 40px;
grid-template-columns: minmax( 290px, 330px ) minmax( 0, 1fr );
}
.mp-redesign__hero-caption {
max-width: 330px;
}
}
@media ( prefers-reduced-motion: reduce ) {
.mp-redesign__hero-art img {
transition-duration: 0s !important;
transform: none !important;
}
}
html[data-tweekiprototype-motion='off'] .mp-redesign__hero-art img {
transition-duration: 0s !important;
transform: none !important;
}