/* ioann-presnya news card preview — Figma node 1:1563 */

.news-card {
    display: flex;
    align-items: stretch;
    gap: 28px;
    padding: 28px 36px;
    background: #ffffff;
    border-top: 1px solid #cecece;
    max-width: var(--ip-content-max);
    margin: 0 auto;
}
.news-card:last-child {
    border-bottom: 1px solid #cecece;
}

/* Media */
.news-card__media {
    flex: 0 0 320px;
    width: 320px;
    height: 212px;
    position: relative;
    display: block;
    overflow: hidden;
    background: #e6e6e6; /* placeholder grey when image is missing */
    border-radius: 0;
}
.news-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.news-card__media-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
    pointer-events: none;
}

/* Body */
.news-card__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.news-card__date {
    font-family: var(--ip-font-body);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.05;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #a4a4a4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-card__title {
    margin: 0;
    font-family: var(--ip-font-title);
    font-weight: 700;
    font-size: 32px;
    line-height: 1;
    color: var(--ip-text);
    word-break: break-word;
}
.news-card__title a {
    color: inherit;
    text-decoration: none;
}
.news-card__title a:hover {
    color: #af4409;
}

.news-card__excerpt {
    margin: 0;
    font-family: var(--ip-font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.3;
    color: #333333;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-card__button {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    color: #a33d25;
    font-family: var(--ip-font-body);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.05;
    text-decoration: none;
    transition: color 0.2s ease;
}
.news-card__button:hover {
    color: #832d18;
    text-decoration: underline;
}

/* Stacked layout < 768px */
@media (max-width: 767.99px) {
    .news-card {
        flex-direction: column;
        padding: 20px 16px;
        gap: 16px;
    }
    .news-card__media {
        width: 100%;
        flex: 0 0 auto;
        height: auto;
        aspect-ratio: 320 / 212;
    }
    .news-card__title {
        font-size: 26px;
    }
    .news-card__body {
        gap: 16px;
    }
}

/* ──────────────────────────────────────────────────────────────────────────────
   ioann-presnya news_list page — Figma nodes 1:1559, 1:1570
   ────────────────────────────────────────────────────────────────────────────── */

/* Section wrapper: full width inside .content */
.news-list {
    width: 100%;
    padding-bottom: 60px;
}

/* Cards container: vertical flex, no gap (borders between cards are used) */
.news-list__items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Every card fills the full list width so all rows share one left edge
   and width; the card's own 28px 36px padding then lines up on every row.
   Overrides the base .news-card max-width/margin:0 auto, which only the
   news_main carousel needs. */
.news-list__items .news-card {
    width: 100%;
    max-width: none;
    margin: 0;
    align-self: stretch;
}

/* Hidden rows — added by news_list.blade.php beyond $perPage; revealed by news-list.js */
.news-list .news-card--hidden { display: none; }

/* Show the whole photo (not cropped) in the list thumbnails — portrait images
   are letterboxed inside the fixed media box instead of being cut off. */
.news-list__items .news-card__image {
    object-fit: contain;
}

/* Transparent preview background — no grey placeholder fill and no dark
   gradient overlay in the list. */
.news-list__items .news-card__media {
    background: transparent;
}
.news-list__items .news-card__media-fade {
    display: none;
}

/* Empty state */
.news-list__empty {
    text-align: center;
    font-family: var(--ip-font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.3;
    color: #a4a4a4;
    padding: 80px 0;
    margin: 0;
}

/* Load-more wrapper */
.news-list__more-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
}

/* Load-more button — Figma 1:1570: 177×35, #ddb6a6 border, #af4409 text, 5px radius */
.news-list__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 177px;
    height: 35px;
    border: 1px solid #ddb6a6;
    border-radius: 5px;
    color: #af4409;
    font-family: var(--ip-font-body);
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.news-list__more:hover {
    background: #ddb6a6;
    color: #ffffff;
}

/* Mobile single column <=767.99px — scoped to news_list page
   (shares news.css with tasks 152/168; only .news-list* selectors here) */
@media (max-width: 767.99px) {
    /* Section: no horizontal padding so .content's 16px gutter (task 146)
       is the sole outer side margin; reduce bottom padding for mobile rhythm */
    .news-list {
        padding: 0 0 40px;
    }

    /* Single-column stack is already the default flex direction; restate
       gap:0 explicitly so the inter-card borders remain the visual separators */
    .news-list__items {
        gap: 0;
    }

    /* Load-more wrapper: tighten vertical margin for mobile */
    .news-list__more-wrap {
        margin: 24px 0;
    }

    /* Load-more button: full-width-ish and taller for a comfortable tap target,
       mirroring the news_main mobile CTA pattern */
    .news-list__more {
        width: 100%;
        max-width: 360px;
        height: 44px;
    }
}

/* ──────────────────────────────────────────────────────────────────────────────
   ioann-presnya news_main block — Figma node 1:1598
   Horizontal 3-card carousel with section title, arrows, and "Все новости" CTA.
   Cards size: 433 × 556 (Figma 1:1609). Arrows are wired to JS (news-main.js)
   which drives scrollLeft of .news-main__items and manages disabled state.
   ────────────────────────────────────────────────────────────────────────────── */

.news-main {
    width: 100%;
    max-width: var(--ip-content-max);
    margin: 0 auto;
    padding: 60px 0 80px;
}

/* Head row: centred title (Cormorant Bold ~32) + arrow group on the right */
.news-main__head {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 40px;
}
.news-main__title {
    margin: 0;
    text-align: center;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 36px;
    line-height: 1;
    letter-spacing: -0.396px;
    text-transform: uppercase;
    color: var(--ip-text);
}
.news-main__arrows {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    gap: 16px;
}
.news-main__arrow {
    width: 30px;
    height: 30px;
    border: 1px solid #ddb6a6;
    border-radius: 50%;
    background: transparent;
    color: #af4409;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.news-main__arrow:hover {
    background: #ddb6a6;
    color: #ffffff;
}
/* Disabled state set by news-main.js */
.news-main__arrow--disabled,
.news-main__arrow:disabled {
    opacity: 0.4;
    cursor: default;
}
.news-main__arrow--disabled:hover,
.news-main__arrow:disabled:hover {
    background: transparent;
    color: #af4409;
}

/* Cards row: horizontal flex with CSS scroll-snap (no JS needed for swipe).
   Each item is 433px wide × 556px tall per Figma 1:1609. */
.news-main__items {
    display: flex;
    flex-direction: row;
    gap: 28px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;            /* Firefox */
    padding-bottom: 8px;
}
.news-main__items::-webkit-scrollbar { display: none; }
.news-main__item {
    flex: 0 0 calc((100% - 2 * 28px) / 3);
    width: calc((100% - 2 * 28px) / 3);
    scroll-snap-align: start;
}

/* Inside the carousel each card stacks vertically (image top, content below)
   and locks to the 433×556 footprint. This overrides the default .news-card
   flex row layout shipped by news_list. */
.news-main__item .news-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    max-width: none;
    height: 556px;
}
.news-main__item .news-card:last-child { border: 0; }
.news-main__item .news-card__media {
    flex: 0 0 auto;
    width: 100%;
    height: 290px;
}
.news-main__item .news-card__body {
    flex: 1 1 auto;          /* fill the 556px card's remaining height so side borders match across cards */
    min-height: 0;           /* allow the body to shrink to its flex-computed height instead of growing to min-content (keeps every card body the same height) */
    gap: 16px;
    padding: 28px 36px;
    border-left: 1px solid #cecece;
    border-right: 1px solid #cecece;
}
/* Clamp the title to 2 lines so a long (3-line) heading can't push the body past
   the card's fixed 556px height — keeps every .news-card__body the same height. */
.news-main__item .news-card__title {
    font-size: 24px;
    line-height: 1.05;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-main__item .news-card__excerpt { -webkit-line-clamp: 3; }

/* Cards are container-relative at every desktop width so exactly 3 cards +
   2×28px gaps fill the full content row (the rest scroll). Mobile breakpoints
   below override the item width with the 88vw swipe layout. */

/* Horizontal divider below the card row — Figma: 1px solid #cecece, 20px below cards */
.news-main__divider {
    border: 0;
    border-top: 1px solid #cecece;
    margin: 20px 0 0;
    width: 100%;
}

/* Empty state */
.news-main__empty {
    text-align: center;
    font-family: var(--ip-font-body);
    font-size: 16px;
    line-height: 1.3;
    color: #a4a4a4;
    padding: 40px 0;
    margin: 0;
}

/* "Все новости" CTA — centred under the carousel; intentionally styled as an
   outlined orange pill (Figma-correct for this element, distinct from the
   per-card .news-card__button plain text link). */
.news-main__more {
    display: flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    margin: 16px auto 0;
    padding: 10px 20px;
    border: 1px solid #ddb6a6;
    border-radius: 5px;
    color: #af4409;
    background: transparent;
    font-family: var(--ip-font-body);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.05;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.news-main__more:hover { background: #ddb6a6; color: #ffffff; }

/* Responsive: <960px collapse items to 90vw cards; <600px center title only */
@media (max-width: 959.99px) {
    .news-main { padding: 40px 16px 56px; }
    .news-main__item, .news-main__item .news-card__media { width: 88vw; flex-basis: 88vw; }
    .news-main__item .news-card__media { height: calc(88vw * 290 / 433); }
    .news-main__item .news-card { height: auto; }
    .news-main__arrows { display: none; } /* arrows hidden on touch viewports */
}

/* Mobile single column ≤767.99px — scoped to news_main (shares news.css with tasks 167/168) */
@media (max-width: 767.99px) {
    /* Section padding: 0 horizontal so .content's 16px gutter (task 146) is the sole side margin */
    .news-main { padding: 32px 0 40px; }

    /* Switch from horizontal carousel to vertical single-column stack */
    .news-main__items {
        flex-direction: column;
        overflow-x: visible;
        scroll-snap-type: none;
        gap: 48px; /* doubled item spacing on mobile */
        padding-bottom: 0;
    }

    /* Each card: full width, no fixed basis, no scroll-snap */
    .news-main__item {
        flex: 0 0 auto;
        width: 100%;
        scroll-snap-align: none;
    }

    /* Mobile shows only the first 3 events (block delivers up to 9 for the
       desktop carousel); the rest stay carousel-only and are hidden here. */
    .news-main__item:nth-child(n+4) {
        display: none;
    }

    /* Drop the divider line that sits above the "Все новости" button — after the
       3-card stack it reads as a bottom border under the third (last) event. */
    .news-main__divider {
        display: none;
    }

    /* Card wrapper: full width, height auto (already set by 959.99px block, restated for clarity) */
    .news-main__item .news-card {
        width: 100%;
        height: auto;
    }

    /* Image: full width, preserve original aspect ratio */
    .news-main__item .news-card__media {
        width: 100%;
        height: auto;
        aspect-ratio: 433 / 290;
    }

    /* Card body: flush to content edges, no side borders, no top padding */
    .news-main__item .news-card__body {
        padding: 0;
        border-left: 0;
        border-right: 0;
    }

    /* CTA button: full-width-ish, centered */
    .news-main__more {
        display: flex;
        width: 100%;
        max-width: 360px;
        margin: 24px auto 0;
    }

    /* Section title: shrink to match .banners-grid__title on mobile */
    .news-main__title {
        font-size: 26px;
    }
}
