/*
 * Rivera — Content sections shared across pages
 *
 * Moved out of the front page's stylesheet so any page can use them.
 * Loaded on every page (functions.php), like the header and footer.
 *
 * Blocks:
 *   .panel        — a content section: navy gradient, maroon rule on the left,
 *                   orange heading. The front page's offers, services and
 *                   videos
 *   .promo-bar    — the maroon strip between panels (Telegram, social)
 *   .social-links — round network icons
 *   .services     — groups of services, a heading and a list each
 *   .prose        — text typed in an editor (catalogue texts, the front
 *                   page's «Про агенцію»)
 *   .about        — the agency in figures and its catalogues
 *   .catalog-links — the catalogues with their counts (front page, 404)
 *   .page-title   — the orange heading every page opens with
 *   .media-cover  — a photo filling its frame, lifting a little on hover
 *   .icon-button  — a round icon button (slider arrows, gallery, lightbox)
 *   .field        — a text input: the enquiry form and the catalogue search
 *   .play-badge   — the red YouTube mark over a video thumbnail
 *   .slider-nav   — prev / next arrows for a slider track
 *   .lead-form    — the enquiry form
 *
 * Front-page-only pieces — the slider track (.panel__grid), its arrows and the
 * cards — stay in css/pages/home.css.
 */


/* ── Field ──────────────────────────────────────────────────────────────── */
/* Mixed into the block's own input class; the block sets the size and the
 * shape, this sets the look and the states shared by both forms. */
.field {
    border:           2px solid var(--color-navy-soft);
    background-color: var(--color-panel);
    color:            var(--color-secondary);
    font-family:      inherit;
    transition:       border-color var(--transition);
    appearance:       none;
}

.field:hover {
    border-color: var(--color-sky);
}

.field:focus-visible {
    border-color: var(--color-orange);
    outline:      none;
}

.field[aria-invalid="true"] {
    border-color: var(--color-error);
}

/* ── Play badge ─────────────────────────────────────────────────────────── */
/* The mark over a video thumbnail. Each place sets its own size and the
 * triangle to match; the shape, the colour and the centring are here. */
.play-badge {
    position:         absolute;
    top:              50%;
    left:             50%;
    background-color: #ff0000;
    transform:        translate(-50%, -50%);
    transition:       background-color var(--transition);
}

.play-badge::after {
    content:      '';
    position:     absolute;
    top:          50%;
    left:         50%;
    border-style: solid;
    border-color: transparent transparent transparent #ffffff;
    transform:    translate(-35%, -50%);
}

/* ── Page title ─────────────────────────────────────────────────────────── */
/* Mixed into the block's own heading class: .catalog__title and the rest keep
 * their margins, this holds the look all of them shared. */
.page-title {
    margin:         0;
    color:          var(--color-orange);
    font-size:      var(--fs-page-title);
    font-weight:    400;
    line-height:    1.2;
    letter-spacing: 0.5px;
    text-transform: var(--tt-heading);
}

/* ── Media ──────────────────────────────────────────────────────────────── */
/* Mixed into a card's own image class. Cropping is right here: the cards are
 * one size and the photos are not. */
.media-cover {
    display:    block;
    width:      100%;
    height:     100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

/* ── Icon button ────────────────────────────────────────────────────────── */
/* The round buttons: the slider arrows, the gallery arrows, the lightbox.
 * Size and colours belong to each of them; this is the shape. */
.icon-button {
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         0;
    border:          0;
    border-radius:   50%;
    color:           var(--color-secondary);
    cursor:          pointer;
    transition:      background-color var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
}

.icon-button:focus-visible {
    outline:        2px solid var(--color-orange);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .media-cover {
        transition: none;
    }
}

/* ── Panel ──────────────────────────────────────────────────────────────── */
.panel {
    border-left: 6px solid var(--color-maroon);
    padding:     32px 48px 40px;
    background:  linear-gradient(180deg, var(--color-panel) 0%, var(--color-navy-deep) 100%);
}

.panel__head {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             24px;
    margin-bottom:   32px;
}

.panel__title {
    margin:         0;
    color:          var(--color-orange);
    font-size:      22px;
    font-weight:    700;
    line-height:    1.2;
    letter-spacing: 0.5px;
    text-transform: var(--tt-heading);
}

/* ── Promo bar ──────────────────────────────────────────────────────────── */
.promo-bar {
    display:          flex;
    align-items:      center;
    gap:              40px;
    min-height:       108px;
    padding:          24px 88px;
    background-color: var(--color-maroon);
}

.promo-bar--telegram {
    justify-content: space-between;
}

/* The editor breaks the text where the design breaks it; pre-line keeps those
 * line breaks without letting stray spaces through. */
.promo-bar__text {
    flex:        1 1 auto;
    min-width:   0;
    margin:      0;
    font-size:   17px;
    font-weight: 700;
    line-height: 1.35;
    white-space: pre-line;
}

.promo-bar__label {
    margin:      0 32px 0 0;
    font-size:   19px;
    font-weight: 700;
    line-height: 1.2;
}

.promo-bar__link {
    display:    block;
    flex:       0 0 auto;
    margin-right: 32px;
    border-radius: 50%;
    transition: transform var(--transition);
}

.promo-bar__link:hover,
.promo-bar__link:focus-visible {
    transform: scale(1.08);
}

.promo-bar__icon,
/* ── Social links ───────────────────────────────────────────────────────── */
.social-links {
    display:     flex;
    align-items: center;
    gap:         28px;
    margin:      0;
    padding:     0;
    list-style:  none;
}

.social-links__item {
    display: flex;
}

.social-links__link {
    display:       block;
    border-radius: 50%;
    transition:    transform var(--transition);
}

.social-links__link:hover,
.social-links__link:focus-visible {
    transform: scale(1.08);
}

.social-links__icon {
    display: block;
    width:   52px;
    height:  52px;
}

/* Colour and scale alone are not enough for someone on a keyboard. */
.promo-bar__link:focus-visible,
.social-links__link:focus-visible {
    outline:        2px solid var(--color-orange);
    outline-offset: 4px;
}

/* ── Services ───────────────────────────────────────────────────────────── */
.services {
    display:               grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap:                   40px;
    margin-top:            48px;
}

/* A grid track will not shrink below its longest word unless told to, and
 * «Нерухомістю» in 19px capitals is wider than a tablet column. */
.services__column {
    min-width: 0;
}

.services__heading {
    margin:         0 0 32px;
    font-size:      19px;
    font-weight:    400;
    line-height:    1.3;
    letter-spacing: 0.5px;
    text-transform: var(--tt-heading);
}

.services__list {
    display:        flex;
    flex-direction: column;
    gap:            22px;
    margin:         0;
    padding:        0;
    list-style:     none;
}

.services__item {
    font-size:   var(--fs-body);
    line-height: 1.35;
}

/* ── Narrow desktop ─────────────────────────────────────────────────────── */
/* The banner's 88px inset is measured on a 1340px column; below that it eats
 * the room the text needs and pushes it onto a third line.
 *
 * The same goes for the editor's line break: it is placed where the widest
 * layout breaks the text, and on a narrower column it lands mid-row and leaves
 * a short ragged line — so from here down the text wraps on its own. */
@media (max-width: 1439px) {
    .promo-bar {
        padding: 24px 48px;
    }

    .promo-bar__text {
        white-space: normal;
    }

    .promo-bar__link {
        margin-right: 0;
    }
}

/* ── Tablet ─────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {

    .panel {
        padding: 28px 28px 32px;
    }

    .panel__head {
        margin-bottom: 24px;
    }

    .panel__title {
        font-size: 20px;
    }

    .promo-bar {
        min-height: 88px;
        padding:    20px 32px;
        gap:        24px;
    }

    .promo-bar__text {
        font-size: 15px;
    }

    .promo-bar__label {
        margin-right: 8px;
        font-size:    17px;
    }

    .promo-bar__link {
        margin-right: 0;
    }

    .promo-bar__icon,
    .social-links__icon {
        width:  44px;
        height: 44px;
    }

    .social-links {
        gap: 20px;
    }

    .services {
        gap:        24px;
        margin-top: 32px;
    }

    .services__heading {
        margin-bottom: 20px;
        font-size:     16px;
    }

    .services__list {
        gap: 14px;
    }

    .services__item {
        font-size: 15px;
    }
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

    .panel {
        border-left-width: 4px;
        padding:           22px 18px 26px;
    }

    .panel__head {
        margin-bottom: 20px;
    }

    .panel__title {
        font-size: 18px;
    }

    .promo-bar {
        padding: 18px 20px;
        gap:     16px;
    }

    /* Beside a 40px icon a phone leaves the invitation a 200px column, six
     * lines deep. Stacked, it reads in three or four. */
    .promo-bar--telegram {
        flex-direction: column;
        align-items:    flex-start;
        gap:            14px;
    }

    .promo-bar__text {
        font-size: 14px;
    }

    .promo-bar__label {
        margin-right: 0;
        font-size:    16px;
        white-space:  nowrap;
    }

    .promo-bar__icon,
    .social-links__icon {
        width:  40px;
        height: 40px;
    }

    .social-links {
        gap: 14px;
    }

    .services {
        grid-template-columns: minmax(0, 1fr);
        gap:                   28px;
        margin-top:            24px;
    }

    .services__heading {
        margin-bottom: 14px;
    }

    .services__list {
        gap: 10px;
    }
}


/* ── Prose ──────────────────────────────────────────────────────────────── */
/* Editor output arrives as bare tags with no classes of their own, so these
 * rules select by tag inside .prose — only for text someone typed. */
.prose {
    max-width:   900px;
    font-size:   17px;
    line-height: 1.6;
}

.prose > :first-child {
    margin-top: 0;
}

.prose > :last-child {
    margin-bottom: 0;
}

.prose p {
    margin: 0 0 14px;
}

.prose h2 {
    margin:         32px 0 14px;
    color:          var(--color-orange);
    font-size:      22px;
    font-weight:    700;
    line-height:    1.3;
    letter-spacing: 0.5px;
    text-transform: var(--tt-heading);
}

.prose h3 {
    margin:      24px 0 10px;
    color:       var(--color-orange);
    font-size:   18px;
    font-weight: 700;
    line-height: 1.35;
}

.prose a {
    color:                 var(--color-orange);
    text-decoration:       underline;
    text-underline-offset: 3px;
    transition:            color var(--transition);
}

.prose a:hover,
.prose a:focus-visible {
    color: var(--color-orange-hot);
}

/* reset.css strips list markers; in editor text they carry meaning. */
.prose ul,
.prose ol {
    margin:       0 0 14px;
    padding-left: 24px;
}

.prose ul {
    list-style: disc;
}

.prose ol {
    list-style: decimal;
}

.prose li {
    display: list-item;
}

.prose li + li {
    margin-top: 6px;
}

.prose strong {
    font-weight: 700;
}

/* ── Slider arrows ──────────────────────────────────────────────────────── */
/* Hidden until the script has checked there is anything to scroll to. */
.slider-nav {
    display: flex;
    flex:    0 0 auto;
    gap:     10px;
}

.slider-nav--hidden {
    display: none;
}

.slider-nav__button {
    width:            42px;
    height:           42px;
    border:           1px solid var(--color-sky);
    background-color: transparent;
}

.slider-nav__button:hover:not(:disabled),
.slider-nav__button:focus-visible {
    border-color: var(--color-orange);
    color:        var(--color-orange);
}

.slider-nav__button:focus-visible {
    outline:        2px solid var(--color-orange);
    outline-offset: 3px;
}

.slider-nav__button:disabled {
    opacity: 0.35;
    cursor:  default;
}

.slider-nav__icon {
    display: block;
    width:   18px;
    height:  18px;
}

/* On the Hebrew version the track scrolls the other way, so the arrows point
 * the other way too. */
.slider-nav__icon:dir(rtl) {
    transform: scaleX(-1);
}

/* ── Form ───────────────────────────────────────────────────────────────── */
.lead-form {
    display:        flex;
    flex-direction: column;
    gap:            22px;
}

/* Empty until there is something to say; it stays in the page (not hidden)
 * so a screen reader announces the text the moment it appears. */
.lead-form__status {
    /* Cancels the form's gap while the line is empty, so it leaves no hole. */
    margin:      0 0 -22px;
    font-size:   17px;
    line-height: 1.45;
}

.lead-form__status--success,
.lead-form__status--error {
    margin-bottom:    0;
    padding:          16px 20px;
    border-left:      4px solid currentColor;
    border-radius:    4px;
    background-color: var(--color-navy);
}

.lead-form__status--success {
    color: var(--color-success);
}

.lead-form__status--error {
    color: var(--color-error);
}

.lead-form__field {
    display:        flex;
    flex-direction: column;
    gap:            8px;
}

.lead-form__label {
    font-size:      16px;
    line-height:    1.3;
    letter-spacing: 0.3px;
    text-transform: var(--tt-heading);
}

.lead-form__required {
    color: var(--color-orange);
}

/* Mixed with .field, which holds the border, the colours and the states. */
.lead-form__input {
    width:         100%;
    min-height:    50px;
    padding:       12px 18px;
    border-radius: 12px;
    font-size:     17px;
    line-height:   1.4;
}

.lead-form__input--textarea {
    min-height: 160px;
    resize:     vertical;
}

.lead-form__error {
    margin:      0;
    color:       var(--color-error);
    font-size:   15px;
    line-height: 1.4;
}

/* Off-screen rather than display:none, which some bots check for. */
.lead-form__trap {
    position: absolute;
    left:     -9999px;
    width:    1px;
    height:   1px;
    overflow: hidden;
}

.lead-form__note {
    margin:    -6px 0 0;
    color:     var(--color-sky);
    font-size: 14px;
}

.lead-form__submit {
    align-self:       flex-start;
    min-width:        240px;
    min-height:       54px;
    padding:          10px 36px;
    border:           0;
    border-radius:    4px;
    background-color: var(--color-orange);
    color:            var(--color-navy-deep);
    font-family:      inherit;
    font-size:        20px;
    line-height:      1.2;
    letter-spacing:   0.5px;
    text-transform:   var(--tt-heading);
    cursor:           pointer;
    transition:       background-color var(--transition), opacity var(--transition);
}

.lead-form__submit:hover,
.lead-form__submit:focus-visible {
    background-color: var(--color-secondary);
}

.lead-form__submit:focus-visible {
    outline:        2px solid var(--color-orange);
    outline-offset: 3px;
}

.lead-form__submit:disabled {
    opacity: 0.6;
    cursor:  progress;
}


@media (max-width: 767px) {
    .lead-form {
        gap: 18px;
    }

    .lead-form__status {
        margin-bottom: -18px;
    }

    .lead-form__status--success,
    .lead-form__status--error {
        margin-bottom: 0;
    }

    .lead-form__input {
        font-size: 16px;
    }

    .lead-form__submit {
        align-self: stretch;
        min-width:  0;
        font-size:  18px;
    }
    .slider-nav {
        display: none;
    }

    .slider-nav__button {
        width:  38px;
        height: 38px;
    }
}

/* ── About ──────────────────────────────────────────────────────────────── */
/* The same shape as the 404 page's body: text on the left, a narrow column of
 * figures and links on the right. */
.about,
.error-page__body {
    display:               grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap:                   40px 56px;
    margin-top:            32px;
}

.about__text {
    grid-row: span 2;
}

.about__facts {
    display:               grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap:                   24px 20px;
    margin:                0;
}

/* The figure reads first, though the label is the term it answers to. */
.about__fact {
    display:        flex;
    flex-direction: column-reverse;
    gap:            4px;
}

.about__value {
    margin:      0;
    color:       var(--color-orange);
    font-size:   30px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.about__label {
    color:       var(--color-sky);
    font-size:   15px;
    line-height: 1.35;
}

.catalog-links__list {
    display:        flex;
    flex-direction: column;
    gap:            2px;
    margin:         0;
    padding:        0;
    list-style:     none;
}

.catalog-links__item {
    display: block;
}

.catalog-links__link {
    display:         flex;
    justify-content: space-between;
    align-items:     baseline;
    gap:             16px;
    padding:         10px 0;
    border-bottom:   1px solid var(--color-navy-soft);
    color:           var(--color-secondary);
    font-size:       16px;
    line-height:     1.35;
    transition:      color var(--transition);
}

.catalog-links__link:hover,
.catalog-links__link:focus-visible {
    color: var(--color-orange);
}

.catalog-links__count {
    flex:        0 0 auto;
    color:       var(--color-sky);
    font-size:   14px;
    white-space: nowrap;
}

/* ── Sections: tablet and phone ─────────────────────────────────────────── */
@media (max-width: 1023px) {
    .page-title {
        font-size: 28px;
    }

    .about,
    .error-page__body {
        grid-template-columns: minmax(0, 1fr);
    }

    .about__text {
        grid-row: auto;
    }
}

@media (max-width: 767px) {
    .page-title {
        font-size: 22px;
    }

    /* The «404» number wants a touch more room above it than other pages. */
    .error-page {
        padding-top: 24px;
    }

    .about,
    .error-page__body {
        gap:        28px;
        margin-top: 20px;
    }

    .prose {
        font-size: 16px;
    }

    .prose h2 {
        margin-top: 24px;
        font-size:  19px;
    }

    .about__value {
        font-size: 24px;
    }

    .about__label {
        font-size: 14px;
    }
}

/* ── 404 ────────────────────────────────────────────────────────────────── */
/* Same panel as the front page's sections; the number sits above the heading
 * as a quiet marker rather than the loudest thing on the page — what the
 * visitor needs is the way on, not the error code. */
.error-page__code {
    margin:         0;
    color:          var(--color-navy-soft);
    font-size:      64px;
    font-weight:    700;
    line-height:    1;
    letter-spacing: 2px;
}

.error-page__title {
    margin: 12px 0 0;
}

.error-page__main-link {
    color:                 var(--color-orange);
    font-weight:           700;
    text-decoration:       underline;
    text-underline-offset: 3px;
    transition:            color var(--transition);
}

.error-page__main-link:hover,
.error-page__main-link:focus-visible {
    color: var(--color-orange-hot);
}

.error-page__phone {
    font-size:   26px;
    font-weight: 700;
}

.error-page__phone a {
    color:      var(--color-orange);
    transition: color var(--transition);
}

.error-page__phone a:hover,
.error-page__phone a:focus-visible {
    color: var(--color-orange-hot);
}

@media (max-width: 767px) {
    .error-page__code {
        font-size: 48px;
    }

    .error-page__phone {
        font-size: 22px;
    }
}

/* ── Video card ─────────────────────────────────────────────────────────── */
/*
 * A YouTube preview that turns into the player. Lives here rather than with
 * the front page because the reviews now have a page of their own as well, and
 * a card that looks different depending on which page it is on is two cards.
 */
.video-card {
    scroll-snap-align: start;
}

.video-card {
    display:        flex;
    flex-direction: column;
    min-width:      0;
}

.video-card__player {
    position:     relative;
    display:      block;
    overflow:     hidden;
    aspect-ratio: 16 / 9;
    border:       1px solid var(--color-sky);
    background:   #000000;
}

/* YouTube's hqdefault preview is 4:3 with black bands top and bottom; cover
 * crops them away inside the 16:9 frame. */
.video-card__thumb,
.video-card__frame {
    position: absolute;
    inset:    0;
    display:  block;
    width:    100%;
    height:   100%;
    border:   0;
}

.video-card__thumb {
    object-fit: cover;
    transition: transform var(--transition-slow), opacity var(--transition);
}

.video-card__player:hover .video-card__thumb,
.video-card__player:focus-visible .video-card__thumb {
    transform: scale(1.04);
    opacity:   0.9;
}

/* The red play button, drawn in CSS so it needs no image of its own. */
/* Mixed with .play-badge; only the size is the card's own. */
.video-card__play {
    width:         68px;
    height:        48px;
    border-radius: 12px;
}

.video-card__play::after {
    border-width: 10px 0 10px 17px;
}

.video-card__player:hover .video-card__play,
.video-card__player:focus-visible .video-card__play {
    background-color: #cc0000;
}

.video-card__title {
    margin:      24px 0 0;
    font-size:   var(--fs-body);
    font-weight: 400;
    line-height: 1.4;
}

/* The object the review walks through, when it is still for sale. */
.video-card__object {
    margin: 8px 0 0;
}

.video-card__object-link {
    font-size:       var(--fs-small);
    color:           var(--color-orange);
    text-decoration: none;
    border-bottom:   1px solid transparent;
}

.video-card__object-link:hover,
.video-card__object-link:focus-visible {
    border-bottom-color: currentColor;
}

/* A link out of a panel to the full list behind it. */
.panel__more {
    margin: 24px 0 0;
}

.panel__more-link {
    font-size:       var(--fs-body);
    color:           var(--color-orange);
    text-decoration: none;
    border-bottom:   1px solid transparent;
}

.panel__more-link:hover,
.panel__more-link:focus-visible {
    border-bottom-color: currentColor;
}

@media (max-width: 1023px) {

    .video-card__title {
        margin-top: 12px;
        font-size:  16px;
    }

    .video-card__play {
        width:  54px;
        height: 38px;
    }
}
