/* Home page (Components/Pages/Home.razor).
   Global file: everything is scoped under .home-page so it only affects the home page.
   (Shared group-photo / social-link styles live in PageLayout.css.)

   Below the banner + tagline the page is stacked full-width sections:
   1. Team.
      Mobile: logo, photo, follow-us (intro text hidden).
      768px+: left 40% = photo; right 60% = "Dreams -Team" logo, intro text and follow-us, centred
      horizontally and vertically centred to the photo. The logo is rendered twice (mobile copy
      in its own grid item above the photo, tablet/desktop copy in the text column).
   2. Latest news (three newest items as stacked cards) + active campaigns.
      Mobile: news only (campaigns are a band under the tagline). 768px+: news left, campaigns right. */

/* ── Follow-us (heading + Instagram/Facebook in one translucent white pill, links side by side) ──
   Rendered twice: .home-social--mobile below the group photo (<768px),
   .home-social--desktop under the team text next to the photo (768px+). */
.home-page .home-social { width: auto; gap: 0.5rem; }
.home-page .home-social .group-photo-social-heading { color: var(--color-secondary-dark); }
.home-page .home-social .group-photo-social-links {
    flex-direction: row;
    width: auto;
    background-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0px 4px 15px 2px rgba(0,0,0,0.12);
    backdrop-filter: blur(3px);
}
.home-page .home-social .group-photo-social-link { padding: 0.5rem 1.1rem; font-size: 1rem; gap: 0.5rem; }
.home-page .home-social .group-photo-social-link svg { width: 1.35rem; height: 1.35rem; }
.home-page .home-social .group-photo-social-link + .group-photo-social-link {
    border-left: 1px solid var(--color-secondary);
}
.home-page .home-social--mobile { margin-top: 2rem; }
.home-page .home-social--desktop { display: none; margin-top: 0.5rem; }
@media (min-width: 768px) {
    .home-page .home-social--mobile { display: none; }
    .home-page .home-social--desktop { display: flex; }
}

/* ── Hero tagline (under "since 2015"): a bit smaller on mobile (base size 0.95rem in PageLayout.css) ── */
@media (max-width: 767.98px) {
    .home-page .hero-tagline-info { font-size: 0.85rem; }
}
/* Tagline is split in two (top: "since 2015" row; bottom: text + underline) so the mobile campaigns can
   sit between them; no padding at the seam, so without campaigns it reads as one block. */
.home-page .hero-tagline-section--top { padding-bottom: 0; }
.home-page .hero-tagline-section--bottom { padding-top: 0; }
/* The "since 2015" row shrink-wraps its content (lines 6rem each, shrinking on narrow screens) so the
   underline below the tagline text, an invisible copy of the row, ends exactly where the row's lines end. */
.home-page .hero-tagline-row { width: fit-content; max-width: min(28rem, 100%); }
/* Explicit width (not flex-basis): a shrink-wrapped row sizes empty items by their width, so a
   flex-basis alone collapsed the lines to 0. min-width: 0 lets them shrink on narrow screens. */
.home-page .hero-tagline-line { flex: 0 1 auto; width: 6rem; min-width: 0; }
.home-page .hero-tagline-underline {
    height: 1px;
    overflow: hidden;
    margin-top: 1rem;
    background-color: var(--color-secondary);
}
.home-page .hero-tagline-underline > * { visibility: hidden; }
/* Mobile with campaigns: the tagline text is hidden, only the underline stays (just under the campaigns).
   Tablet/desktop: the text always shows and the underline is hidden. */
@media (max-width: 767.98px) {
    .home-page .hero-tagline-section--has-campaigns .hero-tagline-info { display: none; }
    .home-page .hero-tagline-section--has-campaigns .hero-tagline-underline { margin-top: 0.25rem; }
}
@media (min-width: 768px) {
    .home-page .hero-tagline-underline { display: none; }
}

/* ── Campaigns ──
   Rendered twice (Home.razor CampaignsBlock):
   - .home-campaign-section--band: mobile only (<768px), between the "since 2015" row and the tagline
     text; inset from the screen edges, rounded corners, shadow all round.
   - .home-campaign-section--column: 768px+ only, the right column of the news section, styled as a card
     like the news cards next to it.
   Kept low: smaller header, tighter spacing, text cut to a few lines in the carousel.
   Several campaigns rotate in a fixed-height carousel with side arrows (banners use Clamp). */
.home-page .home-campaign-section { padding: 0; margin: 0; }
/* Let the page scroll when a touch starts on the carousel (MudBlazor sets touch-action:none on it). */
.home-page .home-campaign-carousel .mud-swipearea { touch-action: pan-y; }
.home-page .home-campaign-section--band .campaign-banner {
    border-radius: 0;
    border: none;
    box-shadow: none;
}
.home-page .home-campaign-section--column .campaign-banner {
    border: none;
    border-radius: 1.5rem;                              /* = .home-news-card */
    box-shadow: 0px 4px 15px 2px rgba(0,0,0,0.08);
}
.home-page .home-campaign-section--column .home-campaign-carousel { border-radius: 1.5rem; }
.home-page .home-campaign-section .campaign-banner-content { padding: 1.25rem 1.5rem; }
.home-page .home-campaign-section .campaign-banner--has-media .campaign-banner-content { min-height: 0; }
.home-page .home-campaign-section .campaign-banner-header { font-size: 1.9rem; }
.home-page .home-campaign-section .campaign-banner--layout-compact .campaign-banner-header { font-size: 1.1rem; }
.home-page .home-campaign-section .campaign-banner-divider { margin: 0.4rem 0 0.6rem; }
.home-page .home-campaign-section .campaign-banner-valid { margin-top: 0.5rem; }
.home-page .home-campaign-section .campaign-banner--clamped .campaign-banner-text { -webkit-line-clamp: 2; line-clamp: 2; }
.home-page .home-campaign-section .campaign-banner--clamped.campaign-banner--layout-split .campaign-banner-media { height: 5rem; }

.home-page .home-campaign-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.home-page .home-campaign-link:hover .campaign-banner { filter: brightness(1.03); }

/* Band (mobile): between the "since 2015" row and the tagline text, inset 1rem from the screen edges
   with rounded corners. Shadow all round, the same as the group photo (.group-photo-frame).
   MudCarousel clips its box, so the carousel stays full width and each slide's padding insets the banner
   and leaves room for the shadow (2.75rem taller than the banner; more below because of the 6px offset). */
.home-page .home-campaign-section--band .campaign-banner {
    border-radius: 1.25rem;
    box-shadow: 0px 6px 18px 2px rgba(0,0,0,0.3);
}
.home-page .home-campaign-section--band > .home-campaign-link { margin: 1rem 1rem 1.75rem; }   /* single campaign: same spacing as a carousel slide */
.home-page .home-campaign-section--band .home-campaign-carousel .mud-carousel-item { padding: 1rem 1rem 1.75rem; }
.home-page .home-campaign-section--band .home-campaign-arrow { margin: 1rem 1.4rem 1.75rem; }   /* centre on the banner, inside its edges */

/* Carousel: fixed height (band; the column copy overrides it from 768px) */
.home-page .home-campaign-carousel { height: 16.75rem; }
/* Side room for the arrows so they don't sit on the text */
.home-page .home-campaign-carousel .campaign-banner-content { padding-left: 3.25rem; padding-right: 3.25rem; }
.home-page .home-campaign-arrow {
    color: var(--color-secondary-dark);
    background-color: rgba(255, 255, 255, 0.75);
    box-shadow: 0px 2px 8px rgba(0,0,0,0.12);
    padding: 0.3rem;
    margin: 0 0.4rem;
}
.home-page .home-campaign-arrow:hover { background-color: rgba(255, 255, 255, 0.95); }

/* Column copy (and its whole grid item) is tablet/desktop only; the band is mobile only */
.home-page .home-campaign-col { display: none; }
@media (min-width: 768px) {
    .home-page .home-campaign-section--band { display: none; }

    /* Column copy: taller slides, since the column is narrow; text may run to 4 lines */
    .home-page .home-campaign-section--column .campaign-banner-content { padding: 1.5rem 1.75rem; }
    .home-page .home-campaign-section--column .home-campaign-carousel { height: 20rem; }
    .home-page .home-campaign-section--column .home-campaign-carousel .campaign-banner-content { padding-left: 3.5rem; padding-right: 3.5rem; }
    .home-page .home-campaign-section--column .campaign-banner--clamped .campaign-banner-text { -webkit-line-clamp: 4; line-clamp: 4; }
    /* Split layout is too cramped side by side in a half-width column: picture on top, text below */
    .home-page .home-campaign-section--column .campaign-banner--layout-split { display: flex; flex-direction: column; }
    .home-page .home-campaign-section--column .campaign-banner--layout-split .campaign-banner-media { min-height: 0; height: 7rem; flex: 0 0 auto; }
    .home-page .home-campaign-section--column .campaign-banner--clamped.campaign-banner--layout-split .campaign-banner-content { flex: 1; }
}

.home-page .home-team-section,
.home-page .home-news-section { padding: 3rem 1.25rem; }
.home-page .home-news-section { background-color: var(--color-background); }

/* ── Team section ── */
.home-page .home-team-grid { max-width: 68rem; margin: 0 auto; }

.home-page .home-team-logo-col { display: flex; justify-content: center; }
/* The logo wrap shrink-wraps its content, so give it a real width for the masked logo to fill */
.home-page .home-team-logo { width: min(100%, 15rem); margin-bottom: 1.25rem; }
.home-page .home-team-logo .group-photo-logo-tinted { width: 100%; }

.home-page .home-team-photo-col { display: flex; flex-direction: column; align-items: center; }
.home-page .home-team-photo-col .group-photo-oval-wrapper { width: 80%; max-width: 26rem; margin: 0; }
.home-page .group-photo-frame { border-radius: 3.5rem; }

/* Text column (logo + intro + follow-us) is tablet/desktop only: on mobile the intro is too much
   text and the logo / follow-us are shown above / below the photo, so the whole column is hidden. */
.home-page .home-team-text-col {
    display: none;
    flex-direction: column;
    align-items: center;       /* logo and follow-us centred over / under the text */
}
.home-page .home-team-intro {
    color: var(--color-secondary-dark);
    margin: 0 0 1.5rem;
    line-height: 1.6;
}
.home-page .home-team-intro p { margin: 0 0 0.75rem; }
.home-page .home-team-intro p:last-child { margin-bottom: 0; }

@media (min-width: 768px) {
    .home-page .home-team-section,
    .home-page .home-news-section { padding: 4.5rem 2.5rem; }

    .home-page .home-team-grid { align-items: center; }
    /* MudItem xs="12" sets width with 2-class selectors; these 3-class rules win */
    /* Logo moves from above the photo to the top of the text column (desktop copy there) */
    .home-page .mud-grid.home-team-grid > .mud-grid-item.home-team-logo-col { display: none; }
    .home-page .mud-grid.home-team-grid > .mud-grid-item.home-team-photo-col {
        flex: 0 0 40%;
        max-width: 40%;
        padding-right: 1.5rem;
    }
    .home-page .home-team-photo-col .group-photo-oval-wrapper { width: 100%; }
    .home-page .mud-grid.home-team-grid > .mud-grid-item.home-team-text-col {
        flex: 0 0 60%;
        max-width: 60%;
        display: flex;
        padding: 0 0 0 2.5rem;
    }
    .home-page .home-team-intro { max-width: 36rem; }
}

/* ── Latest news ── */
.home-page .home-news-divider { margin: 0.75rem auto 2rem; width: 6rem; }
.home-page .home-news-cards {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 64rem;
    margin: 0 auto;
}
.home-page .home-news-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.5rem;
    background-color: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0px 4px 15px 2px rgba(0,0,0,0.08);
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.15s;
}
.home-page .home-news-card:hover { box-shadow: 0px 6px 20px 4px rgba(0,0,0,0.13); transform: translateY(-2px); }
.home-page .home-news-card-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;   /* full title in the tooltip */
}
.home-page .home-news-card-date { display: block; margin: 0.25rem 0 0.75rem; opacity: 0.8; }
.home-page .home-news-card-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    flex-grow: 1;              /* pushes "read more" to the bottom so cards line up */
}
.home-page .home-news-card-more { margin-top: 1rem; color: var(--color-main); }
.home-page .home-news-all { text-align: center; margin-top: 2rem; }
.home-page .home-news-all-link { color: var(--color-main); text-decoration: none; font-size: 1.05rem; }
.home-page .home-news-all-link:hover { text-decoration: underline; }

/* ── News + campaigns ──
   Mobile: news only, one column of stacked cards (campaigns are the band under the tagline).
   768px+ with both: two equal columns, news left and campaigns right, as wide as the team section.
   With only one of them it is a single centred column, capped so it doesn't stretch across the page. */
.home-page .home-news-grid { max-width: 44rem; margin: 0 auto; }
/* Only campaigns and no news: nothing to show here on mobile */
@media (max-width: 767.98px) {
    .home-page .home-news-section--campaigns-only { display: none; }
}
@media (min-width: 768px) {
    .home-page .home-campaign-col { display: block; }
    .home-page .mud-grid.home-news-grid--split { max-width: 68rem; align-items: flex-start; }
    /* MudItem xs="12" sets width with 2-class selectors; these 3-class rules win */
    .home-page .mud-grid.home-news-grid--split > .mud-grid-item.home-news-col {
        flex: 0 0 50%;
        max-width: 50%;
        padding-right: 1.5rem;
    }
    .home-page .mud-grid.home-news-grid--split > .mud-grid-item.home-campaign-col {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 1.5rem;
    }
}
