/*
 * LifeLongLearningDigital visual layer
 * Version: 2026.08.25
 * Scope: Boost Union layouts only. No Moodle data or course content is changed.
 */

:root {
    --lld-ink: #172033;
    --lld-muted: #5d6b82;
    --lld-surface: #ffffff;
    --lld-canvas: #f4f7fb;
    --lld-line: #dfe7f1;
    --lld-primary: #3154d8;
    --lld-primary-dark: #233aa5;
    --lld-cyan: #00a9c7;
    --lld-mint: #16a394;
    --lld-amber: #f2aa2e;
    --lld-radius-sm: 12px;
    --lld-radius: 20px;
    --lld-radius-lg: 28px;
    --lld-shadow-sm: 0 8px 24px rgba(25, 42, 79, 0.08);
    --lld-shadow: 0 18px 50px rgba(25, 42, 79, 0.12);
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 8% 6%, rgba(0, 169, 199, 0.08), transparent 26rem),
        radial-gradient(circle at 92% 20%, rgba(49, 84, 216, 0.08), transparent 30rem),
        var(--lld-canvas);
    color: var(--lld-ink);
    font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
}

a {
    color: var(--lld-primary-dark);
    text-underline-offset: 0.18em;
}

a:hover {
    color: #172b82;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(0, 169, 199, 0.55) !important;
    outline-offset: 3px;
}

.navbar.fixed-top {
    min-height: 68px;
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom: 1px solid rgba(49, 84, 216, 0.12) !important;
    box-shadow: 0 8px 30px rgba(25, 42, 79, 0.08);
    backdrop-filter: blur(16px);
}

.navbar .navbar-brand,
.navbar .navbar-brand .site-name {
    color: var(--lld-ink) !important;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.navbar .navbar-brand::before {
    display: inline-grid;
    width: 36px;
    height: 36px;
    margin-right: 0.65rem;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--lld-primary), var(--lld-cyan));
    box-shadow: 0 7px 18px rgba(49, 84, 216, 0.3);
    color: #fff;
    content: "L";
    font-size: 1rem;
    font-weight: 900;
}

.primary-navigation .navigation .nav-link,
.navbar .usermenu-container .btn,
.navbar .langmenu .btn,
.navbar a[href*="/login/"] {
    border-radius: 999px;
    font-weight: 700;
}

.navbar a[href*="/login/"] {
    padding: 0.55rem 1rem;
    background: linear-gradient(135deg, var(--lld-primary), var(--lld-primary-dark));
    box-shadow: 0 8px 20px rgba(49, 84, 216, 0.22);
    color: #fff !important;
    text-decoration: none;
}

#page.drawers .main-inner,
#page.drawers .main-inner:not(.max-width-100) {
    width: 100%;
    max-width: 1320px !important;
    margin: 1.5rem auto 3rem;
    padding: 0 1.25rem 3rem;
    background: transparent;
}

#page-header {
    margin-bottom: 1.35rem;
    padding: 1.35rem 1.55rem;
    border: 1px solid rgba(49, 84, 216, 0.1);
    border-radius: var(--lld-radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--lld-shadow-sm);
}

#page-header h1,
#page-header .h2 {
    color: var(--lld-ink);
    font-weight: 850;
    letter-spacing: -0.035em;
}

#region-main,
.block.card {
    border: 0;
    background: transparent;
}

.card,
.activity-item,
.course-section .section-item,
.generaltable,
.path-mod .activity-header:not(:empty) {
    border-color: var(--lld-line) !important;
    border-radius: var(--lld-radius-sm) !important;
    box-shadow: var(--lld-shadow-sm);
}

.btn {
    min-height: 42px;
    border-radius: 12px;
    font-weight: 700;
}

.btn-primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--lld-primary), var(--lld-primary-dark));
    box-shadow: 0 8px 20px rgba(49, 84, 216, 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: transparent;
    background: linear-gradient(135deg, #2848c4, #192e8e);
}

.form-control,
.custom-select,
.form-select {
    min-height: 44px;
    border-color: #cbd7e6;
    border-radius: 12px;
}

/* Front-page hero. */
.pagelayout-frontpage #page-header {
    position: relative;
    overflow: hidden;
    padding: clamp(1.8rem, 4vw, 3.5rem);
    border: 0;
    border-radius: var(--lld-radius-lg);
    background:
        radial-gradient(circle at 83% 18%, rgba(255, 255, 255, 0.18), transparent 12rem),
        linear-gradient(125deg, #182b76 0%, var(--lld-primary) 52%, var(--lld-cyan) 115%);
    box-shadow: 0 24px 60px rgba(34, 57, 146, 0.24);
}

.pagelayout-frontpage #page-header::after {
    position: absolute;
    right: -60px;
    bottom: -105px;
    width: 270px;
    height: 270px;
    border: 38px solid rgba(255, 255, 255, 0.09);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.pagelayout-frontpage #page-header h1,
.pagelayout-frontpage #page-header .h2 {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 5vw, 3.55rem);
    line-height: 1.12;
}

.pagelayout-frontpage #page-header .page-header-headings::after {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 0.85rem;
    color: rgba(255, 255, 255, 0.86);
    content: "พื้นที่เรียนรู้ดิจิทัลสำหรับทุกคน • เรียนได้ทุกที่ • ไม่มีค่าใช้จ่าย";
    font-size: clamp(1rem, 2vw, 1.18rem);
    font-weight: 550;
    letter-spacing: 0;
}

.pagelayout-frontpage .sitetopic {
    margin-bottom: 2rem;
}

.pagelayout-frontpage .sitetopic .course-section,
.pagelayout-frontpage .sitetopic .section-item,
.pagelayout-frontpage .sitetopic .activity-item {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.pagelayout-frontpage .sitetopic .activity-altcontent {
    width: 100%;
}

.pagelayout-frontpage .sitetopic .activity-altcontent > .no-overflow > .no-overflow {
    display: grid;
    grid-template-areas:
        "headline media"
        "action media";
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 1rem 2rem;
    align-items: center;
    padding: clamp(1.4rem, 3.5vw, 2.4rem);
    border: 1px solid rgba(49, 84, 216, 0.12);
    border-radius: var(--lld-radius-lg);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--lld-shadow);
}

.pagelayout-frontpage .sitetopic .activity-altcontent p {
    margin: 0;
}

.pagelayout-frontpage .sitetopic .activity-altcontent p:first-child {
    grid-area: headline;
    color: var(--lld-ink);
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    line-height: 1.35;
}

.pagelayout-frontpage .sitetopic .activity-altcontent p:nth-child(2) {
    grid-area: action;
}

.pagelayout-frontpage .sitetopic .activity-altcontent p:nth-child(2) a {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.15rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--lld-primary), var(--lld-cyan));
    box-shadow: 0 10px 24px rgba(49, 84, 216, 0.24);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.pagelayout-frontpage .sitetopic .activity-altcontent p:nth-child(2) a::after {
    margin-left: 0.5rem;
    content: "→";
}

.pagelayout-frontpage .sitetopic .activity-altcontent p:nth-child(3) {
    grid-area: media;
}

.pagelayout-frontpage .sitetopic .activity-altcontent img {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 18px 38px rgba(25, 42, 79, 0.18);
}

.pagelayout-frontpage .skip-block.skip.aabtn {
    position: absolute !important;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

#frontpage-available-course-list > h2 {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    margin: 0 0 1.15rem;
    color: var(--lld-ink);
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    font-weight: 850;
    letter-spacing: -0.03em;
}

#frontpage-available-course-list > h2::before {
    display: inline-block;
    width: 12px;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(var(--lld-primary), var(--lld-cyan));
    content: "";
}

.courses.frontpage-course-list-all {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
}

.courses.frontpage-course-list-all .coursebox {
    position: relative;
    display: flex !important;
    overflow: hidden;
    min-width: 0;
    min-height: 250px;
    flex-direction: column;
    margin: 0 !important;
    padding: 1.4rem !important;
    border: 1px solid rgba(49, 84, 216, 0.1) !important;
    border-radius: var(--lld-radius) !important;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--lld-shadow-sm);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.courses.frontpage-course-list-all .coursebox::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--lld-primary), var(--lld-cyan));
    content: "";
}

.courses.frontpage-course-list-all .coursebox:nth-child(3n + 2)::before {
    background: linear-gradient(90deg, var(--lld-mint), var(--lld-cyan));
}

.courses.frontpage-course-list-all .coursebox:nth-child(3n)::before {
    background: linear-gradient(90deg, var(--lld-amber), #ff7657);
}

.courses.frontpage-course-list-all .coursebox:hover {
    transform: translateY(-4px);
    border-color: rgba(49, 84, 216, 0.24) !important;
    box-shadow: var(--lld-shadow);
}

.courses.frontpage-course-list-all .coursebox[data-courseid="13"] {
    grid-column: span 2;
    background:
        radial-gradient(circle at 92% 15%, rgba(0, 169, 199, 0.11), transparent 13rem),
        #fff;
}

.courses.frontpage-course-list-all .coursebox .info,
.courses.frontpage-course-list-all .coursebox .content {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.courses.frontpage-course-list-all .coursebox .info {
    padding-right: 2rem !important;
}

.courses.frontpage-course-list-all .coursebox .coursename {
    margin: 0.3rem 0 0.85rem;
    font-size: 1.2rem;
    line-height: 1.45;
}

.courses.frontpage-course-list-all .coursebox .coursename a {
    color: var(--lld-ink);
    font-weight: 850;
    text-decoration: none;
}

.courses.frontpage-course-list-all .coursebox .coursename a:hover {
    color: var(--lld-primary-dark);
}

.courses.frontpage-course-list-all .coursebox .enrolmenticons {
    position: absolute;
    top: 1.25rem;
    right: 1.15rem;
    display: flex;
    gap: 0.25rem;
    color: var(--lld-mint);
}

.courses.frontpage-course-list-all .coursebox .summary {
    color: var(--lld-muted);
    line-height: 1.7;
}

.courses.frontpage-course-list-all .coursebox:not([data-courseid="13"]) .summary .no-overflow {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
}

.courses.frontpage-course-list-all .coursebox[data-courseid="13"] .summary .no-overflow {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 9;
}

.courses.frontpage-course-list-all .coursebox .teachers {
    display: inline-flex;
    align-self: flex-start;
    margin: auto 0 0;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #edf5ff;
    color: #355176;
    font-size: 0.88rem;
    list-style: none;
}

.courses.frontpage-course-list-all .coursebox .teachers a {
    color: inherit;
}

/* Course, dashboard and activity surfaces. */
.pagelayout-course #page-header,
.pagelayout-incourse #page-header,
.pagelayout-mydashboard #page-header,
.pagelayout-mycourses #page-header {
    border-left: 7px solid var(--lld-primary);
}

.course-section {
    margin-bottom: 1rem;
}

.course-section .section-item {
    padding: clamp(1rem, 2vw, 1.5rem) !important;
    background: rgba(255, 255, 255, 0.96);
}

.course-section .sectionname,
.course-section .sectionname a {
    color: var(--lld-ink) !important;
    font-weight: 850;
}

.activity-item {
    margin: 0.45rem 0;
    border: 1px solid var(--lld-line) !important;
    background: #fff;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.activity-item:hover {
    border-color: rgba(49, 84, 216, 0.28) !important;
    box-shadow: 0 10px 26px rgba(25, 42, 79, 0.09);
}

.activityiconcontainer {
    border-radius: 11px !important;
}

.secondary-navigation .navigation {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--lld-shadow-sm);
}

.secondary-navigation .nav-link.active {
    color: var(--lld-primary-dark);
    font-weight: 800;
}

/* Internal learning workspace. */
.pagelayout-course #page-header.header-maxwidth,
.pagelayout-incourse #page-header.header-maxwidth,
.pagelayout-mydashboard #page-header.header-maxwidth,
.pagelayout-mycourses #page-header.header-maxwidth {
    box-sizing: border-box;
    width: 100%;
    max-width: 1120px !important;
    margin-right: auto;
    margin-left: auto;
}

/* Unique course hero banners. Titles stay as live HTML for accessibility and search. */
body.course-4 {
    --lld-course-hero: url("assets/course4-digital-safety-hero-v1.jpg");
    --lld-course-accent: #62e4ef;
    --lld-course-accent-2: #ffc85c;
    --lld-course-kicker: "เรื่องที่ 1 • DIGITAL SAFETY";
}

body.course-5 {
    --lld-course-hero: url("assets/course5-digital-citizenship-hero-v1.jpg");
    --lld-course-accent: #b98cff;
    --lld-course-accent-2: #ff7f72;
    --lld-course-kicker: "เรื่องที่ 2 • DIGITAL CITIZENSHIP";
}

body.course-6 {
    --lld-course-hero: url("assets/course6-media-literacy-hero-v1.jpg");
    --lld-course-accent: #ff83ca;
    --lld-course-accent-2: #ffd05d;
    --lld-course-kicker: "เรื่องที่ 3 • MEDIA LITERACY";
}

body.course-7 {
    --lld-course-hero: url("assets/course7-online-collaboration-hero-v1.jpg");
    --lld-course-accent: #5ee5ef;
    --lld-course-accent-2: #ff8776;
    --lld-course-kicker: "เรื่องที่ 4 • COLLABORATION";
}

body.course-8 {
    --lld-course-hero: url("assets/course8-self-development-hero-v1.jpg");
    --lld-course-accent: #67e5b0;
    --lld-course-accent-2: #ffd062;
    --lld-course-kicker: "เรื่องที่ 5 • SELF DEVELOPMENT";
}

body.course-9 {
    --lld-course-hero: url("assets/course9-ai-threats-hero-v1.jpg");
    --lld-course-accent: #5ce5f2;
    --lld-course-accent-2: #ff6179;
    --lld-course-kicker: "เรื่องที่ 7 • AI SECURITY";
}

body.course-10 {
    --lld-course-hero: url("assets/course10-digital-ethics-law-hero-v1.jpg");
    --lld-course-accent: #ffd46b;
    --lld-course-accent-2: #5cdbc9;
    --lld-course-kicker: "เรื่องที่ 6 • DIGITAL ETHICS & LAW";
}

body.course-11 {
    --lld-course-hero: url("assets/course11-digital-civic-participation-hero-v1.jpg");
    --lld-course-accent: #73e2bd;
    --lld-course-accent-2: #ff846f;
    --lld-course-kicker: "เรื่องที่ 8 • CIVIC PARTICIPATION";
}

body.course-12 {
    --lld-course-hero: url("assets/course12-platform-guide-hero-v1.jpg");
    --lld-course-accent: #63e4ee;
    --lld-course-accent-2: #7af0bc;
    --lld-course-kicker: "PLATFORM GUIDE • START HERE";
}

body.course-13 {
    --lld-course-hero: url("assets/course13-ai-coach-hero-v1.jpg");
    --lld-course-accent: #6fe6f2;
    --lld-course-accent-2: #7f9cff;
    --lld-course-kicker: "DIGITAL SKILLS • AI COACH";
}

body.pagelayout-course:is(.course-4, .course-5, .course-6, .course-7, .course-8, .course-9, .course-10, .course-11, .course-12, .course-13) #page-header.header-maxwidth {
    position: relative;
    isolation: isolate;
    display: flex;
    overflow: hidden;
    min-height: 300px;
    align-items: center;
    padding: clamp(2rem, 5vw, 3.75rem);
    border: 1px solid color-mix(in srgb, var(--lld-course-accent) 36%, transparent);
    border-left: 0;
    background:
        linear-gradient(90deg, rgba(4, 18, 58, 0.98) 0%, rgba(8, 38, 97, 0.92) 42%, rgba(6, 30, 78, 0.42) 70%, rgba(4, 18, 58, 0.08) 100%),
        var(--lld-course-hero) center center / cover no-repeat;
    box-shadow: 0 28px 70px rgba(18, 43, 104, 0.28);
}

body.pagelayout-course:is(.course-4, .course-5, .course-6, .course-7, .course-8, .course-9, .course-10, .course-11, .course-12, .course-13) #page-header.header-maxwidth::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: inherit;
    content: "";
    pointer-events: none;
}

body.pagelayout-course:is(.course-4, .course-5, .course-6, .course-7, .course-8, .course-9, .course-10, .course-11, .course-12, .course-13) #page-header.header-maxwidth > .w-100 {
    position: relative;
    z-index: 1;
    max-width: 620px;
}

body.pagelayout-course:is(.course-4, .course-5, .course-6, .course-7, .course-8, .course-9, .course-10, .course-11, .course-12, .course-13) #page-header.header-maxwidth h1 {
    max-width: 640px;
    margin: 0;
    color: #fff !important;
    font-size: clamp(1.75rem, 3.35vw, 3rem);
    font-style: oblique 8deg;
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.14;
    text-shadow: 0 4px 24px rgba(0, 10, 40, 0.42);
}

body.pagelayout-course:is(.course-4, .course-5, .course-6, .course-7, .course-8, .course-9, .course-10, .course-11, .course-12, .course-13) #page-header.header-maxwidth h1::before {
    display: table;
    width: fit-content;
    margin: 0 0 1rem 0.15rem;
    padding: 0.45rem 0.8rem 0.38rem;
    border-radius: 7px 12px 7px 10px;
    background: linear-gradient(115deg, var(--lld-course-accent), var(--lld-course-accent-2));
    box-shadow: 0 8px 24px rgba(0, 10, 40, 0.24);
    color: #071941;
    content: var(--lld-course-kicker);
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 950;
    letter-spacing: 0.09em;
    line-height: 1.25;
    text-shadow: none;
    transform: skewX(-8deg) rotate(-1.5deg);
    transform-origin: left center;
}

body.pagelayout-course:is(.course-4, .course-5, .course-6, .course-7, .course-8, .course-9, .course-10, .course-11, .course-12, .course-13) #page-header.header-maxwidth h1::after {
    display: block;
    width: clamp(88px, 14vw, 150px);
    height: 6px;
    margin-top: 1rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--lld-course-accent), var(--lld-course-accent-2));
    box-shadow: 0 0 24px color-mix(in srgb, var(--lld-course-accent) 48%, transparent);
    content: "";
    transform: skewX(-34deg) rotate(-2deg);
}

body.course-11.pagelayout-course #page-header.header-maxwidth h1 {
    font-size: clamp(1.55rem, 2.7vw, 2.45rem);
    line-height: 1.18;
}

.pagelayout-incourse #region-main,
.pagelayout-course #region-main {
    max-width: 1180px;
    margin-right: auto;
    margin-left: auto;
}

.pagelayout-incourse #region-main > [role="main"] {
    width: min(100%, 1120px);
    min-height: 220px;
    margin: 0 auto;
    padding: clamp(1.4rem, 3vw, 2.4rem);
    border: 1px solid rgba(49, 84, 216, 0.1);
    border-radius: var(--lld-radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--lld-shadow-sm);
}

.pagelayout-incourse #region-main > [role="main"] h2,
.pagelayout-incourse #region-main > [role="main"] h3,
.pagelayout-incourse #region-main > [role="main"] h4 {
    color: var(--lld-ink);
    font-weight: 850;
    letter-spacing: -0.02em;
}

.pagelayout-incourse #region-main > [role="main"] p,
.pagelayout-incourse #region-main > [role="main"] li {
    color: #34435a;
    line-height: 1.85;
}

.pagelayout-incourse #region-main > [role="main"] a:not(.btn) {
    font-weight: 650;
}

.pagelayout-incourse #page-header .breadcrumb {
    gap: 0.15rem;
    margin-bottom: 0.85rem;
    color: var(--lld-muted);
    font-size: 0.9rem;
}

.pagelayout-incourse #page-header .breadcrumb-item a {
    color: #456082;
    text-decoration: none;
}

.pagelayout-incourse #page-header .page-header-image .activityiconcontainer,
.pagelayout-incourse #page-header .page-header-image img {
    border-radius: 12px;
}

.pagelayout-incourse .activity-header:has(.activity-information:empty) {
    display: none;
}

.path-mod-page #region-main > [role="main"] > .box.generalbox {
    margin: 0;
    padding: 0 !important;
    background: transparent;
    box-shadow: none;
}

.path-mod-page #region-main > [role="main"] > .box.generalbox > .no-overflow {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.075rem;
}

.path-mod-page #region-main > [role="main"] > .box.generalbox > .no-overflow::before {
    display: block;
    width: 54px;
    height: 6px;
    margin-bottom: 1.35rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--lld-primary), var(--lld-cyan));
    content: "";
}

/* 2026 lesson refresh: readable structure, visual context, and active learning. */
.path-mod-page .lld-lesson-refresh {
    margin: 0 0 2.25rem;
    color: var(--lld-ink);
}

.path-mod-page .lld-lesson-refresh,
.path-mod-page .lld-lesson-visual,
.path-mod-page .lld-lesson-grid,
.path-mod-page .lld-lesson-card,
.path-mod-page .lld-lesson-update,
.path-mod-page .lld-original-content,
.path-mod-page .lld-lesson-activity,
.path-mod-page .lld-lesson-sources {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

.path-mod-page .lld-lesson-visual {
    position: relative;
    overflow: hidden;
    margin: 0 0 1.5rem;
    border: 1px solid color-mix(in srgb, var(--lld-course-accent, var(--lld-cyan)) 30%, transparent);
    border-radius: 22px;
    background: #071941;
    box-shadow: var(--lld-shadow-sm);
}

.path-mod-page .lld-lesson-visual img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 7;
    object-fit: cover;
    object-position: center;
}

.path-mod-page .lld-lesson-visual figcaption {
    position: absolute;
    right: 0.85rem;
    bottom: 0.75rem;
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    background: rgba(4, 18, 58, 0.76);
    color: #fff;
    font-size: 0.73rem;
    font-weight: 750;
    backdrop-filter: blur(8px);
}

.path-mod-page .lld-lesson-badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.9rem;
    padding: 0.42rem 0.75rem;
    border-radius: 8px 13px 8px 12px;
    background: linear-gradient(115deg, var(--lld-course-accent, var(--lld-cyan)), var(--lld-course-accent-2, var(--lld-mint)));
    color: #071941;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    transform: skewX(-7deg) rotate(-1deg);
}

.path-mod-page .lld-lesson-lead {
    max-width: 780px;
    margin: 0 0 1.35rem;
    color: #24395a;
    font-size: clamp(1.08rem, 2vw, 1.24rem);
    font-weight: 650;
    line-height: 1.78;
}

.path-mod-page .lld-lesson-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.25rem;
}

.path-mod-page .lld-lesson-card,
.path-mod-page .lld-lesson-update,
.path-mod-page .lld-lesson-activity {
    padding: clamp(1rem, 2.4vw, 1.4rem);
    border: 1px solid rgba(49, 84, 216, 0.12);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(20, 45, 105, 0.08);
}

.path-mod-page .lld-lesson-card:last-child {
    border-color: color-mix(in srgb, var(--lld-course-accent-2, var(--lld-mint)) 36%, transparent);
    background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--lld-course-accent-2, var(--lld-mint)) 10%, #fff));
}

.path-mod-page .lld-lesson-refresh h2,
.path-mod-page .lld-lesson-activity h2 {
    margin: 0 0 0.75rem;
    color: #132b58;
    font-size: clamp(1.08rem, 2vw, 1.28rem);
    font-style: oblique 5deg;
    font-weight: 900;
    line-height: 1.4;
}

.path-mod-page .lld-lesson-refresh ul,
.path-mod-page .lld-lesson-refresh ol {
    margin-bottom: 0;
    padding-left: 1.35rem;
}

.path-mod-page .lld-lesson-refresh li + li {
    margin-top: 0.55rem;
}

.path-mod-page .lld-lesson-update {
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
    border-left: 6px solid var(--lld-course-accent, var(--lld-cyan));
    background: linear-gradient(135deg, rgba(238, 247, 255, 0.98), #fff);
}

.path-mod-page .lld-lesson-update::after {
    position: absolute;
    top: -38px;
    right: -30px;
    width: 118px;
    height: 118px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--lld-course-accent-2, var(--lld-mint)) 18%, transparent);
    content: "";
}

.path-mod-page .lld-original-content {
    color: #263a59;
    line-height: 1.88;
}

.path-mod-page .lld-original-content > p,
.path-mod-page .lld-original-content > div {
    margin-bottom: 1.1rem;
}

.path-mod-page .lld-original-content a,
.path-mod-page .lld-lesson-sources a {
    color: var(--lld-primary-dark);
    font-weight: 700;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.18em;
}

.path-mod-page .lld-lesson-activity {
    margin-top: 2rem;
    border-color: color-mix(in srgb, var(--lld-course-accent, var(--lld-cyan)) 35%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--lld-course-accent, var(--lld-cyan)) 12%, #fff), #fff 72%);
}

.path-mod-page .lld-lesson-sources {
    margin-top: 1.5rem;
    padding: 1rem 1.15rem;
    border-radius: 14px;
    background: #f4f7fc;
    color: #51637f;
    font-size: 0.88rem;
    line-height: 1.7;
}

.path-mod-page .lld-lesson-sources strong {
    color: #24395a;
}

.path-mod-page .modified {
    width: min(100%, 900px);
    margin: 2rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid var(--lld-line);
    color: var(--lld-muted);
    font-size: 0.88rem;
}

/* Course outline and activity cards. */
.pagelayout-course .course-section .section-item {
    position: relative;
    overflow: hidden;
    padding: clamp(1.15rem, 2.4vw, 1.85rem) !important;
    border: 1px solid rgba(49, 84, 216, 0.1) !important;
    border-left: 6px solid var(--lld-primary) !important;
    border-radius: var(--lld-radius) !important;
}

.pagelayout-course .course-section:nth-of-type(3n + 2) .section-item {
    border-left-color: var(--lld-mint) !important;
}

.pagelayout-course .course-section:nth-of-type(3n) .section-item {
    border-left-color: var(--lld-amber) !important;
}

.course-section .sectionname {
    font-size: clamp(1.18rem, 2vw, 1.55rem);
    line-height: 1.4;
}

.course-section .section_availability,
.course-section .availabilityinfo {
    color: var(--lld-muted);
    font-size: 0.9rem;
}

.activity-item {
    padding: 0.85rem 1rem !important;
}

.activity-item .activityname a,
.activity-item .activityname .instancename {
    color: #23334e;
    font-weight: 750;
    line-height: 1.5;
    text-decoration: none;
}

.activity-item .description,
.activity-item .activity-dates {
    color: var(--lld-muted);
    font-size: 0.92rem;
}

.activityiconcontainer {
    display: inline-grid !important;
    min-width: 42px;
    min-height: 42px;
    place-items: center;
}

.modtype_page .activityiconcontainer,
.cm-type-page .page-header-image .activityiconcontainer {
    background: #def7fb !important;
    color: #087e94 !important;
}

.modtype_assign .activityiconcontainer,
.cm-type-assign .page-header-image .activityiconcontainer {
    background: #fff1d7 !important;
    color: #9b6200 !important;
}

.modtype_quiz .activityiconcontainer,
.cm-type-quiz .page-header-image .activityiconcontainer {
    background: #efe7ff !important;
    color: #6840b8 !important;
}

.modtype_feedback .activityiconcontainer,
.cm-type-feedback .page-header-image .activityiconcontainer {
    background: #dff8ed !important;
    color: #147a59 !important;
}

.modtype_forum .activityiconcontainer,
.cm-type-forum .page-header-image .activityiconcontainer {
    background: #e3edff !important;
    color: #3154d8 !important;
}

.activity-item [data-region="completion-info"],
.activity-item .automatic-completion-conditions {
    border-radius: 999px;
    background: #f3f6fa;
    color: #4b5e77;
    font-size: 0.86rem;
}

/* Course index drawer. */
.drawer-left {
    border-right: 1px solid rgba(49, 84, 216, 0.12);
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 12px 0 32px rgba(25, 42, 79, 0.08);
}

.drawer-left .drawerheader {
    position: sticky;
    z-index: 2;
    top: 0;
    border-bottom: 1px solid var(--lld-line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
}

.courseindex .courseindex-section {
    margin-bottom: 0.4rem;
}

.courseindex .courseindex-section-title {
    padding: 0.5rem 0.55rem;
    border-radius: 10px;
    color: #263753;
    font-weight: 800;
}

.courseindex .courseindex-item {
    margin: 0.18rem 0;
    padding: 0.42rem 0.5rem;
    border-radius: 10px;
    color: #4c5e75;
}

.courseindex .courseindex-item:hover {
    background: #edf4ff;
    color: var(--lld-primary-dark);
}

.courseindex .courseindex-item.pageitem,
.courseindex .courseindex-item[aria-current="page"] {
    background: linear-gradient(135deg, var(--lld-primary), #277ac7) !important;
    box-shadow: 0 8px 18px rgba(49, 84, 216, 0.2);
    color: #fff !important;
}

.courseindex .courseindex-item.pageitem a,
.courseindex .courseindex-item[aria-current="page"] a {
    color: #fff !important;
}

/* Assignments, quizzes, feedback and data tables. */
.path-mod-assign .submissionstatustable,
.path-mod-assign .feedback,
.path-mod-quiz .quizinfo,
.path-mod-quiz .quizattempt,
.path-mod-feedback .feedback_info,
.path-mod-feedback .complete-feedback {
    margin-bottom: 1.25rem;
    padding: clamp(1rem, 2vw, 1.4rem);
    border: 1px solid var(--lld-line);
    border-radius: var(--lld-radius-sm);
    background: #fff;
    box-shadow: var(--lld-shadow-sm);
}

.generaltable {
    overflow: hidden;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

.generaltable thead th,
.generaltable th.header {
    border-bottom: 1px solid #cbd8e7;
    background: #edf4ff;
    color: #294466;
    font-weight: 800;
}

.generaltable tbody tr:hover {
    background: #f7faff;
}

.alert {
    border: 0;
    border-left: 5px solid currentColor;
    border-radius: 14px;
    box-shadow: var(--lld-shadow-sm);
}

.progress {
    overflow: hidden;
    height: 0.72rem;
    border-radius: 999px;
    background: #e5ecf5;
}

.progress-bar {
    background: linear-gradient(90deg, var(--lld-primary), var(--lld-cyan));
}

.activity-navigation {
    width: min(100%, 1120px);
    margin: 1.25rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid var(--lld-line);
}

.activity-navigation .btn {
    min-height: 46px;
    border-color: #cfdaea;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--lld-shadow-sm);
}

/* Dialogs used by quiz, enrolment and guest access. */
.modal-content,
.moodle-dialogue-base .moodle-dialogue-wrap {
    overflow: hidden;
    border: 0 !important;
    border-radius: var(--lld-radius) !important;
    box-shadow: 0 30px 80px rgba(11, 24, 58, 0.28) !important;
}

.modal-header,
.moodle-dialogue-base .moodle-dialogue-hd {
    border-bottom: 1px solid var(--lld-line) !important;
    background: linear-gradient(135deg, #eef4ff, #ecfbfd) !important;
    color: var(--lld-ink) !important;
    font-weight: 850 !important;
}

.modal-footer {
    border-top: 1px solid var(--lld-line);
    background: #f8fafc;
}

/* Login surface. */
body.pagelayout-login {
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 169, 199, 0.32), transparent 28rem),
        radial-gradient(circle at 90% 80%, rgba(49, 84, 216, 0.42), transparent 32rem),
        #111d50;
}

.pagelayout-login .login-wrapper {
    padding: 1.5rem;
}

.pagelayout-login .login-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 470px;
    margin-right: auto;
    margin-left: auto;
    padding: clamp(1.5rem, 4vw, 2.4rem);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--lld-radius-lg);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 28px 80px rgba(3, 10, 38, 0.35);
}

.pagelayout-login .login-heading {
    color: var(--lld-ink);
    font-weight: 850;
    overflow-wrap: anywhere;
}

.pagelayout-login .login-form-submit .btn {
    min-height: 48px;
}

/* Footer and compact utility polish. */
#page-footer,
.footer-popover {
    --bs-bg-opacity: 1;
    background: #111b3e !important;
}

.badge {
    border-radius: 999px;
}

@media (max-width: 991.98px) {
    .courses.frontpage-course-list-all {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .courses.frontpage-course-list-all .coursebox[data-courseid="13"] {
        grid-column: span 2;
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 1rem;
    }

    .navbar.fixed-top {
        min-height: 60px;
    }

    .navbar .navbar-brand::before {
        width: 32px;
        height: 32px;
        margin-right: 0.4rem;
    }

    #page.drawers .main-inner,
    #page.drawers .main-inner:not(.max-width-100) {
        margin: 0.85rem auto 2rem;
        padding: 0 0.7rem 2rem;
    }

    .pagelayout-frontpage #page-header {
        padding: 1.6rem 1.25rem;
        border-radius: 22px;
    }

    .pagelayout-frontpage #page-header h1,
    .pagelayout-frontpage #page-header .h2 {
        font-size: 0;
    }

    .pagelayout-frontpage #page-header h1::before,
    .pagelayout-frontpage #page-header .h2::before {
        display: block;
        content: "LifeLong Learning Digital";
        font-size: clamp(1.75rem, 8.5vw, 2.25rem);
        line-height: 1.15;
    }

    .pagelayout-frontpage .sitetopic .activity-altcontent > .no-overflow > .no-overflow {
        grid-template-areas:
            "headline"
            "media"
            "action";
        grid-template-columns: minmax(0, 1fr);
        padding: 1.2rem;
        border-radius: 22px;
    }

    .pagelayout-frontpage .sitetopic .activity-altcontent p:nth-child(2) a {
        width: 100%;
    }

    .courses.frontpage-course-list-all {
        grid-template-columns: minmax(0, 1fr);
    }

    .courses.frontpage-course-list-all .coursebox[data-courseid="13"] {
        grid-column: span 1;
    }

    .courses.frontpage-course-list-all .coursebox {
        min-height: 0;
        padding: 1.2rem !important;
    }

    .courses.frontpage-course-list-all .coursebox[data-courseid="13"] .summary .no-overflow,
    .courses.frontpage-course-list-all .coursebox:not([data-courseid="13"]) .summary .no-overflow {
        -webkit-line-clamp: 7;
    }

    .pagelayout-login .login-wrapper {
        width: 100%;
        padding: 0.75rem;
    }

    .pagelayout-course #page-header.header-maxwidth,
    .pagelayout-incourse #page-header.header-maxwidth {
        margin-bottom: 0.85rem;
        padding: 1rem;
        border-left-width: 5px;
        border-radius: 16px;
    }

    .pagelayout-course #page-header h1,
    .pagelayout-incourse #page-header h1 {
        font-size: clamp(1.3rem, 6vw, 1.75rem);
        line-height: 1.35;
    }

    body.pagelayout-course:is(.course-4, .course-5, .course-6, .course-7, .course-8, .course-9, .course-10, .course-11, .course-12, .course-13) #page-header.header-maxwidth {
        min-height: 270px;
        align-items: flex-end;
        padding: 1.35rem;
        border-left-width: 0;
        background:
            linear-gradient(90deg, rgba(4, 18, 58, 0.98) 0%, rgba(8, 38, 97, 0.9) 57%, rgba(4, 18, 58, 0.38) 100%),
            var(--lld-course-hero) 67% center / cover no-repeat;
    }

    body.pagelayout-course:is(.course-4, .course-5, .course-6, .course-7, .course-8, .course-9, .course-10, .course-11, .course-12, .course-13) #page-header.header-maxwidth > .w-100 {
        max-width: 94%;
    }

    body.pagelayout-course:is(.course-4, .course-5, .course-6, .course-7, .course-8, .course-9, .course-10, .course-11, .course-12, .course-13) #page-header.header-maxwidth h1 {
        max-width: 100%;
        font-size: clamp(1.32rem, 5.7vw, 1.85rem);
        letter-spacing: -0.025em;
        line-height: 1.22;
    }

    body.pagelayout-course:is(.course-4, .course-5, .course-6, .course-7, .course-8, .course-9, .course-10, .course-11, .course-12, .course-13) #page-header.header-maxwidth h1::before {
        margin: 0 0 0.7rem 0.1rem;
        padding: 0.35rem 0.55rem 0.3rem;
        font-size: 0.58rem;
        letter-spacing: 0.055em;
    }

    body.pagelayout-course:is(.course-4, .course-5, .course-6, .course-7, .course-8, .course-9, .course-10, .course-11, .course-12, .course-13) #page-header.header-maxwidth h1::after {
        width: 86px;
        height: 5px;
        margin-top: 0.7rem;
    }

    body.course-11.pagelayout-course #page-header.header-maxwidth h1 {
        font-size: clamp(1.17rem, 4.9vw, 1.48rem);
        line-height: 1.22;
    }

    .pagelayout-incourse #region-main > [role="main"] {
        min-height: 0;
        padding: 1.15rem;
        border-radius: 16px;
    }

    .path-mod-page #region-main > [role="main"] > .box.generalbox > .no-overflow {
        font-size: 1rem;
    }

    .pagelayout-course .course-section .section-item {
        padding: 1rem !important;
        border-left-width: 4px !important;
        border-radius: 16px !important;
    }

    .activity-item {
        padding: 0.75rem !important;
    }

    .activityiconcontainer {
        min-width: 38px;
        min-height: 38px;
    }

    .drawer-left {
        width: min(88vw, 330px) !important;
    }

    .generaltable {
        display: block;
        overflow-x: auto;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .activity-navigation {
        gap: 0.65rem;
    }
}

@media (max-width: 430px) {
    .navbar .navbar-brand {
        overflow: hidden;
        max-width: 185px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #page-header {
        padding: 1rem;
    }

    .courses.frontpage-course-list-all .coursebox .coursename {
        font-size: 1.1rem;
    }

    .pagelayout-login .login-heading {
        font-size: 1.55rem;
        letter-spacing: -0.025em;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media print {
    body {
        background: #fff !important;
    }

    .navbar.fixed-top,
    #page-footer {
        box-shadow: none !important;
    }
}

@media (max-width: 767.98px) {
    .path-mod-page .lld-lesson-visual {
        margin-right: 0;
        margin-left: 0;
        border-radius: 16px;
    }

    .path-mod-page #region-main > [role="main"],
    .path-mod-page #region-main > [role="main"] > .box.generalbox,
    .path-mod-page #region-main > [role="main"] > .box.generalbox > .no-overflow {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
    }

    .path-mod-page .lld-lesson-visual img {
        aspect-ratio: 16 / 9;
    }

    .path-mod-page .lld-lesson-visual figcaption {
        right: 0.55rem;
        bottom: 0.5rem;
        font-size: 0.64rem;
    }

    .path-mod-page .lld-lesson-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
    }

    .path-mod-page .lld-lesson-card,
    .path-mod-page .lld-lesson-update,
    .path-mod-page .lld-lesson-activity {
        padding: 1rem;
        border-radius: 15px;
    }

    .path-mod-page .lld-lesson-lead {
        font-size: 1.04rem;
        line-height: 1.72;
    }

    .path-mod-page .lld-original-content {
        line-height: 1.82;
    }

    /* Keep long Thai lesson titles and refreshed learning blocks inside a
       390px viewport. Moodle's activity header uses nested flex containers;
       every text-bearing flex child must be allowed to shrink. */
    #page.drawers .main-inner,
    #page.drawers .main-inner:not(.max-width-100),
    .pagelayout-incourse #page-header,
    .pagelayout-incourse #page-header.header-maxwidth,
    .pagelayout-incourse #page-header > .w-100,
    .pagelayout-incourse #page-header .d-flex,
    .pagelayout-incourse #page-header .page-header-headings,
    .path-mod-page #region-main,
    .path-mod-page #region-main-box,
    .path-mod-page #region-main > [role="main"],
    .path-mod-page #region-main > [role="main"] > .box.generalbox,
    .path-mod-page #region-main > [role="main"] > .box.generalbox > .no-overflow {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100% !important;
    }

    #page.drawers .main-inner,
    #page.drawers .main-inner:not(.max-width-100) {
        width: 100%;
        padding-right: 0.75rem;
        padding-left: 0.75rem;
        overflow-x: clip;
    }

    .pagelayout-incourse #page-header .page-header-headings {
        flex: 1 1 auto;
    }

    .pagelayout-incourse #page-header h1,
    .path-mod-page .lld-lesson-refresh,
    .path-mod-page .lld-original-content,
    .path-mod-page .lld-lesson-activity,
    .path-mod-page .lld-lesson-sources {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .pagelayout-incourse #page-header .breadcrumb {
        flex-wrap: nowrap;
        overflow-x: auto;
        max-width: 100%;
        scrollbar-width: none;
    }

    .pagelayout-incourse #page-header .breadcrumb::-webkit-scrollbar {
        display: none;
    }

    .path-mod-page #region-main > [role="main"] {
        width: 100%;
        padding: 0.9rem;
        overflow-x: clip;
    }

    .path-mod-page .lld-lesson-badge {
        display: flex;
        width: fit-content;
        max-width: 100%;
        flex-wrap: wrap;
        padding: 0.4rem 0.62rem;
        font-size: 0.68rem;
        line-height: 1.45;
        white-space: normal;
        transform: skewX(-4deg) rotate(-0.5deg);
    }

    .path-mod-page .lld-lesson-visual figcaption {
        max-width: calc(100% - 1.1rem);
        white-space: normal;
    }

    .path-mod-page .lld-original-content img,
    .path-mod-page .lld-original-content video,
    .path-mod-page .lld-original-content iframe {
        max-width: 100%;
        height: auto;
    }

    .path-mod-page .lld-original-content table {
        display: block;
        overflow-x: auto;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
}
