/*
Theme Name:   WP Learn LMS Theme
Theme URI:    https://example.com/
Description:  A clean, fast theme built for the WP Learn LMS plugin. It picks up the colors, font and logo you set in the plugin's Theme Settings, and lays out courses, lessons, quizzes, the student dashboard, cart and login pages without extra setup.
Author:       WP Learn
Version: 1.1.2
Requires at least: 5.8
Requires PHP: 7.4
License:      GPL-2.0-or-later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  wp-learn-theme
Tags:         education, e-learning, one-column, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, accessibility-ready
*/

:root {
	--wpllms-primary: #D97757;
	--wpllms-bg: #f6f7f7;
	--wpllms-heading: #1d2327;
	--wpllms-button: #D97757;
	--wpllms-link: #D97757;
	--wpllms-font: 'Lexend';
	--wpt-text: #3c434a;
	--wpt-muted: #6b7280;
	--wpt-surface: #ffffff;
	--wpt-border: #e3e5e8;
	--wpt-radius: 12px;
	--wpt-max: 1120px;
	--wpt-narrow: 760px;
	--wpt-shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--wpllms-bg);
	color: var(--wpt-text);
	font-family: var(--wpllms-font), system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}
img, video, iframe, svg { max-width: 100%; height: auto; }
a { color: var(--wpllms-link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4, h5, h6 { color: var(--wpllms-heading); line-height: 1.25; margin: 1.6em 0 .6em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-top: 0; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.2em; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100000; clip: auto; width: auto; height: auto; background: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--wpt-shadow); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--wpllms-primary) 60%, white); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.wpt-btn, .button, button.button, input[type=submit], .wp-block-button__link {
	display: inline-block; cursor: pointer; border: 0; border-radius: 10px;
	background: var(--wpllms-button); color: #fff !important; text-decoration: none;
	padding: .65em 1.3em; font: inherit; font-weight: 600; line-height: 1.3;
	transition: transform .12s ease, filter .12s ease;
}
.wpt-btn:hover, .button:hover, input[type=submit]:hover { filter: brightness(.93); transform: translateY(-1px); }
.wpt-btn-ghost { background: transparent; color: var(--wpllms-heading) !important; box-shadow: inset 0 0 0 2px var(--wpt-border); }

/* ---------- Forms ---------- */
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=number], textarea, select {
	width: 100%; max-width: 100%; font: inherit; color: inherit; background: var(--wpt-surface);
	border: 1.5px solid var(--wpt-border); border-radius: 10px; padding: .65em .9em;
}
input:focus, textarea:focus, select:focus { border-color: var(--wpllms-primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--wpllms-primary) 22%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--wpllms-primary); }

/* ---------- Header ---------- */
.wpt-header { position: sticky; top: 0; z-index: 50; background: var(--wpt-surface); border-bottom: 1px solid var(--wpt-border); }
.admin-bar .wpt-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .wpt-header { top: 46px; } }
.wpt-header-inner { max-width: var(--wpt-max); margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 24px; }
.wpt-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--wpllms-heading); font-weight: 800; font-size: 1.3rem; }
.wpt-brand img { max-height: 44px; width: auto; display: block; }
.wpt-nav { flex: 1; }
.wpt-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.wpt-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--wpllms-heading); text-decoration: none; font-weight: 500; }
.wpt-nav a:hover, .wpt-nav .current-menu-item > a, .wpt-nav .current_page_item > a { background: color-mix(in srgb, var(--wpllms-primary) 12%, transparent); color: var(--wpllms-primary); }
.wpt-nav .sub-menu { display: none; position: absolute; background: var(--wpt-surface); border: 1px solid var(--wpt-border); border-radius: 10px; box-shadow: var(--wpt-shadow); padding: 6px; min-width: 200px; flex-direction: column; }
.wpt-nav li { position: relative; }
.wpt-nav li:hover > .sub-menu, .wpt-nav li:focus-within > .sub-menu { display: flex; }
.wpt-auth { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wpt-auth a { text-decoration: none; font-weight: 500; color: var(--wpllms-heading); padding: 8px 10px; border-radius: 8px; }
.wpt-auth a.wpt-btn { color: #fff; }
.wpt-auth a:hover { background: color-mix(in srgb, var(--wpllms-primary) 10%, transparent); }
.wpt-cart-count { display: inline-block; min-width: 20px; text-align: center; background: var(--wpllms-primary); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 6px; margin-left: 4px; }
.wpt-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; }
.wpt-toggle span { display: block; width: 24px; height: 2px; background: var(--wpllms-heading); margin: 5px 0; transition: transform .2s; }
@media (max-width: 860px) {
	.wpt-toggle { display: block; }
	.wpt-collapsible { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--wpt-surface); border-bottom: 1px solid var(--wpt-border); padding: 12px 20px 20px; flex-direction: column; gap: 12px; }
	.wpt-collapsible.is-open { display: flex; }
	.wpt-nav ul { flex-direction: column; }
	.wpt-nav .sub-menu { display: flex; position: static; border: 0; box-shadow: none; padding-left: 14px; }
	.wpt-header-inner { flex-wrap: wrap; position: relative; }
}

/* ---------- Layout ---------- */
.wpt-main { min-height: 60vh; }
.wpt-container { max-width: var(--wpt-max); margin: 0 auto; padding: 40px 20px; }
.wpt-narrow { max-width: var(--wpt-narrow); margin: 0 auto; padding: 40px 20px; }
.wpt-card { background: var(--wpt-surface); border: 1px solid var(--wpt-border); border-radius: var(--wpt-radius); box-shadow: var(--wpt-shadow); padding: clamp(20px, 4vw, 40px); }
.wpt-entry-title { margin-bottom: .4em; }
.wpt-meta { color: var(--wpt-muted); font-size: .9rem; margin-bottom: 1.4em; }
.wpt-thumb { border-radius: var(--wpt-radius); overflow: hidden; margin-bottom: 1.6em; }
.wpt-thumb img { display: block; width: 100%; }
.wpt-entry-content > *:first-child { margin-top: 0; }
.wpt-entry-content blockquote { margin: 1.5em 0; padding: .4em 1.2em; border-left: 4px solid var(--wpllms-primary); background: color-mix(in srgb, var(--wpllms-primary) 7%, transparent); border-radius: 0 10px 10px 0; }
.wpt-entry-content pre, .wpt-entry-content code { background: #0f172a; color: #e2e8f0; border-radius: 8px; }
.wpt-entry-content code { padding: .15em .4em; font-size: .9em; }
.wpt-entry-content pre { padding: 16px; overflow: auto; }
.wpt-entry-content pre code { background: none; padding: 0; }
.wpt-entry-content table { border-collapse: collapse; width: 100%; margin-bottom: 1.5em; }
.wpt-entry-content th, .wpt-entry-content td { border: 1px solid var(--wpt-border); padding: 10px 12px; text-align: left; }
.alignwide { max-width: var(--wpt-max); }
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { color: var(--wpt-muted); font-size: .88rem; text-align: center; }

/* ---------- Hero (front page) ---------- */
.wpt-hero { background: linear-gradient(135deg, color-mix(in srgb, var(--wpllms-primary) 14%, var(--wpt-surface)), var(--wpt-surface)); border-bottom: 1px solid var(--wpt-border); }
.wpt-hero-inner { max-width: var(--wpt-max); margin: 0 auto; padding: clamp(48px, 9vw, 110px) 20px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.wpt-hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); letter-spacing: -.02em; }
.wpt-hero p.lead { font-size: 1.2rem; color: var(--wpt-muted); max-width: 34em; }
.wpt-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1.6em; }
.wpt-hero-img img { border-radius: 20px; box-shadow: var(--wpt-shadow); display: block; width: 100%; }
@media (max-width: 860px) { .wpt-hero-inner { grid-template-columns: 1fr; } }
.wpt-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.wpt-section-head h2 { margin: 0; }

/* ---------- Post lists ---------- */
.wpt-post-list { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.wpt-post-card { background: var(--wpt-surface); border: 1px solid var(--wpt-border); border-radius: var(--wpt-radius); overflow: hidden; box-shadow: var(--wpt-shadow); display: flex; flex-direction: column; }
.wpt-post-card .wpt-thumb { margin: 0; border-radius: 0; }
.wpt-post-card-body { padding: 20px; }
.wpt-post-card h2 { font-size: 1.25rem; margin: 0 0 .4em; }
.wpt-post-card h2 a { color: var(--wpllms-heading); text-decoration: none; }
.wpt-pagination, .wpllms-pagination { margin-top: 32px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.wpt-pagination .page-numbers, .wpllms-pagination .page-numbers { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--wpt-border); background: var(--wpt-surface); text-decoration: none; color: var(--wpllms-heading); }
.wpt-pagination .current, .wpllms-pagination .current { background: var(--wpllms-primary); border-color: var(--wpllms-primary); color: #fff; }

/* ---------- Lessons ---------- */
.wpt-crumbs { font-size: .9rem; color: var(--wpt-muted); margin-bottom: 14px; }
.wpt-crumbs a { color: var(--wpt-muted); }
.wpt-lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--wpt-border); flex-wrap: wrap; }

/* ---------- Comments ---------- */
.comment-list { list-style: none; padding: 0; }
.comment-body { background: var(--wpt-surface); border: 1px solid var(--wpt-border); border-radius: var(--wpt-radius); padding: 16px 18px; margin-bottom: 14px; }
.comment-list .children { list-style: none; padding-left: 20px; }

/* ---------- Footer ---------- */
.wpt-footer { background: #111827; color: #cbd5e1; margin-top: 60px; }
.wpt-footer a { color: #e2e8f0; }
.wpt-footer h2, .wpt-footer h3 { color: #fff; font-size: 1.05rem; margin-top: 0; }
.wpt-footer-inner { max-width: var(--wpt-max); margin: 0 auto; padding: 48px 20px 24px; display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.wpt-footer ul { list-style: none; margin: 0; padding: 0; }
.wpt-footer li { margin-bottom: 8px; }
.wpt-footer-bottom { max-width: var(--wpt-max); margin: 0 auto; padding: 18px 20px 28px; border-top: 1px solid rgba(255,255,255,.12); font-size: .9rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Plugin pages: let the student dashboard and builder use the full width ---------- */
body.wpt-fullwidth .wpt-narrow, body.wpt-fullwidth .wpt-container { max-width: none; padding-left: 0; padding-right: 0; }
body.wpt-fullwidth .wpt-card { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
@media print { .wpt-header, .wpt-footer, .wpt-toggle { display: none; } body { background: #fff; } }

/* Desktop: the collapsible wrapper is layout-transparent so nav and auth sit in the header row. */
@media (min-width: 861px) { .wpt-collapsible { display: contents; } }
