/* Anaedo Social Club — front-end styles
 * Tailwind-inspired tokens layered on top of theme.json variables.
 * Includes dark mode, intro overlay, mobile-first responsive helpers
 * and WCAG 2.1 focus / motion / contrast accommodations.
 */

:root {
  --asc-blue: var(--wp--preset--color--primary, #1e3a8a);
  --asc-blue-deep: var(--wp--preset--color--contrast, #0a1733);
  --asc-wine: var(--wp--preset--color--secondary, #722f37);
  --asc-wine-bright: var(--wp--preset--color--secondary-2, #9b2c3a);
  --asc-gold: var(--wp--preset--color--accent, #c9a14a);
  --asc-ivory: var(--wp--preset--color--base, #fcfbf8);
  --asc-cream: var(--wp--preset--color--base-2, #f3eee5);
  --asc-border: var(--wp--preset--color--border, #e5e0d4);
  --asc-radius: 14px;
  --asc-shadow-sm: 0 1px 2px rgba(10, 23, 51, 0.06), 0 1px 3px rgba(10, 23, 51, 0.08);
  --asc-shadow-md: 0 8px 20px -8px rgba(10, 23, 51, 0.25);
  --asc-shadow-lg: 0 30px 60px -20px rgba(10, 23, 51, 0.35);
}

/* ----- Reset niceties ----- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, video { max-width: 100%; height: auto; }

/* ----- Accessibility ----- */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); -webkit-clip-path: inset(50%); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}
.skip-link:focus {
  position: absolute; top: 12px; left: 12px; z-index: 100000;
  background: var(--asc-blue-deep); color: var(--asc-ivory);
  padding: .75rem 1rem; border-radius: 8px; clip: auto; clip-path: none; width: auto; height: auto;
  outline: 2px solid var(--asc-gold); outline-offset: 2px;
}
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--asc-gold);
  outline-offset: 3px;
  border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ----- Typography utilities ----- */
.has-display-font-family { font-family: var(--wp--preset--font-family--display); }
.has-sans-font-family    { font-family: var(--wp--preset--font-family--sans); }
.asc-eyebrow {
  font-size: .8rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--asc-wine); font-weight: 600;
}

/* ----- Buttons ----- */
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent; color: var(--asc-blue-deep);
  border: 2px solid currentColor; border-radius: 9999px;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--asc-blue-deep); color: var(--asc-gold); }
.wp-block-button.is-style-ghost .wp-block-button__link {
  background: transparent; color: inherit; border-radius: 9999px; padding-left: 0; padding-right: 0;
}

/* ----- Decorative pattern strip ----- */
.asc-pattern-strip {
  height: 14px; width: 100%;
  background-image: url("../images/pattern.jpg");
  background-size: cover; background-position: center;
  opacity: .9;
}

/* ----- Cards ----- */
.asc-card {
  background: var(--asc-ivory);
  border: 1px solid var(--asc-border);
  border-radius: var(--asc-radius);
  box-shadow: var(--asc-shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}
.asc-card:hover { transform: translateY(-2px); box-shadow: var(--asc-shadow-md); }

/* ----- Header ----- */
.wp-block-site-title a { text-decoration: none; }
.asc-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(10px);
  background: color-mix(in oklab, var(--asc-ivory) 88%, transparent);
  border-bottom: 1px solid var(--asc-border);
}

/* ----- Welcome intro overlay ----- */
.anaedo-intro {
  position: fixed; inset: 0; z-index: 99999;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, #1c2b57 0%, #0a1733 70%, #050a1a 100%);
  color: var(--asc-ivory);
  overflow: hidden;
  animation: ascIntroIn .4s ease both;
}
.anaedo-intro[hidden] { display: none; }
.anaedo-intro.is-leaving { animation: ascIntroOut .8s ease forwards; }
.anaedo-intro__pattern {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: .08; mix-blend-mode: screen; filter: contrast(140%);
}
.anaedo-intro__pattern::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,23,51,0) 40%, rgba(10,23,51,.9) 100%);
}
.anaedo-intro__inner {
  position: relative; text-align: center; padding: 2rem; max-width: 720px;
}
.anaedo-intro__logo {
  width: clamp(140px, 22vw, 220px); height: auto;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,.45));
  animation: ascLogoIn 1.2s cubic-bezier(.2,.8,.2,1) both;
}
.anaedo-intro__title {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700; letter-spacing: .02em;
  font-size: clamp(2rem, 6vw, 3.75rem);
  margin: 1rem 0 .25rem;
  background: linear-gradient(120deg, #fff 0%, var(--asc-gold) 60%, #fff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: ascFadeUp 1s .4s ease both;
}
.anaedo-intro__tagline {
  font-size: clamp(.95rem, 1.4vw, 1.1rem);
  letter-spacing: .35em; text-transform: uppercase; color: rgba(255,255,255,.78);
  animation: ascFadeUp 1s .6s ease both;
}
.anaedo-intro__bar {
  display: block; width: 240px; max-width: 60vw; height: 3px; margin: 2rem auto 1.25rem;
  background: rgba(255,255,255,.15); border-radius: 999px; overflow: hidden;
}
.anaedo-intro__bar > span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--asc-wine-bright), var(--asc-gold));
  animation: ascBar 3.2s ease forwards;
}
.anaedo-intro__skip {
  margin-top: .5rem; background: transparent; color: var(--asc-gold);
  border: 1px solid rgba(201,161,74,.5); padding: .65rem 1.25rem; border-radius: 9999px;
  font: 600 .9rem/1 var(--wp--preset--font-family--sans); letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.anaedo-intro__skip:hover { background: var(--asc-gold); color: var(--asc-blue-deep); border-color: var(--asc-gold); }

@keyframes ascIntroIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes ascIntroOut { to   { opacity: 0; transform: scale(1.04); visibility: hidden; } }
@keyframes ascLogoIn   { from { opacity: 0; transform: translateY(20px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes ascFadeUp   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ascBar      { to   { width: 100%; } }

/* ----- Dark mode ----- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}
:root[data-theme="dark"] body,
:root[data-theme="dark"] .editor-styles-wrapper {
  background: #07112a; color: #ecebe6;
}
:root[data-theme="dark"] .asc-header { background: color-mix(in oklab, #07112a 85%, transparent); border-bottom-color: rgba(255,255,255,.08); }
:root[data-theme="dark"] .asc-card { background: #0f1b3a; border-color: rgba(255,255,255,.08); }
:root[data-theme="dark"] .wp-block-button.is-style-outline .wp-block-button__link { color: var(--asc-ivory); }
:root[data-theme="dark"] :where(h1,h2,h3,h4,h5,h6) { color: #f7f3e6; }

/* ----- Theme toggle button (Navigation block-friendly) ----- */
.asc-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  width: 40px; height: 40px; border-radius: 9999px;
  border: 1px solid var(--asc-border); background: transparent; color: inherit;
  cursor: pointer; transition: background .2s ease, color .2s ease, transform .2s ease;
}
.asc-theme-toggle:hover { background: var(--asc-blue-deep); color: var(--asc-gold); transform: translateY(-1px); }
.asc-theme-toggle svg { width: 18px; height: 18px; }

/* ----- Mobile tweaks ----- */
@media (max-width: 640px) {
  .wp-block-columns.asc-stack-mobile { flex-wrap: wrap !important; }
  .wp-block-columns.asc-stack-mobile > .wp-block-column { flex-basis: 100% !important; }
}

/* ----- Print ----- */
@media print {
  .anaedo-intro, .asc-header, .wp-block-template-part[data-area="footer"] { display: none !important; }
}
