/*
 * Homepage styles. The homepage is an ordinary Page whose FlowPart starts with the hero
 * RawHtml widget (<header class="ugp-home ...">, see Recipes/home.autosync.recipe.json). Every rule
 * here is scoped to a page containing that widget, so other pages are not affected.
 *
 * Widgets on the homepage, in flow order:
 *   RawHtml  .ugp-home.ugp-hero          hero + call to action + stats
 *   RawHtml  .ugp-band.ugp-mission       "Tko smo" + "Za što se zalažemo"
 *   RawHtml  .ugp-band.ugp-work          "Što radimo", three photo cards
 *   RecentNews                           .ugp-band.ugp-news (Widget-RecentNews.liquid)
 *   RawHtml  .ugp-band.ugp-support-head  "Podrži nas" heading (#podrzi)
 *   RawHtml  .ugp-support-text           why donate + how, left column
 *   PledgeForm                           right column, as a card
 *   Gallery (any number)                 logo tiles
 *   RawHtml  .ugp-band.ugp-cta           closing call to action
 *
 * Tokens and shared components (.ugp-eyebrow, .ugp-title, .ugp-btn, .ugp-link, the donation
 * form card...) are site-wide, in ugp.css. Plain CSS, not part of the Clean Blog SCSS build.
 */

/* The hero replaces the generic page header, and the page uses the full container width. */
body:has(.ugp-home) > header.masthead { display: none; }
body:has(.ugp-home) .container > .row > [class*="col-"]:has(> .flow) {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
}

/* ---------- flow grid ---------- */

.flow:has(> .ugp-home) {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: 2.5rem;
    grid-auto-flow: row dense;
    margin: 0;
    color: var(--ugp-text);
}
.flow:has(> .ugp-home) > * {
    grid-column: 1 / -1;
    width: auto;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

/* Full-bleed sections: break out of the container to the viewport edges. */
.flow:has(> .ugp-home) > .ugp-band,
.flow:has(> .ugp-home) > .ugp-hero {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}
.flow:has(> .ugp-home) > .ugp-band { padding: 5rem 0; }

/* ---------- hero ---------- */

.flow > .ugp-hero {
    position: relative;
    isolation: isolate;
    padding: calc(5rem + 57px) 0 0;
    color: #fff;
    background: var(--ugp-ink) url("/UgpTheme/assets/img/home/hero-prosvjed.jpg") center 60% / cover no-repeat;
}
/* The layout's content wrapper sits below the absolutely positioned navbar; pull the hero up under it. */
body:has(.ugp-home) .container:has(.ugp-home) { padding-top: 0; }
.ugp-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    /* Dark behind the text on the left, letting the protest photo show through on the right. */
    background:
        linear-gradient(180deg, rgba(13, 27, 42, .55) 0%, transparent 25%, transparent 60%, var(--ugp-ink) 100%),
        linear-gradient(90deg, rgba(13, 27, 42, .94) 0%, rgba(13, 27, 42, .8) 40%, rgba(13, 27, 42, .35) 100%);
}
@media (max-width: 767.98px) {
    /* Text spans the full width on phones, so keep the overlay dark all the way across. */
    .ugp-hero::before { background: linear-gradient(180deg, rgba(13, 27, 42, .8) 0%, rgba(13, 27, 42, .88) 70%, var(--ugp-ink) 100%); }
}
.ugp-hero__inner { padding-bottom: 4rem; }
.ugp-hero .ugp-eyebrow { color: #7fd6e8; }
.ugp-hero__title {
    font-family: var(--ugp-sans);
    font-size: clamp(2.5rem, 1.6rem + 4vw, 4.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.02em;
    margin: 0 0 1.25rem;
    color: #fff;
}
.ugp-hero__lead {
    max-width: 40rem;
    font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, .85);
    margin: 0 0 2rem;
}
.ugp-hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.ugp-stats {
    position: relative;
    z-index: 1;
    margin-bottom: -4rem;
}
.ugp-stats__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: #fff;
    border-radius: var(--ugp-radius);
    box-shadow: 0 20px 50px rgba(13, 27, 42, .18);
    overflow: hidden;
}
.ugp-stat { padding: 1.75rem 1.5rem; text-align: center; }
.ugp-stat + .ugp-stat { border-left: 1px solid var(--ugp-line); }
.ugp-stat__value {
    display: block;
    font-family: var(--ugp-sans);
    font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.2;
    color: var(--ugp-teal);
    margin-bottom: .35rem;
}
.ugp-stat__label {
    display: block;
    font-family: var(--ugp-sans);
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--ugp-muted);
}

/* ---------- mission ---------- */

.flow > .ugp-band.ugp-mission { padding-top: 8.5rem; }
.ugp-mission__grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 3rem;
    align-items: start;
}
.ugp-mission__intro .ugp-muted { font-size: 1.05rem; margin-bottom: 1.25rem; }
/* "Za što se zalažemo": three positions next to the intro. */
.ugp-stances {
    padding: 2rem 2.25rem;
    background: var(--ugp-paper);
    border-radius: var(--ugp-radius);
}
.ugp-stances__list {
    list-style: none;
    counter-reset: ugp-stance;
    margin: 0;
    padding: 0;
}
.ugp-stances__list li {
    counter-increment: ugp-stance;
    position: relative;
    padding: 1rem 0 1rem 3.25rem;
    border-top: 1px solid var(--ugp-line);
}
.ugp-stances__list li:first-child { border-top: 0; padding-top: .25rem; }
.ugp-stances__list li::before {
    content: counter(ugp-stance, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 1rem;
    font-family: var(--ugp-sans);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--ugp-accent);
}
.ugp-stances__list li:first-child::before { top: .25rem; }
.ugp-stances__list strong {
    display: block;
    font-family: var(--ugp-sans);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ugp-ink);
    margin-bottom: .2rem;
}
.ugp-stances__list span { display: block; color: var(--ugp-muted); line-height: 1.55; }

/* ---------- what we do: photo cards on a dark band ---------- */

.flow > .ugp-band.ugp-work {
    background:
        radial-gradient(50rem 25rem at 0% 0%, rgba(0, 133, 161, .35), transparent 60%),
        var(--ugp-ink);
    color: #fff;
}
.ugp-work .ugp-eyebrow { color: #7fd6e8; }
.ugp-work .ugp-title { color: #fff; margin-bottom: .5rem; }
.ugp-work__lead { font-size: 1.15rem; color: rgba(255, 255, 255, .78); margin: 0 0 2rem; }
.ugp-work__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}
.ugp-work__card {
    display: flex;
    flex-direction: column;
    background: var(--ugp-ink-2);
    border-radius: var(--ugp-radius);
    overflow: hidden;
}
.ugp-work__img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center 30%;
}
.ugp-work__body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.ugp-work__title {
    font-family: var(--ugp-sans);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.35;
    color: #fff;
    margin: 0 0 .6rem;
}
.ugp-work__text { font-size: .95rem; line-height: 1.6; color: rgba(255, 255, 255, .78); margin: 0 0 1rem; flex: 1; }
.ugp-work__text a { color: #fff; text-decoration: underline; text-decoration-color: rgba(127, 214, 232, .6); text-underline-offset: 3px; }
.ugp-work__text a:hover, .ugp-work__text a:focus { color: #7fd6e8; }
.ugp-work .ugp-link { color: #7fd6e8; }
.ugp-work .ugp-link:hover, .ugp-work .ugp-link:focus { color: #fff; }

/* ---------- news (Widget-RecentNews.liquid; also used outside the homepage) ---------- */

.ugp-news { margin: 2rem 0; }
.ugp-news__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}
.ugp-news__head .ugp-title { margin-bottom: 0; }
.ugp-news__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}
.ugp-news__card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e7ee;
    border-radius: 16px;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.ugp-news__card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(13, 27, 42, .12); }
.ugp-news__media {
    display: block;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #0085a1, #14304a);
    overflow: hidden;
}
.ugp-news__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ugp-news__body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.ugp-news__date {
    font-family: "Open Sans", sans-serif;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: #0085a1;
    margin-bottom: .5rem;
}
.ugp-news__title {
    font-family: "Open Sans", sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 .65rem;
}
.ugp-news__title a { color: #0d1b2a; text-decoration: none; }
.ugp-news__title a:hover, .ugp-news__title a:focus { color: #0085a1; }
.ugp-news__excerpt { font-size: .95rem; line-height: 1.6; color: #5b6875; margin: 0; }

.flow:has(> .ugp-home) > .ugp-band.ugp-news { margin-top: 0; margin-bottom: 0; background: var(--ugp-paper); }
.flow:has(> .ugp-home) > .ugp-band.ugp-news .ugp-news__card { border-color: transparent; box-shadow: var(--ugp-shadow); }

/* ---------- support: heading band, text left, pledge form right ---------- */

.flow > .ugp-band.ugp-support-head {
    padding-bottom: 2.25rem;
    background: linear-gradient(180deg, var(--ugp-teal-soft), #fff);
}
.ugp-support-head .ugp-title { max-width: 46rem; margin-bottom: 0; }

.flow:has(> .ugp-home) > .ugp-support-text { grid-column: 1; }
.ugp-support-text__lead { font-size: 1.1rem; line-height: 1.7; margin: 0 0 1.25rem; }
.ugp-support-text__list {
    list-style: none;
    margin: 0 0 2.25rem;
    padding: 0;
}
.ugp-support-text__list li {
    position: relative;
    padding: .9rem 0 .9rem 2.25rem;
    border-bottom: 1px solid var(--ugp-line);
    line-height: 1.55;
}
.ugp-support-text__list li::before {
    content: "";
    position: absolute;
    left: .35rem;
    top: 1.3rem;
    width: .7rem;
    height: .7rem;
    border-radius: 50%;
    background: var(--ugp-accent);
}
.ugp-support-text__list strong { font-family: var(--ugp-sans); color: var(--ugp-ink); }
.ugp-support-text__subtitle {
    font-family: var(--ugp-sans);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ugp-ink);
    margin: 0 0 1rem;
}
.ugp-steps {
    list-style: none;
    counter-reset: ugp-step;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 0 0 2rem;
    padding: 0;
}
.ugp-steps li {
    counter-increment: ugp-step;
    padding: 1.1rem 1.1rem 1.2rem;
    background: var(--ugp-paper);
    border-radius: 12px;
    font-size: .95rem;
    line-height: 1.5;
}
.ugp-steps li::before {
    content: counter(ugp-step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: .6rem;
    border-radius: 50%;
    background: var(--ugp-teal);
    color: #fff;
    font-family: var(--ugp-sans);
    font-weight: 800;
}

/* The text spans two rows so that, for logged-in members with companies, the "Član" selector
   (a separate form the PledgeForm widget renders first) and the payment form stack in the
   right column instead of pushing the payment form below the text. */
.flow:has(> .ugp-home) > .ugp-support-text { grid-row: span 2; }
.flow:has(> .ugp-home) > #personSelector,
.flow:has(> .ugp-home) > form[action*="Pledge"] {
    grid-column: 2;
}
.flow:has(> .ugp-home) > #personSelector,
.flow:has(> .ugp-home) > form[action*="Pledge"] { align-self: start; margin-bottom: 0; }

/* ---------- galleries as logo tiles ---------- */

.flow:has(> .ugp-home) > .section-heading {
    font-family: var(--ugp-sans);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    text-align: center;
    color: var(--ugp-muted);
    margin: 3.5rem 0 1.75rem;
}
/* The first gallery heading opens the logos section. */
.flow:has(> .ugp-home) > :not(.section-heading, .gallery) + .section-heading {
    margin-top: 5rem;
    padding-top: 4rem;
    border-top: 1px solid var(--ugp-line);
}
.flow:has(> .ugp-home) > .gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}
/* Gallery pieces render as .gallery-item (GPiece) or <article><figure> (Image items); tile both. */
.flow:has(> .ugp-home) > .gallery .gallery-item,
.flow:has(> .ugp-home) > .gallery > article {
    flex: 0 0 160px;
    height: 96px;
    margin: 0;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--ugp-line);
    border-radius: 12px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.flow:has(> .ugp-home) > .gallery .gallery-item:hover,
.flow:has(> .ugp-home) > .gallery > article:hover { border-color: #c9d3de; box-shadow: var(--ugp-shadow); }
.flow:has(> .ugp-home) > .gallery > article .figure { margin: 0; width: 100%; height: 100%; }
.flow:has(> .ugp-home) > .gallery > article .figure-caption:empty { display: none; }
.flow:has(> .ugp-home) > .gallery > article .figure-img { margin: 0; border-radius: 0; }
.flow:has(> .ugp-home) > .gallery .gallery-item a,
.flow:has(> .ugp-home) > .gallery > article a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.flow:has(> .ugp-home) > .gallery img {
    max-width: 100%;
    max-height: 64px;
    object-fit: contain;
    filter: grayscale(1);
    opacity: .75;
    transition: filter .25s ease, opacity .25s ease;
}
.flow:has(> .ugp-home) > .gallery .gallery-item:hover img,
.flow:has(> .ugp-home) > .gallery > article:hover img { filter: none; opacity: 1; }

/* ---------- closing call to action ---------- */

.flow > .ugp-band.ugp-cta { padding-top: 5rem; padding-bottom: 2rem; }
.ugp-cta__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 2.5rem;
    padding: 4rem 3rem;
    border-radius: 24px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(13, 27, 42, .94) 0%, rgba(13, 27, 42, .8) 55%, rgba(13, 27, 42, .45) 100%),
        var(--ugp-ink) url("/UgpTheme/assets/img/home/tim-prosvjed.jpg") center 30% / cover no-repeat;
}
.ugp-cta__title {
    font-family: var(--ugp-sans);
    font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 .5rem;
}
.ugp-cta__text { color: rgba(255, 255, 255, .8); margin: 0; max-width: 38rem; }

/* ---------- responsive ---------- */

@media (max-width: 991.98px) {
    .flow:has(> .ugp-home) { grid-template-columns: minmax(0, 1fr); }
    .flow:has(> .ugp-home) > #personSelector,
    .flow:has(> .ugp-home) > form[action*="Pledge"],
    .flow:has(> .ugp-home) > .ugp-support-text { grid-column: 1; grid-row: auto; }
    .ugp-mission__grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
    .ugp-work__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .flow:has(> .ugp-home) > .ugp-band { padding: 3.5rem 0; }
    .flow > .ugp-hero { padding-top: calc(3rem + 57px); }
    .ugp-hero__inner { padding-bottom: 3rem; }
    .ugp-stats { margin-bottom: -2rem; }
    .ugp-stats__grid { grid-template-columns: minmax(0, 1fr); }
    .ugp-stat { padding: 1.25rem; }
    .ugp-stat + .ugp-stat { border-left: 0; border-top: 1px solid var(--ugp-line); }
    .flow > .ugp-band.ugp-mission { padding-top: 5.5rem; }
    .ugp-stances { padding: 1.5rem; }
    .flow:has(> .ugp-home) > .gallery .gallery-item,
    .flow:has(> .ugp-home) > .gallery > article { flex-basis: calc(50% - .5rem); }
    .ugp-steps,
    .ugp-work__grid { grid-template-columns: minmax(0, 1fr); }
    .ugp-cta__inner { padding: 2rem 1.5rem; }
    .ugp-btn { flex: 1 1 auto; }
}
