Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Home/FeaturedRegionCard/styles.css: Difference between revisions

Template page
No edit summary
No edit summary
Line 1: Line 1:
/* FeaturedRegionCard — TemplateStyles-safe (strict) — FIXED VERSION */
/* FeaturedRegionCard — TemplateStyles-safe, minimal */


/* Grid on main page */
/* Grid wrapper (use on Main Page section) */
.fr-grid {
.fr-grid {
   display: grid;
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
   grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
   grid-gap: 1.5rem;
   gap: 16px;
   align-items: stretch;
   align-items: stretch;
  max-width: 1200px;
   margin: 0 auto;
   margin: 0 auto;
  max-width: 1200px;
  /* Override MediaWiki container styles */
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
}
/* Nuclear option - target all possible MediaWiki wrappers BUT preserve card content */
.fr-grid > *,
.fr-grid > * > *, 
.fr-grid > * > * > *,
.fr-grid div:not(.fr-card):not(.fr-media):not(.fr-body):not(.fr-status-badge),
.fr-grid span:not(.fr-img):not(.fr-media-link):not(.fr-badgelabel):not(.fr-sep):not(.fr-acc),
.fr-grid p:not(.fr-sub):not(.fr-hook):not(.fr-cta) {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
/* Specifically target common MediaWiki classes */
.fr-grid .mw-parser-output,
.fr-grid .template,
.fr-grid [class*="mw-"],
.fr-grid [class*="template"],
.fr-grid .home-card,
.fr-grid [class*="home-card"] {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
/* Override main page card styles that might be interfering */
.fr-grid .home-card,
.fr-grid [class*="home-card"] {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  min-height: auto !important;
}
/* Reset MediaWiki image and figure containers */
.fr-grid figure,
.fr-grid .mw-default-size,
.fr-grid .thumb,
.fr-grid .thumbinner,
.fr-grid .image,
.fr-grid [class*="mw-"] {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}
/* Reset any MediaWiki template container styling */
.fr-grid > div,
.fr-grid > span {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}
/* Ensure cards have their proper styling restored */
.fr-card {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.06) !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  transition: all 0.2s ease !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
}
}


/* Card */
/* Card */
.fr-card {
.fr-card {
   background: #fff;
  display: flex;
  flex-direction: column;
   background: #ffffff;
   border: 1px solid #e5e7eb;
   border: 1px solid #e5e7eb;
   border-radius: 16px;
   border-radius: 12px;
   overflow: hidden;
   overflow: hidden;
   box-shadow: 0 2px 8px rgba(0,0,0,.06);
   box-shadow: 0 1px 2px rgba(0,0,0,.04);
  display: flex;
   transition: box-shadow .2s ease;
  flex-direction: column;
  height: 100%;
   transition: all 0.2s ease;
  position: relative;
}
.fr-card:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,.12);
}
}
.fr-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.12); }


/* Media */
/* Media */
Line 117: Line 28:
   position: relative;
   position: relative;
   height: 200px;
   height: 200px;
  background: #f3f4f6;
   overflow: hidden;
   overflow: hidden;
  background: #f8fafc;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}
}
.fr-img {
.fr-img,
  width: 100%;
.fr-img a { display: block; height: 100%; }
  height: 100%;
.fr-img img,
  display: block;
.fr-img .mw-file-element {
  position: relative;
   display: block;
  background: transparent !important;
   width: 100%;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.fr-img img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}
 
/* Enhanced gradient overlay for better badge readability */
.fr-media::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.4) 0%,
    rgba(0,0,0,.2) 25%,
    rgba(0,0,0,0) 50%
  );
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  z-index: 1;
}
 
/* Placeholder */
.fr-img--placeholder {
   display: flex;
   justify-content: center;
  align-items: center;
   height: 100%;
   height: 100%;
   color: #9ca3af;
   object-fit: cover;
  font-size: 1rem;
   object-position: center;
   font-weight: 500;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}
}


/* Make whole image clickable */
/* make whole image clickable when Page= exists */
.fr-media-link,
.fr-media-link,
.fr-media-link a {
.fr-media-link a {
   position: absolute;  
   position: absolute;
   top: 0; right: 0; bottom: 0; left: 0;
   top: 0; right: 0; bottom: 0; left: 0;
   display: block;
   display: block;
  z-index: 2;
   text-decoration: none;
}
.fr-media-link a {
   text-decoration: none;
}
.fr-media-link a:focus {
  outline: 3px solid #059669;
  outline-offset: 2px;
  border-radius: 12px;  
}
}


/* Badge (status + accessions) - MAJOR IMPROVEMENTS */
/* Body */
.fr-badge {
.fr-body { padding: 16px 18px 18px; display: flex; flex-direction: column; }
  position: absolute;
.fr-title { margin: 0; font-size: 1.125rem; line-height: 1.25; color: #1f2937; font-weight: 700; }
  left: 16px;  
.fr-title a { color: #1f2937; text-decoration: none; }
  bottom: 16px;
.fr-title a:hover { text-decoration: underline; color: #059669; }
  padding: 8px 14px;
  border-radius: 24px;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(255,255,255,.3);
  font-size: .875rem;  
  font-weight: 600;  
  color: #374151;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  z-index: 3;
  white-space: nowrap;
  line-height: 1;
}


.fr-dot {  
.fr-sub { margin: 2px 0 8px 0; color: #6b7280; font-size: .9rem; line-height: 1.3; }
  width: 8px;  
  height: 8px;  
  border-radius: 50%;  
  display: inline-block;
  margin-right: 8px;
  flex-shrink: 0;
}


.fr-badgelabel {
/* Status chip */
  margin-right: 2px;
.fr-status {
}
   display: inline-flex;
 
   align-items: center;
.fr-badge .fr-sep {
   padding: 6px 12px;
  color: #9ca3af;
   border-radius: 999px;
  margin: 0 8px;
   background: #f8fafc;
  font-weight: 400;
   border: 1px solid #e5e7eb;
}
  font-weight: 600;
 
.fr-badge .fr-acc {
  color: #6b7280;
  font-weight: 500;
  font-size: .8rem;
}
 
/* Enhanced dot colors by status */
.fr--status-stable .fr-dot { background: #22c55e; }
.fr--status-vulnerable .fr-dot { background: #eab308; }
.fr--status-endangered .fr-dot { background: #f97316; }
.fr--status-critical .fr-dot { background: #ef4444; }
.fr--status-extinct .fr-dot { background: #6b7280; }
.fr--status-unknown .fr-dot { background: #9ca3af; }
 
/* Body - IMPROVED SPACING */
.fr-body {
  padding: 20px 20px 24px;
  flex: 1;
   display: flex;
   flex-direction: column;
}
 
/* Status badge in body (not overlaid on image) */
.fr-status-badge {
  display: inline-block;
   padding: 8px 16px;
   border-radius: 24px;
   background: #f1f5f9;
   border: 1px solid #e2e8f0;
   font-size: .85rem;
   font-size: .85rem;
  font-weight: 600;
   color: #374151;
   color: #374151;
   margin: 12px 0 18px;
   margin: 2px 0 10px 0;
  line-height: 1.2;
}
}
 
.fr-status .fr-dot {
/* Enhanced status badge colors */
   width: 8px; height: 8px; border-radius: 50%;
.fr--status-stable .fr-status-badge {  
   display: inline-block; margin-right: 8px;
   background: #ecfdf5;
  border-color: #bbf7d0;  
  color: #166534;
}
.fr--status-vulnerable .fr-status-badge {
  background: #fefce8;  
  border-color: #fde047;
  color: #ca8a04;
}
.fr--status-endangered .fr-status-badge {
   background: #fff7ed;
  border-color: #fdba74;  
  color: #ea580c;
}
.fr--status-critical .fr-status-badge {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}
.fr--status-extinct .fr-status-badge {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #6b7280;
}
.fr--status-unknown .fr-status-badge {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
}
}
.fr-status .fr-sep { margin: 0 8px; color: #9ca3af; font-weight: 400; }
.fr-status .fr-acc { color: #6b7280; font-weight: 500; }


.fr-status-badge .fr-dot {
/* Dot colors controlled by card’s status class */
  width: 8px;
.fr--status-stable .fr-status .fr-dot { background: #22c55e; }
  height: 8px;
.fr--status-vulnerable .fr-status .fr-dot { background: #eab308; }
  border-radius: 50%;
.fr--status-endangered .fr-status .fr-dot { background: #f97316; }
  display: inline-block;
.fr--status-critical .fr-status .fr-dot { background: #ef4444; }
  margin-right: 8px;
.fr--status-extinct .fr-status .fr-dot { background: #6b7280; }
  flex-shrink: 0;
.fr--status-unknown .fr-status .fr-dot { background: #9ca3af; }
}


.fr-status-badge .fr-badgelabel {
/* Hook + CTA */
  margin-right: 2px;
}
 
.fr-status-badge .fr-sep {
  color: #9ca3af;
  margin: 0 8px;
  font-weight: 400;
}
 
.fr-status-badge .fr-acc {
  color: #6b7280;
  font-weight: 500;
  font-size: .75rem;
}
 
/* Remove the old overlaid badge */
.fr-badge {
  display: none !important;
}
 
/* Title - BETTER LINE HEIGHT AND SPACING */
.fr-title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  line-height: 1.3;
  color: #1f2937;
  font-weight: 700;
  overflow: hidden;
}
.fr-title a {
  color: #1f2937;
  text-decoration: none;
  transition: color 0.15s ease;
}
.fr-title a:hover {
  color: #059669;
  text-decoration: underline;
}
 
/* Subtitle - IMPROVED TRUNCATION */
.fr-sub {
  margin: 0 0 16px;
  font-size: .9rem;
  color: #6b7280;
  line-height: 1.4;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
 
/* Hook - BETTER TEXT CLAMPING */
.fr-hook {
.fr-hook {
   margin: 0 0 20px;
   margin: 0 0 10px 0;
  font-size: 1rem;
   color: #4b5563;
   color: #4b5563;
   line-height: 1.5;
   line-height: 1.45;
   max-height: 4.5em;
   max-height: 4.5em; /* 3 lines */
   overflow: hidden;
   overflow: hidden;
  flex: 1;
}
/* CTA - IMPROVED STYLING */
.fr-cta {
  margin: 0;
  margin-top: auto;
  padding-top: 4px;
}
.fr-cta a {
  color: #059669;
  font-weight: 600;
  text-decoration: none;
  font-size: .95rem;
  padding: 8px 0;
  transition: all 0.15s ease;
}
.fr-cta a:hover {
  color: #047857;
  text-decoration: underline;
}
.fr-missing {
  color: #9ca3af;
  font-style: italic;
  font-size: .9rem;
  font-weight: 500;
}
}
.fr-cta { margin-top: auto; }
.fr-cta a { color: #059669; font-weight: 600; text-decoration: none; }
.fr-cta a:hover { text-decoration: underline; color: #047857; }
.fr-missing { color: #9ca3af; font-style: italic; }


/* Responsive - ENHANCED BREAKPOINTS */
/* Responsive tweaks */
@media (min-width: 1024px) {  
@media (min-width: 1024px) { .fr-media { height: 220px; } }
  .fr-media { height: 220px; }
@media (max-width: 480px) { .fr-media { height: 180px; } }
  .fr-grid { grid-template-columns: repeat(3, 1fr); }
}
 
@media (min-width: 768px) and (max-width: 1023px) {
  .fr-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 1.25rem;
  }
  .fr-media { height: 190px; }
}
 
@media (max-width: 767px) {
  .fr-grid {
    grid-template-columns: 1fr;
    grid-gap: 1.25rem;
    margin: 0 1rem;
  }
  .fr-media { height: 180px; }
  .fr-body { padding: 16px 18px 20px; }
  .fr-title { font-size: 1.125rem; }
  .fr-sub { font-size: .85rem; }
  .fr-hook { font-size: .95rem; }
  .fr-badge {
    left: 12px;
    bottom: 12px;
    padding: 6px 12px;
    font-size: .8rem;
  }
  .fr-badge .fr-acc { font-size: .75rem; }
}

Revision as of 08:10, 25 August 2025

/* FeaturedRegionCard — TemplateStyles-safe, minimal */

/* Grid wrapper (use on Main Page section) */
.fr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  align-items: stretch;
  max-width: 1200px;
  margin: 0 auto;
}

/* Card */
.fr-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: box-shadow .2s ease;
}
.fr-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.12); }

/* Media */
.fr-media {
  position: relative;
  height: 200px;
  background: #f3f4f6;
  overflow: hidden;
}
.fr-img,
.fr-img a { display: block; height: 100%; }
.fr-img img,
.fr-img .mw-file-element {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* make whole image clickable when Page= exists */
.fr-media-link,
.fr-media-link a {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: block;
  text-decoration: none;
}

/* Body */
.fr-body { padding: 16px 18px 18px; display: flex; flex-direction: column; }
.fr-title { margin: 0; font-size: 1.125rem; line-height: 1.25; color: #1f2937; font-weight: 700; }
.fr-title a { color: #1f2937; text-decoration: none; }
.fr-title a:hover { text-decoration: underline; color: #059669; }

.fr-sub { margin: 2px 0 8px 0; color: #6b7280; font-size: .9rem; line-height: 1.3; }

/* Status chip */
.fr-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  font-weight: 600;
  font-size: .85rem;
  color: #374151;
  margin: 2px 0 10px 0;
}
.fr-status .fr-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 8px;
}
.fr-status .fr-sep { margin: 0 8px; color: #9ca3af; font-weight: 400; }
.fr-status .fr-acc { color: #6b7280; font-weight: 500; }

/* Dot colors controlled by card’s status class */
.fr--status-stable .fr-status .fr-dot { background: #22c55e; }
.fr--status-vulnerable .fr-status .fr-dot { background: #eab308; }
.fr--status-endangered .fr-status .fr-dot { background: #f97316; }
.fr--status-critical .fr-status .fr-dot { background: #ef4444; }
.fr--status-extinct .fr-status .fr-dot { background: #6b7280; }
.fr--status-unknown .fr-status .fr-dot { background: #9ca3af; }

/* Hook + CTA */
.fr-hook {
  margin: 0 0 10px 0;
  color: #4b5563;
  line-height: 1.45;
  max-height: 4.5em; /* 3 lines */
  overflow: hidden;
}
.fr-cta { margin-top: auto; }
.fr-cta a { color: #059669; font-weight: 600; text-decoration: none; }
.fr-cta a:hover { text-decoration: underline; color: #047857; }
.fr-missing { color: #9ca3af; font-style: italic; }

/* Responsive tweaks */
@media (min-width: 1024px) { .fr-media { height: 220px; } }
@media (max-width: 480px)  { .fr-media { height: 180px; } }