/*
 * RTG Avocats — global visual harmony
 *
 * This stylesheet is deliberately separate from Divi content and settings.
 * Removing this file and rtg-visual-harmony.php restores the previous design.
 */

:root {
    --rtg-navy: #1e232b;
    --rtg-ivory: #f2f0ec;
    --rtg-gold: #d7d2cb;
    --rtg-bronze: #8a0f1c;
    --rtg-stone: #d7d2cb;
    --rtg-soft-white: #f2f0ec;
    --rtg-text-on-dark: #eceae6;
    --rtg-muted-on-dark: #c9c7c2;
    --rtg-burgundy: #8a0f1c;
    --rtg-accent: #6f7782;
    --rtg-accent-dark: #4f5863;
    --rtg-white: #ffffff;
}

/* A crisp header prevents page content from showing through while scrolling. */
#main-header,
#main-header.et-fixed-header {
    background-color: rgba(255, 255, 255, 0.97) !important;
    border-bottom: 1px solid rgba(30, 35, 43, 0.08);
    box-shadow: 0 4px 18px rgba(30, 35, 43, 0.08) !important;
}

/* Replace Divi's default blue with a restrained slate accent. */
#top-menu > li:not(.lang-item) > a:hover,
#top-menu > li.current-menu-item:not(.lang-item) > a,
#top-menu > li.current_page_item:not(.lang-item) > a,
#top-menu > li.current-menu-ancestor:not(.lang-item) > a {
    color: var(--rtg-accent-dark) !important;
}

#top-menu > li.current-menu-item:not(.lang-item) > a,
#top-menu > li.current_page_item:not(.lang-item) > a,
#top-menu > li.current-menu-ancestor:not(.lang-item) > a {
    text-decoration: none;
}

/* The same active and hover treatment in Divi's mobile menu. */
.et_mobile_menu li:not(.lang-item) a:hover,
.et_mobile_menu li.current-menu-item:not(.lang-item) > a,
.et_mobile_menu li.current_page_item:not(.lang-item) > a,
.et_mobile_menu li.current-menu-ancestor:not(.lang-item) > a {
    color: var(--rtg-accent-dark) !important;
    opacity: 1;
}

/* Accessible editorial links on light Divi text modules. */
.et_pb_section:not(.et_pb_section_first)
    .et_pb_text.et_pb_bg_layout_light
    a:not(.et_pb_button):not(.decorated-link) {
    color: var(--rtg-accent-dark) !important;
    text-decoration: none;
}

.et_pb_section:not(.et_pb_section_first)
    .et_pb_text.et_pb_bg_layout_light
    a:not(.et_pb_button):not(.decorated-link):hover {
    color: var(--rtg-accent-dark) !important;
    text-decoration: none;
}

/* Refined, consistent edging for Divi calls to action. */
a.et_pb_button {
    border-color: var(--rtg-accent) !important;
    box-shadow: inset 0 0 0 1px rgba(111, 119, 130, 0.28);
}

a.et_pb_button:hover {
    box-shadow:
        inset 0 0 0 1px rgba(111, 119, 130, 0.42),
        0 5px 14px rgba(30, 35, 43, 0.12);
}

/* A visible keyboard focus using the same identity colour. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--rtg-accent) !important;
    outline-offset: 3px;
}

/*
 * Every published language already has the full Divi footer.
 * Hide Divi's additional empty theme footer and duplicated copyright.
 */
#main-footer {
    display: none !important;
}

/*
 * Typography polish for the published site.
 * Divi pages were built at different moments, so some editorial blocks had
 * 14px text, others 16px or 18px, and some dark-section headings inherited a
 * near-black colour. This layer normalises reading rhythm without changing
 * Divi content.
 */
#main-content .et_pb_section:not(.et_pb_section_first)
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner p {
    font-size: 16px;
    line-height: 1.75;
}

#main-content .et_pb_text.et_pb_bg_layout_light .et_pb_text_inner h2,
#main-content .et_pb_text.et_pb_bg_layout_light .et_pb_text_inner h3 {
    line-height: 1.25 !important;
    margin-bottom: 0.65em;
}

#main-content .et_pb_section:not(.et_pb_section_first)
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner h2 {
    font-size: clamp(26px, 1.15vw + 18px, 32px);
}

#main-content .et_pb_section:not(.et_pb_section_first)
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner h3 {
    font-size: clamp(22px, 0.75vw + 18px, 28px);
}

#main-content .et_pb_text.et_pb_bg_layout_light .et_pb_text_inner h2 + p,
#main-content .et_pb_text.et_pb_bg_layout_light .et_pb_text_inner h3 + p {
    margin-top: 0.35em;
}

/*
 * Dark editorial sections with the vertical identity rule.
 * These are the sections visible in the screenshots: the text was white, but
 * headings were almost black on navy. Keep them readable, but more sober than
 * the large decorative hero titles.
 */
#main-content .et_pb_section.et_pb_with_background
    .et_pb_row.et_pb_with_border
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner h2,
#main-content .et_pb_section.et_pb_with_background
    .et_pb_row.et_pb_with_border
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner h3 {
    color: var(--rtg-soft-white) !important;
    font-family: "Open Sans", Arial, sans-serif;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    text-align: left !important;
    word-spacing: normal !important;
}

#main-content .et_pb_section.et_pb_with_background
    .et_pb_row.et_pb_with_border
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner h2 {
    font-size: clamp(25px, 0.9vw + 18px, 30px);
}

#main-content .et_pb_section.et_pb_with_background
    .et_pb_row.et_pb_with_border
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner p {
    color: var(--rtg-text-on-dark) !important;
    text-align: left !important;
    word-spacing: normal !important;
}

/* Make the vertical Divi border less gilded and closer to the logo identity. */
#main-content .et_pb_section.et_pb_with_background
    .et_pb_row.et_pb_with_border {
    border-color: rgba(215, 210, 203, 0.68) !important;
}

/* The large hero titles keep their elegance, but lose the golden cast. */
#main-content .et_pb_section_first.et_pb_with_background
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner h1 {
    color: var(--rtg-stone) !important;
}

/*
 * English home was visually much larger than the French home because its hero
 * H1 inherited the decorative 72px uppercase style. Keep the wording, but make
 * the scale and typography closer to the French home page.
 */
body.page-id-418 #main-content .et_pb_section_first.et_pb_with_background
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner h1 {
    font-size: clamp(32px, 3vw, 46px);
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

body.page-id-418 #main-content .et_pb_section_first.et_pb_with_background
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner h2,
body.page-id-418 #main-content .et_pb_section_first.et_pb_with_background
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner h3 {
    font-family: "Open Sans", Arial, sans-serif;
    letter-spacing: 0.03em;
}

/* English pages: avoid the decorative uppercase serif that looked uneven. */
html[lang^="en"] #main-content .et_pb_section_first.et_pb_with_background
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner h1 {
    font-family: "Open Sans", Arial, sans-serif;
    font-size: clamp(34px, 3.4vw, 52px);
    line-height: 1.18 !important;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

html[lang^="en"] body.page-id-418 #main-content .et_pb_section_first.et_pb_with_background
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner h1 {
    font-size: clamp(32px, 3vw, 46px);
}

/* Contact page: its first title sits directly on a dark image background. */
body.page-id-139 #main-content
    .et_pb_section_first.et_pb_with_background
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner h1 {
    color: var(--rtg-soft-white) !important;
    font-family: "Open Sans", Arial, sans-serif;
    font-weight: 400;
    line-height: 1.2 !important;
}

/* Preserve the larger Arabic reading size chosen after visual review. */
body.page-id-1009 #main-content
    .et_pb_section:not(.et_pb_section_first)
    .et_pb_text.et_pb_bg_layout_light
    .et_pb_text_inner p {
    font-size: 19px;
    line-height: 1.9;
}

/*
 * Arabic landing page: keep the French lawyer names official, but visually
 * aligned with the surrounding Arabic text. Latin uppercase names looked
 * heavier than the Arabic sentence at the same nominal size.
 */
body.page-id-1009 .et_pb_text bdi[dir="ltr"] {
    font-size: 0.92em;
    font-weight: 500;
    letter-spacing: 0;
}

body.page-id-1009 .et_pb_text strong bdi[dir="ltr"] {
    font-weight: 600;
}

@media (max-width: 980px) {
    #main-header,
    #main-header.et-fixed-header {
        background-color: var(--rtg-white) !important;
    }

    .mobile_menu_bar::before {
        color: var(--rtg-accent-dark) !important;
    }

    .et_mobile_menu {
        border-top-color: var(--rtg-accent) !important;
    }
}
