/* =================================================================
   Widget frontend styles — used by the widget preview route today
   and by the public site templates once they exist. Uses the same
   CSS variables theme.css publishes, so widgets automatically match
   whatever colors/fonts are set in Appearance → Design.
   ================================================================= */

.widget-empty { color: #6b7280; font-size: 13px; font-style: italic; }
.widget-more-link { display: inline-block; margin-top: 12px; font-weight: 600; color: var(--eduplus-link, #4f46e5); }

/* Course / Post grids */
.widget-course-grid, .widget-post-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px;
}
.widget-course-slider { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.widget-course-slider .course-card { min-width: 220px; scroll-snap-align: start; }

.course-card, .post-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; overflow: hidden;
}
.course-thumb img, .post-thumb img { width: 100%; height: 130px; object-fit: cover; display: block; background: #f1f5f9; }
.course-title, .post-title { font-size: 15px; margin: 12px 12px 4px; color: var(--eduplus-course-title, #111); }
.post-title { color: var(--eduplus-post-title, #111); }
.course-meta { display: flex; justify-content: space-between; padding: 0 12px 12px; font-size: 12px; color: #6b7280; }
.post-excerpt { padding: 0 12px 14px; font-size: 12.5px; color: #6b7280; line-height: 1.5; }

/* Image widget */
.widget-image img { max-width: 100%; border-radius: 12px; }
.widget-image figcaption { margin-top: 8px; font-size: 13px; color: #6b7280; text-align: center; }

/* Button widget */
.widget-button { display: flex; }
.widget-button.align-center { justify-content: center; }
.widget-button.align-right { justify-content: flex-end; }
.eduplus-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px;
    border-radius: 8px; font-weight: 600; text-decoration: none; font-size: 14px;
}
.eduplus-btn.size-sm { padding: 8px 14px; font-size: 12.5px; }
.eduplus-btn.size-lg { padding: 16px 30px; font-size: 16px; }

/* Block widget (row/columns container) */
.widget-block { flex-wrap: wrap; }
.widget-block-col { min-width: 0; }

/* =================================================================
   EduPlus Media Player — custom control bar over a YouTube IFrame
   ================================================================= */
.eduplus-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}
.eduplus-player[data-ratio="4:3"] { aspect-ratio: 4 / 3; }
.eduplus-player[data-ratio="1:1"] { aspect-ratio: 1 / 1; }

.eduplus-player-frame, .eduplus-player-frame iframe {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

.eduplus-player-controls {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
    color: #fff;
}
.eduplus-player-controls button {
    background: none; border: none; color: #fff; cursor: pointer; font-size: 15px;
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    border-radius: 6px; transition: background 0.15s ease;
}
.eduplus-player-controls button:hover { background: rgba(255,255,255,0.15); }

.epc-progress { flex: 1; height: 5px; background: rgba(255,255,255,0.25); border-radius: 999px; cursor: pointer; position: relative; }
.epc-progress-bar { height: 100%; width: 0%; background: #4f46e5; border-radius: 999px; }
.epc-time { font-size: 11.5px; white-space: nowrap; opacity: 0.9; }
.epc-volume { width: 70px; accent-color: #4f46e5; }
.epc-speed { background: rgba(255,255,255,0.12); color: #fff; border: none; border-radius: 6px; font-size: 11.5px; padding: 4px 6px; }
.epc-speed option { color: #111; }

@media (max-width: 480px) {
    .eduplus-player-controls { flex-wrap: wrap; gap: 6px; padding: 8px; }
    .epc-volume { display: none; }
}
