/* Isolated CSS for archive-storie.php
   Uses ONLY .ccm-storie-* classes (no reuse of eventi / bb-evt classes)
*/

.ccm-storie-archive{
  --ccm-dark:#1e3c3c;
  --ccm-light:#d1ffbb;
  --ccm-accent:#ff6e83;
  --ccm-white:#ffffff;
  --ccm-black:#000000;

  max-width: 1400px;
  margin: 100px auto 0;
  padding-top: 34px;
  padding-bottom: 60px;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

/* ===== Header ===== */
.ccm-storie-archive__header{
  margin-bottom: 18px;
}

.ccm-storie-archive__title{
  margin: 0 0 16px;
  font-weight: 1000;
  line-height: 0.96;
  font-size: clamp(34px, 4.2vw, 60px);
  color: #111;
}

.ccm-storie-archive__pink{
  display: inline-block;
  color: var(--ccm-accent);
  font-weight: 1000;
}

/* ===== Filters (only pills) ===== */
.ccm-storie-archive__filters{
  display: block;
}

.ccm-storie-archive__pills{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: none;
  justify-content: flex-start;
}

.ccm-storie-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid var(--ccm-accent);
  color: #111;
  text-decoration: none;
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
  background: #fff;
}

.ccm-storie-pill.is-active{
  background: var(--ccm-accent);
  color: #fff;
}

.ccm-storie-archive__divider{
  border: 0;
  border-top: 1px solid rgba(255,110,131,0.55);
  margin: 18px 0 0;
}

/* ===== Page grid (content + sidebar) ===== */
.ccm-storie-archive__grid{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 26px;
  align-items: start;
  margin-top: 22px;
}

.ccm-storie-archive__sidebarBox{
  position: sticky;
  top: 24px;
}

.ccm-storie-archive__empty{
  padding: 18px 14px;
  border-radius: 14px;
  background: #f2f2f2;
  font-weight: 900;
}

/* ===== Cards layout (desktop tiles) ===== */
.ccm-storie-list__grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ccm-storie-tile{
  border-radius: 18px;
  overflow: hidden;
  background: #f2f2f2;
}

.ccm-storie-tile__link{
  display:block;
  text-decoration:none;
  color:inherit;
}

.ccm-storie-tile__media{
  position: relative;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: #e4e4e4;
}

.ccm-storie-tile__badge{
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.ccm-storie-tile__body{
  padding: 12px 12px 14px;
  background: #f2f2f2;
}

.ccm-storie-tile__title{
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.12;
  font-weight: 1000;
  color: #111;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.ccm-storie-tile__meta{
  font-size: 13px;
  font-weight: 800;
  color: rgba(0,0,0,0.72);
  margin-top: 6px;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ===== Mobile list ===== */
.ccm-storie-list__list{
  display: none; /* enabled on mobile */
}

.ccm-storie-row{
  border-top: 1px solid rgba(0,0,0,0.12);
}
.ccm-storie-row:last-child{
  border-bottom: 1px solid rgba(0,0,0,0.12);
}

.ccm-storie-row__link{
  display: flex;
  gap: 12px;
  padding: 12px 0;
  text-decoration: none;
  color: inherit;
  align-items: center;
}

.ccm-storie-row__thumb{
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,0.06);
}
.ccm-storie-row__thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}

.ccm-storie-row__body{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ccm-storie-row__title{
  font-size: 16px;
  font-weight: 1000;
  line-height: 1.08;
  color: #173b3b;
  text-transform: none;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.ccm-storie-row__meta{
  display:flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(0,0,0,0.72);
  line-height: 1.2;
}

.ccm-storie-row__date{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

/* ===== Breakpoints ===== */
@media (max-width: 980px){
  .ccm-storie-archive{
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .ccm-storie-archive__grid{
    grid-template-columns: 1fr;
  }

  .ccm-storie-archive__sidebarBox{
    position: static;
  }

  .ccm-storie-list__grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px){
  .ccm-storie-list__grid{ display:none; }
  .ccm-storie-list__list{ display:block; }
}