/*
Theme Name: Arxivia
Theme URI: https://arxivia.ai
Author: Arxivia Team
Author URI: https://arxivia.ai
Description: Custom theme for Arxivia — AI-powered tools for academic researchers and journal editors.
Version: 1.0.0
License: All Rights Reserved
Text Domain: arxivia
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ══════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy: #042C53;
  --navy-mid: #0C447C;
  --blue: #185FA5;
  --blue-light: #378ADD;
  --blue-tint: #B5D4F4;
  --blue-pale: #E6F1FB;
  --green: #1D9E75;
  --green-dark: #0F6E56;
  --green-pale: #E6F7F2;
  --white: #ffffff;
  --gray-light: #F4F6F9;
  --gray-mid: #8A9BB0;
  --text-dark: #042C53;
  --text-body: #3D5068;
  --text-muted: #7A90A8;
  --border: rgba(24,95,165,0.12);
  --max-w: 1280px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--white);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* WordPress core alignment */
.alignwide { max-width: 1200px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100%; max-width: 100%; }
.aligncenter { text-align: center; }

/* ══════════════════════════════════════
   HEADER
   ══════════════════════════════════════ */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo img {
  height: 36px;
  width: auto;
  display: block;
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.logo-name {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1;
}

.logo-slogan {
  font-size: 9.5px;
  font-weight: 400;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.03em;
  line-height: 1;
}

/* Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  font-size: 13.5px;
  font-weight: 400;
  color: rgba(255,255,255,0.68);
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.nav-arrow {
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid rgba(255,255,255,0.38);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.nav-item:hover .nav-arrow { transform: rotate(180deg); }

/* Dropdown */
.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #ffffff;
  border: 0.5px solid rgba(4,44,83,0.12);
  border-radius: 14px;
  padding: 8px;
  min-width: 224px;
  box-shadow: 0 12px 40px rgba(4,44,83,0.14);
  z-index: 200;
}

.nav-item:hover .dropdown { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 400;
  color: #042C53;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s;
}

.dropdown-item:hover { background: #EEF5FB; }

.dropdown-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.dropdown-item.free .dropdown-dot { background: var(--green); }
.dropdown-item.free { color: var(--green-dark); }

.dropdown-divider {
  height: 1px;
  background: rgba(4,44,83,0.07);
  margin: 6px 8px;
}

/* CTA buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-login {
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 400;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: rgba(255,255,255,0.72);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-login:hover {
  border-color: rgba(255,255,255,0.38);
  color: #fff;
}

.btn-try {
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--navy);
  background: var(--green);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-try:hover { background: #18896A; }
.btn-try:active { transform: scale(0.98); }

/* Mobile burger */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.mobile-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════ */
.site-main {
  flex: 1;
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */
.site-footer {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 40px 0;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand {}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  text-decoration: none;
}

.footer-logo img {
  height: 32px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-logo-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.03em;
}

.footer-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.42);
  line-height: 1.7;
  margin-bottom: 6px;
  max-width: 220px;
}

.footer-tagline {
  font-size: 12px;
  color: rgba(29,158,117,0.65);
  font-style: italic;
  margin-bottom: 22px;
}

.social-row {
  display: flex;
  gap: 8px;
}

.social-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
}

.social-icon:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.05);
}

.social-icon svg {
  width: 14px;
  height: 14px;
  fill: rgba(255,255,255,0.55);
}

/* Footer columns */
.footer-col-title {
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.32);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.footer-link {
  display: block;
  font-size: 13.5px;
  font-weight: 400;
  color: rgba(255,255,255,0.58);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.15s;
}

.footer-link:hover { color: #fff; }

.footer-link.free {
  color: rgba(29,158,117,0.8);
}

.footer-link.free:hover { color: var(--green); }

.col-spacer { height: 20px; }

/* Footer bottom */
.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
}

.footer-legal {
  display: flex;
  gap: 20px;
}

.footer-legal a {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-legal a:hover { color: rgba(255,255,255,0.65); }

/* ══════════════════════════════════════
   ARXI BUBBLE (Chat Widget)
   ══════════════════════════════════════ */
.arxi-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--green);
  color: #fff;
  border-radius: 50px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(29,158,117,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 999;
  text-decoration: none;
}

.arxi-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(29,158,117,0.45);
}

.arxi-bubble svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 1024px) {
  .header-inner { padding: 0 24px; gap: 16px; }
  .footer-inner { padding: 40px 24px 0; }
  .footer-bottom { padding: 18px 24px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  .mobile-toggle { display: flex; }

  .header-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    gap: 4px;
    align-items: stretch;
  }

  .header-nav.open { display: flex; }

  .nav-item { width: 100%; }

  .nav-link {
    width: 100%;
    padding: 12px 16px;
    justify-content: space-between;
  }

  .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    margin-top: 4px;
    min-width: auto;
  }

  .nav-item:hover .dropdown { display: none; }
  .nav-item.open .dropdown { display: block; }

  .header-inner { padding: 0 20px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .footer-inner { padding: 32px 20px 0; }
  .footer-bottom { padding: 18px 20px; }
}
