/*
Theme Name: MTC Institutional
Theme URI: https://mtc.ac.ke
Author: Glovin Technologies
Author URI: https://glovintechnologies.co.ke
Description: Custom WordPress theme for Membley Technical College. A maroon and gold institutional design system with page templates for Home, About, Departments, Admissions, Fees, Student Portal, Gallery and Contact. Fully compatible with Elementor for further customization.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mtc-theme
*/

/* ===== MTC Design Tokens ===== */
:root {
  --maroon: #6B1E2E;
  --maroon-dark: #4A1420;
  --maroon-light: #8B3145;
  --gold: #C9A227;
  --gold-light: #E4C866;
  --cream: #FAF6EE;
  --cream-dark: #F0E9D8;
  --charcoal: #2A2320;
  --charcoal-soft: #5A4F48;
  --white: #FFFFFF;
  --radius: 6px;
  --shadow-seal: 0 8px 24px rgba(74, 20, 32, 0.18);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--maroon-dark);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Top Bar ===== */
.top-bar {
  background: var(--maroon-dark);
  color: #E4DCD0;
  font-size: 12.5px;
}
.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 24px;
}
.top-bar-contact { display: flex; gap: 20px; }
.top-bar-social { display: flex; gap: 12px; }
.top-bar-social a {
  color: var(--gold-light);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
}
.top-bar-social a:hover { color: var(--white); }
@media (max-width: 760px) {
  .top-bar-contact span:last-child { display: none; }
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--maroon-dark);
  letter-spacing: 0.2px;
}

.brand-text span {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 1px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav li { display: inline-flex; }

.main-nav a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--charcoal-soft);
  position: relative;
  padding: 6px 0;
  transition: color 0.2s;
}

.main-nav a:hover, .main-nav li.current-menu-item > a { color: var(--maroon); }

.main-nav li.current-menu-item > a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
}

.main-nav li.nav-cta a {
  background: var(--maroon);
  color: var(--white) !important;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-weight: 600 !important;
  transition: background 0.2s;
}
.main-nav li.nav-cta a:hover { background: var(--maroon-dark); color: var(--white) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px; height: 2px; background: var(--maroon-dark);
}

/* ===== Hero ===== */
.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(201,162,39,0.12) 0%, transparent 45%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
  padding: 72px 0 88px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  right: -80px; top: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  border: 40px solid rgba(107,30,46,0.05);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--maroon);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: '';
  width: 24px; height: 2px;
  background: var(--gold);
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal;
  color: var(--maroon);
  border-bottom: 4px solid var(--gold);
}

.hero p.lead {
  font-size: 17.5px;
  color: var(--charcoal-soft);
  max-width: 520px;
  margin-bottom: 32px;
}

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.btn-primary { background: var(--maroon); color: var(--white); }
.btn-primary:hover { background: var(--maroon-dark); transform: translateY(-1px); }
.btn-outline { border-color: var(--maroon); color: var(--maroon); background: transparent; }
.btn-outline:hover { background: var(--maroon); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--maroon-dark); }
.btn-gold:hover { background: var(--gold-light); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid rgba(107,30,46,0.15);
  max-width: 520px;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--maroon);
}
.stat-label {
  font-size: 12px;
  color: var(--charcoal-soft);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.hero-visual {
  position: relative;
  aspect-ratio: 1;
  max-width: 420px;
  margin: 0 auto;
}
.seal-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--gold), var(--maroon), var(--gold-light), var(--maroon-dark), var(--gold));
  padding: 6px;
  animation: rotateSlow 40s linear infinite;
}
@keyframes rotateSlow { to { transform: rotate(360deg); } }
.seal-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-seal);
}
.seal-content { text-align: center; padding: 30px; }
.seal-content .mono {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--maroon);
  line-height: 1;
}
.seal-content .sub {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-top: 8px;
}
.seal-content .est { font-size: 11px; color: var(--charcoal-soft); margin-top: 14px; }

@media (prefers-reduced-motion: reduce) { .seal-ring { animation: none; } }

/* ===== Section basics ===== */
section { padding: 84px 0; }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 12px; }
.section-head p { color: var(--charcoal-soft); font-size: 16px; }

.bg-alt { background: var(--white); }
.bg-maroon { background: linear-gradient(155deg, var(--maroon) 0%, var(--maroon-dark) 100%); color: var(--cream); }
.bg-maroon h2, .bg-maroon h3 { color: var(--white); }

/* ===== Department Seals ===== */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}
.dept-card {
  background: var(--white);
  border-radius: 10px;
  padding: 0 26px 34px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(42,35,32,0.06);
  border: 1px solid rgba(107,30,46,0.08);
  transition: transform 0.25s, box-shadow 0.25s;
  overflow: hidden;
}
.dept-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-seal); }
.dept-photo {
  margin: 0 -26px 0;
  height: 150px;
  overflow: hidden;
}
.dept-photo img { width: 100%; height: 100%; object-fit: cover; }
.dept-seal {
  width: 84px; height: 84px;
  margin: -42px auto 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 60%, #a9840f 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  border: 3px solid var(--white);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), 0 4px 10px rgba(0,0,0,0.25);
  position: relative;
  z-index: 1;
}
.dept-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.dept-card p { color: var(--charcoal-soft); font-size: 14px; margin-bottom: 16px; }
.dept-card .prog-count {
  display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--maroon);
  letter-spacing: 0.5px; text-transform: uppercase; background: var(--cream-dark);
  padding: 4px 12px; border-radius: 20px;
}

.dept-banner {
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 28px;
  max-height: 260px;
}
.dept-banner img { width: 100%; height: 260px; object-fit: cover; }

/* ===== Features ===== */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }
.feature-item { display: flex; gap: 16px; align-items: flex-start; }
.feature-icon {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 10px;
  background: var(--cream-dark); border: 1px solid rgba(107,30,46,0.15);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.feature-item h4 { font-size: 1rem; margin-bottom: 4px; }
.feature-item p { font-size: 14px; color: var(--charcoal-soft); }

/* ===== Quote ===== */
.quote-block { max-width: 720px; margin: 0 auto; text-align: center; }
.quote-block p.quote-text { font-family: var(--font-display); font-size: 1.4rem; font-style: italic; color: var(--white); margin-bottom: 20px; }
.quote-block .quote-by { color: var(--gold-light); font-weight: 600; font-size: 14px; }

/* ===== Tables ===== */
.fee-table-wrap { background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: 0 4px 16px rgba(42,35,32,0.06); margin-bottom: 32px; }
.fee-table-wrap h3 { background: var(--maroon); color: var(--white); padding: 16px 24px; font-size: 1.05rem; font-family: var(--font-body); font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 24px; font-size: 14.5px; border-bottom: 1px solid var(--cream-dark); }
th { color: var(--charcoal-soft); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.4px; }
td.amount { font-weight: 700; color: var(--maroon); text-align: right; }
tr:last-child td { border-bottom: none; }

/* ===== Forms ===== */
.form-card { background: var(--white); border-radius: 10px; padding: 40px; box-shadow: 0 4px 20px rgba(42,35,32,0.08); max-width: 520px; margin: 0 auto; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--charcoal); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid #E0D8C8; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 14.5px; background: var(--cream); transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--maroon); background: var(--white); }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-error { color: #a3232f; font-size: 12.5px; margin-top: 4px; display: none; }
.form-note { font-size: 12.5px; color: var(--charcoal-soft); margin-top: 6px; }

/* ===== Timeline / Steps ===== */
.steps { display: grid; gap: 0; max-width: 760px; margin: 0 auto; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 20px; position: relative; padding-bottom: 40px; }
.step:last-child { padding-bottom: 0; }
.step-num {
  width: 44px; height: 44px; border-radius: 50%; background: var(--maroon); color: var(--gold-light);
  font-family: var(--font-display); font-weight: 700; display: flex; align-items: center; justify-content: center;
  font-size: 16px; z-index: 1;
}
.step:not(:last-child)::before {
  content: ''; position: absolute; left: 21px; top: 44px; bottom: 0; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--gold) 0 6px, transparent 6px 12px);
}
.step-body h4 { margin-bottom: 6px; font-size: 1.05rem; }
.step-body p { font-size: 14.5px; color: var(--charcoal-soft); }

/* ===== Gallery ===== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gallery-item {
  aspect-ratio: 4/3;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--maroon-light), var(--maroon-dark));
  position: relative;
  overflow: hidden;
}
.gallery-item img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.gallery-item span {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(0deg, rgba(42,20,32,0.85), transparent);
}
.gallery-item::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 70% 20%, rgba(201,162,39,0.15), transparent 60%); pointer-events: none; }

/* ===== Portal ===== */
.portal-shell { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 60px 24px; }
.portal-login { background: var(--white); border-radius: 12px; box-shadow: 0 12px 40px rgba(74,20,32,0.15); width: 100%; max-width: 420px; overflow: hidden; }
.portal-login-head { background: linear-gradient(155deg, var(--maroon), var(--maroon-dark)); padding: 32px; text-align: center; color: var(--white); }
.portal-login-head .brand-mark { margin: 0 auto 12px; }
.portal-login-body { padding: 32px; }
.dashboard { display: none; }
.dashboard.active { display: block; }
.portal-login.hidden { display: none; }
.dash-header { background: var(--maroon); color: var(--white); padding: 20px 0; }
.dash-header .container { display: flex; justify-content: space-between; align-items: center; }
.dash-user { font-size: 14px; }
.dash-user strong { color: var(--gold-light); }
.logout-link { font-size: 13px; color: var(--gold-light); cursor: pointer; text-decoration: underline; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 32px; }
.dash-card { background: var(--white); border-radius: 10px; padding: 24px; box-shadow: 0 4px 16px rgba(42,35,32,0.06); }
.dash-card .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--charcoal-soft); font-weight: 600; }
.dash-card .value { font-family: var(--font-display); font-size: 1.7rem; color: var(--maroon); margin-top: 6px; }
.dash-card .value.ok { color: #2f7a4f; }
.dash-card .value.due { color: #a3232f; }
.dash-section { margin-bottom: 36px; }
.dash-section h3 { font-size: 1.15rem; margin-bottom: 16px; }
.timetable-row { display: grid; grid-template-columns: 100px 1fr 140px; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--cream-dark); font-size: 14px; align-items: center; }
.timetable-row:last-child { border-bottom: none; }
.timetable-day { font-weight: 700; color: var(--maroon); }
.timetable-room { color: var(--charcoal-soft); font-size: 13px; text-align: right; }
.resource-list a { display: flex; justify-content: space-between; padding: 13px 18px; background: var(--white); border-radius: 8px; margin-bottom: 10px; font-size: 14px; box-shadow: 0 2px 8px rgba(42,35,32,0.05); transition: background 0.2s; }
.resource-list a:hover { background: var(--cream-dark); }
.resource-list .tag { color: var(--gold); font-size: 12px; font-weight: 700; text-transform: uppercase; }

/* ===== Block-editor content support ===== */
.hero-photo img {
  border-radius: 16px;
  box-shadow: var(--shadow-seal);
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.feature-item-block { padding: 4px 0; }
.feature-item-block h4 { font-size: 1rem; margin-bottom: 4px; }
.feature-item-block p { font-size: 14px; color: var(--charcoal-soft); }
.quote-block.wp-block-quote {
  border: none;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 0;
}
.quote-block.wp-block-quote p {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: italic;
  color: inherit;
  margin-bottom: 20px;
}
.bg-maroon .quote-block.wp-block-quote p { color: var(--white); }
.quote-block.wp-block-quote cite {
  color: var(--gold);
  font-weight: 600;
  font-size: 14px;
  font-style: normal;
}
.bg-maroon .quote-block.wp-block-quote cite { color: var(--gold-light); }
.wp-block-column.dept-card { background: var(--white); border-radius: 10px; padding: 0 20px 28px; box-shadow: 0 4px 16px rgba(42,35,32,0.06); border: 1px solid rgba(107,30,46,0.08); text-align: center; }
.wp-block-column.dept-card .dept-photo { margin: 0 -20px 16px; }
.wp-block-column.dept-card .dept-photo img { width: 100%; height: 150px; object-fit: cover; border-radius: 0; }
.hero-stats { margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(107,30,46,0.15); }

/* ===== Accreditation Strip ===== */
.accred-strip {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.accred-badge {
  width: 130px;
  height: 90px;
  border: 1.5px dashed rgba(107,30,46,0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--charcoal-soft);
  background: var(--cream);
}

/* ===== Footer ===== */
footer.site-footer { background: var(--charcoal); color: #C9BFB4; padding: 56px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 40px; margin-bottom: 40px; }
.footer-grid h4 { color: var(--white); font-size: 14px; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.6px; }
.footer-grid ul li { margin-bottom: 10px; font-size: 14px; }
.footer-grid ul li a:hover { color: var(--gold-light); }
.footer-brand { font-family: var(--font-display); font-size: 1.3rem; color: var(--white); margin-bottom: 10px; }
.footer-tagline { font-size: 13.5px; color: #A79C90; max-width: 280px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: #8A8078; }

/* ===== Utilities ===== */
.text-center { text-align: center; }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }

/* ===== WP core alignments ===== */
.alignwide { max-width: 1180px; margin-left: auto; margin-right: auto; }
.alignfull { max-width: 100%; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 280px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .main-nav {
    position: fixed; top: 73px; left: 0; right: 0; bottom: 0; background: var(--white);
    flex-direction: column; align-items: flex-start; padding: 24px; gap: 4px;
    transform: translateX(100%); transition: transform 0.3s; overflow-y: auto;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav li { width: 100%; display: block; }
  .main-nav a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--cream-dark); display: block; }
  .nav-toggle { display: flex; }
  .main-nav li.nav-cta { margin-top: 12px; }
  .main-nav li.nav-cta a { text-align: center; }
  section { padding: 56px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .timetable-row { grid-template-columns: 70px 1fr; }
  .timetable-room { grid-column: 2; text-align: left; }
}
