/*
Theme Name:   RetroPup — Kadence Child
Theme URI:    https://youtube.com/@itsretropup
Description:  Kadence child theme for RetroPup — retro gaming guides & reviews.
Author:       RetroPup
Template:     kadence
Version:      1.0.0
Text Domain:  retropup-kadence-child
*/

/* ============================================================================
   DESIGN TOKENS
   ============================================================================ */
:root {
  /* Brand palette */
  --rp-purple-deep:   #3B1F5C;
  --rp-purple:        #7B3FA0;
  --rp-pink:          #E85A8A;
  --rp-orange:        #C8651F;
  --rp-lime:          #A8D85A;
  --rp-cream:         #F5EDE0;
  --rp-charcoal:      #1A1525;

  /* Semantic aliases */
  --rp-bg:            var(--rp-cream);
  --rp-text:          var(--rp-charcoal);
  --rp-heading:       var(--rp-purple-deep);
  --rp-link:          var(--rp-purple);
  --rp-link-hover:    var(--rp-pink);
  --rp-btn-bg:        var(--rp-pink);
  --rp-btn-text:      #ffffff;
  --rp-btn-hover-bg:  var(--rp-purple);
  --rp-accent:        var(--rp-orange);
  --rp-tag-bg:        var(--rp-lime);
  --rp-tag-text:      var(--rp-charcoal);
  --rp-card-border:   var(--rp-purple);
  --rp-header-bg:     var(--rp-purple-deep);
  --rp-header-text:   #ffffff;
  --rp-footer-bg:     var(--rp-charcoal);
  --rp-footer-text:   var(--rp-cream);

  /* Typography */
  --rp-font-pixel:    'Press Start 2P', 'VT323', monospace;
  --rp-font-body:     'Inter', 'Manrope', system-ui, sans-serif;
  --rp-font-mono:     'JetBrains Mono', 'Fira Code', monospace;
  --rp-font-size:     17px;
  --rp-line-height:   1.75;

  /* Spacing & shape */
  --rp-radius:        4px;   /* slightly square — retro feel */
  --rp-card-shadow:   2px 2px 0 var(--rp-purple);
}

/* ============================================================================
   GLOBAL RESETS & BASE
   ============================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: var(--rp-font-size);
  scroll-behavior: smooth;
}

body {
  font-family: var(--rp-font-body);
  font-size: 1rem;
  line-height: var(--rp-line-height);
  color: var(--rp-text);
  background-color: var(--rp-bg);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

/* Pixel font for display headings only */
h1, h2,
.site-title,
.wp-block-post-title,
.entry-title,
.hero-title {
  font-family: var(--rp-font-pixel);
  color: var(--rp-heading);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Keep h3–h6 in body font for readability */
h3, h4, h5, h6 {
  font-family: var(--rp-font-body);
  font-weight: 700;
  color: var(--rp-heading);
}

/* Scale headings down when using Press Start 2P — it renders large */
h1 { font-size: clamp(1.1rem, 3vw, 1.6rem); }
h2 { font-size: clamp(0.9rem, 2.2vw, 1.2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

a {
  color: var(--rp-link);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover,
a:focus {
  color: var(--rp-link-hover);
  text-decoration-color: var(--rp-link-hover);
}

/* ============================================================================
   HEADER
   ============================================================================ */
.site-header,
#masthead,
header.wp-block-template-part {
  background-color: var(--rp-header-bg) !important;
  border-bottom: 2px solid var(--rp-purple);
  color: var(--rp-header-text);
}

/* Nav links */
.site-header a,
#masthead a,
.main-navigation a {
  color: var(--rp-header-text) !important;
}

.site-header a:hover,
#masthead a:hover,
.main-navigation a:hover,
.main-navigation a:focus {
  color: var(--rp-pink) !important;
}

/* Kadence header top bar (if enabled) */
.kadence-top-header-wrap {
  background-color: var(--rp-purple-deep) !important;
}

/* Logo sizing */
.site-branding img,
.kadence-site-branding img,
.wp-custom-logo img {
  max-height: 60px;
  width: auto;
}

/* ============================================================================
   NAVIGATION
   ============================================================================ */
.main-navigation ul {
  gap: 0.25rem;
}

.main-navigation ul li a {
  font-family: var(--rp-font-body);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  border-radius: var(--rp-radius);
  transition: background 0.15s ease, color 0.15s ease;
}

.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a {
  background-color: var(--rp-pink) !important;
  color: #fff !important;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.wp-block-button__link,
.btn,
button:not(.search-submit):not(.menu-toggle),
input[type="submit"] {
  font-family: var(--rp-font-body) !important;
  font-weight: 700 !important;
  background-color: var(--rp-btn-bg) !important;
  color: var(--rp-btn-text) !important;
  border: 2px solid transparent !important;
  border-radius: var(--rp-radius) !important;
  padding: 0.6rem 1.4rem !important;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease !important;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--rp-purple-deep);
}

.wp-block-button__link:hover,
.btn:hover,
button:not(.search-submit):not(.menu-toggle):hover,
input[type="submit"]:hover {
  background-color: var(--rp-btn-hover-bg) !important;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--rp-purple-deep) !important;
}

.wp-block-button__link:active,
button:not(.search-submit):not(.menu-toggle):active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--rp-purple-deep) !important;
}

/* Secondary / outline button variant */
.wp-block-button.is-style-outline .wp-block-button__link {
  background-color: transparent !important;
  color: var(--rp-pink) !important;
  border-color: var(--rp-pink) !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background-color: var(--rp-pink) !important;
  color: #fff !important;
}

/* ============================================================================
   CARDS (post grid items)
   ============================================================================ */
.entry-card,
.wp-block-post,
article.type-post,
.kadence-post-grid article,
.kb-post-grid-item {
  background: #fff;
  border: 2px solid var(--rp-card-border);
  border-radius: var(--rp-radius);
  box-shadow: var(--rp-card-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.entry-card:hover,
.wp-block-post:hover,
.kadence-post-grid article:hover,
.kb-post-grid-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--rp-purple);
}

/* Thumbnail */
.post-thumbnail img,
.entry-card img,
.wp-block-post-featured-image img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  image-rendering: auto; /* crisp pixel art? switch to pixelated */
}

/* Card meta */
.entry-meta,
.wp-block-post-date,
.entry-category {
  font-size: 0.8rem;
  color: var(--rp-purple);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================================
   TAGS & CATEGORY BADGES
   ============================================================================ */
.wp-block-post-terms a,
.tag-links a,
a[rel="tag"],
.cat-links a {
  display: inline-block;
  background: var(--rp-tag-bg);
  color: var(--rp-tag-text);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  text-decoration: none;
  margin: 0.15rem 0.1rem;
  transition: background 0.15s ease;
}

.wp-block-post-terms a:hover,
.tag-links a:hover,
a[rel="tag"]:hover {
  background: var(--rp-orange);
  color: #fff;
}

/* ============================================================================
   SINGLE GUIDE / POST
   ============================================================================ */
.single .entry-content {
  max-width: 720px;
  margin: 0 auto;
}

.entry-content p,
.entry-content li {
  font-size: 1rem;
  line-height: var(--rp-line-height);
}

.entry-content h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--rp-pink);
}

.entry-content h3 {
  margin-top: 2rem;
  color: var(--rp-purple);
}

/* Blockquote — retro-styled pull-quote */
.entry-content blockquote {
  border-left: 4px solid var(--rp-pink);
  background: rgba(123, 63, 160, 0.06);
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-radius: 0 var(--rp-radius) var(--rp-radius) 0;
  font-style: italic;
}

/* Code blocks */
.entry-content code,
.entry-content pre {
  font-family: var(--rp-font-mono);
  font-size: 0.88rem;
  background: var(--rp-charcoal);
  color: var(--rp-lime);
  border-radius: var(--rp-radius);
}

.entry-content code {
  padding: 0.15rem 0.4rem;
}

.entry-content pre {
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--rp-purple);
}

/* ============================================================================
   AD SLOT MARKERS
   (Wrap your AdSense <ins> tags in these divs in Site Kit)
   ============================================================================ */
.ad-in-article {
  margin: 2.5rem auto;
  text-align: center;
  max-width: 728px;
}

.ad-sidebar {
  margin-bottom: 2rem;
  text-align: center;
}

/* Visually label ads in dev — remove before launch */
.ad-in-article::before,
.ad-sidebar::before {
  content: 'Ad';
  display: block;
  font-size: 0.65rem;
  color: #999;
  text-align: center;
  margin-bottom: 4px;
  font-family: var(--rp-font-body);
}

/* ============================================================================
   HERO SECTION (homepage)
   ============================================================================ */
.hero-section,
.wp-block-cover.is-style-hero {
  background: linear-gradient(135deg, var(--rp-purple-deep) 0%, var(--rp-purple) 60%, var(--rp-pink) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* Optional CRT scanline overlay on hero — subtle */
.hero-section::after,
.wp-block-cover.is-style-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
}

.hero-section h1,
.wp-block-cover.is-style-hero h1 {
  color: #fff;
  text-shadow: 2px 2px 0 var(--rp-purple-deep);
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */
.widget-area,
.wp-block-group.is-style-sidebar {
  background: #fff;
  border: 2px solid var(--rp-card-border);
  border-radius: var(--rp-radius);
  box-shadow: var(--rp-card-shadow);
  padding: 1.5rem;
}

.widget-title,
.widgettitle {
  font-family: var(--rp-font-pixel);
  font-size: 0.7rem;
  color: var(--rp-purple);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--rp-pink);
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.site-footer,
#colophon,
footer.wp-block-template-part {
  background-color: var(--rp-footer-bg) !important;
  color: var(--rp-footer-text);
  border-top: 3px solid var(--rp-purple);
}

.site-footer a,
#colophon a {
  color: var(--rp-lime);
}

.site-footer a:hover,
#colophon a:hover {
  color: var(--rp-pink);
}

.site-footer .site-info,
.site-footer .copyright {
  font-size: 0.82rem;
  opacity: 0.8;
}

/* Footer pixel tagline */
.footer-tagline {
  font-family: var(--rp-font-pixel);
  font-size: 0.55rem;
  color: var(--rp-lime);
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-top: 0.5rem;
}

/* ============================================================================
   SEARCH
   ============================================================================ */
.search-form input[type="search"] {
  border: 2px solid var(--rp-purple);
  border-radius: var(--rp-radius) 0 0 var(--rp-radius);
  padding: 0.5rem 0.8rem;
  font-family: var(--rp-font-body);
  outline: none;
}

.search-form input[type="search"]:focus {
  border-color: var(--rp-pink);
  box-shadow: 0 0 0 3px rgba(232, 90, 138, 0.2);
}

.search-submit {
  background: var(--rp-purple) !important;
  color: #fff !important;
  border: 2px solid var(--rp-purple) !important;
  border-radius: 0 var(--rp-radius) var(--rp-radius) 0 !important;
  padding: 0.5rem 1rem !important;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-submit:hover {
  background: var(--rp-pink) !important;
  border-color: var(--rp-pink) !important;
}

/* ============================================================================
   COMMENTS
   ============================================================================ */
.comment-body {
  border: 1px solid rgba(123, 63, 160, 0.2);
  border-radius: var(--rp-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: #fff;
}

.comment-meta .comment-author b {
  color: var(--rp-purple);
  font-weight: 700;
}

#respond .comment-reply-title {
  font-family: var(--rp-font-pixel);
  font-size: 0.7rem;
  color: var(--rp-purple-deep);
}

/* ============================================================================
   HOMEPAGE — ANIMATED LOGO
   Wraps your Anim Logo.gif in a bouncing div on the homepage only
   ============================================================================ */
.home .site-logo-animated,
.home .kadence-site-branding .custom-logo-link img.anim-logo {
  animation: rp-bounce 1.8s ease-in-out infinite;
}

@keyframes rp-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

/* "NEW" badge for recent posts */
.badge-new {
  display: inline-block;
  background: var(--rp-lime);
  color: var(--rp-charcoal);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.45rem;
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 0.4rem;
}

/* Pixel-bordered image (add class to <figure> blocks) */
.pixel-border img {
  border: 3px solid var(--rp-purple);
  box-shadow: 4px 4px 0 var(--rp-pink);
  border-radius: var(--rp-radius);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
  h1 { font-size: clamp(0.75rem, 4vw, 1.1rem); }
  h2 { font-size: clamp(0.7rem, 3vw, 0.9rem); }

  .post-thumbnail img,
  .entry-card img,
  .wp-block-post-featured-image img {
    height: 180px;
  }

  .ad-in-article {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  :root {
    --rp-font-size: 16px;
  }
}
