/* Myevoutia - Professional Web Design Platform (WordPress)
   Mobile-first, lightweight, Core Web Vitals optimized */

:root {
  --color-primary: #0f172a;
  --color-primary-light: #1e293b;
  --color-accent: #0ea5e9;
  --color-accent-hover: #0284c7;
  --color-text: #334155;
  --color-text-light: #64748b;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-border: #e2e8f0;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  --max-width: 1200px;
  --header-height: 64px;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-slow: 520ms;
  --duration-reveal: 700ms;
}

*, *::before, *::after { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 var(--space-md); font-weight: 600; line-height: 1.25; color: var(--color-primary); }
h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.375rem, 3vw, 1.75rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 var(--space-md); }
ul, ol { margin: 0 0 var(--space-md); padding-left: 1.25rem; }

.skip-link { position: absolute; top: -100%; left: var(--space-md); z-index: 100; padding: var(--space-sm) var(--space-md); background: var(--color-primary); color: white; border-radius: var(--radius); transition: top 0.2s; }
.skip-link:focus { top: var(--space-md); }

/* Scroll animation keyframes (match template) */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes revealMask {
  from { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateY(16px); }
  to { opacity: 1; clip-path: inset(0 0 0 0); transform: translateY(0); }
}
@keyframes titleUnderline {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: var(--color-bg); border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow); }
body { padding-top: var(--header-height); }

/* When logged in: place theme header below WordPress admin bar */
body.admin-bar .site-header {
  top: 32px;
}
body.admin-bar {
  padding-top: calc(var(--header-height) + 32px);
}
@media screen and (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
  body.admin-bar {
    padding-top: calc(var(--header-height) + 46px);
  }
}
.header-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-md); min-height: var(--header-height); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-lg); }
.site-logo { font-size: 1.25rem; font-weight: 700; color: var(--color-primary); display: flex; align-items: center; gap: var(--space-sm); }
.site-logo:hover { color: var(--color-accent); text-decoration: none; }
.site-logo svg { width: 28px; height: 28px; flex-shrink: 0; }

.nav-toggle { display: none; }
.main-nav { padding: var(--space-md) 0; }
.main-nav ul { list-style: none; padding: 0; margin: 0; }
.main-nav li { margin: 0; border-bottom: 1px solid var(--color-border); }
.main-nav a { display: block; padding: var(--space-md); color: var(--color-text); font-weight: 500; }
.main-nav a:hover { background: var(--color-bg-alt); color: var(--color-accent); text-decoration: none; }
.nav-dropdown { padding-left: var(--space-lg); }
.nav-dropdown a { font-size: 0.9375rem; font-weight: 400; }
@media (min-width: 768px) {
  .main-nav { position: static; max-width: none; padding: 0; border: none; transform: none; background: transparent; }
  .main-nav ul { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; }
  .main-nav li { border: none; }
  .main-nav a { padding: var(--space-sm) var(--space-md); border-radius: var(--radius); }
  .nav-dropdown { position: absolute; left: 0; top: 100%; min-width: 200px; padding: var(--space-sm); background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 0.2s, transform 0.2s, visibility 0.2s; }
  .nav-item-dropdown { position: relative; }
  .nav-item-dropdown:hover .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav-dropdown a { padding: var(--space-sm) var(--space-md); }
}

.main-content { min-height: calc(100vh - var(--header-height) - 200px); }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-md); }
.section { padding: var(--space-2xl) 0; }
.section.is-visible > h2 {
  animation: fadeInUp var(--duration-slow) var(--ease-out-expo) both;
}
.section > h2:not(.visually-hidden) {
  position: relative;
  display: inline-block;
  padding-bottom: var(--space-sm);
}
.section > h2:not(.visually-hidden)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), #38bdf8);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
}
.section.is-visible > h2:not(.visually-hidden)::after {
  animation: titleUnderline var(--duration-reveal) var(--ease-out-expo) 0.2s both;
}
.section-alt { background: var(--color-bg-alt); }

.hero { padding: 0; text-align: center; position: relative; }
.hero-image { width: 100%; max-height: 360px; object-fit: cover; display: block; background: var(--color-primary); }
.hero-content { padding: var(--space-2xl) var(--space-md); }
.hero h1 { margin-bottom: var(--space-md); }
.hero p { font-size: 1.125rem; color: var(--color-text-light); max-width: 600px; margin-left: auto; margin-right: auto; }

.card-img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: var(--color-bg-alt); }
.card-img-top { margin-bottom: 0; }

.ad-slot { background: var(--color-bg-alt); border: 1px dashed var(--color-border); border-radius: var(--radius); min-height: 90px; display: flex; align-items: center; justify-content: center; color: var(--color-text-light); font-size: 0.875rem; margin: var(--space-lg) 0; }
.ad-slot-leaderboard { min-height: 90px; max-width: 728px; margin-left: auto; margin-right: auto; }
.ad-slot-rectangle { min-height: 250px; max-width: 300px; margin-left: auto; margin-right: auto; }

.cards-grid { display: grid; gap: var(--space-lg); grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }

.card { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow 0.2s, transform 0.2s; }
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.card a { text-decoration: none; color: inherit; }
.card a:hover { text-decoration: none; }
.card-body { padding: var(--space-lg); }
/* Scroll-reveal: cards animate in when .cards-grid gets .is-visible (JS) */
.cards-grid .card {
  opacity: 0;
  transform: translateY(24px);
  animation: none;
}
.cards-grid.is-visible .card {
  animation: revealMask var(--duration-reveal) var(--ease-out-expo) both;
}
.cards-grid.is-visible .card:nth-child(1) { animation-delay: 0.05s; }
.cards-grid.is-visible .card:nth-child(2) { animation-delay: 0.12s; }
.cards-grid.is-visible .card:nth-child(3) { animation-delay: 0.19s; }
.cards-grid.is-visible .card:nth-child(4) { animation-delay: 0.26s; }
.cards-grid.is-visible .card:nth-child(5) { animation-delay: 0.33s; }
.cards-grid.is-visible .card:nth-child(6) { animation-delay: 0.4s; }
.cards-grid.is-visible .card:nth-child(n+7) { animation-delay: 0.47s; }
.card-title { margin-bottom: var(--space-sm); font-size: 1.125rem; }
.card-meta { font-size: 0.875rem; color: var(--color-text-light); margin-bottom: var(--space-sm); }
.card-excerpt { font-size: 0.9375rem; color: var(--color-text-light); margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: var(--space-sm) var(--space-lg); font-size: 1rem; font-weight: 500; border-radius: var(--radius); border: none; cursor: pointer; transition: background 0.2s, color 0.2s; text-decoration: none; }
.btn-primary { background: var(--color-accent); color: white; }
.btn-primary:hover { background: var(--color-accent-hover); color: white; text-decoration: none; }
.btn-outline { background: transparent; color: var(--color-accent); border: 2px solid var(--color-accent); }
.btn-outline:hover { background: var(--color-accent); color: white; text-decoration: none; }
.btn-download { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); font-size: 1rem; font-weight: 600; background: var(--color-accent); color: white; border: none; border-radius: var(--radius); cursor: pointer; text-decoration: none; transition: background 0.2s, transform 0.15s; box-shadow: var(--shadow); }
.btn-download:hover { background: var(--color-accent-hover); color: white; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-download svg { width: 20px; height: 20px; flex-shrink: 0; }

.breadcrumb { padding: var(--space-md) 0; font-size: 0.875rem; color: var(--color-text-light); }
.breadcrumb a { color: var(--color-text-light); }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb span { margin: 0 var(--space-xs); }

.site-footer { background: var(--color-primary); color: #94a3b8; padding: var(--space-2xl) 0 var(--space-lg); margin-top: var(--space-2xl); }
.footer-grid { display: grid; gap: var(--space-xl); grid-template-columns: 1fr; margin-bottom: var(--space-xl); }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-col h4 { color: #f1f5f9; font-size: 1rem; margin-bottom: var(--space-md); }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: var(--space-sm); }
.footer-col a { color: #94a3b8; }
.footer-col a:hover { color: white; text-decoration: none; }
.footer-bottom { padding-top: var(--space-lg); border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.875rem; text-align: center; }

.page-title { padding: var(--space-xl) 0 var(--space-md); border-bottom: 1px solid var(--color-border); margin-bottom: var(--space-xl); }
.page-title h1 { margin-bottom: var(--space-sm); }

.form-group { margin-bottom: var(--space-lg); }
.form-group label { display: block; font-weight: 500; margin-bottom: var(--space-sm); }
.form-group input, .form-group textarea { width: 100%; max-width: 100%; padding: var(--space-sm) var(--space-md); font-size: 1rem; font-family: inherit; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg); }
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15); }

.text-center { text-align: center; }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
code { font-family: var(--font-mono); font-size: 0.9em; padding: var(--space-xs) var(--space-sm); background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: 4px; }
.download-card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-md); }

/* Scroll progress bar (above WP admin bar when logged in) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), #38bdf8);
  z-index: 999999;
  transition: width 80ms linear;
  transform-origin: left;
}
@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
}
body.admin-bar .scroll-progress {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .scroll-progress {
    top: 46px;
  }
}
.site-header {
  transition: box-shadow 0.36s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}
.download-card .btn { margin-top: auto; }
