/* ============================================
   TowerInsight — Dark Magazine Theme
   Petronas Twin Towers Information Website
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #0f1117;
  --bg-secondary: #181b23;
  --bg-card: #1e2130;
  --bg-card-hover: #252839;
  --accent: #D4AF37;
  --accent-light: #e8cc6e;
  --accent-dark: #b8961e;
  --text-primary: #e8e6e1;
  --text-secondary: #a09e99;
  --text-muted: #6b6966;
  --border-color: #2a2d3a;
  --nav-bg: rgba(15, 17, 23, 0.95);
  --hero-overlay: linear-gradient(180deg, rgba(15,17,23,0.3) 0%, rgba(15,17,23,0.85) 100%);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --radius: 6px;
  --transition: 0.3s ease;
  --max-width: 1200px;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans Pro', 'Segoe UI', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-light); }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; color: var(--text-primary); }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.7rem); }
h4 { font-size: 1.2rem; }
p { margin-bottom: 1rem; }

/* --- Container --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== NAVIGATION ===== */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--nav-bg); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
}
.nav-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-brand {
  font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700;
  color: var(--accent); letter-spacing: 1px;
}
.nav-brand span { color: var(--text-primary); font-weight: 400; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a {
  color: var(--text-secondary); font-size: 0.9rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; position: relative;
  padding: 4px 0;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -2px; left: 0; width: 0;
  height: 2px; background: var(--accent); transition: width var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > a::after { content: ' ▾'; font-size: 0.7em; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: var(--radius); min-width: 220px; padding: 0.5rem 0;
  box-shadow: var(--shadow); z-index: 100;
}
.dropdown-menu a {
  display: block; padding: 0.5rem 1.2rem; font-size: 0.85rem;
  text-transform: none; letter-spacing: 0; color: var(--text-secondary);
}
.dropdown-menu a::after { display: none; }
.dropdown-menu a:hover { background: var(--bg-card); color: var(--accent); }
.nav-dropdown:hover .dropdown-menu { display: block; }

/* Hamburger */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text-primary); margin: 5px 0; transition: var(--transition); }

/* ===== HERO ===== */
.hero {
  position: relative; min-height: 90vh; display: flex; align-items: center;
  justify-content: center; text-align: center; overflow: hidden; margin-top: 64px;
}
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  z-index: 0;
}
.hero-bg::after { content: ''; position: absolute; inset: 0; background: var(--hero-overlay); }
.hero-content { position: relative; z-index: 2; max-width: 800px; padding: 2rem 1.5rem; }
.hero-label {
  display: inline-block; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 3px; color: var(--accent); border: 1px solid var(--accent);
  padding: 0.3rem 1rem; border-radius: 2px; margin-bottom: 1.5rem;
  font-family: var(--font-body); font-weight: 600;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 1rem; }
.hero p { font-size: 1.15rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto 2rem; }

/* Page Hero (smaller) */
.page-hero {
  position: relative; min-height: 45vh; display: flex; align-items: flex-end;
  margin-top: 64px; overflow: hidden;
}
.page-hero .hero-bg::after { background: linear-gradient(0deg, var(--bg-primary) 0%, rgba(15,17,23,0.4) 100%); }
.page-hero .hero-content { padding: 3rem 1.5rem; text-align: left; max-width: var(--max-width); width: 100%; margin: 0 auto; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3rem); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block; padding: 0.75rem 2rem; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; cursor: pointer;
  transition: all var(--transition); border: none;
}
.btn-primary { background: var(--accent); color: var(--bg-primary); }
.btn-primary:hover { background: var(--accent-light); color: var(--bg-primary); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--bg-primary); }

/* ===== SECTIONS ===== */
.section { padding: 5rem 0; }
.section-dark { background: var(--bg-secondary); }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { margin-bottom: 0.75rem; }
.section-header p { color: var(--text-secondary); max-width: 600px; margin: 0 auto; }
.section-divider { width: 60px; height: 3px; background: var(--accent); margin: 1rem auto; border-radius: 2px; }

/* ===== CARDS ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }
.card {
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border-color); transition: all var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
.card-img { height: 220px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: 1.5rem; }
.card-tag {
  display: inline-block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent); font-weight: 700; margin-bottom: 0.5rem;
}
.card-body h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.card-body h3 a { color: var(--text-primary); }
.card-body h3 a:hover { color: var(--accent); }
.card-body p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.card-meta { font-size: 0.8rem; color: var(--text-muted); }

/* Feature Card (horizontal) */
.feature-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--bg-card); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}
.feature-card .card-img { height: 100%; min-height: 300px; }
.feature-card .card-body { padding: 2rem; display: flex; flex-direction: column; justify-content: center; }

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
  padding: 1rem 0; font-size: 0.85rem; color: var(--text-muted);
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 0.4rem; }

/* ===== ARTICLE ===== */
.article-content {
  max-width: 800px; margin: 0 auto; padding: 0 1.5rem;
}
.article-content h2 { margin: 2.5rem 0 1rem; color: var(--accent); font-size: 1.8rem; }
.article-content h3 { margin: 2rem 0 0.75rem; font-size: 1.4rem; }
.article-content p { font-size: 1.05rem; color: var(--text-secondary); line-height: 1.8; }
.article-content ul, .article-content ol { margin: 1rem 0 1.5rem 1.5rem; color: var(--text-secondary); }
.article-content li { margin-bottom: 0.5rem; font-size: 1.05rem; list-style: disc; }
.article-content ol li { list-style: decimal; }
.article-content blockquote {
  border-left: 4px solid var(--accent); padding: 1rem 1.5rem; margin: 2rem 0;
  background: var(--bg-card); border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--text-secondary);
}
.article-content figure { margin: 2rem 0; }
.article-content figure img { border-radius: var(--radius); width: 100%; }
.article-content figcaption { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-top: 0.5rem; }
.article-meta { display: flex; gap: 2rem; margin: 1rem 0 2rem; font-size: 0.9rem; color: var(--text-muted); flex-wrap: wrap; }

/* Info Box / Sidebar */
.info-box {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent); padding: 1.5rem; border-radius: var(--radius);
  margin: 2rem 0;
}
.info-box h4 { color: var(--accent); margin-bottom: 0.75rem; font-family: var(--font-body); font-weight: 700; }
.info-box p, .info-box li { font-size: 0.95rem; }
.stat-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--border-color); }
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-muted); font-size: 0.9rem; }
.stat-value { color: var(--accent); font-weight: 700; font-size: 0.9rem; }

/* ===== GALLERY ===== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.gallery-item { position: relative; overflow: hidden; border-radius: var(--radius); cursor: pointer; aspect-ratio: 4/3; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex;
  align-items: center; justify-content: center; opacity: 0; transition: opacity var(--transition);
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay span { color: #fff; font-size: 2rem; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 2000;
  display: none; align-items: center; justify-content: center; flex-direction: column;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 80vh; border-radius: var(--radius); }
.lightbox-close {
  position: absolute; top: 1.5rem; right: 1.5rem; background: none; border: none;
  color: #fff; font-size: 2rem; cursor: pointer; z-index: 2001;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1);
  border: none; color: #fff; font-size: 2rem; padding: 1rem; cursor: pointer;
  border-radius: var(--radius); transition: background var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-caption { color: var(--text-secondary); margin-top: 1rem; font-size: 0.9rem; text-align: center; }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding: 2rem 0; }
.timeline::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 3px; background: var(--accent); transform: translateX(-50%);
}
.timeline-item {
  display: flex; align-items: flex-start; margin-bottom: 3rem; position: relative;
}
.timeline-item:nth-child(odd) { flex-direction: row; }
.timeline-item:nth-child(even) { flex-direction: row-reverse; }
.timeline-content {
  width: 45%; padding: 1.5rem; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius);
  transition: all var(--transition);
}
.timeline-content:hover { border-color: var(--accent); transform: translateY(-2px); }
.timeline-dot {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 16px; height: 16px; background: var(--accent); border-radius: 50%;
  border: 3px solid var(--bg-primary); z-index: 2;
}
.timeline-year { font-family: var(--font-heading); font-size: 1.4rem; color: var(--accent); margin-bottom: 0.5rem; }
.timeline-content h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.timeline-content p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0; }

/* ===== STATS BAR ===== */
.stats-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem;
  padding: 3rem 0; text-align: center;
}
.stat-item h3 { font-size: 2.4rem; color: var(--accent); margin-bottom: 0.25rem; font-family: var(--font-heading); }
.stat-item p { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }

/* ===== RELATED ARTICLES ===== */
.related-section { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--border-color); }

/* ===== FOOTER ===== */
.site-footer { background: var(--bg-secondary); border-top: 1px solid var(--border-color); padding: 4rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 3rem; }
.footer-brand { font-family: var(--font-heading); font-size: 1.4rem; color: var(--accent); margin-bottom: 1rem; }
.footer-brand span { color: var(--text-primary); font-weight: 400; }
.footer-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }
.footer-col h4 { font-family: var(--font-body); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-primary); margin-bottom: 1rem; }
.footer-col a { display: block; color: var(--text-muted); font-size: 0.9rem; padding: 0.25rem 0; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border-color); padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; gap: 1rem;
}
.footer-legal a { margin-left: 1.5rem; color: var(--text-muted); }
.footer-legal a:hover { color: var(--accent); }

/* ===== COOKIE BANNER ===== */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-secondary);
  border-top: 1px solid var(--border-color); padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 3000; gap: 1rem; flex-wrap: wrap; transform: translateY(100%);
  transition: transform 0.4s ease;
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }
.cookie-banner a { color: var(--accent); }
.cookie-btn { padding: 0.5rem 1.5rem; font-size: 0.85rem; }

/* ===== CONTACT FORM ===== */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.5rem; font-weight: 600; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.75rem 1rem; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius);
  color: var(--text-primary); font-family: var(--font-body); font-size: 1rem;
  transition: border-color var(--transition);
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { min-height: 150px; resize: vertical; }

/* ===== 404 PAGE ===== */
.page-404 {
  min-height: 80vh; display: flex; align-items: center; justify-content: center;
  text-align: center; margin-top: 64px;
}
.page-404 h1 { font-size: 8rem; color: var(--accent); line-height: 1; }
.page-404 h2 { font-size: 1.8rem; margin-bottom: 1rem; }
.page-404 p { color: var(--text-secondary); margin-bottom: 2rem; }

/* ===== SCROLL ANIMATIONS ===== */
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-in-left { opacity: 0; transform: translateX(-30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in-left.visible { opacity: 1; transform: translateX(0); }
.fade-in-right { opacity: 0; transform: translateX(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in-right.visible { opacity: 1; transform: translateX(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .feature-card { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .timeline::before { left: 20px; }
  .timeline-item, .timeline-item:nth-child(even) { flex-direction: row; padding-left: 50px; }
  .timeline-content { width: 100%; }
  .timeline-dot { left: 20px; }
}
@media (max-width: 768px) {
  .nav-links { display: none; position: fixed; top: 64px; left: 0; right: 0; background: var(--bg-secondary); flex-direction: column; padding: 1.5rem; gap: 0; border-bottom: 1px solid var(--border-color); }
  .nav-links.active { display: flex; }
  .nav-links a { padding: 0.75rem 0; border-bottom: 1px solid var(--border-color); width: 100%; }
  .nav-toggle { display: block; }
  .nav-dropdown .dropdown-menu { position: static; box-shadow: none; border: none; background: transparent; padding-left: 1rem; }
  .nav-dropdown:hover .dropdown-menu { display: none; }
  .nav-dropdown.open .dropdown-menu { display: block; }
  .hero { min-height: 70vh; }
  .page-hero { min-height: 35vh; }
  .card-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .article-meta { flex-direction: column; gap: 0.5rem; }
}
@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr; }
  .page-404 h1 { font-size: 5rem; }
}

/* ===== UTILITY ===== */
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; } .mb-2 { margin-bottom: 2rem; } .mb-3 { margin-bottom: 3rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* People grid for bio page */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2rem; }
.person-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 2rem; text-align: center; transition: all var(--transition); }
.person-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.person-icon { width: 80px; height: 80px; background: var(--bg-secondary); border: 2px solid var(--accent); border-radius: 50%; margin: 0 auto 1rem; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--accent); }
.person-card h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.person-card h3 a { color: var(--text-primary); }
.person-card h3 a:hover { color: var(--accent); }
.person-card .role { font-size: 0.85rem; color: var(--accent); margin-bottom: 0.5rem; }
.person-card p { font-size: 0.85rem; color: var(--text-muted); }

/* Two column layout */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem; align-items: start; }
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }
.sidebar .info-box { margin-top: 0; }
