/* Inner pages theme (articles + comments) */
:root {
  --at-inner-primary: #1e3a8a;
  --at-inner-accent: #f59e0b;
  --at-inner-ink: #0f172a;
  --at-inner-muted: #334155;
  --at-inner-surface: #ffffff;
  --at-inner-soft: #f8fafc;
  --at-inner-border: #e2e8f0;
  --at-inner-radius: 1rem;
}

/* Theme 1 tokens used by the shared menu */
:root {
  --at-primary-800: #1e40af;
  --at-primary-900: #1e3a8a;
  --at-primary-600: #2563eb;
  --at-primary-700: #1d4ed8;
  --at-accent-400: #fbbf24;
  --at-accent-500: #f59e0b;
  --at-accent-600: #d97706;
  --at-gray-300: #cbd5e1;
  --at-gray-400: #94a3b8;
  --at-gray-500: #64748b;
  --at-gray-900: #0f172a;
  --at-font-size-sm: 0.875rem;
  --at-font-size-base: 1rem;
  --at-font-size-lg: 1.125rem;
  --at-font-size-xl: 1.25rem;
  --at-spacing-1: 0.25rem;
  --at-spacing-2: 0.5rem;
  --at-spacing-3: 0.75rem;
  --at-spacing-4: 1rem;
  --at-spacing-6: 1.5rem;
  --at-radius: 0.375rem;
  --at-radius-lg: 0.75rem;
  --at-radius-xl: 1rem;
  --at-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --at-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --at-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --at-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  color: var(--at-inner-ink);
}

a {
  color: var(--at-inner-primary);
}

a:hover {
  color: #1d4ed8;
}

.at-main {
  padding-top: 86px;
}

/* Navigation Styles (Theme 1) */
.at-navigation {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--at-primary-800) 0%, var(--at-primary-900) 100%);
  box-shadow: var(--at-shadow-lg);
}

.at-nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--at-spacing-4) var(--at-spacing-6);
  max-width: 1400px;
  margin: 0 auto;
}

.at-nav-brand {
  display: flex;
  align-items: center;
  gap: var(--at-spacing-3);
  color: white;
  text-decoration: none;
}

.at-brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--at-accent-400), var(--at-accent-600));
  border-radius: var(--at-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--at-font-size-lg);
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.at-brand-text {
  font-size: var(--at-font-size-xl);
  font-weight: 700;
  color: white;
  letter-spacing: -0.025em;
}

.at-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--at-radius-lg);
  cursor: pointer;
  color: white;
  transition: all var(--at-transition);
}

.at-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.at-menu-icon {
  width: 24px;
  height: 24px;
}

.at-menu-close {
  display: none;
}

body.at-menu-open .at-menu-open {
  display: none;
}

body.at-menu-open .at-menu-close {
  display: block;
}

/* Menu Popup */
.at-menu-popup {
  position: fixed;
  top: 76px;
  right: var(--at-spacing-6);
  width: 320px;
  max-height: calc(100vh - 100px);
  background: var(--at-gray-900);
  border-radius: var(--at-radius-xl);
  box-shadow: var(--at-shadow-xl);
  transform: translateX(calc(100% + var(--at-spacing-6))) rotate(5deg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--at-transition-slow);
  z-index: 1001;
  border: 2px solid var(--at-accent-500);
  overflow: hidden;
}

body.at-menu-open .at-menu-popup {
  transform: translateX(0) rotate(0deg);
  opacity: 1;
  visibility: visible;
}

.at-menu-header {
  padding: var(--at-spacing-6);
  background: linear-gradient(135deg, var(--at-primary-800), var(--at-accent-600));
  border-bottom: 2px solid var(--at-accent-500);
}

.at-menu-header h3 {
  font-size: var(--at-font-size-lg);
  font-weight: 700;
  color: white;
  margin: 0;
}

.at-menu-list {
  list-style: none;
  padding: var(--at-spacing-2);
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.at-menu-item {
  margin-bottom: var(--at-spacing-1);
}

.at-menu-link {
  display: flex;
  align-items: center;
  gap: var(--at-spacing-3);
  padding: var(--at-spacing-3) var(--at-spacing-4);
  color: var(--at-gray-300);
  font-weight: 500;
  border-radius: var(--at-radius-lg);
  transition: all var(--at-transition);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  font-size: var(--at-font-size-base);
  text-align: left;
}

.at-menu-link:hover {
  background: var(--at-primary-600);
  color: white;
}

.at-link-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--at-accent-400);
}

.at-menu-link:hover .at-link-icon {
  color: white;
}

.at-link-text {
  flex: 1;
}

.at-submenu-arrow {
  width: 16px;
  height: 16px;
  transition: transform var(--at-transition);
  color: var(--at-gray-500);
}

.at-has-submenu.at-submenu-active .at-submenu-arrow {
  transform: rotate(180deg);
}

.at-submenu {
  list-style: none;
  padding-left: var(--at-spacing-4);
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--at-transition-slow);
}

.at-has-submenu.at-submenu-active .at-submenu {
  max-height: 300px;
}

.at-submenu-link {
  display: flex;
  align-items: center;
  gap: var(--at-spacing-3);
  padding: var(--at-spacing-2) var(--at-spacing-4);
  color: var(--at-gray-400);
  font-size: var(--at-font-size-sm);
  border-radius: var(--at-radius);
  transition: all var(--at-transition);
}

.at-submenu-link:hover {
  background: var(--at-primary-700);
  color: white;
}

.at-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--at-transition);
  z-index: 999;
}

body.at-menu-open .at-menu-overlay {
  opacity: 1;
  visibility: visible;
}

/* Article layout */
.at-article {
  max-width: 960px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2rem;
  background: var(--at-inner-surface);
  border-radius: var(--at-inner-radius);
  border: 1px solid var(--at-inner-border);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.08);
}

.at-article-header {
  text-align: left;
  margin-bottom: 1.5rem;
}

.at-article-header h1 {
  font-family: 'Space Grotesk', 'Playfair Display', 'Georgia', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  color: #0f172a;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.at-article h2 {
  position: relative;
  font-family: 'Space Grotesk', 'Playfair Display', 'Georgia', serif;
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  padding-left: 0.75rem;
  margin: 2.5rem 0 1rem;
  color: #0f172a;
}

.at-article h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 4px;
  height: calc(100% - 0.5rem);
  background: #f59e0b;
  border-radius: 999px;
}

.at-article h3 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.75rem;
  color: #1e3a8a;
}

.at-article h4 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
  color: #1e293b;
}

.at-article h5 {
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
  color: #1e3a8a;
}

.at-article p {
  color: var(--at-inner-muted);
  margin-bottom: 1rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

.at-article a {
  text-decoration: underline;
  text-decoration-color: #f59e0b;
  text-underline-offset: 3px;
}

.at-article ul,
.at-article ol {
  margin: 0 0 1.25rem 1.25rem;
  color: var(--at-inner-muted);
}

.at-article li {
  margin-bottom: 0.5rem;
}

.at-info-box {
  margin: 2rem 0;
  padding: 1.5rem;
  border-radius: 0.9rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

.at-info-box h3 {
  margin-top: 0;
  color: #1e3a8a;
}

.at-info-note {
  margin: 0;
  font-size: 0.95rem;
  color: var(--at-inner-muted);
}

.at-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.at-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.at-table th,
.at-table td {
  padding: 0.75rem;
  border: 1px solid var(--at-inner-border);
  text-align: left;
}

.at-table th {
  background: #e2e8f0;
}

.at-table .at-table-center {
  text-align: center;
}

.at-table .at-table-muted {
  background: var(--at-inner-soft);
  font-weight: 600;
}

/* Comments */
.at-comments-section {
  max-width: 960px;
  margin: 2.5rem auto 3rem;
  padding: 2rem 1.5rem;
  background: var(--at-inner-soft);
  border-radius: var(--at-inner-radius);
  border: 1px solid var(--at-inner-border);
}

.at-comments-section h3 {
  font-size: 1.5rem;
  color: #0f172a;
  margin-bottom: 1rem;
}

.at-comment-form {
  background: white;
  border-radius: 0.9rem;
  padding: 1.5rem;
  border: 1px solid var(--at-inner-border);
  margin-bottom: 2rem;
}

.at-form-group {
  margin-bottom: 1.25rem;
}

.at-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #1e293b;
}

.at-form-group input,
.at-form-group textarea {
  width: 90%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #cbd5e1;
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.at-form-group input:focus,
.at-form-group textarea:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.2);
}

.at-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.at-radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #1e293b;
}

.at-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.at-btn-primary {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: white;
  box-shadow: 0 12px 20px rgba(30, 64, 175, 0.25);
}

.at-btn-primary:hover {
  transform: translateY(-1px);
}

.at-comments-list {
  display: grid;
  gap: 1rem;
}

.at-comment {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 0.9rem;
  background: white;
  border: 1px solid var(--at-inner-border);
}

.at-comment-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}

.at-comment-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.at-comment-author {
  font-weight: 700;
  color: #0f172a;
}

.at-comment-date {
  font-size: 0.875rem;
  color: #64748b;
}

.at-comment-text {
  margin: 0;
  color: #475569;
}

/* Footer */
.at-footer {
  margin-top: 3rem;
  background: #0f172a;
  color: #cbd5f5;
}

.at-footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.at-footer h4 {
  color: #f8fafc;
  margin-bottom: 0.75rem;
}

.at-footer a {
  color: #fbbf24;
}

.at-footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  text-align: center;
  padding: 1.25rem;
  color: #94a3b8;
}

@media (max-width: 768px) {
  .at-article {
    padding: 2.5rem 1.25rem 2rem;
  }

  .at-comment {
    grid-template-columns: 1fr;
  }
}
