/* Mathsbox Guide Page Styles - Matching Overview Pages Exactly */

/* Ensure sidebar is NOT sticky - target all possible selectors and contexts with maximum specificity */
/* Remove ALL sticky-related properties completely */
body.secondary-page .sidebar.guide-sidebar,
body.secondary-page .guide-sidebar,
body.secondary-page .page-container .sidebar.guide-sidebar,
body.secondary-page .page-wrapper .page-container .sidebar.guide-sidebar,
body.secondary-page aside.sidebar.guide-sidebar,
body.secondary-page aside.guide-sidebar,
.sidebar.guide-sidebar,
.guide-sidebar,
.page-container .sidebar.guide-sidebar,
body .sidebar.guide-sidebar,
.page-wrapper .page-container .sidebar.guide-sidebar,
aside.sidebar.guide-sidebar,
aside.guide-sidebar,
.page-container > .sidebar,
.page-wrapper .page-container > .sidebar {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    align-self: auto !important;
    max-height: none !important;
    height: auto !important;
    overflow-y: visible !important;
    overflow-x: visible !important;
    overflow: visible !important;
    z-index: 0 !important; /* Ensure sidebar is below nav bar (nav has z-index: 1000) */
    transform: none !important;
    will-change: auto !important;
}

/* Ensure page-wrapper, page-container, and main content don't create stacking contexts above nav */
/* Nav has z-index: 1000 with position: sticky, so we ensure everything stays below it */
body.secondary-page .page-wrapper,
.page-wrapper {
    position: relative;
    z-index: 0; /* Must be below nav z-index: 1000 */
}

body.secondary-page .page-container,
.page-container {
    position: relative;
    z-index: 0; /* Must be below nav z-index: 1000 */
}

body.secondary-page .main-content3,
.main-content3 {
    position: relative;
    z-index: 0; /* Must be below nav z-index: 1000 */
}

/* Also ensure page-container doesn't create sticky behavior */
body.secondary-page .page-wrapper .page-container,
.page-wrapper .page-container {
    align-items: start;
}

/* Remove any sticky positioning that might be applied via media queries - maximum specificity */
@media (min-width: 768px) {
    body.secondary-page .sidebar.guide-sidebar,
    body.secondary-page .guide-sidebar,
    body.secondary-page .page-container .sidebar.guide-sidebar,
    .sidebar.guide-sidebar,
    .guide-sidebar,
    .page-container .sidebar.guide-sidebar {
        position: static !important;
        top: auto !important;
        align-self: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
}

@media (min-width: 1024px) {
    body.secondary-page .sidebar.guide-sidebar,
    body.secondary-page .guide-sidebar,
    body.secondary-page .page-container .sidebar.guide-sidebar,
    .sidebar.guide-sidebar,
    .guide-sidebar,
    .page-container .sidebar.guide-sidebar {
        position: static !important;
        top: auto !important;
        align-self: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
}

@media (min-width: 1280px) {
    body.secondary-page .sidebar.guide-sidebar,
    body.secondary-page .guide-sidebar,
    body.secondary-page .page-container .sidebar.guide-sidebar,
    .sidebar.guide-sidebar,
    .guide-sidebar,
    .page-container .sidebar.guide-sidebar {
        position: static !important;
        top: auto !important;
        align-self: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
}

/* Fix padding around page container - match overview pages */
.page-wrapper {
    padding-top: 0;
    max-width: 1280px;
    margin: 0 auto;
    background-color: var(--color-bg-primary);
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

.page-container {
    box-sizing: border-box;
}

.guide-main-content,
.main-content3.guide-main-content {
    box-sizing: border-box;
}

/* Ensure carousel is at top with no margin above */
.guide-carousel-section {
    margin-bottom: 2rem;
    margin-top: 0 !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.guide-carousel-main,
.carousel-main {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.guide-content-section.active .guide-carousel-section {
    margin-top: 0 !important;
}

/* Remove top margin from content sections that contain carousels */
.guide-content-section.content-section {
    margin-top: 0 !important;
}

.guide-content-section.content-section:first-of-type {
    margin-top: 0 !important;
}

/* Light grey background for carousel display - no drop shadow */
.guide-carousel-display.carousel-display,
.guide-content-section .carousel-display,
.guide-carousel-section .carousel-display {
    background-color: #f3f4f6 !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
}

/* Remove grid pattern from guide carousel */
.guide-carousel-display.carousel-display::before,
.guide-content-section .carousel-display::before,
.guide-carousel-section .carousel-display::before {
    display: none !important;
}

/* Override any other carousel styles for guide pages */
body.secondary-page .guide-carousel-display.carousel-display,
body.secondary-page .guide-content-section .carousel-display,
body.secondary-page .guide-carousel-section .carousel-display {
    background: #f3f4f6 !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
}

body.secondary-page .guide-carousel-display.carousel-display::before,
body.secondary-page .guide-content-section .carousel-display::before,
body.secondary-page .guide-carousel-section .carousel-display::before {
    display: none !important;
}

/* Thumbnail styling for guide carousel - grey theme */
.guide-carousel-section .thumbnail,
.guide-content-section .thumbnail,
.guide-carousel-thumbnails .thumbnail,
.carousel-thumbnails .thumbnail {
    background-color: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.875rem;
    padding: 0.75rem;
    opacity: 0.8;
    box-shadow: none;
    transition: all 0.2s ease;
}

.guide-carousel-section .thumbnail:hover,
.guide-content-section .thumbnail:hover,
.guide-carousel-thumbnails .thumbnail:hover,
.carousel-thumbnails .thumbnail:hover {
    opacity: 1;
    border-color: #d1d5db !important;
    background-color: #f3f4f6 !important;
    transform: translateY(-2px);
}

.guide-carousel-section .thumbnail.active,
.guide-content-section .thumbnail.active,
.guide-carousel-thumbnails .thumbnail.active,
.carousel-thumbnails .thumbnail.active {
    opacity: 1;
    border: 1px solid #9ca3af !important;
    background-color: #f3f4f6 !important;
    box-shadow: none !important;
}

/* Make last bingo image (bingocards2) smaller */
#bingo-games .guide-carousel-display .guide-carousel-image[data-index="4"],
#bingo-games .carousel-display .guide-carousel-image[data-index="4"] {
    max-width: 75%;
    max-height: 75%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Ensure carousel images are responsive */
.guide-carousel-image,
.carousel-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Quick Print images - drop shadow and rounded corners */
#quick-print .guide-carousel-display .guide-carousel-image,
#quick-print .carousel-display .guide-carousel-image {
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Ensure title and subtitle have proper spacing after carousel */
.guide-content-section .guide-content-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
}

.guide-content-section .guide-content-subtitle {
    margin-bottom: 2.5rem;
    font-size: 1.125rem;
    line-height: 1.6;
    color: #6b7280;
}

/* Guide-specific sidebar navigation styling */
.guide-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
}

/* Desktop - hide mobile selector */
.guide-mobile-selector {
    display: none;
}

.guide-sidebar-title {
    display: block;
}

.guide-nav-item {
    padding: 0.5rem 1rem;
    background-color: transparent;
    border: none;
    border-left: 3px solid transparent;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 400;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Roboto', sans-serif;
    border-radius: 0 0.375rem 0.375rem 0;
    border-bottom: 1px solid #e5e7eb;
    line-height: 1.4;
}

.guide-nav-item:last-child {
    border-bottom: none;
}

.guide-nav-item:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.guide-nav-item.active {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 500;
    border-left-color: #2563eb;
}

/* New badge styling for guide navigation */
.guide-nav-badge-new {
    display: inline-block;
    background-color: #fbbf24;
    color: #78350f;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
    vertical-align: middle;
    line-height: 1.2;
}

.guide-nav-item.active .guide-nav-badge-new {
    background-color: #f59e0b;
    color: #92400e;
}

/* Updated badge styling for guide navigation */
.guide-nav-badge-updated {
    display: inline-block;
    background-color: #3b82f6;
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
    vertical-align: middle;
    line-height: 1.2;
}

.guide-nav-item.active .guide-nav-badge-updated {
    background-color: #2563eb;
    color: #ffffff;
}

/* Content Sections - dynamic display */
.guide-content-section {
    display: none;
}

.guide-content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Override content-section first-of-type margin for active guide sections */
.guide-content-section.active.content-section:first-of-type {
    margin-top: 0;
}

/* Content Body Styling - matching overview pages */
.guide-content-body {
    line-height: 1.7;
    color: #6b7280;
    max-width: 100%;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    overflow-x: hidden;
}

.guide-content-body p {
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
    line-height: 1.7;
    color: #6b7280;
}

.guide-content-body p:last-child {
    margin-bottom: 0;
}

.guide-content-body h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 2.5rem 0 1.25rem 0;
    font-family: 'Roboto', sans-serif;
    line-height: 1.3;
}

.guide-content-body h3:first-child {
    margin-top: 0;
}

.guide-content-body h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 2rem 0 0.875rem 0;
    font-family: 'Roboto', sans-serif;
    line-height: 1.4;
}

.guide-content-body ul {
    margin: 0 0 1.75rem 1.5rem;
    padding: 0;
    list-style: none;
}

.guide-content-body ul ul {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    margin-left: 1.25rem;
}

.guide-content-body li {
    margin: 0.625rem 0;
    padding-left: 1.75rem;
    padding-right: 1rem;
    position: relative;
    font-size: 1rem;
    line-height: 1.7;
    color: #6b7280;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.guide-content-body ul li::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: #6b7280;
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.2;
}

.guide-content-body ul ul li::before {
    content: '◦';
    color: #6b7280;
    font-size: 1rem;
    left: 0.75rem;
}

.guide-content-body ul ul li {
    padding-left: 2rem;
    padding-right: 1rem;
}

.guide-content-body ol {
    margin: 0 0 1.75rem 1.75rem;
    padding: 0;
    list-style: decimal;
    color: #6b7280;
}

.guide-content-body ol li {
    margin: 0.625rem 0;
    padding-left: 0.5rem;
    padding-right: 1rem;
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.guide-content-body strong {
    font-weight: 600;
    color: #374151;
}

.guide-content-body .guide-inline-link {
    color: #6b7280;
    text-decoration: underline;
    font-weight: 400;
    transition: color 0.2s ease;
}

.guide-content-body .guide-inline-link:hover {
    color: #374151;
    text-decoration: underline;
}

.guide-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 2rem 0;
    border: none;
}

/* Sidebar title and description styling */
.guide-sidebar-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 0.5rem;
    display: block;
}

.guide-sidebar-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
    line-height: 1.1;
}

.guide-sidebar-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    line-height: 1.5;
}

.guide-sidebar-description {
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Responsive Design - matching overview pages breakpoints */

/* Desktop - between 1300px and 1024px - ensure carousel scales */
@media (max-width: 1300px) and (min-width: 1025px) {
    .guide-carousel-display.carousel-display,
    .guide-content-section .carousel-display,
    .guide-carousel-section .carousel-display {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .guide-carousel-main,
    .carousel-main {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .guide-carousel-section {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .guide-main-content,
    .main-content3.guide-main-content {
        min-width: 0;
        overflow-x: hidden;
    }
}

/* Tablet - keep 2 panels side by side */
@media (max-width: 1024px) and (min-width: 769px) {
    .page-wrapper {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .page-container {
        grid-template-columns: 300px 1fr !important;
    }

    .guide-sidebar {
        border-right: 1px solid #e5e7eb;
        border-bottom: none;
        padding: 1.5rem 1.25rem;
    }

    .guide-main-content,
    .main-content3.guide-main-content {
        padding: 1.5rem 1.25rem 2rem 1.25rem;
        min-width: 0;
    }

    .guide-sidebar-title {
        font-size: 2.5rem;
    }

    .guide-carousel-display,
    .carousel-display {
        height: 300px;
    }

    .guide-carousel-thumbnails,
    .carousel-thumbnails {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .guide-carousel-thumbnails::-webkit-scrollbar,
    .carousel-thumbnails::-webkit-scrollbar {
        height: 6px;
    }

    .guide-carousel-thumbnails::-webkit-scrollbar-track,
    .carousel-thumbnails::-webkit-scrollbar-track {
        background: #f3f4f6;
        border-radius: 3px;
    }

    .guide-carousel-thumbnails::-webkit-scrollbar-thumb,
    .carousel-thumbnails::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 3px;
    }

    .guide-carousel-thumbnails::-webkit-scrollbar-thumb:hover,
    .carousel-thumbnails::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }
}

/* Mobile - dropdown sidebar */
@media (max-width: 768px) {
    .page-wrapper {
        padding: 0 1rem;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .page-container {
        grid-template-columns: 1fr !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .guide-sidebar {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 0;
        background: #ffffff;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Dropdown toggle button */
    .guide-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 1rem 1.25rem;
        background: none;
        border: none;
        border-bottom: 1px solid #e5e7eb;
        cursor: pointer;
        font-family: 'Roboto', sans-serif;
        text-align: left;
    }

    .guide-sidebar-toggle-title {
        font-size: 1.5rem;
        font-weight: 700;
        color: #111827;
        margin: 0;
        line-height: 1.1;
    }

    .guide-sidebar-toggle-icon {
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }

    .guide-sidebar-toggle-icon svg {
        width: 20px;
        height: 20px;
        stroke: #6b7280;
    }

    .guide-sidebar.open .guide-sidebar-toggle-icon {
        transform: rotate(180deg);
    }

    /* Show mobile selector on mobile */
    .guide-mobile-selector {
        display: block;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .guide-mobile-selector-title-label {
        display: block;
        font-size: 0.875rem;
        font-weight: 600;
        color: #374151;
        margin-bottom: 0.5rem;
        font-family: 'Roboto', sans-serif;
    }

    .guide-mobile-selector-button {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.875rem 1rem;
        background-color: #f3f4f6;
        border: 2px solid #d1d5db;
        border-radius: 0.5rem;
        cursor: pointer;
        font-family: 'Roboto', sans-serif;
        transition: all 0.2s ease;
    }

    .guide-mobile-selector-button:hover {
        background-color: #e5e7eb;
        border-color: #9ca3af;
    }

    .guide-mobile-selector-button:active {
        background-color: #d1d5db;
    }

    .guide-mobile-selector-label {
        font-size: 0.9375rem;
        font-weight: 600;
        color: #374151;
    }

    .guide-mobile-selector-icon {
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }

    .guide-mobile-selector-icon svg {
        width: 20px;
        height: 20px;
        stroke: #6b7280;
    }

    .guide-sidebar.open .guide-mobile-selector-icon {
        transform: rotate(180deg);
    }

    .guide-sidebar.open .guide-mobile-selector-button {
        background-color: #eff6ff;
        border-color: #2563eb;
    }

    .guide-sidebar.open .guide-mobile-selector-button .guide-mobile-selector-label {
        color: #2563eb;
    }

    .guide-sidebar.open .guide-mobile-selector-button .guide-mobile-selector-icon svg {
        stroke: #2563eb;
    }

    /* Hide sidebar nav by default on mobile */
    .guide-sidebar-nav {
        display: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        margin-top: 0;
    }

    .guide-sidebar.open .guide-sidebar-nav {
        display: flex;
        flex-direction: column;
        max-height: 2000px;
        padding: 0.5rem 0;
    }

    .guide-main-content,
    .main-content3.guide-main-content {
        padding: 1.25rem 1rem 1.5rem 1rem;
        min-width: 0;
    }

    .guide-carousel-display,
    .carousel-display {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .page-wrapper {
        padding: 0 1rem;
    }

    .guide-sidebar {
        padding: 1.25rem 1rem;
    }

    .guide-sidebar-title {
        font-size: 3.25rem;
        margin-bottom: 0.25rem;
    }
    
    .guide-sidebar-subtitle {
        font-size: 1.125rem;
        margin-bottom: 0;
    }

    .guide-sidebar-nav {
        margin-top: 0;
    }

    .guide-content-section .guide-content-title {
        font-size: 2rem;
        margin-bottom: 0.875rem;
    }

    .guide-content-section .guide-content-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
        line-height: 1.6;
    }

    .guide-content-body p {
        font-size: 0.9375rem;
        line-height: 1.65;
        margin-bottom: 1.25rem;
    }

    .guide-content-body li {
        font-size: 0.9375rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        line-height: 1.65;
        margin: 0.5rem 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .guide-content-body ul li {
        padding-left: 1.75rem;
    }
    
    .guide-content-body ol li {
        padding-right: 1.5rem;
    }
    
    .guide-content-body ul ul li {
        padding-left: 2.25rem;
        padding-right: 1.5rem;
    }

    .guide-content-body h3 {
        font-size: 1.25rem;
        margin: 2rem 0 1rem 0;
    }

    .guide-content-body h4 {
        font-size: 1rem;
        margin: 1.5rem 0 0.75rem 0;
    }

    .guide-content-body ul {
        margin-bottom: 1.5rem;
    }

    .guide-content-body ol {
        margin-bottom: 1.5rem;
    }

    .guide-nav-item {
        font-size: 0.8125rem;
        padding: 0.5rem 0.875rem;
    }

    .guide-carousel-main,
    .carousel-main {
        gap: 0.5rem;
    }

    .guide-carousel-arrow,
    .carousel-arrow {
        width: 36px;
        height: 36px;
        padding: 0;
    }

    .guide-carousel-arrow svg,
    .carousel-arrow svg {
        width: 18px;
        height: 18px;
    }

    .guide-carousel-display,
    .carousel-display {
        height: 250px;
    }

    .guide-carousel-thumbnails,
    .carousel-thumbnails {
        gap: 0.5rem;
        padding: 0.5rem 0;
    }

    .guide-carousel-section .thumbnail,
    .carousel-thumbnails .thumbnail {
        width: 60px;
        height: 60px;
        padding: 0.5rem;
    }

    .guide-main-content,
    .main-content3.guide-main-content {
        padding: 1.25rem 1rem 1.5rem 1rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .guide-carousel-section {
        margin-bottom: 1.5rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .guide-carousel-main,
    .carousel-main {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .guide-content-section {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }
    
    .guide-content-body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        word-wrap: break-word;
    }
}

@media (max-width: 640px) {
    .page-wrapper {
        padding: 0 0.75rem;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .guide-sidebar {
        padding: 1rem 0.75rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .guide-sidebar-title {
        font-size: 2.75rem;
    }
    
    .guide-sidebar-subtitle {
        font-size: 1rem;
        margin-bottom: 0;
    }

    .guide-content-section .guide-content-title {
        font-size: 1.75rem;
    }

    .guide-content-body p {
        font-size: 0.9375rem;
    }

    .guide-content-body li {
        font-size: 0.9375rem;
        padding-left: 1rem;
        padding-right: 1.25rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .guide-content-body ul li {
        padding-left: 1.25rem;
    }
    
    .guide-content-body ol li {
        padding-right: 1.25rem;
    }
    
    /* More space between open-circle bullet (◦) and text on small screens */
    .guide-content-body ul ul li {
        padding-left: 2.5rem;
        padding-right: 1.25rem;
    }

    .guide-content-body h3 {
        font-size: 1.25rem;
    }

    .guide-content-body h4 {
        font-size: 1rem;
    }

    .guide-nav-item {
        font-size: 0.8125rem;
        padding: 0.5rem 0.875rem;
    }

    .guide-carousel-display,
    .carousel-display {
        height: 200px;
    }

    .guide-main-content,
    .main-content3.guide-main-content {
        padding: 1rem 0.75rem 1.25rem 0.75rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .guide-content-body {
        padding-right: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .guide-carousel-display,
    .carousel-display {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .guide-carousel-image,
    .carousel-image {
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }
}

@media (max-width: 480px) {
    .page-wrapper {
        padding: 0 0.5rem;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .guide-sidebar {
        padding: 0.875rem 0.5rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .guide-sidebar-title {
        font-size: 2.5rem;
    }
    
    .guide-sidebar-subtitle {
        font-size: 0.9375rem;
        margin-bottom: 0;
    }

    .guide-content-section .guide-content-title {
        font-size: 1.5rem;
    }

    .guide-content-body p {
        font-size: 0.9375rem;
    }

    .guide-content-body li {
        font-size: 0.9375rem;
        padding-left: 0.875rem;
        padding-right: 1.25rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .guide-content-body ul li {
        padding-left: 1.125rem;
    }

    .guide-content-body ol li {
        padding-right: 1.25rem;
    }
    
    /* More space between open-circle bullet (◦) and text on iPhone */
    .guide-content-body ul ul li {
        padding-left: 2.25rem;
        padding-right: 1.25rem;
    }

    .guide-content-body h3 {
        font-size: 1rem;
        margin: 1.5rem 0 0.875rem 0;
    }

    .guide-content-body h4 {
        font-size: 0.875rem;
    }

    .guide-nav-item {
        font-size: 0.75rem;
        padding: 0.4375rem 0.75rem;
    }

    .guide-carousel-main,
    .carousel-main {
        gap: 0.25rem;
    }

    .guide-carousel-arrow,
    .carousel-arrow {
        width: 32px;
        height: 32px;
    }

    .guide-carousel-arrow svg,
    .carousel-arrow svg {
        width: 16px;
        height: 16px;
    }

    .guide-carousel-display,
    .carousel-display {
        height: 180px;
        min-height: 180px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .guide-carousel-image,
    .carousel-image {
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    /* Ensure active carousel image is visible on iPhone (no override hiding it) */
    .guide-carousel-section .guide-carousel-display .carousel-image.active,
    .guide-carousel-section .guide-carousel-display .guide-carousel-image.active {
        display: block !important;
        visibility: visible !important;
        opacity: 1;
    }

    .guide-carousel-thumbnails,
    .carousel-thumbnails {
        gap: 0.375rem;
        padding: 0.375rem 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .guide-carousel-section .thumbnail,
    .carousel-thumbnails .thumbnail {
        width: 50px;
        height: 50px;
        padding: 0.375rem;
        flex-shrink: 0;
    }

    .guide-main-content,
    .main-content3.guide-main-content {
        padding: 0.875rem 0.5rem 1rem 0.5rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .guide-content-section {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }
    
    .guide-content-body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        word-wrap: break-word;
    }

    .guide-carousel-section {
        margin-bottom: 1.25rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
}
