/* ==================================================
   CONTAINER GENERALE
   ================================================== */

.fm-front {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
  color: #ddd;
}

.fm-front-top {
  margin: 10px 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.fm-search {
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2c2c2c;
  background: #111;
  color: #eee;
}

/* ==================================================
   GRIGLIA FATTRICI
   ================================================== */

.fm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* ==================================================
   CARD FATTRICE
   ================================================== */

.fm-card {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.fm-card-img {
  height: 360px;
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fm-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fm-ph {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f0f0f, #1b1b1b);
}

.fm-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.fm-card h3 {
  margin: 0 0 8px;
  color: #e23;
  font-weight: 600;
}

.fm-excerpt {
  margin: 0;
  line-height: 1.45;
  opacity: .95;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 5.6em;
}

.fm-spacer {
  flex: 1 1 auto;
}

.fm-btn {
  align-self: flex-start;
  background: #e23;
  color: #fff;
  border: 0;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity .2s ease;
}

.fm-btn:hover {
  opacity: .9;
}

/* ==================================================
   MODALE DETTAGLIO
   ================================================== */

.fm-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.fm-modal.is-active {
  display: block;
}

.fm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
}

.fm-dialog {
  position: relative;
  max-width: 1100px;
  margin: 40px auto;
  background: #111;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 16px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fm-dialog-scroll {
  overflow: auto;
  flex: 1 1 auto;
}

.fm-dialog-content {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .fm-dialog-content {
    grid-template-columns: 1fr;
  }
}

.fm-main-photo {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.fm-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  max-height: 24vh;
  overflow-y: auto;
  padding-right: 4px;
}

.fm-thumb {
  border: 1px solid #333;
  background: #000;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
}

.fm-thumb img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.fm-dialog-text h2 {
  margin: .2em 0 .5em;
  color: #e23;
}

.fm-spec {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.fm-spec th,
.fm-spec td {
  border-bottom: 1px solid #2a2a2a;
  padding: 6px 8px;
  text-align: left;
}

.fm-spec th {
  width: 180px;
  color: #aaa;
  font-weight: 600;
}

.fm-desc p {
  margin: .6em 0;
}

.fm-close {
  position: absolute;
  right: 12px;
  top: 10px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

/* ==================================================
   SCELTA RAZZA (CARD 200x200)
   ================================================== */

.fm-razze {
  padding: 40px 0;
}

.fm-razze-title {
  text-align: center;
  font-size: 28px;
  margin-bottom: 32px;
  color: #eee;
}

.fm-razze-grid {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}

.fm-razza-card {
  width: 400px;
  border-radius: 20px;
  overflow: hidden; 
  background: #000;
  border: 1px solid #333;
  box-shadow: 0 18px 40px rgba(0,0,0,.4);
  transition: transform .3s ease, box-shadow .3s ease;
}


.fm-razza-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 45px rgba(0,0,0,.55);
}

.fm-razza-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.fm-razza-img {
  width: 100%;
  height: 400px;
  position: relative;
  overflow: hidden;
}


.fm-razza-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fm-razza-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.5),
    rgba(0,0,0,.05)
  );
}

.fm-razza-text {
  padding: 14px;
  background: #111;
  text-align: center;
}

.fm-razza-text h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #e23;
  font-weight: 700;
}

.fm-razza-text p {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  opacity: .9;
}

/* ==================================================
   LINK TORNA INDIETRO
   ================================================== */

.fm-back {
  display: inline-block;
  color: #aaa;
  text-decoration: none;
  font-size: 14px;
}

.fm-back:hover {
  color: #fff;
}

@media (max-width: 768px) {

  .fm-razze-grid {
    justify-content: center;
    padding: 0 10px;
  }

  .fm-razza-card {
    width: 100%;
    max-width: 360px;
  }

  .fm-razza-img {
    height: 320px;
  }

}
@media (max-width: 480px) {
  .fm-razza-card {
    max-width: 320px;
  }
}

