/* Page-specific styles */

/* Prevent horizontal scrolling issues */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Force all major containers to respect viewport width */
.container,
.page-content,
.main-content,
.content-section,
.content-block,
.maturity-levels,
.maturity-card,
.roadmap-steps,
.roadmap-step,
.step-content,
.phase-section,
.pillar-section,
.phase-definition,
.pillar-definition,
.roles-tools-grid,
.rt-card,
.best-practices,
.info-box,
.warning-box,
.artifact-list {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Additional overflow protection for mobile */
@media (max-width: 768px) {
    .container,
    .page-content,
    .main-content,
    .content-section,
    .content-block,
    .maturity-levels,
    .maturity-card,
    .roadmap-steps,
    .roadmap-step,
    .step-content,
    .phase-section,
    .pillar-section {
        width: 100%;
        max-width: 100vw;
        margin-left: 0;
        margin-right: 0;
    }
}

.framework-image,
.capability-matrix-image {
    margin: 2rem 0;
    width: 100%;
    overflow: hidden;
}

.framework-image img,
.capability-matrix-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.page-hero {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1e293b 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

.page-hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.page-hero p {
    font-size: 1.2rem;
    color: var(--text-light);
}

.page-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    padding: 3rem 20px;
    max-width: 1400px;
    width: 100%;
    box-sizing: border-box;
}

/* Sidebar Navigation */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--dark-bg);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    border-left-color: var(--primary-color);
}

/* Main Content */
.main-content {
    max-width: 900px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Force word wrapping on all text elements */
h1, h2, h3, h4, h5, h6, p, li, td, th, a, span {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.phase-section,
.pillar-section,
.content-section {
    margin-bottom: 4rem;
    scroll-margin-top: 100px;
}

.phase-header,
.pillar-header {
    margin-bottom: 2rem;
}

.phase-badge,
.pillar-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.phase-header h2,
.pillar-header h2 {
    font-size: 2.5rem;
    color: var(--dark-bg);
    margin-top: 0.5rem;
}

.phase-definition,
.pillar-definition {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(124, 58, 237, 0.05));
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 2rem;
}

.definition-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    font-style: italic;
}

.content-block {
    margin-bottom: 2.5rem;
}

.content-block h3 {
    font-size: 1.5rem;
    color: var(--dark-bg);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.content-block h4 {
    font-size: 1.2rem;
    color: var(--dark-bg);
    margin-bottom: 0.8rem;
}

.content-block p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.content-block ul {
    margin-left: 1.5rem;
    max-width: 100%;
    box-sizing: border-box;
    padding-right: 0.5rem;
}

.content-block ul li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.content-block ol {
    max-width: 100%;
    box-sizing: border-box;
    padding-right: 0.5rem;
}

.artifact-list {
    list-style: none;
    margin-left: 0;
}

.artifact-list li {
    padding: 1rem;
    background: white;
    border-left: 4px solid var(--accent-color);
    margin-bottom: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.artifact-list li strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.3rem;
}

.checklist {
    list-style: none;
    margin-left: 0;
}

.checklist li {
    padding-left: 2rem;
    position: relative;
    margin-bottom: 0.8rem;
}

.checklist li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.2rem;
}

.roles-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.rt-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.rt-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.rt-card ul {
    margin-left: 1.5rem;
}

.best-practices {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(6, 182, 212, 0.05));
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--success-color);
    margin-top: 2rem;
}

.best-practices h4 {
    color: var(--success-color);
    margin-bottom: 1rem;
}

.best-practices ul {
    list-style: none;
    margin-left: 0;
}

.best-practices li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.8rem;
}

.best-practices li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.phase-navigation {
    margin-top: 3rem;
    text-align: center;
}

/* Taxonomy Tables */
.table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.taxonomy-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 600px; /* Prevent table from getting too narrow */
}

.taxonomy-table th {
    background: var(--dark-bg);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.taxonomy-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
    line-height: 1.6;
}

.taxonomy-table tr:last-child td {
    border-bottom: none;
}

.taxonomy-table tr:hover {
    background: rgba(37, 99, 235, 0.02);
}

.taxonomy-table td:first-child {
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

/* Maturity Model */
.maturity-levels {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
    width: 100%;
    max-width: 100%;
}

.maturity-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border-left: 6px solid var(--primary-color);
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.maturity-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.maturity-card.level-1 { border-left-color: #ef4444; }
.maturity-card.level-2 { border-left-color: #f97316; }
.maturity-card.level-3 { border-left-color: #eab308; }
.maturity-card.level-4 { border-left-color: #22c55e; }
.maturity-card.level-5 { border-left-color: #3b82f6; }

.maturity-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.maturity-level {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.maturity-card h3 {
    font-size: 1.5rem;
    color: var(--dark-bg);
}

.maturity-card p {
    color: var(--text-light);
    margin: 1rem 0;
}

.maturity-capabilities {
    background: rgba(37, 99, 235, 0.05);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.maturity-capabilities h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.maturity-capabilities ul {
    margin-left: 1.5rem;
}

/* Implementation Roadmap */
.roadmap-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 2rem 0;
}

.roadmap-step {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.step-number {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.step-content h3 {
    color: var(--dark-bg);
    margin-bottom: 0.8rem;
}

.step-content p {
    color: var(--text-light);
    line-height: 1.7;
}

.step-content ul {
    margin-top: 1rem;
    margin-left: 1.5rem;
}

/* Info Boxes */
.info-box {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05), rgba(37, 99, 235, 0.05));
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
    margin: 2rem 0;
}

.info-box h4 {
    color: var(--accent-color);
    margin-bottom: 0.8rem;
}

.warning-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(239, 68, 68, 0.05));
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--warning-color);
    margin: 2rem 0;
}

.warning-box h4 {
    color: var(--warning-color);
    margin-bottom: 0.8rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 15px;
        width: 100%;
        max-width: 100vw;
    }

    .container {
        max-width: 100%;
        padding: 0 15px;
    }

    .sidebar {
        position: relative;
        top: 0;
        background: white;
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    }

    .sidebar-nav {
        display: flex;
        gap: 1rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .sidebar-nav li {
        margin-bottom: 0;
        white-space: nowrap;
    }

    .sidebar-nav a {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 0.5rem 1rem;
    }

    .sidebar-nav a:hover,
    .sidebar-nav a.active {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }

    .roles-tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 100%;
    }

    .roadmap-step {
        grid-template-columns: 60px 1fr;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .step-number {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        flex-shrink: 0;
    }

    .step-content {
        min-width: 0;
        width: 100%;
    }

    .maturity-card {
        width: 100%;
        max-width: 100%;
    }

    /* Taxonomy Tables - Keep simple scroll on tablet */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .taxonomy-table {
        min-width: 600px;
    }

    .taxonomy-table th,
    .taxonomy-table td {
        padding: 0.8rem;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .container {
        padding: 0 10px;
        max-width: 100%;
    }

    .page-content {
        padding: 1.5rem 10px;
        width: 100%;
        overflow-x: hidden;
    }

    .page-hero {
        padding: 3rem 0;
        width: 100%;
        overflow-x: hidden;
    }

    .page-hero h1 {
        font-size: 1.8rem;
        padding: 0 15px;
    }

    .page-hero p {
        font-size: 1rem;
        padding: 0 15px;
    }

    .main-content {
        padding: 0 10px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Images on mobile */
    .framework-image,
    .capability-matrix-image {
        margin: 1.5rem 0;
    }

    .framework-image img,
    .capability-matrix-image img {
        border-radius: 4px;
    }

    /* Phase navigation buttons on mobile */
    .phase-navigation {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .phase-navigation .btn {
        width: 100%;
    }

    .phase-header h2,
    .pillar-header h2 {
        font-size: 1.8rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .definition-text {
        font-size: 1rem;
        line-height: 1.6;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .phase-definition,
    .pillar-definition {
        padding: 1.5rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .phase-header,
    .pillar-header {
        width: 100%;
        max-width: 100%;
    }

    .content-block h3 {
        font-size: 1.3rem;
    }

    .content-block h4 {
        font-size: 1.1rem;
    }

    .artifact-list li,
    .rt-card {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .best-practices,
    .info-box,
    .warning-box {
        padding: 1.2rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .content-block {
        width: 100%;
        max-width: 100%;
    }

    .phase-section,
    .pillar-section,
    .content-section {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .maturity-card {
        padding: 1.5rem;
    }

    .maturity-header {
        flex-wrap: wrap;
    }

    .maturity-level {
        font-size: 1.5rem;
    }

    .maturity-card h3 {
        font-size: 1.2rem;
    }

    .maturity-card p {
        font-size: 0.95rem;
    }

    .maturity-capabilities {
        padding: 0.8rem;
    }

    .roadmap-step {
        grid-template-columns: 50px 1fr;
    }

    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .step-content {
        padding: 1.2rem;
    }
}

@media (max-width: 480px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .page-content {
        padding: 1.5rem 10px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .container {
        padding: 0 10px;
        width: 100%;
        max-width: 100%;
    }

    .page-hero {
        padding: 2.5rem 0;
        width: 100%;
        overflow-x: hidden;
    }

    .page-hero .container {
        padding: 0 10px;
    }

    .page-hero h1 {
        font-size: 1.5rem;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .page-hero p {
        font-size: 0.9rem;
    }

    .main-content {
        padding: 0 5px;
        width: 100%;
        max-width: 100%;
    }

    .phase-badge,
    .pillar-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.8rem;
    }

    .phase-header h2,
    .pillar-header h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .content-block h3 {
        font-size: 1.2rem;
    }

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

    .content-block p {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .sidebar h3 {
        font-size: 1rem;
    }

    /* Make content more breathable on mobile */
    .content-section {
        margin-bottom: 2.5rem;
    }

    .content-block {
        margin-bottom: 2rem;
    }

    .sidebar-nav {
        gap: 0.5rem;
    }

    .sidebar-nav a {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .roadmap-step {
        grid-template-columns: 1fr;
        text-align: center;
        width: 100%;
        max-width: 100%;
    }

    .step-number {
        margin: 0 auto;
    }

    .step-content {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        box-sizing: border-box;
    }

    .step-content h3,
    .step-content h4,
    .step-content p {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Mobile table improvements */
    .taxonomy-table {
        min-width: 500px;
        font-size: 13px;
    }

    .taxonomy-table th,
    .taxonomy-table td {
        padding: 0.6rem 0.5rem;
        font-size: 12px;
    }

    /* Add scroll indicator */
    .table-wrapper::after {
        content: "← Scroll to see more →";
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: var(--text-light);
        padding: 0.5rem;
        background: #f8fafc;
        border-top: 1px solid var(--border-color);
    }

    .table-wrapper::-webkit-scrollbar {
        height: 6px;
    }

    .table-wrapper::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .table-wrapper::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }

    /* Improve artifact list and content blocks on small screens */
    .artifact-list li {
        font-size: 0.9rem;
    }

    .content-block ul li {
        font-size: 0.9rem;
    }

    /* Make ordered lists more compact */
    .step-content ol {
        margin-left: 1.2rem;
        font-size: 0.9rem;
    }

    /* Tighter spacing for info boxes */
    .info-box ul,
    .warning-box ul,
    .best-practices ul {
        margin-left: 0.8rem;
    }

    .info-box li,
    .warning-box li,
    .best-practices li {
        font-size: 0.9rem;
        margin-bottom: 0.6rem;
    }

    /* Improve maturity card text spacing */
    .maturity-card ul {
        margin-left: 1.2rem;
    }

    .maturity-card li {
        font-size: 0.9rem;
        margin-bottom: 0.6rem;
    }

    /* Phase navigation buttons */
    .phase-navigation {
        margin-top: 2rem;
    }

    .phase-navigation .btn {
        font-size: 0.9rem;
        padding: 0.8rem 1.5rem;
    }
}

/* Touch-friendly improvements for mobile devices */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes */
    .sidebar-nav a,
    .nav-menu a,
    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Better tap highlights */
    * {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
    }

    /* Remove hover effects on touch devices */
    .maturity-card:hover {
        transform: none;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    }

    /* Improve readability on small touch screens */
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
}

/* Landscape mobile optimization */
@media (max-width: 900px) and (orientation: landscape) {
    .page-hero {
        padding: 2rem 0;
    }

    .page-hero h1 {
        font-size: 1.8rem;
    }

    .page-content {
        padding: 2rem 15px;
    }
}

/* Extra small devices optimization */
@media (max-width: 360px) {
    .page-hero h1 {
        font-size: 1.3rem;
    }

    .content-block h3 {
        font-size: 1.1rem;
    }

    .phase-header h2,
    .pillar-header h2 {
        font-size: 1.3rem;
    }

    .taxonomy-table {
        min-width: 450px;
        font-size: 11px;
    }

    .taxonomy-table th,
    .taxonomy-table td {
        padding: 0.5rem 0.4rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.7rem 1.2rem;
    }

    .maturity-card {
        padding: 1.2rem;
    }

    .step-content {
        padding: 1rem;
    }

    /* Final comprehensive overflow fixes */
    * {
        max-width: 100%;
    }

    .page-content,
    .main-content,
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    header,
    footer,
    section {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
}