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:
/* TemplateStyles-Safe Enhanced FeaturedRegionCard CSS */
/* FeaturedRegionCard — TemplateStyles-safe (strict) */
/* Removes webkit properties and other unsupported features */


/* Grid container - enhanced with better mobile handling */
/* Grid on main page */
.fr-grid {
.fr-grid {
   display: grid;
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
   grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
   gap: 1rem;
   grid-gap: 1rem;           /* use grid-gap (no 'gap') */
   align-items: stretch;
   align-items: stretch;
}
}


/* Card shell - enhanced with hover states and flex layout */
/* Card */
.fr-card {
.fr-card {
   background: #fff;
   background: #fff;
Line 20: Line 19:
   flex-direction: column;
   flex-direction: column;
   height: 100%;
   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 4px 12px rgba(0,0,0,.08); }


/* Media section - enhanced with consistent aspect ratio */
/* Media */
.fr-media {
.fr-media {
  background: #f3f4f6;
   position: relative;
   position: relative;
   height: 180px;
   height: 180px;
   overflow: hidden;
   overflow: hidden;
   flex-shrink: 0;
   background: #fff;
}
  border-top-left-radius: 12px;
.fr-img {
   border-top-right-radius: 12px;
  width: 100%;
   height: 100%;
  display: block;
}
}
.fr-img { width: 100%; height: 100%; display: block; }
.fr-img img {
.fr-img img {
   display: block;
   display: block;
   width: 100%;
   width: 100%;
   height: 100%;
   height: 100%;
   object-fit: cover;
   object-fit: cover;      /* keep; if rejected, swap to height:auto */
   object-position: center;
}
 
/* Bottom gradient for 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,.22) 0%, rgba(0,0,0,0) 35%);
  border-top-left-radius: 12px;
   border-top-right-radius: 12px;
  z-index: 0;
}
}
/* Placeholder */
.fr-img--placeholder {
.fr-img--placeholder {
   display: flex;
   display: flex;
  justify-content: center;
   align-items: center;
   align-items: center;
  justify-content: center;
   height: 100%;
   height: 100%;
   color: #6b7280;
   color: #6b7280;
Line 57: Line 60:
}
}


/* Body content - enhanced with flex growth */
/* Make whole image clickable (template adds the link) */
.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; }
 
/* Badge (status + accessions) */
.fr-badge {
  position: absolute; left: 16px; bottom: 10px;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  border: 1px solid #e6e6e6;
  font-size: .85rem; font-weight: 600; color: #374151;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  z-index: 2;
  white-space: nowrap;
}
.fr-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.fr-badgelabel { vertical-align: middle; }
.fr-badge .fr-sep { color: #9ca3af; margin: 0 6px; }
.fr-badge .fr-acc { color: #6b7280; font-weight: 600; }
 
/* Dot colors by status */
.fr--status-stable .fr-dot { background: #16a34a; }
.fr--status-vulnerable .fr-dot { background: #ca8a04; }
.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 */
.fr-body {
.fr-body {
   padding: 12px 16px 16px;
   padding: 12px 16px 14px;
   flex: 1;
   flex: 1;
   display: flex;
   display: flex;
Line 65: Line 104:
}
}


/* Kicker line - enhanced spacing */
/* Title (reserve two lines for even stacks) */
.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 {
.fr-title {
   margin: .15rem 0 .35rem;
   margin: .05rem 0 .3rem;
   font-size: 1.15rem;
   font-size: 1.15rem;
   line-height: 1.25;
   line-height: 1.25;
   color: #1f2937;
   color: #1f2937;
   font-weight: 600;
   font-weight: 600;
  min-height: 2.5em;
}
}
.fr-title a {
.fr-title a { color: #1f2937; text-decoration: none; }
  color: inherit;
.fr-title a:hover { color: #059669; text-decoration: underline; }
  text-decoration: none;
}
.fr-title a:hover {
  color: #059669;
  text-decoration: underline;
}


/* Subtitle - enhanced readability */
/* Subtitle (single line, ellipsized) */
.fr-sub {
.fr-sub {
   margin: 0 0 .5rem;
   margin: 0 0 .45rem;
   font-size: .85rem;
   font-size: .85rem;
   color: #6b7280;
   color: #6b7280;
   line-height: 1.3;
   line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.2em;
}
}


/* Hook - enhanced with height control (no webkit properties) */
/* Hook (3-line clamp via max-height) */
.fr-hook {
.fr-hook {
   margin: 0 0 .75rem;
   margin: 0 0 .6rem;
   font-size: .95rem;
   font-size: .95rem;
   color: #374151;
   color: #374151;
   line-height: 1.4;
   line-height: 1.35;
  max-height: 4.05em;
  overflow: hidden;
   flex: 1;
   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 */
/* CTA */
.fr-cta {
.fr-cta { margin: 0; margin-top: auto; }
  margin: 0;
  margin-top: auto;
}
.fr-cta a {
.fr-cta a {
   display: inline-flex;
   display: inline-block;         /* no inline-flex */
  align-items: center;
  gap: 4px;
   color: #059669;
   color: #059669;
   font-weight: 600;
   font-weight: 600;
Line 139: Line 148:
   font-size: .9rem;
   font-size: .9rem;
   padding: 4px 0;
   padding: 4px 0;
  transition: color 0.2s ease;
}
.fr-cta a:hover {
  color: #047857;
  text-decoration: underline;
}
.fr-missing {
  color: #9ca3af;
  font-style: italic;
  font-size: .9rem;
}
/* Mobile responsive enhancements */
@media (max-width: 768px) {
  .fr-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
}
.fr-cta a:hover { color: #047857; text-decoration: underline; }
.fr-missing { color: #9ca3af; font-style: normal; font-size: .9rem; }


/* Responsive */
@media (min-width: 960px) { .fr-media { height: 210px; } }
@media (max-width: 480px) {
@media (max-width: 480px) {
   .fr-grid {
   .fr-grid { grid-gap: 1rem; }
    gap: 1rem;
   .fr-media { height: 170px; }
  }
   .fr-body { padding: 10px 14px 14px; }
 
   .fr-title { font-size: 1.1rem; }
   .fr-media {
   .fr-sub { font-size: .8rem; }
    height: 160px;
   .fr-hook { font-size: .9rem; }
  }
 
   .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;
  }
}
 
@media (max-width: 360px) {
  .fr-grid {
    grid-template-columns: minmax(260px, 1fr);
  }
 
  .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 */
.fr-badge{
  position:absolute; left:12px; bottom:12px;
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 8px; border-radius:999px;
  background:rgba(255,255,255,.92); border:1px solid #e5e7eb;
  font-size:.85rem; font-weight:600; color:#374151;
  box-shadow:0 1px 2px rgba(0,0,0,.06);
}
.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) */
.fr--status-stable .fr-dot{ background:#16a34a; }      /* green 600 */
.fr--status-vulnerable .fr-dot{ background:#ca8a04; }  /* amber 600 */
.fr--status-endangered .fr-dot{ background:#f97316; }  /* orange 500 */
.fr--status-critical .fr-dot{ background:#ef4444; }    /* red 500 */
.fr--status-extinct .fr-dot{ background:#6b7280; }      /* gray 500 */
.fr--status-unknown .fr-dot{ background:#9ca3af; }
 
/* Tighten body now that kicker is gone */
.fr-body{ padding:12px 16px 14px; }
.fr-title{ margin:.1rem 0 .35rem; }
.fr-sub{ margin:0 0 .5rem; }
.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-badge{ z-index:2; }          /* ensure above File link */
.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; }

Revision as of 07:12, 25 August 2025

/* FeaturedRegionCard — TemplateStyles-safe (strict) */

/* Grid on main page */
.fr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-gap: 1rem;            /* use grid-gap (no 'gap') */
  align-items: stretch;
}

/* Card */
.fr-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.fr-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }

/* Media */
.fr-media {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: #fff;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.fr-img { width: 100%; height: 100%; display: block; }
.fr-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;       /* keep; if rejected, swap to height:auto */
}

/* Bottom gradient for 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,.22) 0%, rgba(0,0,0,0) 35%);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  z-index: 0;
}

/* Placeholder */
.fr-img--placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: #6b7280;
  font-size: .9rem;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

/* Make whole image clickable (template adds the link) */
.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; }

/* Badge (status + accessions) */
.fr-badge {
  position: absolute; left: 16px; bottom: 10px;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  border: 1px solid #e6e6e6;
  font-size: .85rem; font-weight: 600; color: #374151;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  z-index: 2;
  white-space: nowrap;
}
.fr-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.fr-badgelabel { vertical-align: middle; }
.fr-badge .fr-sep { color: #9ca3af; margin: 0 6px; }
.fr-badge .fr-acc { color: #6b7280; font-weight: 600; }

/* Dot colors by status */
.fr--status-stable .fr-dot { background: #16a34a; }
.fr--status-vulnerable .fr-dot { background: #ca8a04; }
.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 */
.fr-body {
  padding: 12px 16px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Title (reserve two lines for even stacks) */
.fr-title {
  margin: .05rem 0 .3rem;
  font-size: 1.15rem;
  line-height: 1.25;
  color: #1f2937;
  font-weight: 600;
  min-height: 2.5em;
}
.fr-title a { color: #1f2937; text-decoration: none; }
.fr-title a:hover { color: #059669; text-decoration: underline; }

/* Subtitle (single line, ellipsized) */
.fr-sub {
  margin: 0 0 .45rem;
  font-size: .85rem;
  color: #6b7280;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.2em;
}

/* Hook (3-line clamp via max-height) */
.fr-hook {
  margin: 0 0 .6rem;
  font-size: .95rem;
  color: #374151;
  line-height: 1.35;
  max-height: 4.05em;
  overflow: hidden;
  flex: 1;
}

/* CTA */
.fr-cta { margin: 0; margin-top: auto; }
.fr-cta a {
  display: inline-block;         /* no inline-flex */
  color: #059669;
  font-weight: 600;
  text-decoration: none;
  font-size: .9rem;
  padding: 4px 0;
}
.fr-cta a:hover { color: #047857; text-decoration: underline; }
.fr-missing { color: #9ca3af; font-style: normal; font-size: .9rem; }

/* Responsive */
@media (min-width: 960px) { .fr-media { height: 210px; } }
@media (max-width: 480px) {
  .fr-grid { grid-gap: 1rem; }
  .fr-media { height: 170px; }
  .fr-body { padding: 10px 14px 14px; }
  .fr-title { font-size: 1.1rem; }
  .fr-sub { font-size: .8rem; }
  .fr-hook { font-size: .9rem; }
}