/* ==========================================================================
   CERTIFICATES & DIPLOMAS - PARCHMENT & FORMAL STYLING ("GRAMOTE")
   Official Academic & Quality Seals for Dr. Matteo Moretti & OSTEO NOVA
   ========================================================================== */

.certificates-hero {
  background: linear-gradient(135deg, var(--primary-navy-dark), var(--primary-navy));
  color: #fff;
  padding: 4rem 0 3rem 0;
  text-align: center;
}

.certificates-hero h1 {
  color: #fff;
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.certificates-hero p {
  color: #cbd5e1;
  max-width: 680px;
  margin: 0 auto;
}

.certificates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  margin-top: 3rem;
  align-items: stretch;
}

/* Formal Diploma / Gramota Card */
.diploma-card {
  position: relative;
  background: #fdfbf7; /* Ivory Parchment */
  background-image: radial-gradient(#efe7d5 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: 6px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 15px 35px rgba(14, 32, 56, 0.12), inset 0 0 40px rgba(197, 143, 68, 0.08);
  border: 1px solid #d4c3a3;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-sizing: border-box;
}

.diploma-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgba(14, 32, 56, 0.18), inset 0 0 50px rgba(197, 143, 68, 0.12);
}

/* Ornate Double Border Frame */
.diploma-card::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 3px double #b8823b;
  pointer-events: none;
  border-radius: 4px;
}

.diploma-card::after {
  content: '';
  position: absolute;
  top: 17px;
  left: 17px;
  right: 17px;
  bottom: 17px;
  border: 1px solid rgba(184, 130, 59, 0.4);
  pointer-events: none;
}

/* Ornate Corner Elements */
.corner-ornament {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2px solid var(--accent-copper);
  pointer-events: none;
  z-index: 2;
}

.corner-top-left {
  top: 14px;
  left: 14px;
  border-right: none;
  border-bottom: none;
}

.corner-top-right {
  top: 14px;
  right: 14px;
  border-left: none;
  border-bottom: none;
}

.corner-bottom-left {
  bottom: 14px;
  left: 14px;
  border-right: none;
  border-top: none;
}

.corner-bottom-right {
  bottom: 14px;
  right: 14px;
  border-left: none;
  border-top: none;
}

/* Diploma Inner Content */
.diploma-header {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.diploma-republic-text {
  font-family: var(--font-diploma);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: #785a2b;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  min-height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diploma-crest {
  width: 58px;
  height: 58px;
  margin: 0 auto 0.75rem auto;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1));
}

.diploma-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--primary-navy-dark);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
}

.diploma-subtitle {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: #8c6d3b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diploma-divider {
  width: 90px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #b8823b, transparent);
  margin: 0.85rem auto 1.25rem auto;
}

.diploma-body {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: #2c3e50;
  line-height: 1.65;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.diploma-recipient {
  display: block;
  font-family: var(--font-diploma);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-navy);
  margin: 0.75rem 0;
  letter-spacing: 0.05em;
}

.diploma-details-box {
  background: rgba(184, 130, 59, 0.06);
  border: 1px dashed rgba(184, 130, 59, 0.35);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-top: auto;
  margin-bottom: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  text-align: left;
}

.diploma-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
}

.diploma-detail-row strong {
  color: var(--primary-navy);
}

/* Diploma Footer (Seals & Signatures) */
.diploma-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(184, 130, 59, 0.25);
  position: relative;
  z-index: 1;
}

.diploma-sign {
  text-align: center;
  flex: 1;
  max-width: 140px;
}

.sign-cursive {
  font-family: 'Playfair Display', cursive, serif;
  font-style: italic;
  font-size: 1.25rem;
  color: #1a365d;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sign-label {
  font-size: 0.75rem;
  color: #64748b;
  border-top: 1px solid #94a3b8;
  padding-top: 2px;
  margin-top: 4px;
  font-family: var(--font-sans);
}

/* Wax Seal / Golden Stamp */
.diploma-seal-wrap {
  position: relative;
}

.gold-seal {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b 70%, #8b6508);
  border: 3px solid #ffe44d;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25), inset 0 2px 4px rgba(255,255,255,0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #3d2600;
  font-family: var(--font-diploma);
  font-weight: 800;
  text-align: center;
  position: relative;
}

.gold-seal-text {
  font-size: 0.55rem;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gold-seal-star {
  font-size: 0.75rem;
  margin-bottom: 1px;
}

.ribbon-decor {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 18px;
  background: #a81c1c;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
  z-index: -1;
}

/* Click to enlarge cue */
.diploma-enlarge-hint {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-copper);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.85);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  z-index: 3;
}

/* Lightbox Modal */
.certificate-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 20, 36, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.certificate-modal.active {
  display: flex;
}

.modal-content-wrap {
  position: relative;
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 40px;
  height: 40px;
  background: var(--accent-copper);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: bold;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

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

@media (max-width: 576px) {
  .diploma-card {
    padding: 2rem 1.25rem 1.5rem 1.25rem;
  }
  .diploma-title {
    font-size: 1.35rem;
  }
  .diploma-footer {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }
  .diploma-seal-wrap {
    order: -1;
    margin-bottom: 0.5rem;
  }
  .modal-close-btn {
    top: 5px;
    right: 5px;
  }
  .certificate-modal {
    padding: 0.75rem;
  }
}
