/* ============================================================
   LINK Community Hub — GLOBAL READABILITY + FULL WIDTH V40
   Public-facing pages only. Loaded LAST so older tiny type rules
   cannot win. Secure admin/editor operational screens excluded.
   ============================================================ */

:root {
  --link-v40-edge: 24px;
  --link-v40-body: 21px;
  --link-v40-card: 20px;
  --link-v40-button: 18px;
  --link-v40-small: 16px;
  --link-v40-nav: 17px;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body:not(.link-admin-page):not(.auth-page) {
  width: 100% !important;
  max-width: none !important;
  font-size: var(--link-v40-body) !important;
  line-height: 1.58 !important;
}

/* ---------- FULL WIDTH PUBLIC PAGE SYSTEM ---------- */

body:not(.link-admin-page):not(.auth-page) main,
body:not(.link-admin-page):not(.auth-page) .link-public-main,
body:not(.link-admin-page):not(.auth-page) .page-shell,
body:not(.link-admin-page):not(.auth-page) .page-wrap,
body:not(.link-admin-page):not(.auth-page) .content-shell,
body:not(.link-admin-page):not(.auth-page) .directory-shell,
body:not(.link-admin-page):not(.auth-page) .directory-main,
body:not(.link-admin-page):not(.auth-page) .community-shell,
body:not(.link-admin-page):not(.auth-page) .resources-shell,
body:not(.link-admin-page):not(.auth-page) .events-shell,
body:not(.link-admin-page):not(.auth-page) .services-shell,
body:not(.link-admin-page):not(.auth-page) .opportunities-shell,
body:not(.link-admin-page):not(.auth-page) .business-public-shell,
body:not(.link-admin-page):not(.auth-page) .foundation-public-shell,
body:not(.link-admin-page):not(.auth-page) .groups-public-shell,
body:not(.link-admin-page):not(.auth-page) .directory-content {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body:not(.link-admin-page):not(.auth-page) main > section,
body:not(.link-admin-page):not(.auth-page) .link-public-main > section,
body:not(.link-admin-page):not(.auth-page) .directory-main > section {
  width: 100% !important;
  max-width: none !important;
}

/* Common inner wrappers: full available width with a small edge gutter. */
body:not(.link-admin-page):not(.auth-page) .link-page-inner,
body:not(.link-admin-page):not(.auth-page) .page-inner,
body:not(.link-admin-page):not(.auth-page) .section-inner,
body:not(.link-admin-page):not(.auth-page) .content-inner,
body:not(.link-admin-page):not(.auth-page) .directory-inner,
body:not(.link-admin-page):not(.auth-page) .community-inner,
body:not(.link-admin-page):not(.auth-page) .resource-inner,
body:not(.link-admin-page):not(.auth-page) .events-inner,
body:not(.link-admin-page):not(.auth-page) .services-inner,
body:not(.link-admin-page):not(.auth-page) .opportunities-inner,
body:not(.link-admin-page):not(.auth-page) main > .container,
body:not(.link-admin-page):not(.auth-page) main > .wrap,
body:not(.link-admin-page):not(.auth-page) main > .shell,
body:not(.link-admin-page):not(.auth-page) main > section > .container,
body:not(.link-admin-page):not(.auth-page) main > section > .wrap,
body:not(.link-admin-page):not(.auth-page) main > section > .shell {
  width: calc(100% - (var(--link-v40-edge) * 2)) !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ---------- GLOBAL TYPE SCALE ---------- */

body:not(.link-admin-page):not(.auth-page) main p,
body:not(.link-admin-page):not(.auth-page) main li,
body:not(.link-admin-page):not(.auth-page) main dd,
body:not(.link-admin-page):not(.auth-page) main dt,
body:not(.link-admin-page):not(.auth-page) main blockquote,
body:not(.link-admin-page):not(.auth-page) main .description,
body:not(.link-admin-page):not(.auth-page) main .copy,
body:not(.link-admin-page):not(.auth-page) main .body-copy {
  font-size: var(--link-v40-body) !important;
  line-height: 1.58 !important;
}

body:not(.link-admin-page):not(.auth-page) main h1 {
  font-size: clamp(44px, 4.2vw, 68px) !important;
  line-height: 1.02 !important;
  letter-spacing: -.035em !important;
}

body:not(.link-admin-page):not(.auth-page) main h2 {
  font-size: clamp(32px, 3vw, 46px) !important;
  line-height: 1.08 !important;
  letter-spacing: -.025em !important;
}

body:not(.link-admin-page):not(.auth-page) main h3 {
  font-size: clamp(25px, 2vw, 32px) !important;
  line-height: 1.15 !important;
}

body:not(.link-admin-page):not(.auth-page) main h4 {
  font-size: 22px !important;
  line-height: 1.2 !important;
}

body:not(.link-admin-page):not(.auth-page) main small,
body:not(.link-admin-page):not(.auth-page) main .small,
body:not(.link-admin-page):not(.auth-page) main .meta,
body:not(.link-admin-page):not(.auth-page) main .eyebrow,
body:not(.link-admin-page):not(.auth-page) main .kicker,
body:not(.link-admin-page):not(.auth-page) main [class*="eyebrow"],
body:not(.link-admin-page):not(.auth-page) main [class*="kicker"],
body:not(.link-admin-page):not(.auth-page) main [class*="meta"] {
  font-size: var(--link-v40-small) !important;
  line-height: 1.35 !important;
}

/* ---------- CARDS ---------- */

body:not(.link-admin-page):not(.auth-page) main .card,
body:not(.link-admin-page):not(.auth-page) main [class$="-card"],
body:not(.link-admin-page):not(.auth-page) main [class*="-card "] {
  font-size: var(--link-v40-card) !important;
}

body:not(.link-admin-page):not(.auth-page) main .card p,
body:not(.link-admin-page):not(.auth-page) main [class$="-card"] p,
body:not(.link-admin-page):not(.auth-page) main [class*="-card "] p {
  font-size: var(--link-v40-card) !important;
  line-height: 1.55 !important;
}

body:not(.link-admin-page):not(.auth-page) main .card h3,
body:not(.link-admin-page):not(.auth-page) main [class$="-card"] h3,
body:not(.link-admin-page):not(.auth-page) main [class*="-card "] h3 {
  font-size: clamp(25px, 1.9vw, 31px) !important;
  line-height: 1.14 !important;
}

/* ---------- BUTTONS / FORMS ---------- */

body:not(.link-admin-page):not(.auth-page) main button,
body:not(.link-admin-page):not(.auth-page) main .btn,
body:not(.link-admin-page):not(.auth-page) main .button,
body:not(.link-admin-page):not(.auth-page) main [class*="button"],
body:not(.link-admin-page):not(.auth-page) main input,
body:not(.link-admin-page):not(.auth-page) main select,
body:not(.link-admin-page):not(.auth-page) main textarea,
body:not(.link-admin-page):not(.auth-page) main label {
  font-size: var(--link-v40-button) !important;
  line-height: 1.35 !important;
}

body:not(.link-admin-page):not(.auth-page) main button,
body:not(.link-admin-page):not(.auth-page) main .btn,
body:not(.link-admin-page):not(.auth-page) main .button,
body:not(.link-admin-page):not(.auth-page) main [class*="button"] {
  min-height: 46px !important;
}

/* ---------- PUBLIC HEADER / NAV ---------- */

body:not(.link-admin-page):not(.auth-page) header nav a,
body:not(.link-admin-page):not(.auth-page) .main-nav a,
body:not(.link-admin-page):not(.auth-page) .link-standard-nav a,
body:not(.link-admin-page):not(.auth-page) .link-v407g-nav a,
body:not(.link-admin-page):not(.auth-page) .link-v407e-nav a {
  font-size: var(--link-v40-nav) !important;
  line-height: 1.25 !important;
}

/* ---------- FOOTER ---------- */

body:not(.link-admin-page):not(.auth-page) footer,
body:not(.link-admin-page):not(.auth-page) footer p,
body:not(.link-admin-page):not(.auth-page) footer a,
body:not(.link-admin-page):not(.auth-page) footer small {
  font-size: 17px !important;
  line-height: 1.45 !important;
}

/* ---------- NONPROFIT DIRECTORY: VERY READABLE ---------- */

.link-directory-page .directory-main,
.link-directory-page .directory-content,
.link-directory-page .directory-map-section,
.link-directory-page .directory-list-section {
  width: calc(100% - 48px) !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.link-directory-page .directory-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 26px !important;
  width: 100% !important;
  max-width: none !important;
}

.link-directory-page .directory-card {
  min-height: 470px !important;
  border-radius: 18px !important;
}

.link-directory-page .directory-card-logo {
  min-height: 170px !important;
  height: 170px !important;
  padding: 22px !important;
}

.link-directory-page .directory-card-logo img {
  width: 100% !important;
  height: 128px !important;
  max-width: 320px !important;
  max-height: 128px !important;
  object-fit: contain !important;
}

.link-directory-page .directory-card-body {
  padding: 22px 24px 18px !important;
}

.link-directory-page .directory-card h3 {
  font-size: clamp(26px, 1.8vw, 32px) !important;
  line-height: 1.14 !important;
}

.link-directory-page .directory-card p {
  font-size: 20px !important;
  line-height: 1.58 !important;
}

.link-directory-page .directory-category {
  font-size: 17px !important;
}

.link-directory-page .directory-verified {
  font-size: 15px !important;
}

.link-directory-page .directory-chips span {
  font-size: 15px !important;
  padding: 7px 10px !important;
}

.link-directory-page .directory-action-count {
  font-size: 16px !important;
}

.link-directory-page .directory-card-footer a,
.link-directory-page .directory-primary {
  min-height: 48px !important;
  font-size: 17px !important;
  padding: 12px 16px !important;
}

/* Mission-group sections from V38 if installed. */
.link-directory-page .link-mission-heading h2 {
  font-size: clamp(30px, 2.4vw, 42px) !important;
}
.link-directory-page .link-mission-heading p {
  font-size: 19px !important;
}
.link-directory-page .link-mission-kicker,
.link-directory-page .link-mission-count {
  font-size: 15px !important;
}

@media (max-width: 1180px) {
  .link-directory-page .directory-grid,
  .link-directory-page .link-mission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  :root {
    --link-v40-edge: 14px;
    --link-v40-body: 18px;
    --link-v40-card: 18px;
    --link-v40-button: 17px;
    --link-v40-small: 15px;
    --link-v40-nav: 16px;
  }

  body:not(.link-admin-page):not(.auth-page) main h1 {
    font-size: clamp(38px, 11vw, 52px) !important;
  }

  body:not(.link-admin-page):not(.auth-page) main h2 {
    font-size: clamp(29px, 8vw, 38px) !important;
  }

  body:not(.link-admin-page):not(.auth-page) main h3 {
    font-size: 24px !important;
  }

  .link-directory-page .directory-main,
  .link-directory-page .directory-content,
  .link-directory-page .directory-map-section,
  .link-directory-page .directory-list-section {
    width: calc(100% - 28px) !important;
  }

  .link-directory-page .directory-grid,
  .link-directory-page .link-mission-grid {
    grid-template-columns: 1fr !important;
  }

  .link-directory-page .directory-card {
    min-height: 0 !important;
  }
}
