Template:Home/Cards - styles/styles.css: Difference between revisions
Template page
More actions
Eloise Zomia (talk | contribs) Undo revision 1392 by Eloise Zomia (talk) Tag: Undo |
Eloise Zomia (talk | contribs) No edit summary Tag: Reverted |
||
| Line 1: | Line 1: | ||
/* ============================================ */ | /* ============================================ */ | ||
/* HOME GRID LAYOUT */ | /* HOME GRID LAYOUT (MAIN CONTENT) */ | ||
/* ============================================ */ | /* ============================================ */ | ||
.home-grid { | .home-grid { | ||
display: grid; | display: grid; | ||
grid-template-columns: repeat(6, 1fr); | grid-template-columns: repeat(6, minmax(0, 1fr)); | ||
gap: 0. | gap: 0.75rem; | ||
margin-top: 2.4rem; | margin-top: 2.4rem; | ||
width: 100%; | width: 100%; | ||
align-items: stretch; | align-items: stretch; | ||
} | |||
.home-card--col2 { | |||
grid-column: span 2; | |||
} | } | ||
/* ============================================ */ | /* ============================================ */ | ||
/* BASE HOME CARD STYLES */ | /* BASE HOME CARD STYLES – ALIGNED WITH .fa-card */ | ||
/* ============================================ */ | /* ============================================ */ | ||
.home-card { | .home-card { | ||
position: relative; | position: relative; | ||
display: flex; | |||
background: #ffffff; | flex-direction: column; | ||
border-radius: | background: #ffffff; | ||
box-shadow: 0 | border: 1px solid #e5e7eb; | ||
border-radius: 12px; | |||
box-shadow: 0 1px 2px rgba(0,0,0,0.03); | |||
padding: 16px 18px 18px; | |||
font-size: 0.875rem; | font-size: 0.875rem; | ||
color: #374151; | |||
min-height: 120px; | min-height: 120px; | ||
transition: box-shadow 0.18s ease, transform 0.18s ease; | |||
. | |||
} | } | ||
.home-card:hover { | .home-card:hover { | ||
transform: translateY(- | transform: translateY(-1px); | ||
box-shadow: 0 | box-shadow: 0 8px 24px rgba(0,0,0,0.12); | ||
} | } | ||
/* Card sub-elements */ | /* Card sub-elements */ | ||
.home-card__label { | .home-card__label { | ||
color: # | color: #6b7280; | ||
font-size: 0. | font-size: 0.78rem; | ||
letter-spacing: 0. | letter-spacing: 0.08em; | ||
text-transform: uppercase; | text-transform: uppercase; | ||
font-weight: | font-weight: 600; | ||
margin-bottom: 0. | margin-bottom: 0.4rem; | ||
} | } | ||
.home-card__header { | .home-card__header { | ||
margin: 0 0 | margin: 0.1rem 0 0.6rem 0; | ||
font-size: 1. | font-size: 1.08rem; | ||
color: # | color: #1f2937; | ||
font-weight: 600; | font-weight: 600; | ||
} | } | ||
| Line 61: | Line 64: | ||
.home-card__header a:hover { | .home-card__header a:hover { | ||
color: # | color: #2d5016; | ||
} | } | ||
.home-card__body { | .home-card__body { | ||
color: # | color: #4b5563; | ||
line-height: 1. | line-height: 1.5; | ||
margin-bottom: | margin-bottom: 0.7rem; | ||
} | } | ||
.home-card__links { | .home-card__links { | ||
font-size: 0. | font-size: 0.8rem; | ||
color: # | color: #6b7280; | ||
border-top: 1px solid # | border-top: 1px solid #e5e7eb; | ||
padding-top: 0. | padding-top: 0.6rem; | ||
margin-top: | margin-top: auto; | ||
} | } | ||
| Line 89: | Line 92: | ||
/* ============================================ */ | /* ============================================ */ | ||
/* IMAGE HEADER | /* IMAGE HEADER VARIANT – SHARES FA-CARD FEEL */ | ||
/* ============================================ */ | /* ============================================ */ | ||
| Line 97: | Line 100: | ||
display: flex; | display: flex; | ||
flex-direction: column; | flex-direction: column; | ||
background: #ffffff; | |||
border-radius: 12px; | |||
border: 1px solid #e5e7eb; | |||
box-shadow: 0 1px 2px rgba(0,0,0,0.03); | |||
height: 100%; | height: 100%; | ||
} | } | ||
/* Image | .home-card--image-header:hover { | ||
box-shadow: 0 8px 24px rgba(0,0,0,0.12); | |||
} | |||
/* Image wrapper – 16:9, like .fa-media */ | |||
.home-card__image-link { | .home-card__image-link { | ||
position: relative; | |||
display: block; | display: block; | ||
overflow: hidden; | overflow: hidden; | ||
background: #f3f4f6; | background: #f3f4f6; | ||
line-height: 0; | line-height: 0; | ||
border-bottom: 1px solid #eef2f7; | |||
border-bottom: 1px solid # | |||
} | } | ||
.home-card__image-link::before { | .home-card__image-link::before { | ||
content: ""; | content: ""; | ||
display: block; | display: block; | ||
width: 100%; | width: 100%; | ||
padding-top: 56.25%; /* 16:9 | padding-top: 56.25%; /* 16:9 */ | ||
} | } | ||
/* Image | /* Image container */ | ||
.home-card__image-header-bg { | .home-card__image-header-bg { | ||
position: absolute; | position: absolute; | ||
inset: 0; | inset: 0; | ||
} | } | ||
.home-card__image-header-bg, | .home-card__image-header-bg, | ||
.home-card__image-header-bg a, | .home-card__image-header-bg a, | ||
.home-card__image- | .home-card__image-link .image, | ||
.home-card__image- | .home-card__image-link .mw-file-description { | ||
display: block; | display: block; | ||
width: 100%; | width: 100%; | ||
| Line 138: | Line 145: | ||
} | } | ||
/* | /* Actual <img> */ | ||
.home-card__image- | |||
.home-card__image- | .home-card__image-link img, | ||
.home-card__image-link .mw-file-element { | |||
display: block; | display: block; | ||
width: 100% !important; | width: 100% !important; | ||
| Line 147: | Line 155: | ||
object-fit: cover; | object-fit: cover; | ||
object-position: center center; | object-position: center center; | ||
} | } | ||
/* | /* Overlay text */ | ||
.home-card__image-overlay { | .home-card__image-overlay { | ||
position: absolute; | position: absolute; | ||
inset: 0; | |||
display: flex; | display: flex; | ||
align-items: center; | align-items: center; | ||
padding: 0 20px; | padding: 0 20px; | ||
color: # | color: #ffffff; | ||
font-weight: 700; | font-weight: 700; | ||
font-size: 1. | font-size: 1.25rem; | ||
text-shadow: 2px 2px 6px rgba(0,0,0,0.9); | text-shadow: 2px 2px 6px rgba(0,0,0,0.9); | ||
background: linear-gradient(to right, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.4) 50%, transparent 100%); | background: linear-gradient( | ||
to right, | |||
rgba(0,0,0,0.75) 0%, | |||
rgba(0,0,0,0.4) 50%, | |||
transparent 100% | |||
); | |||
z-index: 1; | z-index: 1; | ||
} | } | ||
/* Content section | /* Content section under image */ | ||
.home-card__content { | .home-card__content { | ||
padding: | padding: 14px 16px 16px 16px; | ||
display: flex; | display: flex; | ||
flex-direction: column; | flex-direction: column; | ||
gap: 8px; | |||
flex-grow: 1; | |||
} | } | ||
/* | /* Use same label/header/body/links styles inside content block */ | ||
.home-card__content .home-card__label { | .home-card__content .home-card__label { | ||
margin-bottom: 0.3rem; | |||
margin-bottom: 0. | |||
} | } | ||
.home-card__content .home-card__body { | |||
.home-card__content .home- | margin-bottom: 0.7rem; | ||
margin: 0 | |||
} | } | ||
/* | /* Limit media height for giant screens */ | ||
.home- | |||
.home-card__image-link { | |||
max-height: 300px; | |||
} | } | ||
/* | /* ============================================ */ | ||
/* RESPONSIVE BREAKPOINTS */ | |||
/* ============================================ */ | |||
@media (max-width: 1024px) { | |||
.home-grid { | |||
grid-template-columns: repeat(4, minmax(0, 1fr)); | |||
} | |||
} | } | ||
.home- | @media (max-width: 768px) { | ||
.home-grid { | |||
grid-template-columns: repeat(2, minmax(0, 1fr)); | |||
gap: 0.5rem; | |||
} | |||
.home-card--col2 { | |||
grid-column: span 2; | |||
} | |||
.home-card__image-link { | |||
max-height: 220px; | |||
} | |||
.home-card__image-overlay { | |||
font-size: 1.1rem; | |||
padding: 0 15px; | |||
} | |||
.home-card, | |||
.home-card__content { | |||
padding: 14px 14px 16px; | |||
} | |||
} | } | ||
@media (max-width: 600px) { | |||
.home- | .home-card__image-link { | ||
max-height: 190px; | |||
} | |||
.home-card__content { | |||
padding: 12px 14px 14px 14px; | |||
gap: 6px; | |||
} | |||
} | } | ||
@media (max-width: 480px) { | |||
.home- | .home-grid { | ||
grid-template-columns: 1fr; | |||
gap: 0.5rem; | |||
} | |||
.home-card--col2 { | |||
} | grid-column: span 1; | ||
} | |||
.home-card { | |||
padding: 14px 14px 16px; | |||
} | |||
.home- | .home-card__image-link { | ||
max-height: 170px; | |||
} | |||
} | |||
.home- | .home-card__image-overlay { | ||
font-size: 1rem; | |||
padding: 0 12px; | |||
} | |||
} | } | ||
/* ============================================ */ | /* ============================================ */ | ||
Revision as of 08:06, 19 November 2025
/* ============================================ */
/* HOME GRID LAYOUT (MAIN CONTENT) */
/* ============================================ */
.home-grid {
display: grid;
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: 0.75rem;
margin-top: 2.4rem;
width: 100%;
align-items: stretch;
}
.home-card--col2 {
grid-column: span 2;
}
/* ============================================ */
/* BASE HOME CARD STYLES – ALIGNED WITH .fa-card */
/* ============================================ */
.home-card {
position: relative;
display: flex;
flex-direction: column;
background: #ffffff;
border: 1px solid #e5e7eb;
border-radius: 12px;
box-shadow: 0 1px 2px rgba(0,0,0,0.03);
padding: 16px 18px 18px;
font-size: 0.875rem;
color: #374151;
min-height: 120px;
transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.home-card:hover {
transform: translateY(-1px);
box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
/* Card sub-elements */
.home-card__label {
color: #6b7280;
font-size: 0.78rem;
letter-spacing: 0.08em;
text-transform: uppercase;
font-weight: 600;
margin-bottom: 0.4rem;
}
.home-card__header {
margin: 0.1rem 0 0.6rem 0;
font-size: 1.08rem;
color: #1f2937;
font-weight: 600;
}
.home-card__header a {
color: inherit;
text-decoration: none;
}
.home-card__header a:hover {
color: #2d5016;
}
.home-card__body {
color: #4b5563;
line-height: 1.5;
margin-bottom: 0.7rem;
}
.home-card__links {
font-size: 0.8rem;
color: #6b7280;
border-top: 1px solid #e5e7eb;
padding-top: 0.6rem;
margin-top: auto;
}
.home-card__links a {
color: #2d5016;
text-decoration: none;
font-weight: 500;
}
.home-card__links a:hover {
text-decoration: underline;
}
/* ============================================ */
/* IMAGE HEADER VARIANT – SHARES FA-CARD FEEL */
/* ============================================ */
.home-card--image-header {
padding: 0;
overflow: hidden;
display: flex;
flex-direction: column;
background: #ffffff;
border-radius: 12px;
border: 1px solid #e5e7eb;
box-shadow: 0 1px 2px rgba(0,0,0,0.03);
height: 100%;
}
.home-card--image-header:hover {
box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
/* Image wrapper – 16:9, like .fa-media */
.home-card__image-link {
position: relative;
display: block;
overflow: hidden;
background: #f3f4f6;
line-height: 0;
border-bottom: 1px solid #eef2f7;
}
.home-card__image-link::before {
content: "";
display: block;
width: 100%;
padding-top: 56.25%; /* 16:9 */
}
/* Image container */
.home-card__image-header-bg {
position: absolute;
inset: 0;
}
.home-card__image-header-bg,
.home-card__image-header-bg a,
.home-card__image-link .image,
.home-card__image-link .mw-file-description {
display: block;
width: 100%;
height: 100%;
}
/* Actual <img> */
.home-card__image-link img,
.home-card__image-link .mw-file-element {
display: block;
width: 100% !important;
height: 100% !important;
max-width: none !important;
object-fit: cover;
object-position: center center;
}
/* Overlay text */
.home-card__image-overlay {
position: absolute;
inset: 0;
display: flex;
align-items: center;
padding: 0 20px;
color: #ffffff;
font-weight: 700;
font-size: 1.25rem;
text-shadow: 2px 2px 6px rgba(0,0,0,0.9);
background: linear-gradient(
to right,
rgba(0,0,0,0.75) 0%,
rgba(0,0,0,0.4) 50%,
transparent 100%
);
z-index: 1;
}
/* Content section under image */
.home-card__content {
padding: 14px 16px 16px 16px;
display: flex;
flex-direction: column;
gap: 8px;
flex-grow: 1;
}
/* Use same label/header/body/links styles inside content block */
.home-card__content .home-card__label {
margin-bottom: 0.3rem;
}
.home-card__content .home-card__body {
margin-bottom: 0.7rem;
}
/* Limit media height for giant screens */
.home-card__image-link {
max-height: 300px;
}
/* ============================================ */
/* RESPONSIVE BREAKPOINTS */
/* ============================================ */
@media (max-width: 1024px) {
.home-grid {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
}
@media (max-width: 768px) {
.home-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0.5rem;
}
.home-card--col2 {
grid-column: span 2;
}
.home-card__image-link {
max-height: 220px;
}
.home-card__image-overlay {
font-size: 1.1rem;
padding: 0 15px;
}
.home-card,
.home-card__content {
padding: 14px 14px 16px;
}
}
@media (max-width: 600px) {
.home-card__image-link {
max-height: 190px;
}
.home-card__content {
padding: 12px 14px 14px 14px;
gap: 6px;
}
}
@media (max-width: 480px) {
.home-grid {
grid-template-columns: 1fr;
gap: 0.5rem;
}
.home-card--col2 {
grid-column: span 1;
}
.home-card {
padding: 14px 14px 16px;
}
.home-card__image-link {
max-height: 170px;
}
.home-card__image-overlay {
font-size: 1rem;
padding: 0 12px;
}
}
/* ============================================ */
/* MOBILE RESPONSIVENESS */
/* ============================================ */
@media (max-width: 1024px) {
.home-grid {
grid-template-columns: repeat(4, 1fr);
}
}
@media (max-width: 768px) {
.home-grid {
grid-template-columns: repeat(2, 1fr);
gap: 0.5rem;
}
.home-card--col2 {
grid-column: span 2;
}
.home-card__image-link {
max-height: 200px;
}
.home-card__image-overlay {
font-size: 1.1rem;
padding: 0 15px;
}
.home-card__content {
padding: 15px;
}
}
@media (max-width: 600px) {
.home-card__image-link {
max-height: 180px;
}
}
@media (max-width: 480px) {
.home-grid {
grid-template-columns: 1fr;
gap: 0.5rem;
}
.home-card--col2 {
grid-column: span 1;
}
.home-card {
padding: 15px;
}
.home-card__image-link {
max-height: 160px;
}
.home-card__image-overlay {
font-size: 1rem;
padding: 0 12px;
}
.home-card__content {
padding: 12px;
}
}