body {
    background-color: #f5f5f5;
}

p {
    font-size: 18px;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Hero Section (Index Page) */
.hero-section {
    background: linear-gradient(135deg, rgba(0, 40, 94, 0.88) 0%, rgba(0, 40, 94, 0.86) 100%), url('../images/pexels-hoan-ng-c-510735-6961112.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 40px 250px;
    position: relative;
}

.hero-title {
    font-size: 40px;
    font-weight: bold;
    margin-bottom: 25px;
}

.hero-description {
    font-size: 20px;
    line-height: 1.5;
    max-width: 1000px;
    margin-bottom: 15px;
}

.hero-description:last-child {
    margin-bottom: 0;
}

/* Content Section */
.content-section {
    padding: 60px 250px;
}

.section-block {
    margin-bottom: 40px;
    padding: 30px;
}

/* Home page full-width backgrounds */
.home-page.content-section {
    padding: 0;
}

.home-page .section-block {
    margin-bottom: 0;
    padding: 60px 250px;
}

.home-page .section-block:nth-child(odd) {
    background-color: white;
}

.home-page .section-block:nth-child(even) {
    background-color: #f9f9f9;
}

.section-title {
    font-size: 25px;
    font-weight: bold;
    color: var(--color-primary-500);
    margin-bottom: 20px;
}

.section-text, .section-text * {
    font-size: 18px;
    line-height: 1.9;
    color: #333;
    margin-bottom: 15px;
}

.section-text ul {
    margin-left: 20px;
    margin-top: 10px;
    margin-bottom: 10px;
    list-style: revert;
}

.section-text li {
    margin-bottom: 8px;
}

.subsection-title {
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 8px;
}

/* CTA Button */
.cta-button {
    display: block;
    background-color: var(--color-secondary-500);
    color: var(--color-primary-500);
    padding: 25px 30px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    margin: 20px auto 0 auto;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    line-height: 1.4;
}

.cta-button:hover {
    background-color: #e5a920;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

/* Page Title */
.page-title {
    font-size: 28px;
    font-weight: bold;
    color: var(--color-primary-500);
    margin-bottom: 40px;
    text-align: center;
}

/* Note Text */
.note-text {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-top: 30px;
    margin-bottom: 80px;
    text-align: center;
    font-style: italic;
}

/* Table Responsive Wrapper */
.table-responsive {
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
}

/* Table Styles (Frais Page) */
table {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border-collapse: collapse;
    background-color: white;
    box-shadow: none;
}

th {
    background-color: var(--color-primary-500);
    color: white;
    padding: 15px 20px;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
}

th + th {
    border-left: 10px solid white;
}

td {
    padding: 15px 20px;
    border-bottom: none;
    font-size: 17px;
    background-color: #ececec;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
    font-weight: bold;
}

td + td {
    border-left: 10px solid white;
}

tr + tr td {
    border-top: 10px solid white;
}

tr:hover td {
    background-color: #f0f0f0;
}

td:last-child {
    font-weight: bold;
    color: var(--color-primary-500);
}

/* CEB Header (Communique Page) */
.ceb-header {
    background-color: #1227ba;
    padding: 20px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ceb-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ceb-logo {
    width: 90px;
    height: auto;
    display: block;
}

.ceb-name {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    line-height: 1.4;
    text-align: left;
}

.ceb-header .page-title {
    font-size: 36px;
    font-weight: bold;
    color: #ffffff;
    margin: 0;
}

.communique-content {
    background-color: white;
    padding: 0;
}

.announcement-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--color-primary-500);
    margin-bottom: 25px;
    text-transform: uppercase;
}

.signature {
    text-align: right;
    font-size: 18px;
    color: var(--color-primary-500);
    margin-top: 40px;
    font-style: italic;
}

/* Brochure Page Specific Styles */
.formula {
    margin: 20px 0;
    padding-left: 40px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    line-height: 2;
}

.footnote {
    font-size: 18px;
    margin: 20px 0;
    font-style: italic;
    line-height: 1.6;
}

.table-placeholder {
    margin: 25px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border: 2px dashed #ccc;
    text-align: center;
    color: #999;
}

/* Grid Code Page Styles */
.grid-code h1 {
    font-size: 32px;
    font-weight: bold;
    color: var(--color-primary-500);
    margin-bottom: 30px;
    text-align: center;
}

.grid-code h1 .subtitle {
    display: block;
    font-size: 24px;
    color: var(--color-primary-500);
    margin-top: 10px;
}

.grid-code h1 .version {
    display: block;
    font-size: 16px;
    color: #666;
    font-weight: normal;
    margin-top: 5px;
}

.grid-code h2 {
    font-size: 22px;
    font-weight: bold;
    color: var(--color-primary-500);
    margin-top: 40px;
    margin-bottom: 20px;
}

.grid-code h3 {
    font-size: 20px;
    font-weight: bold;
    color: var(--color-primary-500);
    margin-top: 30px;
    margin-bottom: 15px;
}

.grid-code h4 {
    font-size: 18px;
    font-weight: bold;
    color: var(--color-primary-500);
    margin-top: 25px;
    margin-bottom: 12px;
}

.toc {
    background-color: #f9f9f9;
    padding: 30px;
    margin-bottom: 40px;
    border-left: 4px solid var(--color-primary-500);
}

.toc-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--color-primary-500);
    margin-bottom: 15px;
}

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

.toc-list li {
    margin-bottom: 8px;
}

.toc-list a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
}

.toc-list a:hover {
    color: var(--color-primary-500);
    text-decoration: underline;
}

/* Grid Code Sticky Sidebar */
.grid-code.content-section {
    display: flex;
    gap: 40px;
    position: relative;
}

.grid-code .main-content {
    flex: 1;
}

.grid-code .sticky-sidebar {
    position: fixed;
    top: 50%;
    right: -320px;
    transform: translateY(-50%);
    width: 320px;
    max-height: 80vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 5px 0 0 5px;
    border-left: 4px solid var(--color-secondary-500);
    transition: right 0.3s ease;
    z-index: 1000;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

.grid-code .sticky-sidebar.open {
    right: 0;
}

.grid-code .sidebar-toggle {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--color-secondary-500);
    color: var(--color-primary-500);
    border: none;
    padding: 15px 10px;
    cursor: pointer;
    border-radius: 5px 0 0 5px;
    font-size: 14px;
    font-weight: bold;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transition: background-color 0.3s, opacity 0.5s ease, visibility 0.5s;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
}

.grid-code .sidebar-toggle.visible {
    opacity: 1;
    visibility: visible;
}

.grid-code .sidebar-toggle:hover {
    background-color: var(--color-primary-500);
    color: white;
}

.grid-code .sticky-sidebar .sidebar-title {
    position: sticky;
    top: -20px;
    background-color: #f9f9f9;
    padding-bottom: 15px;
    margin-bottom: 0;
    margin-top: -20px;
    margin-left: -20px;
    margin-right: -20px;
    padding-top: 20px;
    padding-left: 20px;
    padding-right: 20px;
    font-size: 16px;
    font-weight: bold;
    color: var(--color-primary-500);
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    border-bottom: 2px solid #eee;
}

.grid-code .sidebar-close {
    background: none;
    border: none;
    color: var(--color-primary-500);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.grid-code .sidebar-close:hover {
    background-color: var(--color-secondary-500);
}

.grid-code .sticky-sidebar .sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-top: 15px;
}

.grid-code .sticky-sidebar .sidebar-list li {
    margin-bottom: 8px;
}

.grid-code .sticky-sidebar .sidebar-list li.sub-item {
    margin-left: 15px;
    font-size: 13px;
}

.grid-code .sticky-sidebar .sidebar-list a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    display: block;
    padding: 5px 0;
    transition: color 0.2s;
}

.grid-code .sticky-sidebar .sidebar-list a:hover {
    color: var(--color-secondary-500);
    padding-left: 5px;
}

/* Scrollbar styling for sidebar */
.grid-code .sticky-sidebar::-webkit-scrollbar {
    width: 6px;
}

.grid-code .sticky-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.grid-code .sticky-sidebar::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 3px;
}

.grid-code .sticky-sidebar::-webkit-scrollbar-thumb:hover {
    background: #999999;
}

/* ============================================
   RESPONSIVE MEDIA QUERIES
   ============================================ */

/* Under 1360px: reduce inline padding */
@media screen and (max-width: 1360px) {
    .content-section {
        padding: 60px 80px;
    }

    .hero-section {
        padding: 40px 80px;
    }

    .home-page .section-block {
        padding: 60px 80px;
    }
}

/* Tablet and below (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    .hero-section {
        padding: 80px 40px;
    }

    .hero-description {
        max-width: 100%;
    }

    .home-page .section-block {
        padding: 60px 40px;
    }

    table {
        max-width: 100%;
    }
}

/* Tablet portrait and mobile landscape (max-width: 768px) */
@media screen and (max-width: 768px) {
    .content-section {
        padding: 20px;
    }

    /* Communique page */
    .ceb-header {
        padding: 15px 20px;
    }

    .ceb-left {
        gap: 10px;
    }

    .ceb-logo {
        width: 70px;
    }

    .ceb-name {
        font-size: 11px;
    }

    .ceb-header .page-title {
        font-size: 28px;
    }

    .communique-content {
        padding: 0;
    }

    .announcement-title {
        font-size: 20px;
    }

    .section-block {
        padding: 20px;
    }

    .hero-section {
        padding: 60px 20px;
    }

    .hero-section h1 {
        font-size: 28px;
    }

    .hero-section p {
        font-size: 16px;
    }

    .home-page .section-block {
        padding: 40px 20px;
    }

    .section-block h2 {
        font-size: 28px;
    }

    .section-block p {
        font-size: 16px;
    }

    .cta-button {
        padding: 25px 30px;
        font-size: 16px;
    }

    /* Table responsive */
    .table-responsive {
        margin: 0;
    }

    table {
        width: 100%;
        max-width: 100%;
    }

    th, td {
        padding: 12px 10px;
        font-size: 15px;
    }

    .page-title {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .note-text {
        font-size: 14px;
        margin-top: 25px;
    }

    /* Grid-code page */
    .grid-code-header {
        padding: 30px 20px;
    }

    .grid-code-header h1 {
        font-size: 28px;
    }

    .grid-code-content {
        padding: 30px 20px;
    }

    .grid-code-content h2 {
        font-size: 24px;
    }

    .grid-code-content h3 {
        font-size: 20px;
    }

    .grid-code-content p,
    .grid-code-content li {
        font-size: 15px;
    }

    .grid-code .sticky-sidebar {
        position: fixed;
        top: auto;
        bottom: -100%;
        left: 0;
        right: auto;
        transform: none;
        width: 100%;
        height: 100vh;
        max-height: none;
        padding: 0;
        border-radius: 0;
        border-left: none;
        border-top: 4px solid var(--color-secondary-500);
        transition: bottom 0.3s ease;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 1001;
    }

    .grid-code .sticky-sidebar.open {
        bottom: 0;
        right: auto;
    }

    .grid-code .sidebar-toggle {
        position: fixed;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        padding: 12px 30px;
        font-size: 14px;
        z-index: 1000;
        bottom: 0;
        top: unset;
        width: 100%;
        border-radius: 0;
    }

    .grid-code .sticky-sidebar .sidebar-title {
        margin-top: 0;
        margin-left: 0;
        margin-right: 0;
        padding-top: 15px;
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 15px;
        top: 0;
        border-radius: 0;
    }

    .grid-code .sticky-sidebar .sidebar-list {
        padding: 0 20px 20px 20px;
    }
}

/* Mobile devices (max-width: 480px) */
@media screen and (max-width: 480px) {
    .content-section {
        padding: 15px;
    }

    /* Communique page */
    .ceb-header {
        padding: 10px 15px;
    }

    .ceb-left {
        gap: 8px;
    }

    .ceb-logo {
        width: 55px;
    }

    .ceb-name {
        font-size: 9px;
    }

    .ceb-header .page-title {
        font-size: 24px;
    }

    .communique-content {
        padding: 0;
    }

    .announcement-title {
        font-size: 18px;
    }

    .section-text, .section-text * {
        font-size: 14px;
    }

    .signature {
        font-size: 14px;
        margin-top: 30px;
    }

    .section-block {
        padding: 15px;
    }

    .hero-section {
        padding: 40px 15px;
    }

    .hero-section h1 {
        font-size: 24px;
        line-height: 1.3;
    }

    .hero-section p {
        font-size: 14px;
        line-height: 1.6;
    }

    .home-page .section-block {
        padding: 30px 15px;
    }

    .section-block h2 {
        font-size: 24px;
    }

    .section-block p {
        font-size: 14px;
        line-height: 1.6;
    }

    .cta-button {
        padding: 20px 25px;
        font-size: 14px;
        width: 100%;
        max-width: 300px;
    }

    /* Table */
    .table-responsive {
        margin: 0;
    }

    table {
        width: 100%;
        max-width: 100%;
    }

    th, td {
        padding: 10px 6px;
        font-size: 13px;
    }

    th {
        font-size: 14px;
    }

    .page-title {
        font-size: 24px;
        margin-bottom: 25px;
        line-height: 1.3;
    }

    .note-text {
        font-size: 13px;
        margin-top: 20px;
    }

    /* Grid-code */
    .grid-code-header {
        padding: 20px 15px;
    }

    .grid-code-header h1 {
        font-size: 24px;
    }

    .grid-code-content {
        padding: 20px 15px;
    }

    .grid-code-content h2 {
        font-size: 20px;
    }

    .grid-code-content h3 {
        font-size: 18px;
    }

    .grid-code-content h4 {
        font-size: 16px;
    }

    .grid-code-content p,
    .grid-code-content li {
        font-size: 14px;
    }

    .grid-code .sidebar-toggle {
        position: fixed;
        bottom: 0;
        left: 0;
        right: auto;
        width: 100%;
        transform: none;
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        padding: 10px 24px;
        font-size: 13px;
        border-radius: 0;
        z-index: 1000;
    }

    .grid-code .sticky-sidebar {
        padding: 0;
    }

    .grid-code .sticky-sidebar .sidebar-title {
        font-size: 14px;
        margin-top: 0;
        margin-left: 0;
        margin-right: 0;
        padding-top: 12px;
        padding-left: 15px;
        padding-right: 15px;
        padding-bottom: 12px;
        top: 0;
    }

    .grid-code .sticky-sidebar .sidebar-list {
        padding: 0 15px 15px 15px;
    }

    .grid-code .sticky-sidebar .sidebar-list a {
        font-size: 12px;
    }
}

/* Very small devices (max-width: 360px) */
@media screen and (max-width: 360px) {
    .hero-section h1 {
        font-size: 20px;
    }

    .section-block h2 {
        font-size: 20px;
    }

    .grid-code-header h1 {
        font-size: 20px;
    }

    .content-section {
        padding: 12px;
    }

    /* Communique page */
    .ceb-header {
        padding: 8px 12px;
    }

    .ceb-left {
        gap: 6px;
    }

    .ceb-logo {
        width: 45px;
    }

    .ceb-name {
        font-size: 8px;
        line-height: 1.3;
    }

    .ceb-header .page-title {
        font-size: 20px;
    }

    .communique-content {
        padding: 0;
    }

    .announcement-title {
        font-size: 16px;
    }

    .section-text {
        font-size: 13px;
    }

    .section-block {
        padding: 12px;
    }

    /* Table */
    th, td {
        padding: 8px 4px;
        font-size: 11px;
    }

    th {
        font-size: 12px;
    }

    .page-title {
        font-size: 20px;
        margin-bottom: 20px;
        line-height: 1.2;
    }

    .note-text {
        font-size: 12px;
        margin-top: 15px;
    }

    .grid-code .sidebar-toggle {
        position: fixed;
        bottom: 0;
        left: 0;
        right: auto;
        width: 100%;
        transform: none;
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        padding: 8px 20px;
        font-size: 12px;
        border-radius: 0;
        z-index: 1000;
    }

    .grid-code .sticky-sidebar {
        padding: 0;
    }

    .grid-code .sticky-sidebar .sidebar-title {
        font-size: 13px;
        margin-top: 0;
        margin-left: 0;
        margin-right: 0;
        padding-top: 10px;
        padding-left: 12px;
        padding-right: 12px;
        padding-bottom: 10px;
        top: 0;
    }

    .grid-code .sticky-sidebar .sidebar-list {
        padding: 0 12px 12px 12px;
    }
}
