/* 
 * Theme Name: LaComics Pro
 * File: main.css
 * Description: Foundation styles, variables, reset, typography, and layout.
 */

:root {
  /* Light theme (default) */
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-elevated: #f0f0f2;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.08);
  --download: #ff9500;
  --download-hover: #e68000;
  --download-gradient: linear-gradient(180deg, #ff9800 0%, #ee7d00 100%);
  --download-gradient-hover: linear-gradient(180deg, #f28a00 0%, #dc6e00 100%);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --header-height: 60px;
  --mobile-nav-height: 58px;
  --max-width: 1400px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-primary: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg-primary: #000000;
  --bg-secondary: #161618;
  --bg-card: #1c1c1e;
  --bg-card-hover: #242426;
  --bg-elevated: #2c2c2e;
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-muted: #6e6e73;
  --accent: #2997ff;
  --accent-hover: #47a3ff;
  --accent-soft: rgba(41, 151, 255, 0.15);
  --download: #ff9500;
  --download-hover: #e68000;
  --download-gradient: linear-gradient(180deg, #ff9800 0%, #ee7d00 100%);
  --download-gradient-hover: linear-gradient(180deg, #f28a00 0%, #dc6e00 100%);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-primary);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

ul, ol {
  list-style: none;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1 { font-size: 2rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.125rem; font-weight: 600; }
h5 { font-size: 1rem; font-weight: 600; }
h6 { font-size: 0.875rem; font-weight: 600; }

/* ==========================================================================
   Layout Utilities
   ========================================================================== */
.lc-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.lc-section {
  padding: 40px 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.lc-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

/* ==========================================================================
   Header (.lc-header)
   ========================================================================== */
.lc-header {
  position: relative;
  z-index: 100;
  height: var(--header-height);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.lc-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  gap: 24px;
}

.lc-header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 20px;
}

.lc-header__logo img {
  max-height: 40px;
}

/* Brand Logo (.lc-logo-brand) - Rebuilt from previous theme */
.lc-logo-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  user-select: none;
}

.lc-logo-brand__badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.1;
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.28);
  text-transform: lowercase;
}

.lc-logo-brand__tld {
  color: #ffffff;
  font-weight: 800;
}

.lc-header__nav {
  display: flex;
  align-items: center;
}

.lc-nav__list {
  display: flex;
  gap: 24px;
}

.lc-nav__link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 20px 0;
  position: relative;
}

.lc-nav__link:hover {
  color: var(--accent);
}

.lc-nav__link--active {
  color: var(--accent);
}

.lc-nav__link--active::after {
  content: '';
  position: absolute;
  bottom: -1px; /* Align with header border */
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent);
}

.lc-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.lc-header__actions > * {
  flex-shrink: 0;
}

.lc-header__btn,
.lc-header__sponsor-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.lc-header__btn svg,
.lc-header__sponsor-btn svg {
  fill: var(--accent);
  width: 13px;
  height: 13px;
  transition: fill 0.2s ease;
  flex-shrink: 0;
}

.lc-header__btn:hover,
.lc-header__sponsor-btn:hover {
  background-color: var(--bg-card);
  border-color: var(--accent);
  color: var(--accent);
}

.lc-header__btn:active,
.lc-header__sponsor-btn:active {
  transform: scale(0.97);
}

.lc-header__icon-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all var(--transition);
}

.lc-header__icon-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--accent);
}

.lc-header__icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.lc-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
}

.lc-mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-card);
  z-index: 999;
  overflow-y: auto;
  padding: 20px;
}

.lc-mobile-menu.lc-mobile-menu--open {
  display: block;
}

.lc-mobile-menu__sponsor {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.lc-header__btn--mobile,
.lc-header__sponsor-btn--mobile {
  display: flex !important;
  justify-content: center;
  width: 100%;
  height: 40px;
  padding: 10px 16px;
  font-size: 0.88rem;
}

/* ==========================================================================
   Footer (.lc-footer)
   ========================================================================== */
.lc-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: 36px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.lc-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
}

.lc-footer__title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.lc-footer__popular-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.lc-footer__popular-grid .lc-card {
  padding: 8px;
  border-radius: 12px;
}

.lc-footer__popular-grid .lc-card__cover {
  border-radius: 8px;
}

.lc-footer__popular-grid .lc-card__title {
  font-size: 0.84rem;
  min-height: 2.5em;
  margin-bottom: 6px;
}

.lc-footer__popular-grid .lc-card__meta {
  font-size: 0.68rem;
  gap: 4px;
}

/* Footer About & Legal Information Block */
.lc-footer__about {
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
  padding: 0;
}

.lc-footer__about--compact {
  padding: 0;
}

.lc-footer__about-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.lc-footer__about-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.lc-footer__about-text strong {
  color: var(--text-primary);
  font-weight: 700;
}

.lc-footer__disclaimer {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.lc-footer__links-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.lc-footer__social-group,
.lc-footer__nav-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.lc-footer__group-label {
  color: var(--text-muted);
}

.lc-footer__link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease, filter 0.2s ease, color 0.2s ease;
}

.lc-footer__link:hover {
  filter: brightness(1.15);
  text-decoration: none;
  color: var(--accent-hover);
}

.lc-footer__sep {
  color: var(--border-strong);
  font-size: 0.7rem;
}

.lc-footer__bottom {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.lc-footer__left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lc-footer__copyright {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.lc-footer__stats {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity var(--transition);
}

.lc-footer__stats:hover {
  opacity: 1;
}

.lc-footer__stats img {
  display: block;
}

.lc-footer__right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  padding-right: 54px;
}

.lc-footer__link--discord {
  color: var(--accent);
  font-weight: 600;
}

.lc-footer__discord {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}

.lc-footer__discord:hover {
  color: #5865f2;
}

.lc-back-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 900;
  border: none;
  box-shadow: var(--shadow-md);
}

.lc-back-top svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.lc-back-top--visible {
  opacity: 1;
  visibility: visible;
}

.lc-back-top:hover {
  background-color: var(--accent-hover);
}
