/* Protected page viewer — /p/<slug>. Also styles the /protected-pages listing
   and reuses site chrome from calendar.css for the header. */

.pp-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--color-ink, #1F2A37);
}

.pp-container {
  max-width: 480px;
  margin: 0 auto;
}

.pp-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  border: 1px solid #E5E7EB;
}

.pp-loading {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}
.pp-spinner {
  width: 32px; height: 32px;
  border: 3px solid #E5E7EB;
  border-top-color: var(--color-blue, #1B4B8A);
  border-radius: 50%;
  animation: pp-spin 0.9s linear infinite;
  margin: 0 auto 16px;
}
@keyframes pp-spin { to { transform: rotate(360deg); } }

.pp-header {
  padding: 28px 32px 20px;
  text-align: center;
  border-bottom: 1px solid #F3F4F6;
}
.pp-lock {
  font-size: 40px;
  color: var(--color-blue, #1B4B8A);
  margin-bottom: 8px;
}
.pp-header h1 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--color-blue, #1B4B8A);
  font-weight: 600;
}
.pp-desc {
  color: #4b5563;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 8px;
}
.pp-meta {
  font-size: 12px;
  color: #6b7280;
  margin: 8px 0 0;
}

.pp-form {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pp-form label {
  display: block;
}
.pp-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.pp-form input,
.pp-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.pp-form input:focus,
.pp-form textarea:focus {
  outline: none;
  border-color: var(--color-blue, #1B4B8A);
  box-shadow: 0 0 0 3px rgba(27, 75, 138, 0.12);
}

.pp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: inherit;
}
.pp-btn-primary {
  background: var(--color-blue, #1B4B8A);
  color: #fff;
}
.pp-btn-primary:hover { background: #143867; }
.pp-btn-primary:disabled { opacity: 0.6; cursor: wait; }
.pp-btn-ghost {
  background: #fff;
  color: var(--color-blue, #1B4B8A);
  border-color: #D1D5DB;
}
.pp-btn-ghost:hover { background: #F9FAFB; }
.pp-btn-sm { padding: 6px 12px; font-size: 13px; }

.pp-error {
  padding: 10px 14px;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
  border-radius: 6px;
  font-size: 13px;
  text-align: left;
}

.pp-footer {
  padding: 16px 32px 24px;
  background: #FAFAFA;
  text-align: center;
  border-top: 1px solid #F3F4F6;
}
.pp-footer p {
  margin: 0 0 10px;
  font-size: 13px;
  color: #6b7280;
}

/* Unlocked state — the destination iframe with a top bar */
.pp-unlock-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--color-blue, #1B4B8A);
  color: #fff;
  gap: 12px;
  flex-wrap: wrap;
}
.pp-unlock-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #059669;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pp-unlock-actions { display: flex; gap: 6px; }
.pp-unlock-actions .pp-btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}
.pp-unlock-actions .pp-btn-ghost:hover { background: rgba(255,255,255,0.15); }

/* When unlocked, expand the card to fill the viewport */
.pp-card:has(.pp-unlock-bar) {
  max-width: none;
  height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
}
.pp-container:has(.pp-unlock-bar) { max-width: 1400px; }
.pp-frame { flex: 1; width: 100%; border: none; background: #fff; min-height: 500px; }

.pp-fallback {
  padding: 40px 32px;
  text-align: center;
  background: #FFFBEB;
  border-top: 1px solid #FCD34D;
}
.pp-fallback p { color: #78350F; font-size: 14px; margin: 0 0 12px; }

/* Protected pages listing at /protected-pages */
.pp-list-main { max-width: 1000px; margin: 0 auto; padding: 40px 20px 60px; }
.pp-list-header { margin-bottom: 24px; }
.pp-list-header h1 { margin: 0 0 8px; color: var(--color-blue, #1B4B8A); font-size: 26px; }
.pp-list-header p { color: #4b5563; margin: 0; }
.pp-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.pp-list-card {
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-left: 4px solid var(--color-gold, #C9A227);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, transform .15s;
  display: block;
}
.pp-list-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  transform: translateY(-1px);
  border-left-color: var(--color-blue, #1B4B8A);
}
.pp-list-card-lock {
  display: inline-block;
  color: var(--color-blue, #1B4B8A);
  margin-right: 6px;
}
.pp-list-card h3 { margin: 0 0 6px; font-size: 15px; color: #1F2A37; font-weight: 600; }
.pp-list-card-desc { font-size: 13px; color: #4b5563; margin: 0 0 10px; line-height: 1.4; }
.pp-list-card-meta { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; }
.pp-list-empty { padding: 60px 20px; text-align: center; color: #9CA3AF; }

/* Protected Pages inside the Quick Links accordion — the "See all" row gets
   a subtle separator and italic style so it doesn't blend into a real link. */
.link-list li.pp-see-all a {
  font-style: italic;
  color: var(--blue, #1B4B8A);
  border-top: 1px dashed #E5E7EB;
  padding-top: 12px !important;
  margin-top: 4px;
}
.link-list li.pp-injected .ll-label {
  /* Slight visual hint that these came from the protected pages system */
  font-weight: 500;
}
