/* ═══════════════════════════════════════════════════════════════
   Parent Hub — Quick Links + School Calendar
   Used on: dashboard.php (edit mode) + school.php (public view)
═══════════════════════════════════════════════════════════════ */

/* ── Dashboard: hub section container ─────────────────────── */
.lrn-hub-section {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.lrn-hub-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* ── Add form ──────────────────────────────────────────────── */
.lrn-hub-form-wrap {
  margin-bottom: 1.25rem;
}
.lrn-hub-form {
  background: #faf5ff;
  border: 1.5px solid #e9d5ff;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
}
.lrn-hub-form-title {
  font-size: .9rem;
  font-weight: 800;
  color: #6d28d9;
  margin: 0 0 .9rem;
}
.lrn-hub-form-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.lrn-hub-field {
  display: flex;
  flex-direction: column;
  gap: .28rem;
  flex: 1;
  min-width: 0;
  margin-bottom: .6rem;
}
.lrn-hub-label {
  font-size: .75rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.lrn-hub-input {
  padding: .5rem .75rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font: inherit;
  font-size: .88rem;
  color: #1f2937;
  background: #fff;
  transition: border-color .13s;
  width: 100%;
  box-sizing: border-box;
}
.lrn-hub-input:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
.lrn-hub-input--icon { max-width: 4rem; text-align: center; font-size: 1.2rem; }
.lrn-hub-hint {
  font-size: .75rem;
  color: #9ca3af;
  margin-top: .15rem;
}
.lrn-hub-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-bottom: .2rem;
}
.lrn-hub-radio {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
}
.lrn-hub-form-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid #e9d5ff;
}
.lrn-hub-save-status {
  font-size: .82rem;
  font-weight: 700;
}

/* ── Empty state ───────────────────────────────────────────── */
.lrn-hub-empty {
  font-size: .85rem;
  color: #9ca3af;
  font-style: italic;
  padding: .5rem 0;
  margin: 0;
}

/* ── Visibility badge ─────────────────────────────────────── */
.lrn-hub-vis-badge {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .68rem;
  font-weight: 700;
  padding: .12rem .4rem;
  border-radius: 4px;
}
.lrn-hub-vis-badge--private { background: #f3f4f6; color: #6b7280; }
.lrn-hub-vis-badge--class   { background: #ede9fe; color: #6d28d9; }
.lrn-hub-vis-badge--school  { background: #d1fae5; color: #065f46; }

/* ── Icon action buttons ───────────────────────────────────── */
.lrn-hub-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: .25rem .3rem;
  border-radius: 6px;
  opacity: .55;
  transition: opacity .13s, background .13s;
  line-height: 1;
}
.lrn-hub-icon-btn:hover { opacity: 1; background: #f3f4f6; }
.lrn-hub-icon-btn--del:hover { background: #fee2e2; }

/* ════════════════════════════
   LINKS — dashboard
════════════════════════════ */
.lrn-hub-link-grid {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.lrn-hub-link-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .85rem;
  border: 1.5px solid #f3f4f6;
  border-radius: 10px;
  background: #fafafa;
  transition: border-color .13s;
}
.lrn-hub-link-card:hover { border-color: #e9d5ff; }
.lrn-hub-link-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  width: 2rem;
  text-align: center;
}
.lrn-hub-link-body { flex: 1; min-width: 0; }
.lrn-hub-link-title {
  font-weight: 700;
  font-size: .9rem;
  color: #1f2937;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lrn-hub-link-title:hover { color: #7c3aed; text-decoration: underline; }
.lrn-hub-link-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  font-size: .72rem;
  color: #9ca3af;
  margin-top: .1rem;
}
.lrn-hub-link-actions {
  display: flex;
  gap: .1rem;
  flex-shrink: 0;
}

/* ════════════════════════════
   EVENTS — dashboard
════════════════════════════ */
.lrn-hub-event-list { display: flex; flex-direction: column; gap: .45rem; }

.lrn-hub-event-card {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .75rem .85rem;
  border: 1.5px solid #f3f4f6;
  border-radius: 12px;
  background: #fafafa;
  border-left: 3px solid var(--type-color, #7c3aed);
  transition: border-color .13s;
}
.lrn-hub-event-card:hover { background: #fff; border-color: #e9d5ff; border-left-color: var(--type-color, #7c3aed); }
.lrn-hub-event-card--past { opacity: .55; }

.lrn-hub-event-date-block {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--type-color, #7c3aed);
  border-radius: 10px;
  color: #fff;
}
.lrn-hub-event-month { font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; line-height: 1; opacity: .85; }
.lrn-hub-event-day   { font-size: 1.2rem; font-weight: 900; line-height: 1; }

.lrn-hub-event-body  { flex: 1; min-width: 0; }
.lrn-hub-event-title {
  font-size: .9rem;
  font-weight: 700;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.lrn-hub-event-type-icon { font-size: .95rem; flex-shrink: 0; }
.lrn-hub-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  font-size: .72rem;
  color: #9ca3af;
  margin-top: .2rem;
  align-items: center;
}
.lrn-hub-event-desc { font-size: .78rem; color: #6b7280; margin-top: .2rem; }

.lrn-hub-days-left {
  font-size: .72rem;
  font-weight: 800;
  padding: .1rem .45rem;
  border-radius: 99px;
  background: #ede9fe;
  color: #6d28d9;
}
.lrn-hub-days-left--urgent { background: #fee2e2; color: #b91c1c; }

.lrn-hub-past-toggle {
  margin-top: .5rem;
  font-size: .82rem;
  color: #9ca3af;
  cursor: pointer;
}
.lrn-hub-past-toggle summary { padding: .4rem 0; font-weight: 700; cursor: pointer; }

/* ════════════════════════════
   LINKS — public school hub
════════════════════════════ */
.sd-hub-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .6rem;
}
.sd-hub-link-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .9rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 99px;
  background: #f9fafb;
  text-decoration: none;
  color: #1f2937;
  font-size: .85rem;
  font-weight: 600;
  transition: background .12s, border-color .12s;
}
.sd-hub-link-pill:hover { background: #ede9fe; border-color: #c4b5fd; color: #6d28d9; }
.sd-hub-link-pill-icon  { font-size: 1.05rem; }
.sd-hub-link-pill-scope {
  font-size: .68rem;
  color: #9ca3af;
  font-weight: 500;
  margin-left: .1rem;
}
.sd-hub-resource-note {
  font-size: .72rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-top: .25rem;
}

/* ════════════════════════════
   EVENTS — public school hub
════════════════════════════ */
.sd-hub-event-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}
.sd-hub-event-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .7rem .85rem;
  border: 1.5px solid #f3f4f6;
  border-radius: 10px;
  background: #fafafa;
  border-left: 3px solid var(--type-color, #6b7280);
  min-width: 0;
}
.sd-hub-event-date-col {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 2.4rem;
  background: var(--type-color, #6b7280);
  border-radius: 8px;
  color: #fff;
  padding: .25rem .1rem;
}
.sd-hub-event-m { font-size: .55rem; font-weight: 800; text-transform: uppercase; opacity: .85; }
.sd-hub-event-d { font-size: 1.1rem; font-weight: 900; line-height: 1; }

.sd-hub-event-info {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  min-width: 0;
}
.sd-hub-event-icon  { font-size: .95rem; flex-shrink: 0; margin-top: .08rem; }
.sd-hub-event-name  { font-weight: 700; font-size: .88rem; color: #1f2937; }
.sd-hub-event-when  { font-size: .74rem; color: #6d28d9; font-weight: 800; margin-top: .1rem; }
.sd-hub-event-scope { font-size: .72rem; color: #9ca3af; margin-top: .1rem; }
.sd-hub-event-desc-pub { font-size: .78rem; color: #6b7280; margin-top: .15rem; }
.sd-hub-event-countdown {
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 800;
  padding: .2rem .5rem;
  border-radius: 99px;
  background: #ede9fe;
  color: #6d28d9;
  align-self: center;
}
.sd-hub-event-countdown--soon { background: #fee2e2; color: #b91c1c; }

/* ════════════════════════════
   IMAGE UPLOAD — form (dashboard)
════════════════════════════ */
.lrn-hub-img-upload-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.lrn-hub-img-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border: 1.5px dashed #c4b5fd;
  border-radius: 8px;
  background: #faf5ff;
  color: #7c3aed;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .13s, border-color .13s;
  font-family: inherit;
}
.lrn-hub-img-pick-btn:hover  { background: #ede9fe; border-color: #7c3aed; }
.lrn-hub-img-pick-btn:focus  { outline: 2px solid #7c3aed; outline-offset: 2px; }
.lrn-hub-img-upload-status {
  font-size: .8rem;
  font-weight: 700;
  display: inline-block;
  padding: .25rem .5rem;
  border-radius: 6px;
  min-width: 2rem;
}

.lrn-hub-img-preview-frame {
  position: relative;
  display: inline-block;
}
.lrn-hub-img-preview-frame img {
  display: block;
  width: 100%;
  max-width: 360px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1.5px solid #e5e7eb;
}
.lrn-hub-img-remove-btn {
  position: absolute;
  top: .35rem;
  right: .35rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .13s;
}
.lrn-hub-img-remove-btn:hover { background: #dc2626; }

.lrn-hub-shared-badge {
  display: inline-flex;
  align-items: center;
  padding: .18rem .42rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
}
.lrn-hub-hide-btn {
  border: 1px solid #d1d5db;
  border-radius: 7px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  font: inherit;
  font-size: .7rem;
  font-weight: 800;
  padding: .24rem .45rem;
}
.lrn-hub-hide-btn:hover { border-color: #9ca3af; color: #374151; }

/* ════════════════════════════
   EVENT CARD — with image (dashboard)
════════════════════════════ */
.lrn-hub-event-card--has-img {
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  align-items: stretch;
}
.lrn-hub-event-img-thumb {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border-radius: 0; /* card already has border-radius */
}
.lrn-hub-event-card--has-img .lrn-hub-event-body {
  padding: .75rem .85rem;
}
.lrn-hub-event-card--has-img .lrn-hub-link-actions {
  padding: 0 .85rem .65rem;
  justify-content: flex-end;
}
.lrn-hub-event-img-date {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 800;
  color: var(--type-color, #7c3aed);
  margin-bottom: .25rem;
}

/* ════════════════════════════
   EVENT ROW — with image (school hub)
════════════════════════════ */
.sd-hub-event-row--has-img {
  padding: 0;
  overflow: hidden;
  flex-direction: column;
  gap: 0;
}
.sd-hub-event-img-col {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  background-color: #f8fafc;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  position: relative;
}
.sd-hub-event-img-date-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  padding: .75rem .75rem .35rem;
}
.sd-hub-event-row--has-img .sd-hub-event-info {
  padding: .65rem .75rem;
}
.sd-hub-event-row--has-img .sd-hub-event-countdown {
  margin: 0 .75rem .65rem;
  align-self: flex-start;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sd-hub-event-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .sd-hub-event-strip { grid-template-columns: minmax(0, 1fr); }
  .lrn-hub-form-row { flex-direction: column; }
  .lrn-hub-section  { padding: 1rem; }
  .lrn-hub-link-card { gap: .5rem; }
  .lrn-hub-event-card { gap: .5rem; }
  .lrn-hub-img-preview-frame img { max-width: 100%; height: 120px; }
}
