/*
Theme Name: InfoAina
Theme URI: https://infoaina.com
Author: InfoAina
Description: Custom editorial theme for InfoAina, built around an interactive glowing tile hero.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: infoaina
*/

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background: transparent;
  color: var(--text);
  transition: color 0.3s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: 'Fraunces', Georgia, serif; margin: 0 0 0.4em; line-height: 1.15; font-weight: 600; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }

/* ---------- Design tokens ---------- */
@property --k {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

:root {
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  --bg-dark: #05070a;
  --panel-dark: #12151a;
  --text-dark: #e7ebf0;
  --text-dark-soft: #9aa4b2;
  --border-dark: rgba(255, 255, 255, 0.09);
  --tile-dark-a: #343b45;
  --tile-dark-b: #0f1114;
  --step1-dark: #0e1115;
  --step2-dark: #090b0e;
  --step3-dark: #050608;
  --step4-dark: #020304;
  --shadow-alpha-dark: 0.68;
  --glow-dark: #2f8fff;
  --glow-dark-soft: rgba(47, 143, 255, 0.6);
  --glow-dark-ambient: rgba(47, 143, 255, 0.42);

  --bg-light: #eef1f6;
  --panel-light: #ffffff;
  --text-light: #1b2027;
  --text-light-soft: #5b6572;
  --border-light: rgba(20, 25, 35, 0.09);
  --tile-light-a: #ffffff;
  --tile-light-b: #dde3ec;
  --step1-light: #c9d0da;
  --step2-light: #b6bdc8;
  --step3-light: #a3abb7;
  --step4-light: #929aa6;
  --shadow-alpha-light: 0.24;
  --glow-light: #cd9a3a;
  --glow-light-soft: rgba(205, 154, 58, 0.42);
  --glow-light-ambient: rgba(205, 154, 58, 0);
}

body[data-theme="dark"] {
  --bg: var(--bg-dark); --panel: var(--panel-dark);
  --bg-rgb: 5, 7, 10; --panel-rgb: 18, 21, 26;
  --text: var(--text-dark); --text-soft: var(--text-dark-soft); --border: var(--border-dark);
  --tile-a: var(--tile-dark-a); --tile-b: var(--tile-dark-b);
  --step1: var(--step1-dark); --step2: var(--step2-dark); --step3: var(--step3-dark); --step4: var(--step4-dark);
  --shadow-alpha: var(--shadow-alpha-dark);
  --glow: var(--glow-dark); --glow-soft: var(--glow-dark-soft); --glow-ambient: var(--glow-dark-ambient);
}
body[data-theme="light"] {
  --bg: var(--bg-light); --panel: var(--panel-light);
  --bg-rgb: 238, 241, 246; --panel-rgb: 255, 255, 255;
  --text: var(--text-light); --text-soft: var(--text-light-soft); --border: var(--border-light);
  --tile-a: var(--tile-light-a); --tile-b: var(--tile-light-b);
  --step1: var(--step1-light); --step2: var(--step2-light); --step3: var(--step3-light); --step4: var(--step4-light);
  --shadow-alpha: var(--shadow-alpha-light);
  --glow: var(--glow-light); --glow-soft: var(--glow-light-soft); --glow-ambient: var(--glow-light-ambient);
}

/* ---------- Full-page live tile background ---------- */
.bg-tile-grid {
  position: fixed;
  inset: 0;
  display: grid;
  gap: 10px;
  padding: 10px;
  background: var(--bg);
  overflow: hidden;
}

/* ---------- Hero ---------- */
.hero { position: relative; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  background: linear-gradient(
    180deg,
    rgba(var(--bg-rgb), 0.92) 0%,
    rgba(var(--bg-rgb), 0.55) 60%,
    rgba(var(--bg-rgb), 0) 100%
  );
  pointer-events: none;
}
.hero-topbar, .hero-copy { position: relative; }
.hero-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 24px;
}
.site-brand-text {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.site-brand img { max-height: 36px; width: auto; }

.nav-menu { display: flex; gap: 28px; flex-wrap: wrap; }
.nav-menu a {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-soft);
  transition: color 0.2s ease;
}
.nav-menu a:hover, .nav-menu a:focus-visible { color: var(--glow); }

.theme-toggle {
  flex-shrink: 0;
  width: 40px; height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  position: relative;
  cursor: pointer;
  padding: 0;
}
.theme-toggle-dot {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--glow);
  transition: transform 0.25s ease, background 0.25s ease;
}
body[data-theme="light"] .theme-toggle-dot { transform: translateX(16px); }

.hero-copy { max-width: 1100px; margin: 0 auto; padding: 0 24px 32px; }
.hero-title { font-size: clamp(2.2rem, 5vw, 3.4rem); color: var(--text); }
.hero-tagline { font-family: var(--mono); font-size: 14px; color: var(--text-soft); margin-top: 10px; }

.tile {
  --k: 0.05;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--tile-a), var(--tile-b));
  box-shadow:
    0 1px 0 var(--step1),
    0 2px 0 var(--step2),
    0 3px 0 var(--step3),
    0 4px 0 var(--step4),
    0 calc(7px + var(--k) * 5px) calc(12px + var(--k) * 10px) rgba(0, 0, 0, var(--shadow-alpha)),
    0 0 7px 1px var(--glow-ambient),
    0 0 calc(var(--k) * 30px) calc(var(--k) * 9px) var(--glow-soft),
    inset 0 2px 0 rgba(255, 255, 255, calc(0.16 + var(--k) * 0.2)),
    inset 0 -3px 4px rgba(0, 0, 0, 0.34);
  filter: brightness(calc(1 + var(--k) * 0.4));
  transform: translateY(calc(var(--k) * -7px)) scale(calc(1 + var(--k) * 0.11));
  transition: background 0.3s ease;
  animation: tile-wave 6.4s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

/* The surge: --k rises and falls on every tile, but each tile's delay is set
   in JS from its straight-line distance to the starting corner. That makes
   the glow originate at one corner, spread outward as an expanding arc, and
   finish at the opposite corner — then recede back, on a continuous loop. */
@keyframes tile-wave {
  0%, 100% { --k: 0.04; }
  50% { --k: 0.62; }
}

@media (prefers-reduced-motion: reduce) {
  .tile { animation: none; --k: 0.14; }
}

/* ---------- Content shell ---------- */
.site-main {
  position: relative;
  max-width: 1100px;
  margin: 24px auto 32px;
  padding: 56px 24px 100px;
  background: var(--panel);
  background: rgba(var(--panel-rgb), 0.26);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, var(--shadow-alpha));
}

.post-eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--glow);
}

/* Homepage: featured + list feed */
.post-featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.post-featured img { border-radius: 14px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.post-featured h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-top: 10px; }
.post-featured > .post-featured-body:only-child { grid-column: 1 / -1; }
.post-excerpt { color: var(--text-soft); margin-top: 14px; }
.post-meta { font-family: var(--mono); font-size: 12px; color: var(--text-soft); margin-top: 16px; display: flex; gap: 16px; }

.post-list-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.post-list-item img { border-radius: 10px; aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }
.post-list-item > div:only-child { grid-column: 1 / -1; }
.post-list-item h3 { font-size: 1.3rem; transition: color 0.2s ease; }
.post-list-item:hover h3 { color: var(--glow); }

.pagination { display: flex; justify-content: center; gap: 12px; margin-top: 48px; font-family: var(--mono); font-size: 13px; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-soft); }
.pagination .current { color: var(--glow); border-color: var(--glow); }

.archive-header { margin-bottom: 32px; }
.archive-title { font-size: clamp(1.6rem, 3vw, 2.2rem); }

/* Single article */
.single-article { max-width: 700px; margin: 0 auto; }
.single-article h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-top: 14px; }
.single-article .featured-media { margin: 24px 0 32px; border-radius: 14px; overflow: hidden; }
.single-article .featured-media img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }

.entry-content { font-size: 1.05rem; }
.entry-content p { margin: 0 0 1.4em; }
.entry-content h2 { margin-top: 1.6em; font-size: 1.5rem; }
.entry-content h3 { margin-top: 1.4em; font-size: 1.25rem; }
.entry-content blockquote {
  border-left: 3px solid var(--glow);
  margin: 1.6em 0;
  padding: 0.2em 0 0.2em 1.4em;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text-soft);
}
.entry-content a { color: var(--glow); text-decoration: underline; text-underline-offset: 2px; }
.entry-content img { border-radius: 10px; margin: 1.6em 0; }
.page-links { font-family: var(--mono); font-size: 13px; margin-top: 24px; }

/* Static pages */
.page-content { max-width: 700px; margin: 0 auto; }
.page-content h1 { font-size: clamp(2rem, 4vw, 2.6rem); }

/* Comments (baseline styling over WP defaults) */
.comments-wrap { max-width: 700px; margin: 56px auto 0; padding-top: 40px; border-top: 1px solid var(--border); }
.comments-wrap input[type="text"], .comments-wrap input[type="email"], .comments-wrap input[type="url"], .comments-wrap textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-family: inherit; margin-bottom: 12px;
}
.comments-wrap .submit {
  background: var(--glow); color: #fff; border: none; padding: 10px 20px;
  border-radius: 8px; cursor: pointer; font-family: var(--mono); font-size: 13px;
}

/* Footer */
.site-footer {
  position: relative;
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  background: var(--panel);
  background: rgba(var(--panel-rgb), 0.2);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-copy { font-family: var(--mono); font-size: 12px; color: var(--text-soft); }
.site-footer .nav-menu { gap: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .post-featured { grid-template-columns: 1fr; }
  .post-list-item { grid-template-columns: 1fr; }
  .hero-topbar { flex-wrap: wrap; row-gap: 14px; }
}
