Template:Home/Cards - styles/styles.css: Difference between revisions
Template page
More actions
Eloise Zomia (talk | contribs) No edit summary Tag: Reverted |
Eloise Zomia (talk | contribs) No edit summary Tag: Reverted |
||
| Line 1: | Line 1: | ||
/* ============================================ */ | /* ============================================ */ | ||
/* HOME GRID LAYOUT | |||
/* HOME GRID LAYOUT */ | |||
/* ============================================ */ | /* ============================================ */ | ||
.home-grid { | .home-grid { | ||
display: grid; | display: grid; | ||
grid-template-columns: repeat(6 | |||
gap: 0. | grid-template-columns: repeat(6, 1fr); | ||
gap: 0.625rem; | |||
margin-top: 2.4rem; | margin-top: 2.4rem; | ||
width: 100%; | width: 100%; | ||
align-items: stretch; | align-items: stretch; | ||
} | } | ||
/* ============================================ */ | /* ============================================ */ | ||
/* BASE HOME CARD STYLES | |||
/* BASE HOME CARD STYLES */ | |||
/* ============================================ */ | /* ============================================ */ | ||
.home-card { | .home-card { | ||
position: relative; | position: relative; | ||
padding: 20px; | |||
background: #ffffff; | |||
background: #ffffff; /* Changed to pure white */ | |||
border-radius: | |||
box-shadow: 0 | border-radius: 8px; | ||
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.04), 0 3px 6px rgba(0, 0, 0, 0.0575); | |||
font-size: 0.875rem; | font-size: 0.875rem; | ||
transition: transform 0.2s ease, box-shadow 0.2s ease; | |||
border: 1px solid #dee2e6; | |||
min-height: 120px; | min-height: 120px; | ||
height: 100%; | |||
} | |||
.home-card--col2 { | |||
grid-column: span 2; | |||
} | } | ||
.home-card:hover { | .home-card:hover { | ||
transform: translateY(- | |||
box-shadow: 0 | transform: translateY(-2px); | ||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08), 0 6px 12px rgba(0, 0, 0, 0.115); | |||
} | } | ||
/* | |||
/* Card sub-elements */ | |||
.home-card__label { | .home-card__label { | ||
color: # | |||
font-size: 0. | color: #6c757d; | ||
letter-spacing: 0. | |||
font-size: 0.8125rem; | |||
letter-spacing: 0.75px; | |||
text-transform: uppercase; | text-transform: uppercase; | ||
font-weight: | |||
margin-bottom: 0. | font-weight: 500; | ||
margin-bottom: 0.5rem; | |||
} | } | ||
.home-card__header { | .home-card__header { | ||
margin: 0 | |||
font-size: 1. | margin: 0 0 1rem 0; | ||
color: # | |||
font-size: 1.1rem; | |||
color: #2d5016; | |||
font-weight: 600; | font-weight: 600; | ||
} | } | ||
.home-card__header a { | .home-card__header a { | ||
color: inherit; | color: inherit; | ||
text-decoration: none; | text-decoration: none; | ||
} | } | ||
.home-card__header a:hover { | .home-card__header a:hover { | ||
color: # | |||
color: #3d6b1f; | |||
} | } | ||
.home-card__body { | .home-card__body { | ||
color: # | |||
line-height: 1. | color: #495057; | ||
margin-bottom: | |||
line-height: 1.6; | |||
margin-bottom: 1rem; | |||
} | } | ||
.home-card__links { | .home-card__links { | ||
font-size: 0. | |||
color: # | font-size: 0.8125rem; | ||
border-top: 1px solid # | |||
padding-top: 0. | color: #6c757d; | ||
margin-top: | |||
border-top: 1px solid #dee2e6; | |||
padding-top: 0.75rem; | |||
margin-top: 0.75rem; | |||
} | } | ||
.home-card__links a { | .home-card__links a { | ||
color: #2d5016; | color: #2d5016; | ||
text-decoration: none; | text-decoration: none; | ||
font-weight: 500; | font-weight: 500; | ||
} | } | ||
.home-card__links a:hover { | .home-card__links a:hover { | ||
text-decoration: underline; | text-decoration: underline; | ||
} | } | ||
/* ============================================ */ | /* ============================================ */ | ||
/* IMAGE HEADER | |||
/* IMAGE HEADER CARDS - Based on working region cards */ | |||
/* ============================================ */ | /* ============================================ */ | ||
.home-card--image-header { | .home-card--image-header { | ||
padding: 0; | padding: 0; | ||
overflow: hidden; | overflow: hidden; | ||
display: flex; | display: flex; | ||
flex-direction: column; | flex-direction: column; | ||
height: 100%; | |||
background: #ffffff; /* Ensure white background */ | |||
} | } | ||
/* Image wrapper | |||
/* Image header link wrapper - 16:9 aspect ratio */ | |||
.home-card__image-link { | .home-card__image-link { | ||
display: block; | |||
position: relative; | position: relative; | ||
width: 100%; | |||
overflow: hidden; | overflow: hidden; | ||
background: #f3f4f6; | background: #f3f4f6; | ||
line-height: 0; | line-height: 0; | ||
border-bottom: 1px solid # | |||
flex-shrink: 0; | |||
border-bottom: 1px solid #e5e7eb; /* Subtle separator */ | |||
} | } | ||
/* Create 16:9 ratio */ | |||
.home-card__image-link::before { | .home-card__image-link::before { | ||
content: ""; | content: ""; | ||
display: block; | display: block; | ||
width: 100%; | width: 100%; | ||
padding-top: | |||
padding-top: 56.25%; /* 16:9 ratio */ | |||
} | } | ||
/* Image container */ | |||
/* Image background container */ | |||
.home-card__image-header-bg { | .home-card__image-header-bg { | ||
position: absolute; | position: absolute; | ||
inset: 0; | inset: 0; | ||
line-height: 0; | |||
} | } | ||
/* Handle MediaWiki wrappers */ | |||
.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- | .home-card__image-header-bg .image, | ||
.home-card__image-header-bg .mw-file-description { | |||
display: block; | display: block; | ||
width: 100%; | width: 100%; | ||
height: 100%; | height: 100%; | ||
} | } | ||
.home-card__image- | |||
.home-card__image- | |||
/* Handle actual img element */ | |||
.home-card__image-header-bg img, | |||
.home-card__image-header-bg .mw-file-element { | |||
display: block; | display: block; | ||
width: 100% !important; | width: 100% !important; | ||
height: 100% !important; | height: 100% !important; | ||
max-width: none !important; | max-width: none !important; | ||
object-fit: cover; | object-fit: cover; | ||
object-position: center center; | object-position: center center; | ||
transition: transform 0.3s ease; | |||
margin: 0; | |||
padding: 0; | |||
} | } | ||
/* | |||
/* Hover effect on image */ | |||
.home-card__image-link:hover .home-card__image-header-bg img, | |||
.home-card__image-link:hover .home-card__image-header-bg .mw-file-element { | |||
transform: scale(1.05); | |||
} | |||
/* Text overlay on image */ | |||
.home-card__image-overlay { | .home-card__image-overlay { | ||
position: absolute; | position: absolute; | ||
top: 0; | |||
left: 0; | |||
right: 0; | |||
bottom: 0; | |||
display: flex; | display: flex; | ||
align-items: | |||
align-items: center; | |||
padding: 0 | |||
color: # | padding: 0 20px; | ||
font-weight: | |||
font-size: | color: #fff; | ||
text-shadow: | |||
background: linear-gradient( | font-weight: 700; | ||
font-size: 1.3rem; | |||
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; | z-index: 1; | ||
} | } | ||
/* Content section | |||
/* Content section below image - FIXED STYLING */ | |||
.home-card__content { | .home-card__content { | ||
padding: | |||
padding: 20px; | |||
background: #ffffff !important; /* Force white background */ | |||
flex-grow: 1; | |||
display: flex; | display: flex; | ||
flex-direction: column; | flex-direction: column; | ||
} | |||
/* Override any MediaWiki default styles on content */ | |||
.home-card--image-header .home-card__content { | |||
background: #ffffff !important; | |||
color: #495057; | |||
} | } | ||
/* | |||
/* Nested label in content section */ | |||
.home-card__content .home-card__label { | .home-card__content .home-card__label { | ||
margin-bottom: 0. | |||
color: #6c757d !important; | |||
font-size: 0.8125rem; | |||
letter-spacing: 0.75px; | |||
text-transform: uppercase; | |||
font-weight: 500; | |||
margin-bottom: 0.5rem; | |||
} | } | ||
/* Nested header in content section */ | |||
.home-card__content .home-card__header { | |||
margin: 0 0 1rem 0; | |||
font-size: 1.1rem; | |||
color: #2d5016 !important; | |||
font-weight: 600; | |||
} | |||
/* Nested body in content section */ | |||
.home-card__content .home-card__body { | .home-card__content .home-card__body { | ||
margin-bottom: 0. | |||
color: #495057 !important; | |||
line-height: 1.6; | |||
margin-bottom: 1rem; | |||
} | |||
/* Links in body should maintain red color */ | |||
.home-card__content .home-card__body a { | |||
color: #c92a2a !important; /* Keep red links visible */ | |||
text-decoration: none; | |||
} | |||
.home-card__content .home-card__body a:hover { | |||
text-decoration: underline; | |||
} | |||
/* External link icon styling */ | |||
.home-card__content .home-card__body a.external { | |||
color: #c92a2a !important; | |||
} | |||
/* Nested links footer in content section */ | |||
.home-card__content .home-card__links { | |||
font-size: 0.8125rem; | |||
color: #6c757d; | |||
border-top: 1px solid #dee2e6; | |||
padding-top: 0.75rem; | |||
margin-top: auto; | |||
} | |||
.home-card__content .home-card__links a { | |||
color: #2d5016 !important; | |||
text-decoration: none; | |||
font-weight: 500; | |||
} | |||
.home-card__content .home-card__links a:hover { | |||
text-decoration: underline; | |||
} | |||
/* Hard cap media height on wide screens */ | |||
.home-card__image-link { | |||
max-height: 300px; | |||
} | } | ||
/* ============================================ */ | /* ============================================ */ | ||
/* | |||
/* MOBILE RESPONSIVENESS */ | |||
/* ============================================ */ | /* ============================================ */ | ||
@media (max-width: 1024px) { | @media (max-width: 1024px) { | ||
.home-grid { | .home-grid { | ||
grid-template-columns: repeat(4 | |||
grid-template-columns: repeat(4, 1fr); | |||
} | } | ||
} | } | ||
@media (max-width: 768px) { | @media (max-width: 768px) { | ||
.home-grid { | .home-grid { | ||
grid-template-columns: repeat(2 | |||
grid-template-columns: repeat(2, 1fr); | |||
gap: 0.5rem; | gap: 0.5rem; | ||
} | } | ||
.home-card--col2 { | .home-card--col2 { | ||
grid-column: span 2; | grid-column: span 2; | ||
} | } | ||
.home-card__image-link { | .home-card__image-link { | ||
max-height: | |||
max-height: 200px; | |||
} | } | ||
.home-card__image-overlay { | .home-card__image-overlay { | ||
font-size: | |||
padding: 0 | font-size: 1.1rem; | ||
padding: 0 15px; | |||
} | } | ||
.home-card__content { | .home-card__content { | ||
padding: | |||
padding: 15px; | |||
} | } | ||
} | } | ||
@media (max-width: 600px) { | @media (max-width: 600px) { | ||
.home-card__image-link { | .home-card__image-link { | ||
max-height: | |||
max-height: 180px; | |||
} | } | ||
} | } | ||
@media (max-width: 480px) { | @media (max-width: 480px) { | ||
.home-grid { | .home-grid { | ||
grid-template-columns: 1fr; | grid-template-columns: 1fr; | ||
gap: 0.5rem; | gap: 0.5rem; | ||
} | } | ||
.home-card--col2 { | .home-card--col2 { | ||
grid-column: span 1; | grid-column: span 1; | ||
} | } | ||
.home-card { | .home-card { | ||
padding: | |||
padding: 15px; | |||
} | } | ||
.home-card__image-link { | .home-card__image-link { | ||
max-height: 160px; | max-height: 160px; | ||
} | } | ||
.home-card__image-overlay { | .home-card__image-overlay { | ||
font-size: | |||
padding: 0 | font-size: 1rem; | ||
padding: 0 12px; | |||
} | } | ||
.home-card__content { | |||
padding: 12px; | |||
} | |||
} | } | ||
Revision as of 11:19, 19 November 2025
/* ============================================ */
/* HOME GRID LAYOUT */
/* ============================================ */
.home-grid {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 0.625rem;
margin-top: 2.4rem;
width: 100%;
align-items: stretch;
}
/* ============================================ */
/* BASE HOME CARD STYLES */
/* ============================================ */
.home-card {
position: relative;
padding: 20px;
background: #ffffff; /* Changed to pure white */
border-radius: 8px;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.04), 0 3px 6px rgba(0, 0, 0, 0.0575);
font-size: 0.875rem;
transition: transform 0.2s ease, box-shadow 0.2s ease;
border: 1px solid #dee2e6;
min-height: 120px;
height: 100%;
}
.home-card--col2 {
grid-column: span 2;
}
.home-card:hover {
transform: translateY(-2px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08), 0 6px 12px rgba(0, 0, 0, 0.115);
}
/* Card sub-elements */
.home-card__label {
color: #6c757d;
font-size: 0.8125rem;
letter-spacing: 0.75px;
text-transform: uppercase;
font-weight: 500;
margin-bottom: 0.5rem;
}
.home-card__header {
margin: 0 0 1rem 0;
font-size: 1.1rem;
color: #2d5016;
font-weight: 600;
}
.home-card__header a {
color: inherit;
text-decoration: none;
}
.home-card__header a:hover {
color: #3d6b1f;
}
.home-card__body {
color: #495057;
line-height: 1.6;
margin-bottom: 1rem;
}
.home-card__links {
font-size: 0.8125rem;
color: #6c757d;
border-top: 1px solid #dee2e6;
padding-top: 0.75rem;
margin-top: 0.75rem;
}
.home-card__links a {
color: #2d5016;
text-decoration: none;
font-weight: 500;
}
.home-card__links a:hover {
text-decoration: underline;
}
/* ============================================ */
/* IMAGE HEADER CARDS - Based on working region cards */
/* ============================================ */
.home-card--image-header {
padding: 0;
overflow: hidden;
display: flex;
flex-direction: column;
height: 100%;
background: #ffffff; /* Ensure white background */
}
/* Image header link wrapper - 16:9 aspect ratio */
.home-card__image-link {
display: block;
position: relative;
width: 100%;
overflow: hidden;
background: #f3f4f6;
line-height: 0;
flex-shrink: 0;
border-bottom: 1px solid #e5e7eb; /* Subtle separator */
}
/* Create 16:9 ratio */
.home-card__image-link::before {
content: "";
display: block;
width: 100%;
padding-top: 56.25%; /* 16:9 ratio */
}
/* Image background container */
.home-card__image-header-bg {
position: absolute;
inset: 0;
line-height: 0;
}
/* Handle MediaWiki wrappers */
.home-card__image-header-bg,
.home-card__image-header-bg a,
.home-card__image-header-bg .image,
.home-card__image-header-bg .mw-file-description {
display: block;
width: 100%;
height: 100%;
}
/* Handle actual img element */
.home-card__image-header-bg img,
.home-card__image-header-bg .mw-file-element {
display: block;
width: 100% !important;
height: 100% !important;
max-width: none !important;
object-fit: cover;
object-position: center center;
transition: transform 0.3s ease;
margin: 0;
padding: 0;
}
/* Hover effect on image */
.home-card__image-link:hover .home-card__image-header-bg img,
.home-card__image-link:hover .home-card__image-header-bg .mw-file-element {
transform: scale(1.05);
}
/* Text overlay on image */
.home-card__image-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
padding: 0 20px;
color: #fff;
font-weight: 700;
font-size: 1.3rem;
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 below image - FIXED STYLING */
.home-card__content {
padding: 20px;
background: #ffffff !important; /* Force white background */
flex-grow: 1;
display: flex;
flex-direction: column;
}
/* Override any MediaWiki default styles on content */
.home-card--image-header .home-card__content {
background: #ffffff !important;
color: #495057;
}
/* Nested label in content section */
.home-card__content .home-card__label {
color: #6c757d !important;
font-size: 0.8125rem;
letter-spacing: 0.75px;
text-transform: uppercase;
font-weight: 500;
margin-bottom: 0.5rem;
}
/* Nested header in content section */
.home-card__content .home-card__header {
margin: 0 0 1rem 0;
font-size: 1.1rem;
color: #2d5016 !important;
font-weight: 600;
}
/* Nested body in content section */
.home-card__content .home-card__body {
color: #495057 !important;
line-height: 1.6;
margin-bottom: 1rem;
}
/* Links in body should maintain red color */
.home-card__content .home-card__body a {
color: #c92a2a !important; /* Keep red links visible */
text-decoration: none;
}
.home-card__content .home-card__body a:hover {
text-decoration: underline;
}
/* External link icon styling */
.home-card__content .home-card__body a.external {
color: #c92a2a !important;
}
/* Nested links footer in content section */
.home-card__content .home-card__links {
font-size: 0.8125rem;
color: #6c757d;
border-top: 1px solid #dee2e6;
padding-top: 0.75rem;
margin-top: auto;
}
.home-card__content .home-card__links a {
color: #2d5016 !important;
text-decoration: none;
font-weight: 500;
}
.home-card__content .home-card__links a:hover {
text-decoration: underline;
}
/* Hard cap media height on wide screens */
.home-card__image-link {
max-height: 300px;
}
/* ============================================ */
/* 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;
}
}