/**
 * James Carter Homes — global modern layer (tokens, type, links, nav, footer).
 * Load after stylesheetmain.css / footer.css (e.g. from links.php).
 */

:root {
  --jch-ink: #0f172a;
  --jch-ink-soft: #334155;
  --jch-brand: #0c4a6e;
  --jch-brand-hover: #0369a1;
  --jch-accent: #0ea5e9;
  --jch-surface: #f8fafc;
  --jch-surface-2: #f1f5f9;
  --jch-border: #e2e8f0;
  --jch-radius: 10px;
  --jch-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --jch-line: 1.6;
  --jch-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

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

body {
  font-family: var(--jch-font);
  color: var(--jch-ink);
  line-height: var(--jch-line);
  background-color: #fff;
}

/* Main text blocks */
#flex-container flex-bodytext,
flex-bodytext,
#flex-container > flex-bodytext {
  display: block;
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem 1.5rem;
}

#flex-container flex-bodytext p,
flex-bodytext p,
#flex-container p {
  font-weight: 400;
  font-size: 1.05rem;
  line-height: var(--jch-line);
  color: var(--jch-ink-soft);
  text-align: left;
}

/* Page titles using .h10 */
h2.h10,
.h10 {
  font-family: var(--jch-font);
  font-weight: 700;
  color: var(--jch-brand);
  letter-spacing: -0.02em;
  line-height: 1.2;
  padding-left: 0;
  text-align: center;
  font-size: clamp(1.75rem, 4vw, 2.5rem) !important;
}

/* Links in content (not nav / footer components) */
flex-bodytext a:link,
flex-bodytext a:visited,
#flex-container a:link:not(.grow):not(.button-container),
#flex-container a:visited:not(.grow) {
  color: var(--jch-brand-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

flex-bodytext a:hover,
#flex-container a:hover:not(.grow) {
  color: var(--jch-accent);
}

/* Nav strip — complements ddmenu.css sticky bar */
#ddmenu {
  background: linear-gradient(to bottom, #f8fafc 0%, #eef2f7 100%) !important;
  border-bottom: 1px solid var(--jch-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 2px 8px rgba(15, 23, 42, 0.04);
}

#ddmenu ul {
  background: transparent !important;
}

/* Top-level menu headings — extra horizontal spacing between items */
#ddmenu > ul > li {
  margin: 0.5rem 1.35rem !important;
}

#ddmenu a,
#ddmenu a:link,
#ddmenu a:hover {
  color: var(--jch-ink) !important;
  font-family: var(--jch-font) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: color 0.15s ease, background 0.15s ease;
}

#ddmenu a:hover {
  color: var(--jch-brand-hover) !important;
}

#ddmenu .dd-inner {
  background-color: rgba(248, 250, 252, 0.97) !important;
  border: 1px solid var(--jch-border);
  border-radius: var(--jch-radius);
  box-shadow: var(--jch-shadow);
}

/* Past projects mega-menu: three balanced columns (overrides ddmenu nowrap / wide min-width) */
#ddmenu .jch-dd-inner--past-three {
  white-space: normal !important;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  max-width: calc(100vw - 1.5rem);
  overflow-x: auto;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

#ddmenu .jch-dd-inner--past-three .column {
  flex: 0 0 auto;
  width: max-content;
  min-width: 13.5rem;
  max-width: none;
  box-sizing: border-box;
  border-right: 1px solid #94a3b8;
  text-align: left;
}

#ddmenu .jch-dd-inner--past-three .column li,
#ddmenu .jch-dd-inner--past-three .column a {
  white-space: nowrap;
}

#ddmenu .jch-dd-inner--past-three .column:last-child {
  border-right: none;
}

/* Header logo area */
.sky {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

#flex-container .imgclass,
#headerlogos {
  border-radius: 4px;
}

/* Images in article-style content */
.imgclass2,
.imgclass3,
.ourcompimg {
  border-radius: 8px;
  box-shadow: var(--jch-shadow);
}

/* Footer — layout & polish */
.footer-distributed.jch-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 2.5rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2.25rem 1.5rem 1.5rem;
  margin-top: 2rem;
  background: var(--jch-surface) !important;
  border-top: 1px solid var(--jch-border);
  font: normal 1rem var(--jch-font) !important;
}

.footer-distributed.jch-footer .footer-left,
.footer-distributed.jch-footer .footer-center,
.footer-distributed.jch-footer .footer-right {
  display: block;
  width: auto !important;
  flex: 1 1 220px;
  max-width: 340px;
  text-align: left;
}

.footer-distributed.jch-footer .footer-left {
  text-align: left;
}

.footer-distributed.jch-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  justify-content: flex-start;
  margin-top: 0.75rem;
}

.footer-distributed.jch-footer .footer-links a {
  color: var(--jch-brand) !important;
  font-weight: 600;
  margin: 0;
}

.footer-distributed.jch-footer .footer-links a:hover {
  color: var(--jch-brand-hover) !important;
}

.footer-distributed.jch-footer .footer-center p,
.footer-distributed.jch-footer .footer-right p {
  font-weight: 400 !important;
  color: var(--jch-ink-soft) !important;
  line-height: 1.55;
}

.footer-distributed.jch-footer .footer-center a {
  color: var(--jch-brand) !important;
}

.footer-distributed.jch-footer .footer-center i {
  background-color: var(--jch-brand) !important;
  color: #fff !important;
}

.footer-distributed .footer-center-row,
.footer-distributed.jch-footer .footer-center-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.footer-distributed .footer-center-row > i,
.footer-distributed.jch-footer .footer-center-row > i {
  flex-shrink: 0;
}

.footer-distributed .footer-center-row > p,
.footer-distributed.jch-footer .footer-center-row > p {
  margin: 0;
}

.footer-distributed .footer-center-row--social > p {
  padding-left: calc(38px + 0.65rem);
}

.jch-footer-copy {
  flex: 1 0 100%;
  text-align: center;
  font-size: 0.8125rem;
  color: #64748b;
  padding-top: 1.25rem;
  margin: 0;
  border-top: 1px solid var(--jch-border);
}

@media (max-width: 880px) {
  .footer-distributed.jch-footer .footer-left,
  .footer-distributed.jch-footer .footer-center,
  .footer-distributed.jch-footer .footer-right {
    max-width: 100%;
    text-align: center;
  }

  .footer-distributed.jch-footer .footer-links {
    justify-content: center;
  }

  .footer-distributed .footer-center-row--social > p,
  .footer-distributed.jch-footer .footer-center-row--social > p {
    padding-left: 0;
  }
}
