/* Construction Methodology Glossary - Stylesheet */
:root {
  --primary: #2c3e50;
  --secondary: #e74c3c;
  --background: #ecf0f1;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #bdc3c7;
  --success: #27ae60;
  --warning: #f39c12;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.6;
}

/* Header */
header {
  background: var(--primary);
  color: white;
  padding: 2rem;
  border-bottom: 4px solid var(--secondary);
}

header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

header p {
  color: #ecf0f1;
  font-size: 0.95rem;
}

/* Navigation */
nav {
  background: white;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--secondary);
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-left: 4px solid var(--secondary);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Language selector */
nav select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.category-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: block;
  text-decoration: none;
  color: inherit;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  border-color: var(--secondary);
}

.category-card h3 {
  color: var(--primary);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.category-card .term-count {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Term Pages */
h1 {
  color: var(--primary);
  margin: 1.5rem 0 1rem;
  font-size: 2rem;
}

h2 {
  color: var(--primary);
  margin: 1.5rem 0 0.5rem;
  font-size: 1.5rem;
  border-bottom: 2px solid var(--secondary);
  padding-bottom: 0.5rem;
}

h3 {
  color: var(--text);
  margin: 1rem 0 0.5rem;
  font-size: 1.1rem;
}

.term-definition {
  background: white;
  border-left: 4px solid var(--secondary);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.term-definition strong {
  color: var(--primary);
}

.related-terms {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.related-terms ul {
  list-style: none;
  margin-top: 1rem;
}

.related-terms li {
  margin: 0.5rem 0;
}

.related-terms a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.related-terms a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Search */
.search-container {
  background: white;
  padding: 1.5rem 2rem;
  margin: 1rem 0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-container input {
  width: 100%;
  max-width: 500px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
}

.search-container input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
}

/* Breadcrumbs */
.breadcrumb {
  padding: 1rem 0;
  font-size: 0.9rem;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 0.5rem;
}

/* Footer */
footer {
  background: var(--primary);
  color: white;
  padding: 3rem 2rem;
  margin-top: 3rem;
  text-align: center;
  border-top: 4px solid var(--secondary);
}

footer p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

footer a {
  color: #ecf0f1;
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.5rem;
  }

  nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  .categories-grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: 0 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.2rem;
  }
}

/* Print Styles */
@media print {
  header, nav, footer {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .term-definition {
    border: 1px solid #000;
    page-break-inside: avoid;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #1a1a1a;
    --text: #e0e0e0;
    --text-light: #a0a0a0;
    --border: #404040;
  }

  body {
    background: var(--background);
    color: var(--text);
  }

  .category-card,
  .term-definition,
  .stat-card {
    background: #2a2a2a;
  }

  nav select {
    background: #1a1a1a;
    color: var(--text);
  }

  .related-terms {
    background: #252525;
  }

  .search-container {
    background: #2a2a2a;
  }

  .search-container input {
    background: #1a1a1a;
    color: var(--text);
    border-color: var(--border);
  }
}


/* ===== WSC standard landing-page components ===== */
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:1rem;margin:1.5rem 0}
.stat-card{background:#fff;border:1px solid #ddd;border-left:4px solid #e74c3c;border-radius:8px;padding:1.25rem;display:flex;flex-direction:column;gap:.25rem}
.stat-value{font-size:1.75rem;font-weight:700;color:#2c3e50}
.stat-label{font-size:.85rem;color:#7f8c8d;text-transform:uppercase;letter-spacing:.5px}
.categories-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:1.5rem;margin:2rem 0}
.category-card{background:#fff;border:1px solid #ddd;border-radius:8px;padding:1.5rem;display:block;text-decoration:none;color:inherit;transition:all .3s ease;box-shadow:0 2px 4px rgba(0,0,0,.1)}
.category-card:hover{transform:translateY(-5px);box-shadow:0 4px 8px rgba(0,0,0,.15);border-color:#e74c3c}
.category-card h3{font-size:1.15rem;margin-bottom:.5rem;color:#2c3e50}
.category-card .term-count{color:#7f8c8d;font-size:.9rem}
.search-container{background:#fff;padding:1.5rem;margin:1rem 0;border-radius:8px;box-shadow:0 2px 4px rgba(0,0,0,.1)}
.search-container input{width:100%;max-width:500px;padding:.75rem 1rem;border:1px solid #ddd;border-radius:4px;font-size:1rem}
.search-container input:focus{outline:none;border-color:#e74c3c}
nav select{padding:.4rem .6rem;border:1px solid #ddd;border-radius:4px;background:#fff;color:inherit;font:inherit;font-size:.9rem}
@media (max-width:768px){.categories-grid{grid-template-columns:1fr}}
@media (prefers-color-scheme:dark){
  .stat-card,.category-card,.search-container{background:#2a2a2a;border-color:#404040}
  .stat-value,.category-card h3{color:#e0e0e0}
  .search-container input,nav select{background:#1a1a1a;color:#e0e0e0;border-color:#404040}
}

/* ===== WSC standard footer ===== */
footer .footer-desc{font-size:.9rem;margin-bottom:.85rem}
footer .footer-meta{font-size:.85rem;margin:.3rem 0}
footer .footer-disclaimer{font-size:.8rem;font-style:italic;opacity:.85;margin:.55rem 0}
footer .footer-partners,footer .footer-tools{font-size:.78rem;margin:.4rem 0;line-height:1.9}
footer .footer-version{font-size:.74rem;opacity:.75;margin-top:.85rem}
footer a{text-decoration:none}
footer a:hover{text-decoration:underline}

/* ===== WSC standard header ===== */
:root{--hdr-bg:#fff;--hdr-bd:#ddd;--hdr-tx:#2c3e50;--hdr-mut:#7f8c8d;--hdr-ac:#e74c3c}
:root[data-theme="slate"] {--hdr-ac:#3b4252}
:root[data-theme="sand"]  {--hdr-ac:#c9b79c}
:root[data-theme="ochre"] {--hdr-ac:#b8860b}
:root[data-theme="forest"]{--hdr-ac:#2f6b4f}
:root[data-theme="plum"]  {--hdr-ac:#7d4a5f}
:root[data-theme="ocean"] {--hdr-ac:#2c5f7c}
:root[data-theme="violet"]{--hdr-ac:#6b5b95}
:root[data-theme="amber"] {--hdr-ac:#a86f2e}

.site-header{display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  background:var(--hdr-bg);color:var(--hdr-tx);border-bottom:1px solid var(--hdr-bd);
  padding:8px 16px;position:sticky;top:0;z-index:50}
.site-header .home-btn{display:inline-flex;align-items:center;justify-content:center;
  width:32px;height:30px;border:1px solid var(--hdr-bd);border-radius:6px;
  text-decoration:none;color:var(--hdr-tx);font-size:1.05rem;line-height:1;background:transparent}
.site-header .home-btn:hover{border-color:var(--hdr-ac);color:var(--hdr-ac)}
.site-header .site-title{font-weight:700;font-size:.95rem;white-space:nowrap}
.site-header .header-spacer{flex:1 1 auto;min-width:8px}
.site-header .version-badge{font-family:ui-monospace,monospace;font-size:.7rem;
  border:1px solid var(--hdr-bd);border-radius:5px;padding:2px 7px;color:var(--hdr-mut)}
.site-header .hdr-label{font-size:.7rem;text-transform:uppercase;letter-spacing:.6px;color:var(--hdr-mut)}
.site-header .lang-select{padding:.3rem .5rem;border:1px solid var(--hdr-bd);border-radius:5px;
  background:var(--hdr-bg);color:var(--hdr-tx);font:inherit;font-size:.82rem}
.theme-dots{display:inline-flex;gap:5px}
.theme-dot{width:19px;height:19px;border-radius:50%;border:2px solid transparent;
  cursor:pointer;padding:0;outline-offset:2px}
.theme-dot:hover{transform:scale(1.12)}
.theme-dot.is-active{border-color:var(--hdr-tx);box-shadow:0 0 0 2px var(--hdr-bg) inset}
.page-intro{max-width:1200px;margin:1.6rem auto .4rem;padding:0 2rem}
.page-intro h1{margin:0 0 .3rem}
.page-intro p{color:var(--hdr-mut);font-size:.92rem}
@media (max-width:768px){
  .site-header{gap:7px;padding:7px 10px}
  .site-header .site-title{font-size:.85rem}
  .site-header .hdr-label{display:none}
  .page-intro{padding:0 1rem}
}
@media (prefers-color-scheme:dark){
  :root{--hdr-bg:#242424;--hdr-bd:#404040;--hdr-tx:#e8e8e8;--hdr-mut:#a5a5a5}
}
