/* UTD School Website - Main Styles */
:root {
  --utd-orange: #C75B12;
  --utd-orange-dark: #A04810;
  --utd-green: #006B3F;
  --utd-green-dark: #004D2E;
  --utd-gold: #C4A962;
  --utd-beige: #F5F0E8;
  --text: #1a1a1a;
  --text-muted: #555;
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --border: #e0e0e0;
  --shadow: 0 4px 24px rgba(0,0,0,.08);
  --radius: 8px;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --header-h: 80px;
  --transition: .25s ease;
}

[data-theme="dark"] {
  --text: #f0f0f0;
  --text-muted: #aaa;
  --bg: #121212;
  --bg-alt: #1e1e1e;
  --border: #333;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --utd-beige: #2a2520;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--utd-orange); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--utd-orange-dark); }

.container { width: min(1200px, 92%); margin: 0 auto; }

/* Top bar */
.top-bar {
  background: var(--utd-green);
  color: #fff;
  font-size: .85rem;
  padding: .4rem 0;
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.top-bar a { color: #fff; opacity: .9; }
.top-bar a:hover { opacity: 1; color: #fff; }

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 0;
  gap: 1rem;
}
.logo-link { display: flex; align-items: center; gap: .75rem; color: var(--text); }
.logo-link:hover { color: var(--text); }
.logo-link img { width: 56px; height: 56px; object-fit: contain; }
.logo-text { line-height: 1.2; }
.logo-text strong { display: block; font-family: var(--font-serif); font-size: 1.05rem; }
.logo-text span { font-size: .75rem; color: var(--text-muted); }

.main-nav { display: flex; align-items: center; gap: .25rem; }
.main-nav a {
  padding: .5rem .75rem;
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  border-radius: var(--radius);
}
.main-nav a:hover, .main-nav a.active { background: var(--utd-beige); color: var(--utd-orange); }
.nav-portal {
  background: var(--utd-orange) !important;
  color: #fff !important;
  margin-left: .5rem;
}
.nav-portal:hover { background: var(--utd-orange-dark) !important; color: #fff !important; }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.theme-toggle, .menu-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .4rem .6rem;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);
}
.menu-toggle { display: none; }

/* Hero */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  color: #fff;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,107,63,.85) 0%, rgba(0,0,0,.55) 100%);
}
.hero-content { position: relative; z-index: 1; max-width: 700px; padding: 4rem 0; }
.hero-tag { font-size: .9rem; text-transform: uppercase; letter-spacing: .15em; opacity: .9; margin-bottom: 1rem; }
.hero h1 { font-family: var(--font-serif); font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; margin-bottom: 1rem; }
.hero p { font-size: 1.15rem; opacity: .95; margin-bottom: 2rem; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-primary { background: var(--utd-orange); color: #fff; border-color: var(--utd-orange); }
.btn-primary:hover { background: var(--utd-orange-dark); color: #fff; border-color: var(--utd-orange-dark); }
.btn-outline { background: transparent; color: #fff; border-color: #fff; }
.btn-outline:hover { background: #fff; color: var(--utd-green); }
.btn-green { background: var(--utd-green); color: #fff; border-color: var(--utd-green); }
.btn-green:hover { background: var(--utd-green-dark); color: #fff; }

/* Quick links strip */
.quick-strip {
  background: var(--utd-orange);
  padding: 0;
}
.quick-strip .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.quick-strip a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1.25rem 1rem;
  color: #fff;
  font-weight: 600;
  border-right: 1px solid rgba(255,255,255,.2);
  transition: background var(--transition);
}
.quick-strip a:last-child { border-right: none; }
.quick-strip a:hover { background: var(--utd-orange-dark); color: #fff; }

/* Sections */
section { padding: 4rem 0; }
section.alt { background: var(--bg-alt); }
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  color: var(--utd-green);
  margin-bottom: .5rem;
}
.section-header p { color: var(--text-muted); max-width: 600px; margin: 0 auto; }
.section-header .line {
  width: 60px; height: 3px;
  background: var(--utd-orange);
  margin: 1rem auto 0;
}

/* Cards grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(0,0,0,.12); }
.card-img { height: 200px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.25rem; }
.card-body .date { font-size: .8rem; color: var(--utd-orange); font-weight: 600; margin-bottom: .5rem; }
.card-body h3 { font-size: 1.1rem; margin-bottom: .5rem; line-height: 1.3; }
.card-body p { font-size: .9rem; color: var(--text-muted); }

/* Welcome block */
.welcome-block { display: grid; grid-template-columns: 280px 1fr; gap: 2.5rem; align-items: start; }
.principal-photo {
  width: 280px; height: 320px;
  background: var(--utd-beige);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem;
  border: 3px solid var(--utd-orange);
}
.welcome-block blockquote {
  font-style: italic;
  border-left: 4px solid var(--utd-orange);
  padding-left: 1.5rem;
  margin: 1rem 0;
  color: var(--text-muted);
}
.welcome-sig { margin-top: 1.5rem; }
.welcome-sig strong { display: block; color: var(--utd-green); }

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}
.stat-item {
  padding: 2rem 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.stat-item .num { font-size: 2.5rem; font-weight: 700; color: var(--utd-orange); }
.stat-item .label { font-size: .9rem; color: var(--text-muted); margin-top: .25rem; }

/* Page hero (inner pages) */
.page-hero {
  background: var(--utd-green);
  color: #fff;
  padding: 3rem 0;
  text-align: center;
}
.page-hero h1 { font-family: var(--font-serif); font-size: 2.5rem; margin-bottom: .5rem; }
.breadcrumb { font-size: .9rem; opacity: .85; }
.breadcrumb a { color: #fff; }

/* Content prose */
.prose { max-width: 800px; }
.prose h2 { font-family: var(--font-serif); color: var(--utd-green); margin: 2rem 0 1rem; }
.prose h3 { color: var(--utd-orange); margin: 1.5rem 0 .75rem; }
.prose p, .prose li { margin-bottom: 1rem; color: var(--text-muted); }
.prose ul { padding-left: 1.5rem; }

/* Department accordion */
.dept-list { display: flex; flex-direction: column; gap: 1rem; }
.dept-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.dept-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--utd-green);
  transition: background var(--transition);
}
.dept-header:hover { background: var(--utd-beige); }
.dept-header .icon { font-size: 1.25rem; transition: transform var(--transition); }
.dept-item.open .dept-header .icon { transform: rotate(180deg); }
.dept-body {
  display: none;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}
.dept-item.open .dept-body { display: block; }
.dept-body ul { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.dept-body li {
  background: var(--utd-beige);
  padding: .35rem .75rem;
  border-radius: 20px;
  font-size: .85rem;
  color: var(--text);
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item .caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
  color: #fff;
  font-size: .9rem;
}

.gallery-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; justify-content: center; }
.filter-btn {
  padding: .5rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 20px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--text);
  transition: all var(--transition);
}
.filter-btn.active, .filter-btn:hover { background: var(--utd-orange); color: #fff; border-color: var(--utd-orange); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; }
.contact-info-item { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.contact-icon {
  width: 48px; height: 48px;
  background: var(--utd-beige);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-size: .9rem; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea {
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .95rem;
  background: var(--bg);
  color: var(--text);
}
.form-group textarea { min-height: 140px; resize: vertical; }
.map-embed {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 2rem;
}
.map-embed iframe { width: 100%; height: 350px; border: 0; display: block; }

/* Admissions steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.step {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
}
.step-num {
  width: 48px; height: 48px;
  background: var(--utd-orange);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 auto 1rem;
}
.fee-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.fee-table th, .fee-table td { padding: .75rem 1rem; border: 1px solid var(--border); text-align: left; }
.fee-table th { background: var(--utd-green); color: #fff; }
.fee-table tr:nth-child(even) { background: var(--bg-alt); }

/* Events timeline */
.event-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.event-date {
  text-align: center;
  background: var(--utd-orange);
  color: #fff;
  border-radius: var(--radius);
  padding: .75rem .5rem;
}
.event-date .day { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.event-date .month { font-size: .8rem; text-transform: uppercase; }

/* Testimonials */
.testimonial {
  padding: 2rem;
  background: var(--bg);
  border-left: 4px solid var(--utd-orange);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.testimonial p { font-style: italic; margin-bottom: 1rem; color: var(--text-muted); }
.testimonial cite { font-style: normal; font-weight: 600; color: var(--utd-green); }

/* Footer */
.site-footer {
  background: var(--utd-green-dark);
  color: rgba(255,255,255,.85);
  padding: 3rem 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
}
.footer-grid h4 { color: #fff; margin-bottom: 1rem; font-size: 1rem; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: .5rem; }
.footer-grid a { color: rgba(255,255,255,.75); font-size: .9rem; }
.footer-grid a:hover { color: #fff; }
.footer-brand img { width: 64px; margin-bottom: 1rem; }
.social-links { display: flex; gap: .75rem; margin-top: 1rem; }
.social-links a {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
}
.social-links a:hover { background: var(--utd-orange); color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .85rem;
}
.footer-bottom a { color: rgba(255,255,255,.75); }

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--utd-green);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all .3s;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Responsive */
@media (max-width: 992px) {
  .grid-4, .stats-row, .quick-strip .container { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .welcome-block { grid-template-columns: 1fr; }
  .principal-photo { width: 100%; max-width: 280px; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .grid-2, .grid-3, .grid-4, .stats-row { grid-template-columns: 1fr; }
  .quick-strip .container { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { min-height: 70vh; }
  .event-item { grid-template-columns: 60px 1fr; }
}

@media (max-width: 480px) {
  .quick-strip .container { grid-template-columns: 1fr; }
  .quick-strip a { border-right: none; border-bottom: 1px solid rgba(255,255,255,.2); }
}
