/* ============================================================
   MITCON Forum — Base Styles
   HTML reset, typography, common utilities
   Depends on: tokens.css
   Used by: all pages
   ============================================================ */

/* ---------- RESET ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  /* SEBI Accessibility: allow text resizing up to 200% without breaking layout */
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

/* ---------- SEBI ACCESSIBILITY: FOCUS INDICATORS ---------- */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* SEBI: Skip nav link — hidden until keyboard focus */
.skip-nav {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  font-weight: 600;
  z-index: 99999;
  border-radius: 0 0 8px 0;
  transition: top 0.2s var(--ease);
}

.skip-nav:focus-visible {
  top: 0;
  outline: 3px solid var(--ink);
  outline-offset: 0;
  color: #fff;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
h2 { font-size: clamp(2rem, 3.6vw, 3.2rem); }
h3 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); }
h4 { font-size: clamp(1.2rem, 1.8vw, 1.5rem); }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }

p { margin: 0; line-height: 1.65; }

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

strong { font-weight: 700; }

/* ---------- SELECTION ---------- */
::selection {
  background: var(--accent);
  color: #fff;
}

/* ---------- SECTION COMMON ---------- */
.section-pad {
  padding: var(--section-pad) 0;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section-heading {
  margin-bottom: var(--space-lg);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.eyebrow .bar {
  display: inline-block;
  width: 30px;
  height: 1px;
  background: var(--accent);
}

.eyebrow.justify-content-center {
  justify-content: center;
}

.section-title {
  margin-bottom: var(--space-md);
}

.lead-text {
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 18px;
  max-width: 680px;
}

.body-text {
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ---------- BUTTONS ---------- */
.btn-primary-custom {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 30px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  box-shadow: 0 10px 24px rgba(21, 90, 61, 0.22);
  position: relative;
  overflow: hidden;
  border: none;
}

.btn-primary-custom:hover {
  color: #fff;
  background: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(21, 90, 61, 0.32);
}

.btn-primary-custom i {
  transition: transform 0.3s var(--ease);
}

.btn-primary-custom:hover i {
  transform: translateX(5px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  background: transparent;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  border-radius: var(--radius-pill);
  font-size: 14.5px;
  font-weight: 600;
  transition: all 0.3s var(--ease);
}

.btn-ghost:hover {
  background: var(--ink);
  color: #fff;
  transform: translateY(-2px);
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.25s var(--ease);
  box-shadow: 0 6px 18px rgba(21, 90, 61, 0.25);
}

.btn-pill:hover {
  color: #fff;
  background: var(--accent-deep);
  transform: translateY(-1px);
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--beige);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-deep);
}

/* ---------- PRELOADER ---------- */
.preloader {
  position: fixed;
  inset: 0;
  background: var(--beige);
  z-index: 99999;
  display: grid;
  place-items: center;
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
}

.preloader-ring {
  width: 60px;
  height: 60px;
  border: 3px solid var(--beige-deep);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- REDUCED MOTION (SEBI Accessibility) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- PRINT ---------- */
@media print {
  .site-header, .site-footer, .back-to-top, .preloader { display: none; }
  body { background: #fff; color: #000; }
}

/* ---------- BACK TO TOP BUTTON ---------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 52px;
  height: 52px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  z-index: var(--z-back-top);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s var(--ease);
  box-shadow: 0 12px 28px rgba(21, 90, 61, 0.4);
  border: none;
  cursor: pointer;
  font-size: 18px;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--accent-deep);
  transform: translateY(-4px);
}

@media (max-width: 575px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
}

/* ---------- LIGHTBOX (Gallery + Press shared) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.lightbox.is-open {
  display: flex;
  opacity: 1;
}

.lightbox-stage {
  position: relative;
  max-width: 1100px;
  width: 100%;
  max-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: lbZoomIn 0.45s var(--ease-out);
}

@keyframes lbZoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox-caption {
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.25s var(--ease);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lightbox-close {
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  font-size: 22px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 22px;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.lightbox-prev:hover,
.lightbox-next:hover {
  transform: translateY(-50%) scale(1.05);
}

.lightbox-close:hover {
  transform: scale(1.05);
}

.lightbox-counter {
  position: absolute;
  top: 24px;
  left: 24px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 600px) {
  .lightbox { padding: 20px 12px; }
  .lightbox-img { max-height: calc(100vh - 200px); }
  .lightbox-close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .lightbox-prev, .lightbox-next {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-counter {
    top: 14px;
    left: 14px;
    font-size: 11px;
    padding: 6px 10px;
  }
  .lightbox-caption {
    bottom: -38px;
    font-size: 12.5px;
  }
}