/*
Theme Name:  Amir Rafiee Academic
Theme URI:   https://amirrafiee.com.au
Author:      Amir Ali Rafiee
Description: Academic portfolio theme. Elementor handles all page content. ACF manages Publications and Research Principles. Customizer handles site-wide settings.
Version:     1.0.0
License:     GNU General Public License v2 or later
Text Domain: amir-rafiee
Tags:        academic, portfolio, elementor, dark
*/

/* =========================================
   CSS VARIABLES — global design tokens
   All Elementor widgets inherit these
   ========================================= */
:root {
  --ar-navy:        #080C14;
  --ar-navy-mid:    #0D1220;
  --ar-navy-card:   #111827;
  --ar-border:      rgba(196,160,82,0.18);
  --ar-gold:        #C4A052;
  --ar-gold-light:  #D4B472;
  --ar-gold-pale:   rgba(196,160,82,0.12);
  --ar-cream:       #F5F0E8;
  --ar-muted:       rgba(245,240,232,0.55);
  --ar-font-serif:  'Libre Baskerville', Georgia, serif;
  --ar-font-sans:   'IBM Plex Sans', 'Helvetica Neue', sans-serif;
  --ar-font-mono:   'IBM Plex Mono', 'Courier New', monospace;
  --ar-transition:  all 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* =========================================
   RESET & BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ar-font-sans);
  background: var(--ar-navy);
  color: var(--ar-cream);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ar-gold); text-decoration: none; transition: var(--ar-transition); }
a:hover { color: var(--ar-gold-light); }
ul { list-style: none; }

/* =========================================
   CANVAS PARTICLE BACKGROUND
   ========================================= */
#ar-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.3;
}
#page-wrap { position: relative; z-index: 1; }

/* =========================================
   HEADER
   ========================================= */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  height: 72px;
  display: flex;
  align-items: center;
  transition: background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
#site-header.scrolled {
  background: rgba(8,12,20,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--ar-border);
}
.ar-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Logo */
.ar-logo a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.ar-logo-badge {
  width: 40px; height: 40px;
  background: var(--ar-gold-pale);
  border: 1px solid rgba(196,160,82,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ar-font-serif);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ar-gold);
  clip-path: polygon(0 0,calc(100% - 6px) 0,100% 6px,100% 100%,6px 100%,0 calc(100% - 6px));
  flex-shrink: 0;
}
.ar-logo-text { display: flex; flex-direction: column; }
.ar-logo-name {
  font-family: var(--ar-font-serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ar-cream);
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.ar-logo-role {
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--ar-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Primary nav */
#ar-primary-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0; margin: 0;
  list-style: none;
}
#ar-primary-nav ul li a {
  display: block;
  padding: 8px 16px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ar-muted);
  border: 1px solid transparent;
  transition: var(--ar-transition);
}
#ar-primary-nav ul li a:hover,
#ar-primary-nav ul li.current-menu-item > a,
#ar-primary-nav ul li.current_page_item > a {
  color: var(--ar-gold);
  border-color: rgba(196,160,82,0.2);
}
#ar-primary-nav ul li.menu-cta > a {
  background: var(--ar-gold-pale);
  color: var(--ar-gold);
  border-color: rgba(196,160,82,0.3);
}
#ar-primary-nav ul li.menu-cta > a:hover {
  background: var(--ar-gold);
  color: var(--ar-navy);
}

/* Hamburger */
.ar-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.ar-menu-toggle span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--ar-cream);
  transition: var(--ar-transition);
}
.ar-menu-toggle.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.ar-menu-toggle.active span:nth-child(2) { opacity: 0; }
.ar-menu-toggle.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* =========================================
   PAGE WRAPPER — pushes content below header
   ========================================= */
.ar-page-content { padding-top: 72px; }

/* Elementor full-width pages override this */
.page-template-page-fullwidth .ar-page-content,
.elementor-editor-active .ar-page-content { padding-top: 72px; }

/* =========================================
   FOOTER
   ========================================= */
#site-footer {
  background: var(--ar-navy-mid);
  border-top: 1px solid var(--ar-border);
  padding: 56px 0 32px;
}
.ar-footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(196,160,82,0.08);
}
.ar-footer-brand-name {
  font-family: var(--ar-font-serif);
  font-size: 1rem;
  color: var(--ar-cream);
  margin-bottom: 6px;
}
.ar-footer-brand-desc {
  font-size: 0.82rem;
  color: var(--ar-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}
.ar-footer-orcid {
  font-family: var(--ar-font-mono);
  font-size: 0.7rem;
  color: var(--ar-gold);
  letter-spacing: 0.06em;
}
.ar-footer-col-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ar-gold);
  margin-bottom: 14px;
}
.ar-footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ar-footer-links a {
  font-size: 0.82rem;
  color: var(--ar-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--ar-transition);
}
.ar-footer-links a::before {
  content: '';
  width: 14px; height: 1px;
  background: rgba(196,160,82,0.25);
  flex-shrink: 0;
  transition: var(--ar-transition);
}
.ar-footer-links a:hover { color: var(--ar-gold); }
.ar-footer-links a:hover::before { background: var(--ar-gold); width: 20px; }
.ar-footer-bottom {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ar-footer-copy {
  font-size: 0.7rem;
  color: rgba(245,240,232,0.25);
}
.ar-footer-affil {
  font-size: 0.68rem;
  color: rgba(245,240,232,0.2);
  font-family: var(--ar-font-mono);
}

/* =========================================
   PUBLICATION CARDS
   (used on Elementor pages via shortcode)
   ========================================= */
.ar-pub-card {
  background: var(--ar-navy-card);
  border: 1px solid var(--ar-border);
  padding: 28px 32px;
  margin-bottom: 2px;
  position: relative;
  transition: var(--ar-transition);
}
.ar-pub-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--ar-gold), transparent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}
.ar-pub-card:hover { border-color: rgba(196,160,82,0.3); }
.ar-pub-card:hover::before { transform: scaleY(1); }
.ar-pub-year {
  font-family: var(--ar-font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ar-gold);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ar-pub-year::after {
  content: '';
  flex: 1; max-width: 36px;
  height: 1px;
  background: rgba(196,160,82,0.3);
}
.ar-pub-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--ar-gold-pale);
  color: var(--ar-gold);
  border: 1px solid rgba(196,160,82,0.2);
  margin-bottom: 10px;
}
.ar-pub-title {
  font-family: var(--ar-font-serif);
  font-size: 1rem;
  color: var(--ar-cream);
  line-height: 1.4;
  margin-bottom: 8px;
  font-weight: 700;
}
.ar-pub-venue {
  font-size: 0.82rem;
  color: var(--ar-muted);
  font-style: italic;
  margin-bottom: 8px;
}
.ar-pub-authors {
  font-size: 0.76rem;
  color: rgba(245,240,232,0.3);
  margin-bottom: 12px;
}
.ar-pub-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ar-pub-doi {
  font-family: var(--ar-font-mono);
  font-size: 0.68rem;
  color: var(--ar-gold);
  opacity: 0.75;
  border: 1px solid rgba(196,160,82,0.2);
  padding: 3px 10px;
  transition: var(--ar-transition);
}
.ar-pub-doi:hover { opacity: 1; color: var(--ar-gold); border-color: var(--ar-gold); }
.ar-pub-citations {
  font-size: 0.68rem;
  color: var(--ar-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* =========================================
   PRINCIPLE CARDS
   ========================================= */
.ar-principle-card {
  background: var(--ar-navy-card);
  border: 1px solid var(--ar-border);
  padding: 28px 28px;
  transition: var(--ar-transition);
}
.ar-principle-card:hover {
  border-color: rgba(196,160,82,0.3);
  box-shadow: 0 0 40px rgba(196,160,82,0.06);
}
.ar-principle-code {
  font-family: var(--ar-font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ar-gold);
  margin-bottom: 10px;
}
.ar-principle-title {
  font-family: var(--ar-font-serif);
  font-size: 0.95rem;
  color: var(--ar-cream);
  font-weight: 700;
  margin-bottom: 10px;
}
.ar-principle-desc {
  font-size: 0.84rem;
  color: var(--ar-muted);
  line-height: 1.7;
}
.ar-principles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

/* =========================================
   STATS STRIP
   ========================================= */
.ar-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--ar-border);
  border: 1px solid var(--ar-border);
  margin-bottom: 48px;
}
.ar-stat-block {
  background: var(--ar-navy-card);
  padding: 24px;
  text-align: center;
}
.ar-stat-num {
  font-family: var(--ar-font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--ar-gold);
  line-height: 1;
  margin-bottom: 5px;
}
.ar-stat-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ar-muted);
}

/* =========================================
   SECTION LABELS (used globally)
   ========================================= */
.ar-section-label {
  font-family: var(--ar-font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ar-gold);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ar-section-label::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--ar-gold);
  flex-shrink: 0;
}

/* =========================================
   ELEMENTOR COMPATIBILITY
   — makes Elementor sections look right on dark bg
   ========================================= */
.elementor-section { position: relative; }
.elementor-widget-text-editor { color: var(--ar-cream); }
.elementor-widget-heading .elementor-heading-title { color: var(--ar-cream); }

/* Elementor full-width stretch */
.elementor-section.elementor-section-stretched {
  left: 0 !important;
  width: 100% !important;
}

/* =========================================
   MOBILE
   ========================================= */
@media (max-width: 768px) {
  .ar-menu-toggle { display: flex; }

  #ar-primary-nav {
    position: fixed;
    top: 72px; left: 0; right: 0; bottom: 0;
    background: rgba(8,12,20,0.98);
    backdrop-filter: blur(16px);
    padding: 1.5rem 1rem;
    display: none;
    overflow-y: auto;
    border-top: 1px solid var(--ar-border);
    z-index: 9998;
  }
  #ar-primary-nav.open { display: block; }
  #ar-primary-nav ul { flex-direction: column; gap: 0; }
  #ar-primary-nav ul li a {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(196,160,82,0.06);
    border-left: none; border-right: none; border-top: none;
  }

  .ar-footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .ar-footer-bottom { flex-direction: column; gap: 4px; text-align: center; }
  .ar-principles-grid { grid-template-columns: 1fr; }
  .ar-stats-strip { grid-template-columns: 1fr; }
}
