/* =====================================================
   CORSI PAGES – Stile unipegaso.it per CG Education
   ===================================================== */

/* ── HERO ── */
.cp-hero {
  background: linear-gradient(135deg, #2d0a14 0%, #155299 60%, #155299 100%);
  color: #fff;
  padding: 52px 0 44px;
  position: relative;
  overflow: hidden;
}
.cp-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1541339907198-e08756dedf3f?w=1400&q=60') center/cover no-repeat;
  opacity: .15;
}
.cp-hero-triennali::before { background-image: url('https://images.unsplash.com/photo-1541339907198-e08756dedf3f?w=1400&q=60'); }
.cp-hero-magistrali::before { background-image: url('https://images.unsplash.com/photo-1523050854058-8df90110c9f1?w=1400&q=60'); }
.cp-hero-master::before    { background-image: url('https://images.unsplash.com/photo-1434030216411-0b793f4b4173?w=1400&q=60'); }
.cp-hero-perf::before      { background-image: url('https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=1400&q=60'); }
.cp-hero-alta::before      { background-image: url('https://images.unsplash.com/photo-1487017159836-4e23ece2e4cf?w=1400&q=60'); }

.cp-hero .container { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.cp-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: rgba(255,255,255,.7);
  margin-bottom: 18px;
}
.cp-breadcrumb a { color: rgba(255,255,255,.7); text-decoration: none; }
.cp-breadcrumb a:hover { color: #fff; }
.cp-breadcrumb i { font-size: 10px; }

.cp-hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 900;
  margin-bottom: 14px;
  line-height: 1.1;
}
.cp-hero p {
  font-size: 17px;
  color: rgba(255,255,255,.85);
  max-width: 640px;
  line-height: 1.7;
  margin-bottom: 32px;
}
.cp-hero-stats {
  display: flex; gap: 32px; flex-wrap: wrap;
}
.cp-stat { display: flex; flex-direction: column; gap: 2px; }
.cp-stat strong { font-size: 28px; font-weight: 900; color: #fff; }
.cp-stat span   { font-size: 13px; color: rgba(255,255,255,.7); }

/* ── TABS ── */
.cp-tabs-bar {
  background: #fff;
  border-bottom: 2px solid #e5e7eb;
}
.cp-tabs-bar .container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.cp-tabs { display: flex; gap: 0; }
.cp-tab {
  padding: 16px 28px;
  border: none; background: none;
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 700;
  color: #6b7280; cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: all .2s;
}
.cp-tab:hover { color: #1E6FBF; }
.cp-tab.active { color: #1E6FBF; border-bottom-color: #1E6FBF; }

/* ── FILTRI BAR ── */
.cp-filters-bar {
  background: #f8fafc;
  border-bottom: 2px solid #e5e7eb;
  padding: 18px 0;
  position: sticky; top: 73px; z-index: 120;
}
.cp-filters-bar .container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.cp-filters { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }

.cp-filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cp-filter-group label { font-size: 13px; font-weight: 700; color: #374151; white-space: nowrap; }

.cp-filter-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-fbtn {
  padding: 7px 16px;
  border: 2px solid #e5e7eb; border-radius: 24px;
  background: #fff; font-size: 13px; font-weight: 600; color: #374151;
  cursor: pointer; transition: all .2s; font-family: 'Inter', sans-serif;
}
.cp-fbtn:hover { border-color: #1E6FBF; color: #1E6FBF; }
.cp-fbtn.active { background: #1E6FBF; border-color: #1E6FBF; color: #fff; box-shadow: 0 2px 8px rgba(192,22,44,.25); }

.cp-select {
  padding: 8px 14px; border: 2px solid #e5e7eb; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: #374151; background: #fff;
  cursor: pointer; outline: none; font-family: 'Inter', sans-serif;
}
.cp-select:focus { border-color: #1E6FBF; }

.cp-search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.cp-search-wrap i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: 14px; }
.cp-search {
  width: 100%; padding: 9px 14px 9px 36px;
  border: 2px solid #e5e7eb; border-radius: 8px;
  font-size: 14px; font-family: 'Inter', sans-serif;
  outline: none; transition: border-color .2s; box-sizing: border-box;
}
.cp-search:focus { border-color: #1E6FBF; }

.cp-results-count { font-size: 14px; color: #6b7280; font-weight: 500; }
.cp-results-count span { font-weight: 700; color: #1f2937; }

/* ══════════════════════════════════════════
   CARD PRINCIPALE (lauree + master con foto)
   ══════════════════════════════════════════ */
.cp-grid-section { padding: 40px 0 64px; }
.cp-grid-section .container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.cp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

/* ── CARD ── */
.cp-card {
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid #e5e7eb;
  overflow: hidden;
  transition: all .25s;
  display: flex; flex-direction: column;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.cp-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 48px rgba(0,0,0,.14);
  border-color: #d1d5db;
}
.cp-card.hidden { display: none; }

/* ── IMMAGINE ── */
.cp-card-img {
  height: 200px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #155299, #1E6FBF);
}
.cp-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s;
}
.cp-card:hover .cp-card-img img { transform: scale(1.06); }

/* Overlay scuro in basso per leggibilità badge */
.cp-card-img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.1) 0%, rgba(0,0,0,.45) 100%);
}

/* ── LOGO ATENEO – grande, in alto a sinistra sull'immagine ── */
.cp-card-logo {
  position: absolute;
  top: 12px; left: 12px; z-index: 3;
  background: rgba(255,255,255,.96);
  border-radius: 6px;
  padding: 7px 11px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  max-width: 150px;
}
.cp-card-logo img {
  height: 36px; width: auto; display: block; object-fit: contain;
  max-width: 130px;
}

/* ── BADGE CLASSE + AMBITO – in basso a sinistra sull'immagine ── */
.cp-card-badges-img {
  position: absolute;
  bottom: 12px; left: 14px; z-index: 3;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.cp-badge-img-classe {
  background: #fff;
  color: #111;
  font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .5px;
}
.cp-badge-img-ambito {
  background: #1E6FBF;
  color: #fff;
  font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .5px;
}
.cp-badge-img-ambito.mercatorum { background: #155299; }
.cp-badge-img-ambito.sanraffaele { background: #155299; }
.cp-badge-img-ambito.master1 { background: #1E6FBF; }
.cp-badge-img-ambito.master2 { background: #1E6FBF; }
.cp-badge-img-ambito.perf    { background: #b45309; }
.cp-badge-img-ambito.alta    { background: #155299; }

/* ── CORPO CARD ── */
.cp-card-body {
  padding: 20px 20px 16px;
  display: flex; flex-direction: column; gap: 12px;
  flex: 1;
}

.cp-card-body h3 {
  font-size: 17px; font-weight: 700; color: #111827; line-height: 1.35; margin: 0;
}

/* ── META 2 colonne ── */
.cp-card-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.cp-card-meta-grid span {
  font-size: 13px; color: #374151;
  display: flex; align-items: center; gap: 6px;
}
.cp-card-meta-grid i { color: #6b7280; font-size: 12px; width: 14px; flex-shrink: 0; }
.cp-card-meta-grid .cp-open-dot { color: #16a34a; }

/* ── BOTTONI ── */
.cp-card-actions {
  display: flex; gap: 10px; margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid #f3f4f6;
}
.cp-btn-primary {
  flex: 1;
  background: #1E6FBF; color: #fff;
  padding: 11px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 700;
  text-decoration: none; text-align: center;
  transition: all .2s; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 2px solid #1E6FBF;
}
.cp-btn-primary:hover { background: #B5184D; border-color: #B5184D; transform: translateY(-1px); }
.cp-btn-secondary {
  flex: 1;
  background: transparent; color: #374151;
  padding: 11px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  text-decoration: none; text-align: center;
  border: 2px solid #d1d5db;
  transition: all .2s; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.cp-btn-secondary:hover { border-color: #1E6FBF; color: #1E6FBF; }

/* Varianti colori per ateneo */
.cp-btn-primary.mercatorum  { background: #155299; border-color: #155299; }
.cp-btn-primary.mercatorum:hover { background: #72193A; border-color: #72193A; }
.cp-btn-primary.sanraffaele { background: #155299; border-color: #155299; }
.cp-btn-primary.sanraffaele:hover { background: #155299; border-color: #155299; }
.cp-btn-primary.master1  { background: #1E6FBF; border-color: #1E6FBF; }
.cp-btn-primary.master1:hover  { background: #155299; border-color: #155299; }
.cp-btn-primary.master2  { background: #1E6FBF; border-color: #1E6FBF; }
.cp-btn-primary.master2:hover  { background: #1E6FBF; border-color: #1E6FBF; }
.cp-btn-primary.perf     { background: #b45309; border-color: #b45309; }
.cp-btn-primary.perf:hover     { background: #92400e; border-color: #92400e; }
.cp-btn-primary.alta     { background: #155299; border-color: #155299; }
.cp-btn-primary.alta:hover     { background: #72193a; border-color: #72193a; }

/* Prezzo master */
.cp-card-price {
  font-size: 22px; font-weight: 900; color: #111827;
  margin-bottom: 2px;
}

/* ── NO RESULTS ── */
.cp-no-results {
  text-align: center; padding: 64px 20px; color: #6b7280;
}
.cp-no-results i { font-size: 48px; margin-bottom: 16px; opacity: .4; display: block; }
.cp-no-results p { font-size: 16px; margin-bottom: 20px; }
.cp-no-results button {
  background: #1E6FBF; color: #fff;
  border: none; padding: 10px 24px; border-radius: 8px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: 'Inter', sans-serif;
}

/* ── CTA BANNER ── */
.cp-cta-banner { background: linear-gradient(135deg, #155299, #1E6FBF); padding: 48px 0; }
.cp-cta-banner .container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.cp-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cp-cta-inner h2 { font-size: 26px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.cp-cta-inner p  { color: rgba(255,255,255,.85); font-size: 15px; }
.cp-cta-btns { display: flex; gap: 12px; flex-shrink: 0; flex-wrap: wrap; }
.cp-cta-btn-main {
  background: #fff; color: #155299;
  padding: 13px 26px; border-radius: 10px;
  font-size: 15px; font-weight: 800;
  text-decoration: none; transition: all .2s;
}
.cp-cta-btn-main:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.cp-cta-btn-sec {
  background: transparent; color: #fff;
  padding: 13px 22px; border-radius: 10px;
  border: 2px solid rgba(255,255,255,.6);
  font-size: 15px; font-weight: 700;
  text-decoration: none; display: flex; align-items: center; gap: 8px; transition: all .2s;
}
.cp-cta-btn-sec:hover { background: rgba(255,255,255,.1); border-color: #fff; }

/* Active link nel dropdown */
.dropdown a.active-link { background: #EAF3FB; color: #1E6FBF; font-weight: 700; }

/* Sezione titolo interno (Master I/II) */
.cp-section-title {
  font-size: 20px; font-weight: 800; color: #1f2937;
  margin-bottom: 20px; padding-top: 8px;
  display: flex; align-items: center; gap: 10px;
}
.cp-section-title i { font-size: 18px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .cp-filters { gap: 12px; }
  .cp-hero-stats { gap: 16px; }
  .cp-stat strong { font-size: 22px; }
  .cp-grid { grid-template-columns: 1fr; }
  .cp-cta-inner { flex-direction: column; text-align: center; }
  .cp-cta-btns { justify-content: center; }
  .cp-filters-bar { position: static; }
}
@media (max-width: 480px) {
  .cp-filter-group { flex-direction: column; align-items: flex-start; }
  .cp-search-wrap { min-width: 100%; max-width: 100%; }
  .cp-card-img { height: 170px; }
}

/* ══ SVG Icone stile Pegaso nelle pagine corsi ══ */
.cp-card-meta-grid span svg,
.cp-hero-icon svg {
  width: 14px; height: 14px;
  color: #1E6FBF;
  stroke: #1E6FBF;
  fill: none;
  flex-shrink: 0;
  vertical-align: middle;
}
.cp-btn-primary { background: #1E6FBF; border-color: #1E6FBF; }
.cp-btn-primary:hover { background: #B5184D; border-color: #B5184D; }
.cp-fbtn.active { background: #1E6FBF; border-color: #1E6FBF; }
.cp-tab.active { color: #1E6FBF; border-bottom-color: #1E6FBF; }
.cp-tab:hover  { color: #1E6FBF; }
.cp-badge-img-ambito { background: #1E6FBF; }

/* ============================================================
   CARD STILE PEGASO — Master / Perfezionamenti / Alta Formazione
   ============================================================ */

/* Card base stile Pegaso */
.pg-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  transition: box-shadow .2s, transform .2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.pg-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,.14);
  transform: translateY(-3px);
}

/* Immagine */
.pg-card-img {
  position: relative;
  height: 200px;
  overflow: hidden;
  flex-shrink: 0;
}
.pg-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.pg-card:hover .pg-card-img img {
  transform: scale(1.04);
}

/* Logo ateneo sull'immagine */
.pg-card-logo {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  background: rgba(255,255,255,.96);
  border-radius: 6px;
  padding: 7px 11px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  max-width: 150px;
}
.pg-card-logo img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
  max-width: 130px;
}
.pg-card-logo img.logo-pegaso { height: 78px; } /* solo per pg-cards, non cp-cards */

/* Badge tipo corso sull'immagine */
.pg-card-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 3;
  background: #fff;
  color: #1E6FBF;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .6px;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  border: 1.5px solid #1E6FBF;
}
.pg-card-badge.master    { color: #155299; border-color: #155299; }
.pg-card-badge.altaform  { color: #155299; border-color: #155299; }
.pg-card-badge.mercatorum { color: #155299; border-color: #155299; }
.pg-card-badge.sanraffaele { color: #155299; border-color: #155299; }

/* Body */
.pg-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.pg-card-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.4;
}

/* Metadati griglia 2 colonne stile Pegaso */
.pg-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  margin-top: 4px;
}
.pg-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}
.pg-meta-item i {
  font-size: 13px;
  color: #9ca3af;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}
.pg-meta-item.full {
  grid-column: 1 / -1;
}
.pg-meta-open {
  color: #16a34a !important;
  font-weight: 600;
}
.pg-meta-open i {
  color: #16a34a !important;
}

/* Prezzo */
.pg-card-price {
  font-size: 15px;
  font-weight: 700;
  color: #1E6FBF;
  margin-top: 2px;
}

/* Link "Scopri il corso" */
.pg-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #1E6FBF;
  text-decoration: none;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}
.pg-card-link:hover { color: #155299; }
.pg-card-link i { font-size: 12px; transition: transform .2s; }
.pg-card-link:hover i { transform: translateX(4px); }

/* Varianti colore link per ateneo */
.pg-card[data-ateneo="mercatorum"] .pg-card-link { color: #155299; }
.pg-card[data-ateneo="sanraffaele"] .pg-card-link { color: #155299; }

/* Grid container (riusa cp-grid) */

/* Badge varianti ateneo per pg-card */
.pg-card-badge.master2        { color: #155299; border-color: #155299; }
.pg-card-badge.mercatorum     { color: #155299; border-color: #155299; background: #fff; }
.pg-card-badge.sanraffaele    { color: #155299; border-color: #155299; background: #fff; }
.pg-card[data-ateneo="mercatorum"] .pg-card-price { color: #155299; }
.pg-card[data-ateneo="mercatorum"] .pg-card-link  { color: #155299; }
.pg-card[data-ateneo="sanraffaele"] .pg-card-price { color: #155299; }
.pg-card[data-ateneo="sanraffaele"] .pg-card-link  { color: #155299; }

/* Override: logo Pegaso dentro cp-card-logo deve rispettare height:36px */
.cp-card-logo img { height: 36px !important; width: auto !important; max-width: 130px !important; }
