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
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* TemplateStyles-Safe Enhanced FeaturedRegionCard CSS */
/* FeaturedRegionCard — TemplateStyles-safe, minimal */
/* Removes webkit properties and other unsupported features */


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


/* Card shell - enhanced with hover states and flex layout */
/* Card */
.fr-card {
.fr-card {
   background: #fff;
  display: flex;
  flex-direction: column;
   background: #ffffff;
   border: 1px solid #e5e7eb;
   border: 1px solid #e5e7eb;
   border-radius: 12px;
   border-radius: 12px;
   overflow: hidden;
   overflow: hidden;
   box-shadow: 0 1px 2px rgba(0,0,0,.03);
   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;
}
.fr-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transform: translateY(-1px);
}
}
.fr-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.12); }


/* Media section - enhanced with consistent aspect ratio */
/* Media */
.fr-media {
.fr-media {
  position: relative;
  height: 200px;
   background: #f3f4f6;
   background: #f3f4f6;
  position: relative;
  height: 180px;
   overflow: hidden;
   overflow: hidden;
  flex-shrink: 0;
}
.fr-img {
  width: 100%;
  height: 100%;
  display: block;
}
}
.fr-img img {
.fr-img,
.fr-img a { display: block; height: 100%; }
.fr-img img,
.fr-img .mw-file-element {
   display: block;
   display: block;
   width: 100%;
   width: 100%;
Line 46: Line 40:
   object-fit: cover;
   object-fit: cover;
   object-position: center;
   object-position: center;
}
.fr-img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6b7280;
  font-size: .9rem;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}
}


/* Body content - enhanced with flex growth */
/* make whole image clickable when Page= exists */
.fr-body {
.fr-media-link,
  padding: 12px 16px 16px;
.fr-media-link a {
  flex: 1;
   position: absolute;
  display: flex;
   top: 0; right: 0; bottom: 0; left: 0;
  flex-direction: column;
   display: block;
}
 
/* Kicker line - enhanced spacing */
.fr-kicker {
  margin: 0 0 .25rem;
  font-size: .85rem;
  color: #374151;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.fr-status {
   font-weight: 600;
}
.fr-sep {
   color: #9ca3af;
  margin: 0 .25rem;
}
.fr-acc {
  color: #6b7280;
  font-weight: 500;
}
 
/* Title - enhanced hover states */
.fr-title {
  margin: .15rem 0 .35rem;
   font-size: 1.15rem;
  line-height: 1.25;
  color: #1f2937;
  font-weight: 600;
}
.fr-title a {
  color: inherit;
   text-decoration: none;
   text-decoration: none;
}
.fr-title a:hover {
  color: #059669;
  text-decoration: underline;
}
}


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


/* Hook - enhanced with height control (no webkit properties) */
.fr-sub { margin: 2px 0 8px 0; color: #6b7280; font-size: .9rem; line-height: 1.3; }
.fr-hook {
  margin: 0 0 .75rem;
  font-size: .95rem;
  color: #374151;
  line-height: 1.4;
  flex: 1;
 
  /* Alternative to webkit-line-clamp using max-height */
  max-height: 5.6em; /* 4 lines at 1.4 line-height */
  overflow: hidden;
}


/* CTA - enhanced with better button styling */
/* Status chip */
.fr-cta {
.fr-status {
  margin: 0;
  margin-top: auto;
}
.fr-cta a {
   display: inline-flex;
   display: inline-flex;
   align-items: center;
   align-items: center;
   gap: 4px;
   padding: 6px 12px;
   color: #059669;
   border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
   font-weight: 600;
   font-weight: 600;
  text-decoration: none;
   font-size: .85rem;
   font-size: .9rem;
   color: #374151;
  padding: 4px 0;
   margin: 2px 0 10px 0;
  transition: color 0.2s ease;
}
.fr-cta a:hover {
   color: #047857;
   text-decoration: underline;
}
}
.fr-missing {
.fr-status .fr-dot {
   color: #9ca3af;
   width: 8px; height: 8px; border-radius: 50%;
  font-style: italic;
   display: inline-block; margin-right: 8px;
   font-size: .9rem;
}
}
.fr-status .fr-sep { margin: 0 8px; color: #9ca3af; font-weight: 400; }
.fr-status .fr-acc { color: #6b7280; font-weight: 500; }


/* Mobile responsive enhancements */
/* Dot colors controlled by card’s status class */
@media (max-width: 768px) {
.fr--status-stable .fr-status .fr-dot { background: #22c55e; }
  .fr-grid {
.fr--status-vulnerable .fr-status .fr-dot { background: #eab308; }
    grid-template-columns: 1fr;
.fr--status-endangered .fr-status .fr-dot { background: #f97316; }
    gap: 1.5rem;
.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; }


@media (max-width: 480px) {
/* Hook + CTA */
  .fr-grid {
.fr-hook {
    gap: 1rem;
   margin: 0 0 10px 0;
   }
   color: #4b5563;
 
   line-height: 1.45;
  .fr-media {
   max-height: 4.5em; /* 3 lines */
    height: 160px;
  overflow: hidden;
  }
 
  .fr-body {
    padding: 10px 14px 14px;
   }
 
  .fr-kicker {
    font-size: .8rem;
    gap: .4rem;
   }
 
  .fr-title {
    font-size: 1.1rem;
    margin: .1rem 0 .3rem;
  }
 
  .fr-sub {
    font-size: .8rem;
   }
 
  .fr-hook {
    font-size: .9rem;
    max-height: 4.05em; /* 3 lines at 1.35 line-height */
    line-height: 1.35;
  }
}
}
.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; }


@media (max-width: 360px) {
/* Responsive tweaks */
  .fr-grid {
@media (min-width: 1024px) { .fr-media { height: 220px; } }
    grid-template-columns: minmax(260px, 1fr);
@media (max-width: 480px)  { .fr-media { height: 180px; } }
  }
 
  .fr-media {
    height: 140px;
  }
 
  .fr-body {
    padding: 8px 12px 12px;
  }
 
  .fr-kicker {
    font-size: .75rem;
  }
 
  .fr-title {
    font-size: 1rem;
  }
 
  .fr-sub {
    font-size: .75rem;
  }
 
  .fr-hook {
    font-size: .85rem;
    line-height: 1.3;
    max-height: 3.3em; /* ~3 lines */
  }
}


/* Accessibility improvements - TemplateStyles safe */
@media (prefers-reduced-motion: reduce) {
  .fr-card:hover {
    transform: none;
  }
  .fr-card,
  .fr-cta a {
    transition: none;
  }
}


/* Badge overlay */
/* --- kill any MW wrapper styling around each card --- */
.fr-badge{
.fr-grid > * {
   position:absolute; left:12px; bottom:12px;
   background: transparent !important;
   display:inline-flex; align-items:center; gap:6px;
   border: 0 !important;
   padding:4px 8px; border-radius:999px;
   border-radius: 0 !important;
   background:rgba(255,255,255,.92); border:1px solid #e5e7eb;
   box-shadow: none !important;
   font-size:.85rem; font-weight:600; color:#374151;
   padding: 0 !important;
   box-shadow:0 1px 2px rgba(0,0,0,.06);
   margin: 0 !important;
}
}
.fr-dot{ width:8px; height:8px; border-radius:50%; display:inline-block; }
.fr-badgelabel{ line-height:1; }
.fr-badge .fr-sep{ color:#9ca3af; margin:0 .25rem; }
.fr-badge .fr-acc{ color:#6b7280; font-weight:600; }


/* Map dot color by status (no CSS vars) */
/* --- lock the status chip to its intended size --- */
.fr--status-stable .fr-dot{ background:#16a34a; }      /* green 600 */
.fr-status {
.fr--status-vulnerable .fr-dot{ background:#ca8a04; }  /* amber 600 */
   display: inline-flex !important;
.fr--status-endangered .fr-dot{ background:#f97316; }   /* orange 500 */
  align-items: center !important;
.fr--status-critical .fr-dot{ background:#ef4444; }    /* red 500 */
  padding: 6px 12px !important;
.fr--status-extinct .fr-dot{ background:#6b7280; }      /* gray 500 */
  margin: 4px 0 12px 0 !important;
.fr--status-unknown .fr-dot{ background:#9ca3af; }
  background: #f8fafc !important;
 
  border: 1px solid #e5e7eb !important;
/* Tighten body now that kicker is gone */
  border-radius: 999px !important;
.fr-body{ padding:12px 16px 14px; }
  width: auto !important;
.fr-title{ margin:.1rem 0 .35rem; }
  height: auto !important;
.fr-sub{ margin:0 0 .5rem; }
   box-shadow: none !important;
.fr-hook{ margin:0 0 .6rem; }
 
/* Focus states */
.fr-title a:focus{ outline:2px solid #059669; outline-offset:2px; border-radius:6px; }
 
/* Optional: a touch more image presence */
@media (min-width: 960px){
   .fr-media{ height:196px; } /* was 180px */
}
}
 
.fr-status::before,
.fr-badge{ z-index:2; }          /* ensure above File link */
.fr-status::after { content: none !important; } /* in case a skin adds pseudo-elements */
.fr-kicker{ display:none; }      /* old row no longer used */
 
/* Image → region link overlay (no 'inset', no negative outline-offset) */
.fr-media-link,
.fr-media-link a {
  position:absolute; top:0; right:0; bottom:0; left:0;
  display:block; z-index:1;
}
.fr-media-link a { text-decoration:none; }
.fr-media-link a:focus { outline:2px solid #059669; outline-offset:2px; border-radius:8px; }
 
/* Bottom lift for badge readability (TemplateStyles-safe) */
.fr-media::after{
  content:""; position:absolute; top:0; right:0; bottom:0; left:0;
  background:linear-gradient(to top, rgba(0,0,0,.15) 0%, rgba(0,0,0,0) 45%);
  z-index:0;
}
 
/* Keep title color consistent (no :visited) */
.fr-title a { color:#1f2937; }
.fr-title a:hover { color:#059669; text-decoration:underline; }
 
/* Micro rhythm tweaks */
@media (min-width:960px){ .fr-media{ height:200px; } }
.fr-title{ margin:.05rem 0 .3rem; }
.fr-sub{ margin:0 0 .45rem; }
.fr-hook{ line-height:1.35; max-height:4.05em; }
.fr-missing{ color:#9ca3af; font-style:normal; }
 
/* Badge tweaks */
.fr-badge{ z-index:2; padding:4px 10px; gap:8px; }
.fr-dot{ width:9px; height:9px; }

Latest revision as of 08:14, 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; } }


/* --- kill any MW wrapper styling around each card --- */
.fr-grid > * {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* --- lock the status chip to its intended size --- */
.fr-status {
  display: inline-flex !important;
  align-items: center !important;
  padding: 6px 12px !important;
  margin: 4px 0 12px 0 !important;
  background: #f8fafc !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 999px !important;
  width: auto !important;
  height: auto !important;
  box-shadow: none !important;
}
.fr-status::before,
.fr-status::after { content: none !important; }  /* in case a skin adds pseudo-elements */