/* MarbleArc (ma-) Style System */
/* Namespace: ma- ; Primary color is white, with mineral neutrals and etched dividers */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }

:root {
  --ma-primary: #ffffff;
  --ma-ink: #1b1d1f;
  --ma-muted: #5a5e63;
  --ma-surface: #f4f5f6;
  --ma-surface-2: #eceff1;
  --ma-accent: #9aa0a6;
  --ma-border: #d3d7db;
  --ma-radius-1: 6px;
  --ma-radius-2: 12px;
  --ma-radius-3: 22px;
  --ma-shadow-1: 0 1px 0 rgba(0,0,0,.03), 0 0 0 1px rgba(0,0,0,.02);
  --ma-shadow-2: 0 8px 20px rgba(0,0,0,.08);
  --ma-maxw: 72rem;
  --ma-space-1: .5rem;
  --ma-space-2: 1rem;
  --ma-space-3: 1.5rem;
  --ma-space-4: 2rem;
  --ma-space-5: 3rem;
}

body.ma-bg {
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.9)),
    radial-gradient(1200px 600px at 20% -10%, rgba(0,0,0,.04), transparent 60%),
    radial-gradient(1000px 500px at 120% 10%, rgba(0,0,0,.035), transparent 60%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.02) 0, rgba(0,0,0,.02) 1px, transparent 1px, transparent 24px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.02) 0, rgba(0,0,0,.02) 1px, transparent 1px, transparent 24px);
  color: var(--ma-ink);
  font: 400 17px/1.75 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.ma-wrap { max-width: var(--ma-maxw); margin: 0 auto; padding: 0 var(--ma-space-3); }
.ma-space-y > * + * { margin-top: var(--ma-space-5); }

.ma-header { background: var(--ma-primary); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--ma-border); }
.ma-nav { display: flex; align-items: center; justify-content: space-between; padding: var(--ma-space-2) 0; }
.ma-brand { display: flex; align-items: center; gap: var(--ma-space-2); text-decoration: none; color: inherit; }
.ma-brand img { width: 42px; height: 42px; border-radius: 9px; box-shadow: var(--ma-shadow-1); }
.ma-menu { display: flex; gap: .25rem; justify-content: center; margin-left: auto; }
.ma-menu a {
  text-decoration: none;
  color: var(--ma-ink);
  padding: .5rem .85rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.ma-menu a:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
.ma-menu a:hover { background: var(--ma-surface-2); }
.ma-menu a[aria-current="page"] { background: #fff; border-color: var(--ma-border); box-shadow: var(--ma-shadow-1); }

.ma-hero { margin: var(--ma-space-4) 0 var(--ma-space-4); }
.ma-hero figure { margin: 0; background: #fff; border: 1px solid var(--ma-border); border-radius: var(--ma-radius-3); overflow: hidden; box-shadow: var(--ma-shadow-2); }
.ma-hero img { width: 100%; height: auto; max-height: 52vh; object-fit: cover; }
.ma-hero figcaption { padding: .75rem 1rem; font-size: .9rem; color: var(--ma-muted); background: var(--ma-surface); border-top: 1px solid var(--ma-border); }

h1, h2, h3 { font-weight: 700; letter-spacing: .2px; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: var(--ma-space-4) 0 var(--ma-space-2); }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); margin: var(--ma-space-4) 0 var(--ma-space-2); }
h3 { font-size: clamp(1.05rem, 2vw, 1.2rem); margin: var(--ma-space-3) 0 var(--ma-space-2); }
p { margin: 0 0 1rem 0; }
.ma-dek { color: var(--ma-muted); max-width: 60ch; }

.ma-section + .ma-section { border-top: 1px solid var(--ma-border); padding-top: var(--ma-space-4); }

.ma-footer { margin-top: var(--ma-space-5); border-top: 1px solid var(--ma-border); background: var(--ma-primary); }
.ma-footer .ma-wrap { display: flex; align-items: center; justify-content: space-between; padding: var(--ma-space-3) 0; font-size: .95rem; color: var(--ma-muted); }

article p,
section p,
main p,
p {
  text-align: justify !important;
  text-justify: inter-word !important;
  -webkit-hyphens: auto !important;
  -ms-hyphens: auto !important;
  hyphens: auto !important;
}

.ma-to-top{
  position: fixed;
  right: 18px; bottom: 18px;
  width: 42px; height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.25);
  background: var(--ma-primary);
  color: #111;
  font: 600 18px/42px system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  text-align: center;
  cursor: pointer;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
  z-index: 60;
}
.ma-to-top:hover{ background: #fff; }
.ma-to-top.ma-show{ opacity: 1; transform: translateY(0); pointer-events: auto; }
@media (prefers-reduced-motion: reduce){ .ma-to-top{ transition: none; } }

/* Footer centering fix */
.ma-footer .ma-wrap {
  display: flex;
  justify-content: center;  /* centers content horizontally */
  align-items: center;      /* centers content vertically if multiple lines */
  padding: var(--ma-space-3) 0;
  font-size: .95rem;
  color: var(--ma-muted);
}

/* --- Footer Alignment & Styling Fix (MarbleArc / EarthMatters adaptation) --- */

/* Center all footer and network content */
.ma-footer,
.ma-footer * {
  text-align: center !important;
}

/* General layout centering */
.ma-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--ma-space-3);
  padding-top: var(--ma-space-4);
  padding-bottom: var(--ma-space-4);
  background: var(--ma-primary);
  border-top: 1px solid var(--ma-border);
  color: var(--ma-muted);
}

/* Metrolagu Network Section — adapted to MarbleArc neutral theme */
.metrolagu-network {
  background: none;
  color: var(--ma-ink);
  padding: var(--ma-space-4) 0;
}

.network-container {
  max-width: var(--ma-maxw);
  margin: 0 auto;
  padding: 0 var(--ma-space-3);
}

.metrolagu-network h3 {
  font-size: 1.15em;
  margin-bottom: var(--ma-space-1);
  color: var(--ma-muted);
  font-weight: 600;
  text-align: center;
}

.metrolagu-network p {
  color: var(--ma-muted);
  margin-bottom: 10px;
  line-height: 1.7;
  text-align: center;
}

/* Links inside footer */
.network-links {
  text-align: center;
}

.network-links a {
  color: var(--ma-muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(90,94,99,0.15);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.network-links a:hover {
  color: var(--ma-ink);
  border-bottom-color: var(--ma-ink);
}

/* Copyright pill */
.site-footer .copyright,
.ma-footer .copyright {
  display: inline-block;
  margin: 18px auto 6px auto;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.4px;
  color: var(--ma-ink);
  background: var(--ma-surface);
  padding: 8px 22px;
  border: 1.5px solid var(--ma-border);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
}

/* Hover tone and raised depth */
.ma-footer .copyright:hover {
  background: #ffffff;
  color: #000;
  border-color: rgba(0,0,0,0.2);
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

/* Ensure link inside pill inherits color */
.ma-footer .copyright a {
  color: inherit !important;
  text-decoration: none !important;
  transition: opacity 0.3s ease;
}
