/*
Theme Name: RDN (GeneratePress)
Template: generatepress
Description: Child theme for фонд-рдн.рф. GeneratePress supplies the typography
and page furniture; the mobile menu is styled after Astra's, which the client
preferred. Mobile-first: the fund's audience reads this on a phone.
Version: 1.0
*/

:root {
    --rdn-navy: #1B2A4A;
    --rdn-gold: #C09030;
    --rdn-gold-2: #A87C2A;
    --rdn-ink: #16233D;
    --rdn-line: #ECEFF3;
    --rdn-muted: #6B7280;
    --rdn-gut: 20px;
}

/* ------------------------------------------------------------------ header */
.site-header {
    border-bottom: 1px solid var(--rdn-line);
}

/* Astra put the mark and the name on one line; GeneratePress stacks them
   centred. Restore the inline lockup. */
.site-header .inside-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
    text-align: left;
}
.site-header .site-logo { order: -1; flex: 0 0 auto; margin: 0; }
.site-header .site-branding { flex: 1 1 auto; text-align: left; }

/* the logo is the bare monogram, so the fund's name comes from the title */
.custom-logo, .header-image, .site-logo img {
    max-height: 56px !important;
    width: auto !important;
}
.site-branding, .site-branding .main-title { min-width: 0; }
.site-branding .main-title,
.site-branding .site-title {
    white-space: normal;
    max-width: 100%;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 600;
    color: var(--rdn-ink);
    overflow-wrap: anywhere;
}
.site-branding .main-title a { color: inherit; }
.site-header .site-description { display: none; }

/* --------------------------------------------- mobile menu, Astra-style ---
   Astra: full-width rows, a hairline between them, the current page softly
   highlighted, compact row height. GeneratePress ships an inset grey panel,
   which the client did not want. */
@media (max-width: 899px) {
    .main-navigation,
    .main-navigation .inside-navigation,
    .main-navigation .main-nav > ul {
        background: #ffffff;
        padding: 0;
        margin: 0;
    }
    .main-navigation .main-nav ul li a {
        display: block;
        padding: 13px var(--rdn-gut);
        font-size: 15px;
        line-height: 1.3;
        font-weight: 500;
        color: var(--rdn-navy);
        border-bottom: 1px solid var(--rdn-line);
        background: transparent;
    }
    .main-navigation .main-nav ul li.current-menu-item > a,
    .main-navigation .main-nav ul li.current_page_item > a {
        background: #EEF3FA;
        color: var(--rdn-gold-2);
    }
    .main-navigation .main-nav ul li a:hover,
    .main-navigation .main-nav ul li a:focus { background: #F7F9FC; }
    .main-navigation .main-nav ul .sub-menu li a { padding-left: calc(var(--rdn-gut) * 2); }

    /* Astra's toggle: a bordered square, not a filled grey block */
    .menu-toggle {
        background: transparent !important;
        border: 1px solid var(--rdn-line);
        border-radius: 4px;
        width: 42px; height: 42px;
        padding: 0;
        color: var(--rdn-navy);
    }
    .menu-toggle:hover, .menu-toggle:focus { background: #F7F9FC !important; }
}

/* --------------------------------------------------------------- headings */
h1, h2, h3, h4, .entry-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 400;
    color: var(--rdn-ink);
}

/* ------------------------------------------------------------------- hero */
.wp-block-cover h1,
.wp-block-cover h2 {
    font-size: clamp(30px, 7.5vw, 58px);
    line-height: 1.12;
    max-width: 22ch;
    margin-left: auto;
    margin-right: auto;
    color: #ffffff;
}
.wp-block-cover p {
    font-size: clamp(15px, 4vw, 20px);
    line-height: 1.5;
    max-width: 44ch;
    margin-left: auto;
    margin-right: auto;
}

/* GeneratePress styles its own buttons, so the cover's primary call to
   action needs to win explicitly. */
.wp-block-cover .wp-block-button:not(.is-style-outline) .wp-block-button__link {
    background-color: var(--rdn-navy) !important;
    color: #ffffff !important;
    border: none !important;
}
.wp-block-cover .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
    background-color: var(--rdn-gold-2) !important;
}

/* ------------------------------------------------------------------ links */
a { color: var(--rdn-navy); }
a:hover, a:focus { color: var(--rdn-gold-2); }

/* ---------------------------------------------------------------- buttons */
.wp-block-button__link, .button, button.button {
    background: var(--rdn-navy);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 13px 26px;
    font-size: 16px;
    transition: background .2s ease;
}
.wp-block-button__link:hover, .button:hover { background: var(--rdn-gold-2); color: #fff; }
.wp-block-cover .is-style-outline .wp-block-button__link {
    background: transparent;
    border: 2px solid #ffffff;
    color: #ffffff;
}
.wp-block-cover .is-style-outline .wp-block-button__link:hover {
    background: #ffffff; color: var(--rdn-navy);
}

/* ------------------------------------------------------------------ cards */
.inside-article, .otzyvy-card, .rdn-card {
    background: #fff;
    border: 1px solid var(--rdn-line);
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(27, 42, 74, .05);
}
.entry-summary p, .entry-content .entry-summary { color: var(--rdn-muted); }

/* rounded imagery throughout */
.wp-block-image img, .post-image img, .wp-block-cover, figure img {
    border-radius: 14px;
}
.wp-block-cover { overflow: hidden; }

/* ----------------------------------------------------------- mobile rules */
@media (max-width: 900px) {
    /* full-bleed sections escape the container, so they carry their own gutter */
    .entry-content > .wp-block-group.alignfull,
    .entry-content > .alignfull > .wp-block-group__inner-container,
    .wp-block-cover__inner-container {
        padding-left: max(var(--rdn-gut), env(safe-area-inset-left));
        padding-right: max(var(--rdn-gut), env(safe-area-inset-right));
        box-sizing: border-box;
    }
    .entry-content > .wp-block-group.alignfull > .wp-block-columns,
    .entry-content > .wp-block-group.alignfull > .wp-block-heading,
    .entry-content > .wp-block-group.alignfull > p,
    .entry-content > .wp-block-group.alignfull > .wp-block-buttons {
        padding-left: 0; padding-right: 0;
    }
    /* "wide" is meaningless on a phone and some rules give it a negative margin */
    .entry-content .alignwide,
    .wp-block-group__inner-container > .alignwide {
        margin-left: 0 !important; margin-right: 0 !important;
        width: auto !important; max-width: 100% !important;
    }
    .wp-block-columns { gap: 26px !important; }
    .wp-block-column { min-width: 0; }
    .wp-block-button__link { display: block; text-align: center; min-height: 44px; }
    html, body { overflow-x: hidden; }
    img, figure, .wp-block-image { max-width: 100%; height: auto; }
    /* the front page does not need a "Главная" heading above the hero */
    .home .entry-header, .home .page-title, .home .entry-title { display: none; }
}

/* ----------------------------------------------------------------- footer */
.site-footer {
    background: #FAFAF7;
    border-top: 1px solid var(--rdn-line);
    color: var(--rdn-muted);
}
.site-footer a { color: var(--rdn-navy); }
.site-footer a:hover { color: var(--rdn-gold-2); }
