/*
Theme Name: Juan P. Romano Blog
Theme URI: https://jpromano.net
Author: Juan P. Romano
Author URI: https://jpromano.net
Description: Minimal cyberpunk blog theme — navbar title, post cards, matching site footer. No sidebars, no dates.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
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: jpr-blog
*/

/* ===== TOKENS (aligned with jpromano.net) ===== */
:root,
[data-theme="dark"] {
  --void: #05080c;
  --void-soft: #071018;
  --panel: #0a1219;
  --neon: #00ff9c;
  --neon-deep: #008f5b;
  --cyan: #2de2e6;
  --text: #e8f0f5;
  --text-muted: #6b7f94;
  --border: rgba(0, 255, 156, 0.18);
  --header-bg: rgba(5, 8, 12, 0.88);
  --header-text: #e8fff4;
  --font-display: "Oxanium", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Share Tech Mono", ui-monospace, monospace;
  --max: 72rem;
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hero-glow-a: rgba(0, 255, 156, 0.12);
  --hero-glow-b: rgba(45, 226, 230, 0.08);
}

[data-theme="light"] {
  --void: #e8f4ee;
  --void-soft: #d7ebe1;
  --panel: #f2fbf6;
  --neon: #008f5b;
  --neon-deep: #006b44;
  --cyan: #0e7c80;
  --text: #06140f;
  --text-muted: #3d5a4c;
  --border: rgba(0, 120, 80, 0.22);
  --header-bg: rgba(232, 244, 238, 0.94);
  --header-text: #06140f;
  --hero-glow-a: rgba(0, 153, 90, 0.14);
  --hero-glow-b: rgba(14, 124, 128, 0.1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  background: var(--void);
  color: var(--text);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--hero-glow-a), transparent 55%),
    radial-gradient(ellipse 40% 40% at 90% 10%, var(--hero-glow-b), transparent 50%);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* ===== NAVBAR ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2.5rem, var(--max));
}

.site-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neon);
  text-shadow: 0 0 18px rgba(0, 255, 156, 0.35);
}

[data-theme="light"] .site-title {
  text-shadow: none;
}

.site-title a {
  color: inherit;
}

.site-title a:hover,
.site-title a:focus-visible {
  color: var(--cyan);
}

.theme-toggle {
  position: relative;
  width: 2.6rem;
  height: 2.6rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--header-text);
  cursor: pointer;
  display: grid;
  place-items: center;
  clip-path: polygon(18% 0, 100% 0, 100% 82%, 82% 100%, 0 100%, 0 18%);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.theme-toggle:hover {
  border-color: var(--neon);
  color: var(--neon);
  box-shadow: 0 0 16px rgba(0, 255, 156, 0.25);
}

.theme-toggle__icon {
  position: absolute;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

[data-theme="light"] .theme-toggle__icon--sun {
  opacity: 0;
  transform: rotate(-40deg) scale(0.7);
}

[data-theme="light"] .theme-toggle__icon--moon {
  opacity: 1;
  transform: none;
}

[data-theme="dark"] .theme-toggle__icon--sun,
html:not([data-theme="light"]) .theme-toggle__icon--sun {
  opacity: 1;
  transform: none;
}

[data-theme="dark"] .theme-toggle__icon--moon,
html:not([data-theme="light"]) .theme-toggle__icon--moon {
  opacity: 0;
  transform: rotate(40deg) scale(0.7);
}

/* ===== MAIN / CARDS ===== */
.site-main {
  flex: 1;
  padding: 2.75rem 0 4rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.35rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.post-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  height: 100%;
}

.post-card:hover,
.post-card:focus-within {
  border-color: rgba(0, 255, 156, 0.45);
  box-shadow: 0 0 24px rgba(0, 255, 156, 0.15);
  transform: translateY(-3px);
}

.post-card__media {
  aspect-ratio: 16 / 10;
  background: var(--void-soft);
  overflow: hidden;
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.post-card:hover .post-card__media img {
  transform: scale(1.05);
}

.post-card__body {
  padding: 1.15rem 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.post-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.post-card:hover .post-card__title {
  color: var(--neon);
}

.post-card__excerpt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.post-card__cta {
  margin-top: auto;
  padding-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.post-card:hover .post-card__cta,
.post-card:focus-within .post-card__cta {
  opacity: 1;
}

.no-posts {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Single post */
.single-post {
  max-width: 46rem;
  margin: 0 auto;
}

.single-post__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--neon);
  margin: 0 0 1.5rem;
  line-height: 1.15;
}

.single-post__content {
  line-height: 1.7;
  color: var(--text);
}

.single-post__content a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--neon);
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-blink {
  color: var(--neon);
  animation: blink 1.1s steps(1) infinite;
}

.footer-social {
  display: flex;
  gap: 0.7rem;
}

.social-link {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  clip-path: polygon(18% 0, 100% 0, 100% 82%, 82% 100%, 0 100%, 0 18%);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.social-link:hover {
  border-color: var(--neon);
  color: #03140c;
  background: var(--neon);
  box-shadow: 0 0 20px rgba(0, 255, 156, 0.4);
}

[data-theme="light"] .social-link:hover {
  color: #fff;
}

.footer-copy {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.footer-heart {
  color: #ff2d7a;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
}

::selection {
  background: rgba(0, 255, 156, 0.3);
  color: inherit;
}
