/* cedima-cards.css
   Purpose: Cedima product card component (non-destructive override loaded after cedima.css)
   Scope: only the blades grid section (.cedima-blade-grid)
*/

:root {
  --cedima-yellow: #FFCC00;
  --cedima-card-border: #D8D8D8;
  --cedima-card-body-bg: #ECECEC;

  --cedima-text: #000000;
  --cedima-text-muted: #484848;  /* description: lighter than pure black */
}

.cedima-blade-grid,
.cedima-blade-grid * {
  box-sizing: border-box;
}

/* ---------------------------
   Card shell
---------------------------- */
.cedima-blade-grid .cedima-card {
  display: block;
  width: 100%;
  height: 100%;

  text-decoration: none;
  color: var(--cedima-text);

  background: #fff;
  border: 1px solid var(--cedima-card-border);
  border-radius: 5px;
  overflow: hidden; /* ensures rounded corners clip inner areas */

  /* keep your toned-down shadow here */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

/* Clear "clickable" hover without underline */
.cedima-blade-grid .cedima-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
  text-decoration: none;
}

.cedima-blade-grid .cedima-card:hover,
.cedima-blade-grid .cedima-card:hover * {
  text-decoration: none;
}

/* ---------------------------
   Media (image area)
---------------------------- */
.cedima-blade-grid .cedima-card__media {
  background: #fff;
  padding: 16px 18px 10px;

  /* Square media area for uniform card heights */
  aspect-ratio: 1 / 1;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* Keep full blade visible (no crop) + zoom on hover */
.cedima-blade-grid .cedima-card__media img {
  display: block;
  max-width: 86%;
  max-height: 86%;
  width: auto;
  height: auto;
  object-fit: contain;

  transform: scale(1);
  transition: transform 200ms ease;
}

.cedima-blade-grid .cedima-card:hover .cedima-card__media img {
  transform: scale(1.10);
}

/* ---------------------------
   Body (text area)
---------------------------- */
.cedima-blade-grid .cedima-card__body {
  position: relative;
  background: var(--cedima-card-body-bg);

  /* slightly tighter internal spacing */
  padding: 16px 16px 16px 18px;

  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

/* Yellow bar with matching rounded bottom-left corner */
.cedima-blade-grid .cedima-card__bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--cedima-yellow);
  border-bottom-left-radius: 5px;
}

/* Title + description */
.cedima-blade-grid .cedima-card__title {
  margin: 0 0 8px 0;

  font-family: "Open Sans", Arial, sans-serif;
  font-weight: 700;

  /* keep your current size but make it more “systematic” */
  font-size: 20px;
  line-height: 1.15;

  text-transform: uppercase;

  letter-spacing: 0em;

  color: var(--cedima-text);
}

.cedima-blade-grid .cedima-card__desc {
  margin: 0;

  font-family: "Open Sans", Arial, sans-serif;
  font-weight: 400;

  /* clean scale vs title */
  font-size: 15px;
  line-height: 1.5;

  /* reduce emphasis */
  color: var(--cedima-text-muted);

  hyphens: auto;
}

/* ---------------------------
   Grid alignment fixes
   (Bootstrap floats + variable card heights = gaps)
---------------------------- */
.cedima-blade-grid #products {
  display: flex;
  flex-wrap: wrap;
}

/* Each Bootstrap column becomes a flex item */
.cedima-blade-grid #products > [class*="col-"] {
  display: flex;
  margin-bottom: 24px; /* row spacing */
}

/* Make card fill the column and allow body to stretch */
.cedima-blade-grid .cedima-card {
  display: flex;
  flex-direction: column;
}

.cedima-blade-grid .cedima-card__media {
  flex: 0 0 auto;
}

.cedima-blade-grid .cedima-card__body {
  flex: 1 1 auto;
}

/* ---------------------------
   Fix the “big gap” between filter section and blade grid
   (only affects these specific containers)
---------------------------- */

/* Filter container: reduce bottom space */
.page-cedima .container.cedima-product-section:not(.cedima-blade-grid) {
  margin-bottom: 1.2rem !important;
}

/* Blade grid container: remove extra top space */
.page-cedima .container.cedima-product-section.cedima-blade-grid {
  margin-top: 0 !important;
}

/* Timanttilaikat-page only (cedima-cards.css is only loaded here)
   Adjust spacing around the intro lead paragraph */
.page-cedima .container p.lead {
  margin-top: 1.2rem;
  margin-bottom: 2.0rem;
}

/* Bigger "Materiaalit" (legend) on the filter panel */
.page-cedima .cedima-filter-panel #filters legend {
  font-size: 2.1rem;
  line-height: 1.15;
  margin-bottom: 0.6rem;
}


/* Small screens: slightly smaller title */
@media (max-width: 420px) {
  .cedima-blade-grid .cedima-card__title {
    font-size: 18px;
    letter-spacing: 0.045em;
  }

  .cedima-blade-grid .cedima-card__desc {
    font-size: 14px;
  }
}
