/* ==========================================================
   CESC – Civil Engineering and Sustainable Cities
   SITE STYLE SHEET
   Purpose: Global site-level stylesheet for journal website (OJS-ready)
   File: cesc-site.css
   Theme: Blue Steel + Green (Professional, Accessible)
   ========================================================== */

/* =========================
   0. ROOT VARIABLES & RESET
   ========================= */

:root{
  /* Color palette */
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #0e1724;
  --muted: #6b7280;
  --accent-blue: #0b66ff;
  --accent-blue-dark: #0a4fd6;
  --accent-green: #16a34a;
  --line: rgba(14,23,36,0.06);
  --shadow-lg: 0 18px 40px rgba(14,23,36,0.08);
  --radius-sm: 6px;
  --radius-md: 12px;

  /* Typography */
  --font-sans: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Merriweather", Georgia, serif;
  --font-mono: "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  /* Layout */
  --container-width: 1200px;
  --gutter: 1rem;

  /* Accessibility */
  --focus-ring: 3px rgba(11,102,255,0.18);
}

/* Basic Reset */
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-sans); color: var(--ink); background: linear-gradient(180deg,var(--bg), #eef3f8); line-height: 1.6; }

/* Links */
a { color: var(--accent-blue); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; outline: none; }

/* Images */
img { max-width: 100%; height: auto; display: block; }

/* Utility helpers */
.container { width: 100%; max-width: var(--container-width); margin: 0 auto; padding: 0 var(--gutter); }
.row { display: flex; flex-wrap: wrap; gap: 1rem; }
.col { flex: 1; min-width: 0; }

/* Accessibility focus */
:focus { outline: none; box-shadow: 0 0 0 4px rgba(10,103,255,0.12); border-radius: 6px; }

/* =========================
   1. SITE HEADER
   ========================= */

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0; gap: 1rem; }
.brand { display:flex; align-items:center; gap:0.85rem; }
.brand .logo { width:56px; height:56px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-family:var(--font-heading); font-weight:700; color:#fff; background: linear-gradient(135deg,var(--accent-blue),var(--accent-green)); box-shadow: var(--shadow-lg); }
.brand .title { font-family: var(--font-heading); font-size:1rem; margin:0; }
.brand .subtitle { font-size:0.78rem; color:var(--muted); margin-top:2px; }

/* Main nav */
.nav { display:flex; gap:1rem; align-items:center; }
.nav a { padding:0.45rem 0.6rem; border-radius:8px; font-weight:600; color:var(--ink); }
.nav a:hover { background: linear-gradient(90deg, rgba(11,102,255,0.06), rgba(22,163,74,0.03)); }

/* Search */
.site-search { display:flex; gap:0.5rem; align-items:center; }
.search-input { padding:0.5rem 0.65rem; border-radius:8px; border:1px solid var(--line); min-width:220px; }
.search-btn { padding:0.5rem 0.8rem; border-radius:8px; border:0; background:var(--accent-blue); color:#fff; cursor:pointer; }

/* Mobile nav toggle */
.nav-toggle { display:none; background:transparent; border:1px solid var(--line); padding:0.5rem; border-radius:8px; }

/* =========================
   2. HOMEPAGE HERO
   ========================= */

.hero { padding:3rem 0; }
.hero .hero-inner { display:grid; grid-template-columns: 1fr 420px; gap: 1.25rem; align-items:center; }
.hero .hero-card { background: var(--surface); padding:1.5rem; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.hero h1 { font-family: var(--font-heading); font-size:2.1rem; margin:0 0 0.5rem; }
.hero p.lead { margin:0; color:var(--muted); }

/* HERO actions */
.hero .actions { margin-top:1rem; display:flex; gap:0.6rem; flex-wrap:wrap; }
.btn { display:inline-flex; align-items:center; gap:0.5rem; padding:0.6rem 1rem; border-radius:8px; cursor:pointer; font-weight:700; }
.btn-primary { background: linear-gradient(90deg,var(--accent-blue),var(--accent-blue-dark)); color:#fff; border: none; }
.btn-outline { background:transparent; color:var(--ink); border:1px solid var(--line); }

/* =========================
   3. PROCEEDINGS GRID
   ========================= */

.proceedings-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap:1.2rem; }
.proceeding { background: var(--surface); border-radius:10px; padding:1.1rem; border:1px solid var(--line); box-shadow: 0 8px 20px rgba(14,23,36,0.04); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.proceeding:hover { transform: translateY(-6px); box-shadow: 0 22px 54px rgba(14,23,36,0.08); }
.proceeding .thumb { height:120px; border-radius:8px; background: linear-gradient(180deg,var(--accent-blue), var(--accent-green)); }
.proceeding h3 { margin:0.6rem 0 0.3rem; font-size:1.05rem; }
.proceeding p.meta { color:var(--muted); font-size:0.88rem; }

/* Tags */
.tags { display:flex; gap:0.4rem; flex-wrap:wrap; margin-top:0.6rem; }
.tag { padding:0.18rem 0.5rem; border-radius:999px; background: rgba(11,102,255,0.06); color:var(--accent-blue); font-weight:700; font-size:0.78rem; }

/* =========================
   4. ARTICLE / PAPER PAGE
   ========================= */

.article-wrap { padding:2rem 0; }
.article { background: var(--surface); padding:1.6rem; border-radius:12px; border:1px solid var(--line); box-shadow: var(--shadow-lg); }
.article h2 { font-family: var(--font-heading); margin-top:0; font-size:1.6rem; }
.article .authors { color:var(--muted); margin-bottom:0.6rem; }
.article .abstract { background: linear-gradient(90deg, rgba(11,102,255,0.03), rgba(22,163,74,0.02)); padding:1rem; border-left:4px solid var(--accent-blue); border-radius:8px; margin:1rem 0; }
.article .content p { margin-bottom:1rem; color:var(--ink); }

/* Figure and table */
.figure { margin:1.2rem 0; text-align:center; }
.figure img { border-radius:8px; max-height:420px; object-fit:cover; }
.table { width:100%; border-collapse: collapse; margin:1rem 0; font-size:0.95rem; }
.table th, .table td { padding:0.6rem 0.75rem; border:1px solid var(--line); text-align:left; }
.table th { background: linear-gradient(90deg, rgba(11,102,255,0.04), rgba(22,163,74,0.02)); }

/* References */
.references { margin-top:1.2rem; font-size:0.95rem; color:var(--muted); }
.references ol { padding-left:1.2rem; }

/* =========================
   5. FORMS (SUBMIT / REGISTER)
   ========================= */

.form-card { background: var(--surface); padding:1.2rem; border-radius:10px; border:1px solid var(--line); }
.form-row { display:flex; gap:0.8rem; flex-wrap:wrap; }
.form-group { flex:1 1 240px; display:flex; flex-direction:column; gap:0.4rem; }
label { font-size:0.9rem; font-weight:600; color:var(--ink); }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  padding:0.6rem 0.75rem; border-radius:8px; border:1px solid var(--line); background: #fff; font-size:0.95rem;
}
textarea { min-height:120px; resize:vertical; }
.input-help { font-size:0.82rem; color:var(--muted); }
.form-actions { margin-top:0.8rem; display:flex; gap:0.6rem; }

/* Checkbox / radio */
.checkbox, .radio { display:flex; gap:0.5rem; align-items:center; }

/* =========================
   6. SIDEBAR & WIDGETS
   ========================= */

.sidebar { width:320px; }
.widget { background: var(--surface); padding:1rem; border-radius:10px; border:1px solid var(--line); margin-bottom:1rem; }
.widget h4 { margin:0 0 0.6rem; font-size:1rem; font-weight:700; }
.widget .item { padding:0.45rem 0; border-bottom:1px dashed rgba(14,23,36,0.03); display:flex; justify-content:space-between; align-items:center; }

/* =========================
   7. FOOTER
   ========================= */

.site-footer { margin-top:2.4rem; padding:1.4rem 0; border-top:1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,0.6), transparent); }
.site-footer .inner { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.site-footer .links { display:flex; gap:1rem; align-items:center; color:var(--muted); }
.site-footer .copyright { color:var(--muted); font-size:0.9rem; }

/* =========================
   8. NOTIFICATIONS & ALERTS
   ========================= */

.alert { padding:0.8rem 1rem; border-radius:8px; margin-bottom:1rem; font-weight:600; }
.alert-info { background: linear-gradient(90deg, rgba(11,102,255,0.06), rgba(11,102,255,0.02)); color:var(--accent-blue); border:1px solid rgba(11,102,255,0.08); }
.alert-success { background: linear-gradient(90deg, rgba(22,163,74,0.06), rgba(22,163,74,0.02)); color:var(--accent-green); border:1px solid rgba(22,163,74,0.08); }
.alert-warning { background: linear-gradient(90deg, rgba(255,179,71,0.06), rgba(255,179,71,0.02)); color:#b06b00; border:1px solid rgba(255,179,71,0.08); }
.alert-danger { background: linear-gradient(90deg, rgba(255,94,94,0.06), rgba(255,94,94,0.02)); color:#c53030; border:1px solid rgba(255,94,94,0.08); }

/* =========================
   9. ACCESSIBILITY & PRINT
   ========================= */

/* High contrast focus */
a:focus, button:focus, input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px rgba(11,102,255,0.12); outline: none; }

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Print styles */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .nav, .search-input, .btn, .widget { display: none !important; }
  .container { max-width: 100%; padding: 0; }
  .article { box-shadow: none; border: none; background: transparent; }
}

/* =========================
   10. RESPONSIVE
   ========================= */

@media (max-width: 1024px) {
  .hero .hero-inner { grid-template-columns: 1fr 340px; }
  .sidebar { width: 300px; }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .hero .hero-inner { grid-template-columns: 1fr; }
  .sidebar { width: 100%; order: 2; }
  .site-header .container { padding: 0.6rem; }
}

@media (max-width: 420px) {
  .brand .title { font-size: 0.95rem; }
  .proceedings-grid { grid-template-columns: 1fr; }
  .site-header .container { gap: 0.5rem; }
}
