/* Highland Seas - Custom Styles */

:root {
    --hs-primary: #1a5f7a;
    --hs-primary-dark: #134a5e;
    --hs-primary-light: #e8f1f5;
    --hs-secondary: #57837b;
    --hs-secondary-light: #eef4f3;
    --hs-accent: #c38e70;
    --hs-accent-light: #f5ede8;
    --hs-dark: #1e2d3d;
    --hs-light: #f8f9fa;
    --hs-text: #333;
    --hs-text-muted: #6c757d;
}

/* ===================== Layout ===================== */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--hs-text);
    --bs-body-bg: #edf1f4;
    background-color: #edf1f4 !important;
    background-image: linear-gradient(180deg, #f0f4f6 0%, #e6ecf0 100%);
    background-attachment: fixed;
}

main {
    padding-top: 70px;
}

main > .container, main > .container-fluid {
    padding: 0 15px 20px;
}

/* ===================== Navbar ===================== */

.navbar-hs {
    background-color: var(--hs-dark) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

.navbar-hs .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.navbar-hs .navbar-brand img {
    border-radius: 4px;
}

.navbar-hs .nav-link {
    font-weight: 500;
    padding: 0.5rem 0.85rem !important;
    transition: color 0.2s ease;
}

.navbar-hs .nav-link:hover,
.navbar-hs .nav-link.active {
    color: #fff !important;
}

.navbar form > button.logout {
    padding-top: 7px;
    color: rgba(255, 255, 255, 0.5);
}

@media(max-width:767px) {
    .navbar form > button.logout {
        display: block;
        text-align: left;
        width: 100%;
        padding: 10px 0;
    }
}

.navbar form > button.logout:focus,
.navbar form > button.logout:hover {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
}

/* ===================== Hero Section ===================== */

.hero-section {
    background: linear-gradient(160deg, var(--hs-dark) 0%, var(--hs-primary) 45%, var(--hs-secondary) 100%);
    color: white;
    padding: 8rem 0 5rem;
    margin-top: -70px;
    position: relative;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom right, transparent 49.5%, #f0f4f6 50%);
}

.hero-section h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-section .lead {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ===================== Section Spacing ===================== */

.section-padding {
    padding: 5rem 0;
}

.section-title {
    font-weight: 700;
    color: var(--hs-dark);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.section-subtitle {
    color: var(--hs-text-muted);
    margin-bottom: 3rem;
    font-size: 1.05rem;
}

/* ===================== Cards ===================== */

.card-service,
.card-course {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.7rem;
    transition: all 0.3s ease;
    height: 100%;
    background: linear-gradient(165deg, #1e3a4a 0%, #2a5e6b 60%, #3a7a78 100%);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 8px 20px -6px rgba(0, 0, 0, 0.4),
        0 1px 0 0 rgba(255, 255, 255, 0.05);
}

.card-service::before,
.card-course::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
    pointer-events: none;
}

.card-clickable {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.card-clickable:hover {
    text-decoration: none;
    color: inherit;
}

.card-service:hover,
.card-course:hover {
    transform: translateY(-6px);
    box-shadow:
        0 16px 32px -6px rgba(0, 0, 0, 0.45),
        0 1px 0 0 rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-service:active,
.card-course:active {
    transform: translateY(2px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-icon {
    width: 68px;
    height: 68px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.4rem;
    font-size: 1.9rem;
    color: rgba(195, 142, 112, 0.8);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.card-icon-svg {
    width: 1.9rem;
    height: 1.9rem;
    filter: brightness(0) invert(1);
    opacity: 0.55;
    transition: all 0.3s ease;
}

.card-service:hover .card-icon,
.card-course:hover .card-icon {
    transform: scale(1.08);
    color: var(--hs-accent);
    background: rgba(255, 255, 255, 0.08);
}

.card-service:hover .card-icon-svg,
.card-course:hover .card-icon-svg {
    opacity: 0.8;
    filter: brightness(0) saturate(100%) invert(72%) sepia(28%) saturate(567%) hue-rotate(339deg) brightness(93%) contrast(86%);
}

.card-service .card-title,
.card-course .card-title {
    font-weight: 600;
    color: rgba(240, 248, 250, 0.95);
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.card-service .card-text,
.card-course .card-text {
    color: rgba(210, 225, 230, 0.6);
    font-size: 0.92rem;
    line-height: 1.6;
}

/* ===================== Audience Badges ===================== */

.badge-audience {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.3em 0.85em;
    border-radius: 20px;
    letter-spacing: 0.2px;
    background: rgba(195, 142, 112, 0.12);
    border: 1px solid rgba(195, 142, 112, 0.3);
    color: rgba(210, 178, 158, 0.9);
    transition: all 0.3s ease;
}

.card-course:hover .badge-audience {
    background: rgba(195, 142, 112, 0.18);
    border-color: rgba(195, 142, 112, 0.4);
    color: rgba(220, 188, 168, 1);
}

/* ===================== Free Banner ===================== */

.badge-free-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}

.badge-free-banner::before {
    content: 'FOR FREE';
    position: absolute;
    top: 20px;
    left: -28px;
    width: 130px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #fff;
    background: #6abe45;
    padding: 5px 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.card-course:hover .badge-free-banner::before {
    background: #7dd356;
}

/* ===================== Buttons ===================== */

.btn-hs-primary {
    background-color: var(--hs-primary);
    border-color: var(--hs-primary);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.2s ease;
}

.btn-hs-primary:hover {
    background-color: var(--hs-primary-dark);
    border-color: var(--hs-primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 95, 122, 0.3);
}

.btn-hs-outline {
    border: 1.5px solid rgba(195, 142, 112, 0.35);
    color: rgba(195, 142, 112, 0.8);
    border-radius: 8px;
    font-weight: 500;
    padding: 0.45rem 1.4rem;
    transition: all 0.3s ease;
}

.btn-hs-outline:hover {
    border-color: var(--hs-accent);
    color: var(--hs-accent);
    background: rgba(195, 142, 112, 0.08);
    transform: translateY(-1px);
}

.card-clickable:hover .btn-hs-outline {
    border-color: var(--hs-accent);
    color: var(--hs-accent);
    background: rgba(195, 142, 112, 0.08);
}

/* ===================== Back Button ===================== */

.back-button-container {
    padding: 1rem 15px 1.5rem;
}

.btn-hs-back {
    color: var(--hs-primary);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--hs-primary);
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-hs-back:hover {
    background-color: var(--hs-primary);
    color: white;
}

/* ===================== CTA Section ===================== */

.cta-section {
    background: linear-gradient(160deg, var(--hs-dark) 0%, var(--hs-primary) 100%);
    color: white;
    padding: 5rem 0;
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top left, transparent 49.5%, #f0f4f6 50%);
}

.cta-section h2 {
    font-weight: 700;
    font-size: 2rem;
}

/* ===================== Footer ===================== */

.footer {
    background-color: var(--hs-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 3.5rem 0 1.5rem;
    font-size: 0.9em;
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: white;
}

.footer h6 {
    color: white;
    font-weight: 600;
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    margin-top: 2rem;
}

/* ===================== Feature List ===================== */

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 0.4rem 0;
    padding-left: 1.75rem;
    position: relative;
}

.feature-list li::before {
    content: "\F272";
    font-family: "bootstrap-icons";
    position: absolute;
    left: 0;
    color: var(--hs-secondary);
}

/* ===================== Page Header ===================== */

.page-header {
    background: linear-gradient(160deg, var(--hs-dark) 0%, var(--hs-primary) 45%, var(--hs-secondary) 100%);
    color: white;
    padding: 5rem 0 3rem;
    margin-top: -70px;
    margin-bottom: 2rem;
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom right, transparent 49.5%, #f0f4f6 50%);
}

.page-header-dark::after {
    background: linear-gradient(to bottom right, transparent 49.5%, #1a2332 50%) !important;
}

.page-header-dark {
    margin-bottom: 0;
}

/* Dark section directly after dark page header: seamless transition */
.page-header-dark + .bg-dark-section::before {
    display: none;
}

/* Back button styled for dark sections */
.btn-hs-back-dark {
    color: rgba(240, 248, 250, 0.7);
    border-color: rgba(240, 248, 250, 0.2);
}

.btn-hs-back-dark:hover {
    color: white;
    border-color: rgba(240, 248, 250, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

/* Full dark page: no diagonals, body background matches dark section */
.bg-dark-section-full::before,
.bg-dark-section-full::after {
    display: none;
}

body.dark-page {
    background-color: #1a2332 !important;
    background-image: none;
}

.dark-page .page-header-dark::after {
    display: none;
}

.dark-page .page-header-dark {
    padding-bottom: 2rem;
}

.page-header h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* ===================== Breadcrumbs ===================== */

.breadcrumb {
    background-color: var(--bs-gray-200);
    border-radius: .25rem;
    padding: .75rem 1rem;
}

.breadcrumb-item > a {
    text-decoration: none;
    color: var(--hs-primary);
}

/* ===================== Contact Form ===================== */

.contact-info-card {
    background: linear-gradient(160deg, var(--hs-dark) 0%, var(--hs-primary) 70%, var(--hs-secondary) 100%);
    color: white;
    border-radius: 16px;
    padding: 2.5rem;
}

.contact-info-card i {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* ===================== About Values ===================== */

.value-card {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.value-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.value-card i {
    font-size: 2rem;
    color: var(--hs-primary);
}

/* ===================== Dark Section (Card areas) ===================== */

.bg-dark-section {
    background: linear-gradient(170deg, #1a2332 0%, #1e2d3d 50%, #243444 100%);
    position: relative;
}

.bg-dark-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top left, transparent 49.5%, #f0f4f6 50%);
    z-index: 1;
}

.bg-dark-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom right, transparent 49.5%, #f0f4f6 50%);
    z-index: 1;
}

/* Hide diagonals between adjacent dark sections */
.bg-dark-section + .bg-dark-section::before {
    display: none;
}

.bg-dark-section:has(+ .bg-dark-section)::after {
    display: none;
}

/* Hide bottom diagonal of dark section before CTA (CTA has its own) */
.bg-dark-section:has(+ .cta-section)::after {
    display: none;
}

/* Hide top diagonal of dark section after hero (hero has its own) */
.hero-section + .bg-dark-section::before {
    display: none;
}

.bg-dark-section .section-title {
    color: rgba(240, 248, 250, 0.95);
}

.bg-dark-section .section-subtitle {
    color: rgba(210, 225, 230, 0.55);
}

.bg-dark-section .btn-hs-outline {
    border-color: rgba(195, 142, 112, 0.4);
    color: rgba(195, 142, 112, 0.85);
}

.bg-dark-section .btn-hs-outline:hover {
    border-color: var(--hs-accent);
    color: var(--hs-accent);
    background: rgba(195, 142, 112, 0.1);
}

/* ===================== Courses section background ===================== */

.bg-light {
    background-color: #f0f4f6 !important;
}

/* ===================== Grid view sorting icons ===================== */

a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px #212529;
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px #212529;
    border-bottom-width: 0;
}

/* ===================== Utility ===================== */

.not-set {
    color: #c55;
    font-style: italic;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

/* ===================== Profile Dashboard ===================== */

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hs-primary) 0%, var(--hs-secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.profile-sidebar .list-group-item {
    border: none;
    padding: 0.85rem 1.25rem;
    font-weight: 500;
    color: var(--hs-text);
    transition: all 0.2s ease;
    background: transparent;
}

.profile-sidebar .list-group-item:first-child {
    border-radius: 16px 16px 0 0;
}

.profile-sidebar .list-group-item:last-child {
    border-radius: 0 0 16px 16px;
}

.profile-sidebar .list-group-item:hover {
    background-color: var(--hs-primary-light);
    color: var(--hs-primary);
}

.profile-sidebar .list-group-item.active {
    background-color: var(--hs-primary);
    color: white;
}

.profile-stat-card {
    border: none;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease;
}

.profile-stat-card:hover {
    transform: translateY(-2px);
}

.profile-stat-card h3 {
    color: var(--hs-primary);
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.profile-stat-card p {
    color: var(--hs-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.enrollment-card {
    border: none;
    border-radius: 12px;
    border-left: 4px solid var(--hs-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.enrollment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.enrollment-card.completed {
    border-left-color: var(--hs-secondary);
}

.enrollment-progress .progress {
    height: 8px;
    border-radius: 4px;
    background-color: var(--hs-primary-light);
}

.enrollment-progress .progress-bar {
    background-color: var(--hs-primary);
    border-radius: 4px;
}

/* User dropdown in navbar */
.navbar-hs .user-dropdown .dropdown-toggle {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border: none;
    background: none;
    transition: color 0.2s ease;
}

.navbar-hs .user-dropdown .dropdown-toggle:hover,
.navbar-hs .user-dropdown .dropdown-toggle:focus {
    color: white;
}

.navbar-hs .user-dropdown .dropdown-menu {
    background-color: var(--hs-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    padding: 0.5rem 0;
}

.navbar-hs .user-dropdown .dropdown-item {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.navbar-hs .user-dropdown .dropdown-item:hover,
.navbar-hs .user-dropdown .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
}

.navbar-hs .user-dropdown .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 0.35rem 0;
}

.navbar-hs .user-dropdown .dropdown-header {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 1.25rem 0.25rem;
}

.navbar-hs .user-dropdown .dropdown-item-logout {
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.navbar-hs .user-dropdown .dropdown-item-logout:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
}

/* ===================== Topic Viewer ===================== */

.topic-content h2,
.topic-content h3 {
    color: var(--hs-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.topic-content h2:first-child,
.topic-content h3:first-child {
    margin-top: 0;
}

.topic-content p {
    line-height: 1.7;
    margin-bottom: 1rem;
}

.topic-content ul,
.topic-content ol {
    padding-left: 1.25rem;
    margin-bottom: 1.25rem;
}

.topic-content ul li,
.topic-content ol li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.topic-content .exercise-box {
    background-color: var(--hs-accent-light);
    border-left: 4px solid var(--hs-accent);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.topic-content .exercise-box h4 {
    color: var(--hs-accent);
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.topic-content .key-point {
    background-color: var(--hs-primary-light);
    border-left: 4px solid var(--hs-primary);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.topic-content .key-point strong {
    color: var(--hs-primary);
}

.topic-content .disclaimer {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.topic-nav a {
    text-decoration: none;
    color: var(--hs-text);
    transition: background-color 0.2s;
}

.topic-nav a:hover {
    background-color: var(--hs-primary-light);
}

.topic-nav a.topic-nav-active {
    background-color: rgba(26, 95, 122, 0.08);
}

/* ===================== Slide Gallery ===================== */

.slide-gallery {
    margin-bottom: 2rem;
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.slide-viewer {
    position: relative;
    display: flex;
    align-items: center;
}

.slide-container {
    width: 100%;
    height: 50vh;
    max-height: 380px;
    overflow: hidden;
    background: #1a1a2e;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.slide-image.active {
    display: block;
    opacity: 1;
}

.slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.slide-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.05);
}

.slide-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.slide-prev {
    left: 12px;
}

.slide-next {
    right: 12px;
}

.slide-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    position: relative;
}

.slide-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.slide-btn-fullscreen {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.slide-btn-fullscreen:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Close button (hidden outside fullscreen) */
.slide-btn-close {
    display: none;
}

/* Fullscreen mode */
.slide-gallery.is-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.slide-gallery.is-fullscreen .slide-viewer {
    flex: 1;
    min-height: 0;
}

.slide-gallery.is-fullscreen .slide-container {
    height: 100%;
    max-height: none;
}

.slide-gallery.is-fullscreen .slide-btn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.2s;
}

.slide-gallery.is-fullscreen .slide-btn-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.slide-gallery.is-fullscreen .slide-footer {
    padding: 12px 24px;
    gap: 16px;
}

.slide-gallery.is-fullscreen .slide-counter {
    font-size: 1rem;
}

.slide-gallery.is-fullscreen .slide-btn-fullscreen {
    font-size: 1.2rem;
}

/* Desktop fullscreen: keep arrows on the slide */
@media (min-width: 769px) {
    .slide-gallery.is-fullscreen .slide-btn {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

    .slide-gallery.is-fullscreen .slide-prev {
        left: 24px;
    }

    .slide-gallery.is-fullscreen .slide-next {
        right: 24px;
    }
}

/* Mobile fullscreen: move arrows to footer bar */
@media (max-width: 768px) {
    .slide-gallery.is-fullscreen .slide-viewer .slide-prev,
    .slide-gallery.is-fullscreen .slide-viewer .slide-next {
        position: static;
        transform: none;
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .slide-gallery.is-fullscreen .slide-viewer .slide-prev:hover,
    .slide-gallery.is-fullscreen .slide-viewer .slide-next:hover {
        transform: none;
    }

    .slide-gallery.is-fullscreen .slide-viewer .slide-prev:active,
    .slide-gallery.is-fullscreen .slide-viewer .slide-next:active {
        transform: none;
    }

    .slide-gallery.is-fullscreen .slide-footer {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 24px;
        padding: 12px 16px;
    }

    .slide-gallery.is-fullscreen .slide-footer .slide-nav-prev,
    .slide-gallery.is-fullscreen .slide-footer .slide-nav-next {
        display: flex;
    }

    .slide-gallery.is-fullscreen .slide-btn-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* Hide first-child margin reset for slide gallery */
.topic-content .slide-gallery + h2 {
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .slide-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .slide-prev {
        left: 8px;
    }

    .slide-next {
        right: 8px;
    }

    .slide-gallery {
        border-radius: 8px;
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }
}
