/*
 * diaspora.ro — canonical mobile shell
 * Shared geometry and brand language. Section menus remain page-owned.
 */
:root {
  --mobile-shell-ink: #102b49;
  --mobile-shell-blue: #0c5ca8;
  --mobile-shell-line: #dbe3ee;
  --mobile-shell-surface: #ffffff;
  --mobile-shell-height: 58px;
  --mobile-shell-logo-size: 42px;
  --mobile-shell-wordmark-size: 21px;
}

@media (max-width: 900px) {
  body[data-mobile-shell="canonical"] .site-header-stack {
    position: relative;
    z-index: 1000;
  }
  body[data-mobile-shell="canonical"] .site-header-stack .topbar {
    min-height: var(--mobile-shell-height);
    height: var(--mobile-shell-height);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,.97);
    border-bottom: 1px solid var(--mobile-shell-line);
    box-shadow: 0 1px 4px rgba(15,23,42,.07);
    overflow: visible;
  }
  body[data-mobile-shell="canonical"] .site-header-stack .tb-logo {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex: 0 1 auto;
    color: var(--mobile-shell-ink);
  }
  body[data-mobile-shell="canonical"] .site-header-stack .tb-logo > img,
  body[data-mobile-shell="canonical"] .site-header-stack .tb-logo-mark {
    width: var(--mobile-shell-logo-size);
    height: var(--mobile-shell-logo-size);
    min-width: var(--mobile-shell-logo-size);
    min-height: var(--mobile-shell-logo-size);
    flex: 0 0 var(--mobile-shell-logo-size);
    border-radius: 10px;
    object-fit: cover;
  }
  body[data-mobile-shell="canonical"] .site-header-stack .tb-logo-txt {
    min-width: 0;
    overflow: hidden;
    color: var(--mobile-shell-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: var(--mobile-shell-wordmark-size);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body[data-mobile-shell="canonical"] .site-header-stack .tb-logo-txt span {
    color: #6d28d9;
    font-family: inherit;
    font-weight: 900;
  }
  body[data-mobile-shell="canonical"] .site-header-stack .tb-desktop-quick-nav,
  body[data-mobile-shell="canonical"] .site-header-stack .tb-live,
  body[data-mobile-shell="canonical"] .site-header-stack .tb-right {
    display: none;
  }
  body[data-mobile-shell="canonical"] .site-header-stack .site-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--mobile-shell-line);
    border-radius: 12px;
    background: var(--mobile-shell-surface);
    color: #334155;
    box-shadow: 0 2px 8px rgba(15,23,42,.10);
  }
  body[data-mobile-shell="canonical"] .site-header-stack .site-menu-trigger > span:last-child {
    display: none;
  }
  body[data-mobile-shell="canonical"] .site-header-stack .dpr-global-language--header {
    display: none;
  }
}

@media (max-width: 380px) {
  body[data-mobile-shell="canonical"] .site-header-stack .topbar { padding-left: 8px; padding-right: 8px; }
  body[data-mobile-shell="canonical"] .site-header-stack .tb-logo { gap: 5px; }
  body[data-mobile-shell="canonical"] .site-header-stack .tb-logo-txt { font-size: 19px; }
}

/* Canonical homepage mobile logo scale. */
@media (max-width: 768px) {
  body[data-mobile-shell="canonical"] .site-header-stack .tb-logo > img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex: 0 0 42px;
  }

  body[data-mobile-shell="canonical"] .site-header-stack .tb-logo-txt {
    font-size: 21px;
    line-height: 1;
    letter-spacing: -.03em;
  }


}

@media (max-width: 430px) {
  body[data-mobile-shell="canonical"] .site-header-stack .topbar {
    padding-left: 8px;
    padding-right: 8px;
  }

}


/* Mobile homepage visual contract — canonical post-Hero owner. */
@media (max-width: 640px), (max-width: 900px) and (orientation: landscape) and (pointer: coarse) {
  /* Keep the language wheel and hamburger aligned with the protected Hero header. */
  body.homepage-body .site-header-stack .dpr-global-language--header {
    display: grid;
    flex: 0 0 46px;
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    height: 46px;
    min-height: 46px;
    max-height: 46px;
    margin-left: auto;
  }
  body.homepage-body .site-header-stack .site-menu-trigger { margin-left: auto; }

  /* Homepage mobile cards — one clean owner for the service and feature system. */
  body.homepage-body .home-mobile-rebuild {
    display: block;
    margin: 0;
    padding: 18px 14px 10px;
    background: linear-gradient(180deg, #f6f8fc 0%, #eef3fb 100%);
    color: #1c1e21;
  }
  body.homepage-body .home-mobile-services,
  body.homepage-body .home-mobile-feature-stack { margin-bottom: 20px; }
  body.homepage-body .home-mobile-services {
    padding: 20px 0 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  body.homepage-body .home-mobile-section-heading { padding: 0 5px 15px; }
  body.homepage-body .home-mobile-section-heading h2 {
    margin: 0;
    color: #1c1e21;
    text-align: center;
    font-size: clamp(25px, 7vw, 30px);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -.055em;
  }
  body.homepage-body .home-mobile-section-heading p {
    max-width: 300px;
    margin: 7px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
  }
  body.homepage-body .home-mobile-service-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }
  body.homepage-body .home-mobile-service-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 138px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 21px;
    background: #fff;
    color: #1c1e21;
    box-shadow: 0 8px 20px rgba(30, 41, 59, .07), inset 0 1px 0 rgba(255, 255, 255, .95);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  }
  body.homepage-body .home-mobile-service-card::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 55px;
    height: 55px;
    border-radius: 0 21px 0 55px;
    background: color-mix(in srgb, var(--service-accent) 10%, transparent);
    content: '';
  }
  body.homepage-body .home-mobile-service-card:hover,
  body.homepage-body .home-mobile-service-card:focus-visible {
    border-color: color-mix(in srgb, var(--service-accent) 45%, #dbe3ef);
    box-shadow: 0 14px 27px color-mix(in srgb, var(--service-accent) 15%, transparent);
    transform: translateY(-2px);
  }
  body.homepage-body .home-mobile-service-card:nth-child(1) { --service-accent: #2563eb; }
  body.homepage-body .home-mobile-service-card:nth-child(2) { --service-accent: #7c3aed; }
  body.homepage-body .home-mobile-service-card:nth-child(3) { --service-accent: #0f766e; }
  body.homepage-body .home-mobile-service-card:nth-child(4) { --service-accent: #db2777; }
  body.homepage-body .home-mobile-service-icon {
    position: relative;
    z-index: 1;
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--service-accent) 18%, #e5e7eb);
    border-radius: 14px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--service-accent) 12%, #fff), #fff);
    color: var(--service-accent);
    box-shadow: 0 5px 13px color-mix(in srgb, var(--service-accent) 11%, transparent);
  }
  body.homepage-body .home-mobile-service-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
  body.homepage-body .home-mobile-service-card strong {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    max-width: calc(100% - 18px);
    padding-right: 12px;
    color: #121827;
    font-size: clamp(13px, 3.6vw, 16px);
    font-weight: 900;
    line-height: 1.16;
    letter-spacing: -.04em;
  }
  body.homepage-body .home-mobile-service-card .home-title-accent { color: var(--service-accent); }
  body.homepage-body .home-mobile-service-more { margin-top: 12px; }
  body.homepage-body .home-mobile-service-more > summary {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid #ddd6fe;
    border-radius: 14px;
    background: linear-gradient(135deg, #faf9ff, #f3f0ff);
    color: #5b21b6;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
  }
  body.homepage-body .home-mobile-service-more > summary::-webkit-details-marker { display: none; }
  body.homepage-body .home-mobile-service-more > summary:hover { border-color: #a78bfa; background: #ede9fe; }
  body.homepage-body .home-mobile-service-more[open] > summary { margin-bottom: 12px; }
  body.homepage-body .home-mobile-service-grid--more { padding-top: 0; }
  body.homepage-body .home-mobile-service-grid--more .home-mobile-service-card:nth-child(1) { --service-accent: #e11d48; }
  body.homepage-body .home-mobile-service-grid--more .home-mobile-service-card:nth-child(2) { --service-accent: #0891b2; }
  body.homepage-body .home-mobile-service-grid--more .home-mobile-service-card:nth-child(3) { --service-accent: #ea580c; }
  body.homepage-body .home-mobile-service-grid--more .home-mobile-service-card:nth-child(4) { --service-accent: #4f46e5; }
  body.homepage-body .home-mobile-service-grid--more .home-mobile-service-card:nth-child(5) { --service-accent: #16a34a; }
  body.homepage-body .home-mobile-service-grid--more .home-mobile-service-card:nth-child(6) { --service-accent: #9333ea; }

  body.homepage-body .home-mobile-feature-stack { display: grid; gap: 16px; margin-bottom: 0; }
  body.homepage-body .home-mobile-feature {
    position: relative;
    display: flex;
    min-height: 156px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 23px;
    background: linear-gradient(135deg, var(--feature-surface), #fff 72%);
    box-shadow: 0 9px 23px rgba(28, 30, 33, .07);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  }
  body.homepage-body .home-mobile-feature::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--feature-accent);
    content: '';
  }
  body.homepage-body .home-mobile-feature::after {
    position: absolute;
    top: -68px;
    right: -55px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--feature-accent) 10%, transparent);
    content: '';
    pointer-events: none;
  }
  body.homepage-body .home-mobile-feature:hover,
  body.homepage-body .home-mobile-feature:focus-visible {
    border-color: color-mix(in srgb, var(--feature-accent) 35%, #e2e8f0);
    box-shadow: 0 14px 28px color-mix(in srgb, var(--feature-accent) 13%, transparent);
    transform: translateY(-2px);
  }
  body.homepage-body .home-mobile-feature--community { --feature-accent: #7c3aed; --feature-surface: #faf7ff; }
  body.homepage-body .home-mobile-feature--marketplace { --feature-accent: #d97706; --feature-surface: #fffaf0; }
  body.homepage-body .home-mobile-feature--jobs { --feature-accent: #2563eb; --feature-surface: #f4f8ff; }
  body.homepage-body .home-mobile-feature-copy {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px 19px 18px 23px;
  }
  body.homepage-body .home-mobile-feature-copy > strong {
    max-width: 82%;
    color: #1c1e21;
    font-size: clamp(18px, 5vw, 22px);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -.045em;
  }
  body.homepage-body .home-mobile-feature-copy > small { max-width: 88%; margin-top: 5px; color: #626b78; font-size: 13px; line-height: 1.42; }
  body.homepage-body .home-mobile-cta {
    display: inline-flex;
    align-self: center;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: auto;
    padding: 0 13px;
    border-radius: 11px;
    background: var(--feature-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 7px 16px color-mix(in srgb, var(--feature-accent) 24%, transparent);
  }

  body.homepage-body .home-mobile-help-card {
    position: relative;
    display: flex;
    min-height: 148px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    padding: 18px 17px;
    border: 1px solid #e5e7ee;
    border-radius: 24px;
    background: linear-gradient(135deg, #fff 0%, #f5f7ff 100%);
    box-shadow: 0 10px 26px rgba(28, 30, 33, .08);
  }
  body.homepage-body .home-mobile-help-icon {
    position: absolute;
    top: 10px;
    left: 17px;
    display: grid;
    width: 43px;
    height: 43px;
    place-items: center;
    border: 2px solid #e05a76;
    border-radius: 50%;
    color: #d84a69;
    font-size: 10px;
  }
  body.homepage-body .home-mobile-help-copy {
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
  }
  body.homepage-body .home-mobile-help-copy strong { max-width: 250px; color: #1c1e21; font-size: 19px; font-weight: 900; line-height: 1.1; letter-spacing: -.04em; }
  body.homepage-body .home-mobile-help-copy small { max-width: 270px; margin-top: 7px; color: #626b78; font-size: 13px; line-height: 1.4; }
  body.homepage-body .home-mobile-help-copy .home-mobile-cta { margin-top: 13px; }
  body.homepage-body .home-mobile-help-phone { display: none; }

  body.homepage-body .home-mobile-news {
    display: block;
    margin-top: 20px;
    padding: 0 0 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  body.homepage-body .home-mobile-news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.homepage-body .home-mobile-news-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 170px;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    padding: 16px 12px 14px;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 16px;
    background: #1c2736;
    box-shadow: 0 8px 18px rgba(29,70,105,.12);
  }
  body.homepage-body .home-mobile-news-card::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 20, 34, .02) 18%, rgba(10, 20, 34, .82) 100%);
    content: '';
    pointer-events: none;
  }
  body.homepage-body .home-mobile-news-card img { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
  body.homepage-body .home-mobile-news-card strong { position: relative; z-index: 1; align-self: center; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, .9); color: #6d28d9; font-size: 15px; line-height: 1.16; text-align: center; text-shadow: none; }
  body.homepage-body .home-mobile-news-card small { position: relative; z-index: 1; padding: 6px 0 0; color: rgba(255, 255, 255, .88); font-size: 11px; line-height: 1.3; text-align: center; text-shadow: 0 1px 7px rgba(0, 0, 0, .2); }
  body.homepage-body .home-mobile-news-card time { margin-top: auto; padding: 8px; color: #8a98a8; font-size: 9px; line-height: 1.2; }
  body.homepage-body .home-mobile-news-card:nth-child(3) { grid-column: 1 / -1; }

}

@media (max-width: 360px) {
  body.homepage-body .home-mobile-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.homepage-body .home-mobile-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* Hero typography parity pass — same black ink and Plus Jakarta Sans hierarchy. */
@media (max-width: 640px), (max-width: 900px) and (orientation: landscape) and (pointer: coarse) {
  body.homepage-body .hero-compact-h1,
  body.homepage-body .home-mobile-section-heading h2,
  body.homepage-body .home-mobile-service-card strong,
  body.homepage-body .home-mobile-feature-copy > strong,
  body.homepage-body .home-mobile-help-copy strong,
  body.homepage-body .home-mobile-news-card strong {
    color: #1c1e21;
    -webkit-text-fill-color: #1c1e21;
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  }

  body.homepage-body .home-mobile-section-heading h2 { font-weight: 900; }
  body.homepage-body .home-mobile-service-card strong,
  body.homepage-body .home-mobile-feature-copy > strong,
  body.homepage-body .home-mobile-help-copy strong,
  body.homepage-body .home-mobile-news-card strong { font-weight: 900; }

}
/* Mobile homepage help CTA refinement — owner pass */
@media (max-width: 640px), (max-width: 900px) and (orientation: landscape) and (pointer: coarse) {
  body.homepage-body .home-mobile-help-copy .home-mobile-cta {
    min-height: 30px;
    height: 30px;
    align-self: center;
    margin-top: 8px;
    padding: 0 11px;
    border-radius: 9px;
    background: #d84a69;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    box-shadow: 0 5px 12px rgba(216, 74, 105, .22);
  }
}

/* Homepage mobile news cards: centered purple labels with a modest size increase. */
@media (max-width: 640px), (max-width: 900px) and (orientation: landscape) and (pointer: coarse) {
  body.homepage-body .home-mobile-news-grid {
    gap: 8px;
    margin-inline: -2px;
  }
  body.homepage-body .home-mobile-news-card {
    min-height: 182px;
  }
  body.homepage-body .home-mobile-news-card strong {
    color: #6d28d9;
    -webkit-text-fill-color: #6d28d9;
    text-align: center;
  }
}

/* The first five hero words are the black lead-in; the remaining phrase keeps the purple accent. */
@media (max-width: 640px), (max-width: 900px) and (orientation: landscape) and (pointer: coarse) {
  body.homepage-body .hero-compact-primary {
    color: #1c1e21;
    -webkit-text-fill-color: #1c1e21;
  }
}

@media (max-width: 640px), (max-width: 900px) and (orientation: landscape) and (pointer: coarse) {
  body.homepage-body .home-mobile-news-all {
    display: flex;
    width: fit-content;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    margin: 12px auto 0;
    padding: 0 16px;
    border: 1px solid #6d28d9;
    border-radius: 11px;
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 7px 16px rgba(109, 40, 217, .22);
  }

  body.homepage-body .home-mobile-news-all:hover,
  body.homepage-body .home-mobile-news-all:focus-visible {
    background: #5b21b6;
    color: #fff;
  }
}

/* Preserve the mobile hero accent and news-card readability while the heading is removed. */
@media (max-width: 640px), (max-width: 900px) and (orientation: landscape) and (pointer: coarse) {
  body.homepage-body .hero-compact-accent {
    color: #6d28d9;
    -webkit-text-fill-color: #6d28d9;
  }

  body.homepage-body .home-mobile-news-card strong {
    padding: 4px 8px;
    font-size: 15px;
    line-height: 1.2;
  }

  body.homepage-body .home-mobile-news-card small {
    padding: 6px 0 0;
    color: rgba(255, 255, 255, .88);
    font-size: 12px;
    line-height: 1.35;
  }

  body.homepage-body .home-mobile-news-card time { display: none; }
}
