/* =========================================
   Faculty Homepage CSS (Ivory/Light Gray) - v3
   Goal: ALWAYS left menu + right content
   Works even if #menu1 is not inside #colOne
   Uses GRID on #content with fallback rules.
   ========================================= */

:root{
  /* Background: ivory / light gray */
  --bg-top: #fafafa;
  --bg: #f5f6f7;
  --bg-bottom: #f1f2f4;

  /* Surfaces */
  --surface: #ffffff;
  --surface-2: rgba(255,255,255,0.90);

  /* Text */
  --text: #111827;      /* near-black navy */
  --muted: rgba(17,24,39,0.62);

  /* Borders & shadows */
  --border: rgba(17,24,39,0.12);
  --shadow: 0 14px 38px rgba(17,24,39,0.10);
  --shadow-soft: 0 10px 26px rgba(17,24,39,0.08);

  /* Accent (minimal) */
  --accent: #f58025;
  --accent-dark: #b45309;
  --ink: #0f172a;

  /* Layout */
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 980px;

  /* Sidebar width */
  --side: 260px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.65;
  text-align: left;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 45%, var(--bg-bottom) 100%);
}

/* Typography */
p{ margin: 0 0 12px 0; color: rgba(17,24,39,0.92); }
h1,h2,h3,h4,h5{ margin: 0 0 10px 0; letter-spacing: -0.01em; }
ul{ margin: 0 0 12px 18px; }
li{ margin: 6px 0; }

/* Links */
a{
  color: var(--accent-dark);
  text-decoration: none;
  transition: color .15s ease, background .15s ease, transform .15s ease, opacity .15s ease;
}
a:hover{ color: var(--accent); }

/* =========================================
   Header
   ========================================= */
#header{
  width: min(var(--maxw), calc(100% - 32px));
  margin: 16px auto 0 auto;
  padding: 20px 22px;
  border-radius: var(--radius);

  background: linear-gradient(135deg, var(--ink), #111827 55%, #0b1220);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
}

/* orange accent bar */
#header::before{
  content:"";
  position:absolute;
  top:0; left:0; right:0;
  height: 3px;
  background: linear-gradient(90deg, rgba(245,128,37,1), rgba(245,128,37,0.35));
}

/* subtle glow */
#header::after{
  content:"";
  position:absolute;
  inset:-170px -170px auto auto;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle at 30% 30%, rgba(245,128,37,0.18), transparent 62%);
  transform: rotate(12deg);
  pointer-events:none;
}

#header h1{
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  color: #fff;
  font-weight: 850;
  letter-spacing: -0.03em;
}

#header h2{
  margin: 6px 0 0 0;
  font-size: 14px;
  color: rgba(255,255,255,0.88);
  font-weight: 500;
}

/* =========================================
   Content container (GRID)
   IMPORTANT: this forces 2-column layout
   ========================================= */
#content{
  width: min(var(--maxw), calc(100% - 32px));
  margin: 12px auto 0 auto;
  padding: 18px;

  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);

  display: grid;
  grid-template-columns: var(--side) 1fr;
  gap: 18px;
  align-items: start;
}

/* =========================================
   Robust placement rules:
   - #menu1 is treated as the sidebar
   - #colTwo is treated as main content
   - #colOne is optional; if present, it's also sidebar
   ========================================= */

/* Sidebar column */
#menu1,
#colOne{
  grid-column: 1;
}

/* Main column */
#colTwo{
  grid-column: 2;
  min-width: 0;
}

/* If old template floats exist anywhere, neutralize */
#colOne, #colTwo{
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 6px 6px 12px 6px;
}

/* Prevent first-child margins from "pushing down" */
#menu1 > :first-child,
#colOne > :first-child,
#colTwo > :first-child{
  margin-top: 0 !important;
}

/* Section headings inside content */
#content h2{
  margin: 14px 0 10px 0;
  font-size: 18px;
  color: rgba(17,24,39,0.95);
}

/* =========================================
   Menu (Left Nav)
   ========================================= */
#menu1{
  width: 100%;
  margin: 0;
  padding: 6px 6px 12px 6px; /* make it align with #colTwo padding */
  font-weight: 750;
  font-size: 14px;
}

#menu1 ul{
  margin: 0;
  padding: 0;
  list-style: none;

  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 10px 22px rgba(17,24,39,0.06);
}

#menu1 li{ margin: 0; }

#menu1 a{
  display: block;
  width: 100%;
  padding: 12px 14px;

  border-bottom: 1px solid rgba(17,24,39,0.08);
  font-weight: 750;
  color: rgba(17,24,39,0.92);
  background: transparent;
}

#menu1 a:hover{
  background: rgba(245,128,37,0.10);
  color: rgba(17,24,39,1);
}

#menu1 li:last-child a{ border-bottom: 0; }

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

#colTwo img{
  display: block;
  margin: 10px auto 14px auto;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(17,24,39,0.10);
}

/* =========================================
   Optional panel utility
   ========================================= */
.panel{
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 10px 22px rgba(17,24,39,0.06);
  padding: 14px 16px;
}

/* =========================================
   Course list (scoped to #colTwo)
   ========================================= */
#colTwo .course-subtitle{
  margin: 6px 0 14px 0;
  color: var(--muted);
  font-size: 13px;
}

#colTwo .course-table{
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 10px 22px rgba(17,24,39,0.06);
}

#colTwo .course-row{
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 14px;
  padding: 12px 14px;
  border-top: 1px solid rgba(17,24,39,0.08);
}

#colTwo .course-row:first-child{ border-top: none; }

#colTwo .course-head{
  background: rgba(245,128,37,0.10);
  font-weight: 850;
  color: rgba(17,24,39,0.92);
}

#colTwo .course-cell{ line-height: 1.35; }

#colTwo .course-code{
  font-weight: 850;
  font-size: 13px;
  letter-spacing: -0.01em;
}

#colTwo .course-name{
  color: rgba(17,24,39,0.70);
  font-size: 12.5px;
  margin-top: 2px;
}

#colTwo .course-row:not(.course-head):hover{
  background: rgba(17,24,39,0.02);
}

/* =========================================
   Footer
   ========================================= */
#footer{
  width: min(var(--maxw), calc(100% - 32px));
  margin: 12px auto 28px auto;
}

#footer p{
  text-align: center;
  padding: 10px 0;
  font-size: 12px;
  color: rgba(17,24,39,0.58);
}

/* =========================================
   Responsive (stack on mobile)
   ========================================= */
@media (max-width: 900px){
  #content{
    grid-template-columns: 1fr;
    padding: 14px;
  }
  #menu1, #colOne, #colTwo{
    grid-column: 1;
  }
  #menu1{ padding: 0; }
}

@media (max-width: 720px){
  #colTwo .course-head{ display: none; }
  #colTwo .course-row{ grid-template-columns: 1fr; gap: 6px; }
  #colTwo .course-row .course-cell:last-child{
    color: rgba(17,24,39,0.62);
    font-size: 12.5px;
  }
}
