/* ===========================================================
   MDM HOMES — SHARED STYLESHEET
   Used across: index, tenants, anti-social-behaviour,
   damp-mould, privacy, service-standards
   =========================================================== */

:root {
  --green: #1F3A2E;
  --green-deep: #142620;
  --green-soft: #2D5142;
  --cream: #F4EFE6;
  --cream-warm: #EBE3D3;
  --brass: #B8935A;
  --brass-deep: #8F6F40;
  --sage: #D4DDD3;
  --ink: #1A1A1A;
  --ink-soft: #4A4A48;
  --line: rgba(31, 58, 46, 0.14);
  --line-strong: rgba(31, 58, 46, 0.28);

  --p1-bg: #FCE6E0; --p1-fg: #9B2C18;
  --p2-bg: #FDF1D9; --p2-fg: #8B5A0F;
  --p3-bg: #D4DDD3; --p3-fg: #1F3A2E;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (max-width: 800px) {
  body { font-size: 17px; line-height: 1.62; }
}

/* ----- TYPOGRAPHY ----- */
.serif { font-family: 'Fraunces', Georgia, serif; font-variation-settings: 'SOFT' 30, 'WONK' 0; }
h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'SOFT' 30, 'WONK' 0;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--green);
}
h2 em, h1 em, h3 em {
  font-style: italic;
  font-variation-settings: 'SOFT' 100, 'WONK' 1;
  color: var(--brass-deep);
  font-weight: 300;
}

.eyebrow {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-deep);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: '';
  width: 32px; height: 1px;
  background: var(--brass);
}
.eyebrow.light { color: var(--brass); }
.eyebrow.light::before { background: var(--brass); }

/* ----- LAYOUT ----- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: 860px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 700px) {
  .wrap, .wrap-narrow { padding: 0 24px; }
}

section { padding: 100px 0; position: relative; }
@media (max-width: 700px) { section { padding: 64px 0; } }

.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head h2 {
  font-size: clamp(40px, 5.4vw, 60px);
  font-weight: 400;
  margin-top: 18px;
}
.section-head p {
  font-size: 18px;
  color: var(--ink-soft);
  margin-top: 22px;
  max-width: 620px;
}

/* ----- NAV ----- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244, 239, 230, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-mark { width: 56px; height: 56px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 26px;
  color: var(--green); letter-spacing: -0.02em;
}
.brand-sub {
  font-size: 10px; letter-spacing: 0.32em; color: var(--green);
  text-transform: uppercase; margin-top: 5px; font-weight: 600;
}

.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  color: var(--green); text-decoration: none; font-size: 14px; font-weight: 500;
  position: relative; transition: color 0.2s;
}
.nav-links a:not(.btn):hover { color: var(--brass-deep); }
.nav-links a:not(.btn)::after {
  content: ''; position: absolute; bottom: -6px; left: 0; width: 0; height: 1px;
  background: var(--brass); transition: width 0.3s ease;
}
.nav-links a:not(.btn):hover::after,
.nav-links a:not(.btn).active::after { width: 100%; }
.nav-links a.active { color: var(--brass-deep); }

.btn {
  background: var(--green); color: var(--cream) !important;
  padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: 13px;
  letter-spacing: 0.02em; transition: all 0.2s; border: 1px solid var(--green);
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--green-deep); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--green) !important; border-color: var(--green); }
.btn-outline:hover { background: var(--green); color: var(--cream) !important; }
.btn-brass { background: var(--brass); border-color: var(--brass); color: var(--cream) !important; }
.btn-brass:hover { background: var(--brass-deep); border-color: var(--brass-deep); }

/* ----- MOBILE BURGER + MENU ----- */
.nav-burger {
  display: none;
  width: 44px; height: 44px;
  background: transparent; border: none; cursor: pointer;
  position: relative; padding: 0; margin: 0;
}
.nav-burger span {
  position: absolute; left: 11px; right: 11px; height: 2px;
  background: var(--green); border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}
.nav-burger span:nth-child(1) { top: 15px; }
.nav-burger span:nth-child(2) { top: 21px; }
.nav-burger span:nth-child(3) { top: 27px; }
.nav-burger.open span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--cream);
  z-index: 99;
  padding: 92px 28px 48px;
  overflow-y: auto;
}
.mobile-menu.open { display: block; animation: mmFade 0.22s ease; }
@keyframes mmFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.mobile-menu a {
  display: block; padding: 18px 0;
  font-size: 20px; font-weight: 500;
  color: var(--green); text-decoration: none;
  border-bottom: 1px solid var(--line);
  font-family: 'Manrope', sans-serif;
  letter-spacing: -0.01em;
}
.mobile-menu a.active { color: var(--brass-deep); }
.mobile-menu a.btn {
  margin-top: 28px; padding: 14px 28px;
  font-size: 14px; letter-spacing: 0.04em;
  display: inline-block; border-bottom: none;
  color: var(--cream) !important;
}
body.menu-open { overflow: hidden; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-burger { display: block; }
}
@media (min-width: 901px) {
  .mobile-menu { display: none !important; }
}

/* ----- SUB-PAGE HERO ----- */
.subhero {
  padding: 70px 0 80px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.subhero h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 400;
  margin-top: 24px;
  max-width: 880px;
}
.subhero-lead {
  font-size: 18px; color: var(--ink-soft); max-width: 680px;
  margin-top: 24px; line-height: 1.65;
}
.breadcrumb {
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 8px;
}
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--brass-deep); }
.breadcrumb span { margin: 0 8px; color: var(--brass); }

@media (max-width: 700px) {
  .subhero { padding: 48px 0 56px; }
}

/* ----- DARK INVERTED SECTION ----- */
.dark { background: var(--green); color: var(--cream); }
.dark h1, .dark h2, .dark h3, .dark h4 { color: var(--cream); }
.dark .section-head p, .dark p { color: rgba(244, 239, 230, 0.78); }
.dark .eyebrow { color: var(--brass); }
.dark .eyebrow::before { background: var(--brass); }

/* ----- BUTTONS / CTAS ----- */
.cta-row { display: flex; gap: 14px; margin-top: 40px; flex-wrap: wrap; }

/* ----- CARDS ----- */
.card {
  background: white; padding: 32px; border-radius: 4px;
  border: 1px solid var(--line); transition: all 0.3s ease;
}
.card:hover { border-color: var(--brass); transform: translateY(-3px); box-shadow: 0 18px 36px -20px rgba(31, 58, 46, 0.18); }
.card h3 { font-size: 25px; margin-bottom: 12px; }
.card p { color: var(--ink-soft); font-size: 16px; }

/* ----- CALLOUT ----- */
.callout {
  padding: 24px 28px; border-radius: 4px; background: var(--cream-warm);
  border-left: 3px solid var(--brass); margin: 24px 0;
}
.callout h4 {
  font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 700;
  color: var(--green); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px;
}
.callout p { font-size: 16px; color: var(--ink-soft); line-height: 1.65; margin: 0; }
.callout .em-line {
  font-family: 'Fraunces', serif; font-size: 22px; color: var(--green);
  font-weight: 600; margin-top: 6px; letter-spacing: -0.01em;
}
.callout.warn { background: #FCE6E0; border-left-color: var(--p1-fg); }
.callout.warn h4 { color: var(--p1-fg); }
.callout.tip { background: var(--sage); border-left-color: var(--green); }
.callout.tip h4 { color: var(--green); }

/* ----- PRIORITY BADGES ----- */
.priority-badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.priority-p1 { background: var(--p1-bg); color: var(--p1-fg); }
.priority-p1::before { content: ''; width: 6px; height: 6px; background: var(--p1-fg); border-radius: 50%; }
.priority-p2 { background: var(--p2-bg); color: var(--p2-fg); }
.priority-p2::before { content: ''; width: 6px; height: 6px; background: var(--p2-fg); border-radius: 50%; }
.priority-p3 { background: var(--p3-bg); color: var(--p3-fg); }
.priority-p3::before { content: ''; width: 6px; height: 6px; background: var(--p3-fg); border-radius: 50%; }

/* ----- TABLES ----- */
.table-wrap { background: white; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.styled-table { width: 100%; border-collapse: collapse; }
.styled-table thead { background: var(--green); color: var(--cream); }
.styled-table th {
  text-align: left; padding: 18px 24px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
}
.styled-table td {
  padding: 22px 24px; border-top: 1px solid var(--line); font-size: 15px;
  color: var(--ink); vertical-align: top;
}
.styled-table tr:hover td { background: var(--cream); }
.cell-issue { font-weight: 600; color: var(--green); }
.cell-desc { font-size: 13px; color: var(--ink-soft); margin-top: 4px; font-weight: 400; }
.sla-time {
  font-family: 'Fraunces', serif; font-size: 18px; font-weight: 500;
  color: var(--green); letter-spacing: -0.01em;
}

/* Mobile table → cards */
@media (max-width: 760px) {
  .styled-table thead { display: none; }
  .styled-table, .styled-table tbody, .styled-table tr, .styled-table td { display: block; width: 100%; }
  .styled-table tr {
    border-top: 1px solid var(--line); padding: 20px 24px;
  }
  .styled-table tr:first-child { border-top: 0; }
  .styled-table td { padding: 6px 0; border: none; }
  .styled-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-soft); margin-bottom: 4px; font-weight: 600;
  }
}

/* ----- PROSE (long-form content) ----- */
.prose { max-width: 760px; }
.prose h2 {
  font-size: clamp(34px, 4.4vw, 48px); margin-top: 56px; margin-bottom: 18px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-size: 24px; margin-top: 36px; margin-bottom: 12px;
  font-weight: 600;
}
.prose p {
  font-size: 17px; color: var(--ink); line-height: 1.75; margin-bottom: 18px;
}
.prose p strong { color: var(--green); font-weight: 700; }
.prose a { color: var(--brass-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 0.2s; }
.prose a:hover { color: var(--green); }
.prose ul, .prose ol { margin: 0 0 22px 22px; }
.prose ul li, .prose ol li {
  font-size: 17px; line-height: 1.7; margin-bottom: 8px; color: var(--ink); padding-left: 6px;
}
.prose ul li::marker { color: var(--brass); }
.prose blockquote {
  border-left: 3px solid var(--brass); padding: 4px 0 4px 20px; margin: 24px 0;
  font-family: 'Fraunces', serif; font-size: 22px; color: var(--green);
  font-style: italic; line-height: 1.5;
}

/* ----- TWO COLUMN ----- */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
}
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; gap: 18px; } }

/* ----- FOOTER ----- */
.footer {
  background: var(--green-deep); color: var(--cream); padding: 80px 0 32px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px;
  padding-bottom: 56px; border-bottom: 1px solid rgba(244, 239, 230, 0.1);
}
.footer-brand .brand-name { color: var(--cream); }
.footer-brand .brand-sub { color: rgba(244, 239, 230, 0.7); }
.footer-brand p {
  color: rgba(244, 239, 230, 0.7); font-size: 14px; line-height: 1.65;
  margin-top: 20px; max-width: 320px;
}
.footer-badges {
  display: flex; gap: 14px; align-items: center; margin-top: 24px;
}
.footer-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid rgba(244, 239, 230, 0.18);
  border-radius: 999px; font-size: 11px; letter-spacing: 0.08em;
  color: var(--brass); text-transform: uppercase; font-weight: 600;
}

.footer h5 {
  font-family: 'Manrope', sans-serif; font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--brass); margin-bottom: 18px; font-weight: 700;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer ul a, .footer p, .footer address {
  color: rgba(244, 239, 230, 0.75); text-decoration: none; font-size: 15px;
  font-style: normal; line-height: 1.65; transition: color 0.2s;
}
.footer ul a:hover { color: var(--brass); }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px; font-size: 13px; color: rgba(244, 239, 230, 0.5);
  flex-wrap: wrap; gap: 16px;
}
.footer-bottom .seal { display: flex; align-items: center; gap: 8px; }

@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; padding-bottom: 40px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ----- GRAIN OVERLAY ----- */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  opacity: 0.025; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' /%3E%3C/svg%3E");
}

/* ----- ENTRY ANIMATION ----- */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.subhero h1, .subhero-lead, .subhero .breadcrumb { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.subhero h1 { animation-delay: 0.1s; }
.subhero-lead { animation-delay: 0.2s; }

/* ----- FORMS ----- */
.tenant-form { display: flex; flex-direction: column; gap: 14px; }
.tenant-form label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--green); font-weight: 600;
}
.tenant-form input, .tenant-form select, .tenant-form textarea {
  font-family: 'Manrope', sans-serif; font-size: 16px; color: var(--ink);
  padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 3px;
  background: var(--cream); width: 100%;
  transition: border-color 0.2s, background-color 0.2s;
}
.tenant-form input:focus, .tenant-form select:focus, .tenant-form textarea:focus {
  outline: none; border-color: var(--brass); background: white;
}
.tenant-form textarea { resize: vertical; min-height: 100px; font-family: 'Manrope', sans-serif; }
.tenant-form .field { display: flex; flex-direction: column; gap: 6px; }
.tenant-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .tenant-form .row { grid-template-columns: 1fr; } }
.tenant-form button { margin-top: 8px; align-self: flex-start; cursor: pointer; }
.form-success {
  display: none; padding: 16px; background: var(--sage); border-radius: 3px;
  color: var(--green); font-size: 15px; margin-top: 12px;
}
.form-success.show { display: block; }

/* ----- LINK CARD GRID (for resource hubs) ----- */
.link-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px;
}
.link-card {
  display: block; padding: 28px; background: white; border-radius: 4px;
  border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: all 0.3s ease; position: relative;
}
.link-card:hover {
  border-color: var(--brass); transform: translateY(-3px);
  box-shadow: 0 18px 36px -20px rgba(31, 58, 46, 0.18);
}
.link-card-tag {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--brass-deep); font-weight: 700; margin-bottom: 14px;
}
.link-card h4 {
  font-family: 'Fraunces', serif; font-size: 23px; font-weight: 500;
  margin-bottom: 8px; color: var(--green);
}
.link-card p {
  font-size: 15px; color: var(--ink-soft); line-height: 1.6; margin: 0;
}
.link-card .arrow {
  position: absolute; top: 28px; right: 28px;
  width: 20px; height: 20px; transition: transform 0.3s;
  color: var(--brass);
}
.link-card:hover .arrow { transform: translate(3px, -3px); }
