/*
Theme Name: Polygonerz
Author: Tony Polygonerz
Description: Technology x Entertainment — dark, editorial homepage theme.
Version: 1.0
*/

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Root & Page ───────────────────────────────────────────── */
:root {
  --bg:        #080808;
  --bg2:       #111111;
  --accent:    #c8f135;
  --accent2:   #00e5ff;
  --text:      #f0f0f0;
  --muted:     #B0B0B0;
  --border:    rgba(255,255,255,0.12);
  --card-bg:   #111111;
}

html, body {
  background: var(--bg) !important;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Grain overlay ─────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

/* ── Wrapper ───────────────────────────────────────────────── */
#pgz-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  padding: 120px 40px 80px;
  text-align: center;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 2px;
}

.wordmark {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 6vw, 6rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 0%, #999999 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 16px;
}

/* ── Toggle ────────────────────────────────────────────────── */
.toggle-wrap {
  margin-top: 56px;
  display: inline-flex;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px;
  gap: 2px;
}

.toggle-btn {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 28px;
  min-height: 44px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--muted);
}

.toggle-btn.active {
  background: var(--accent);
  color: #000;
}

.toggle-btn:not(.active):hover { color: var(--text); }

/* ── Divider ───────────────────────────────────────────────── */
.pgz-divider {
  width: 100%;
  max-width: 1100px;
  height: 1px;
  background: var(--border);
  margin: 0 auto 60px;
}

/* ── Views ─────────────────────────────────────────────────── */
.view {
  display: none;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px 120px;
  width: 100%;
  animation: rise 0.35s ease-out both;
}

.view.active { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Tech Card Grid ────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.card {
  background: var(--card-bg);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
  z-index: 2;
}

.card:hover { background: #161616; }
.card:hover::after { width: 100%; }

/* ── Card Image Placeholder ────────────────────────────────── */
.card-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.4s ease;
}

.card:hover .card-image {
  transform: scale(1.3);
}

.card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(255,255,255,0.015) 39px,
      rgba(255,255,255,0.015) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(255,255,255,0.015) 39px,
      rgba(255,255,255,0.015) 40px
    );
}

/* ── Card Content Area ─────────────────────────────────────── */
.card-content {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.card-num {
  font-family: 'Syne', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

.card h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
}

.card-link {
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.card-link::after { content: ' →'; }

/* ── Entertainment View ────────────────────────────────────── */
.ent-hero {
  position: relative;
  height: 500px;
  background-color: #0a0a12;
  background-image: url('https://polygonerz.com/wp-content/uploads/2019/06/Well-then-technically-speaking-its-not.jpg');
  background-size: cover;
  background-position: center 30%;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 50px;
  overflow: hidden;
}

.ent-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 0;
}

.ent-badge {
  font-family: 'Syne', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.ent-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.ent-sub {
  font-size: 0.95rem;
  color: rgba(240,240,240,0.8);
  max-width: 480px;
  margin-top: 16px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.ent-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  position: relative;
  z-index: 1;
}

.btn-primary {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent2);
  color: #000;
  border: none;
  padding: 12px 24px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-ghost {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 12px 24px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: border-color 0.2s;
}

.btn-ghost:hover { border-color: rgba(255,255,255,0.6); }

/* ── Footer ────────────────────────────────────────────────── */
#pgz-footer {
  border-top: 1px solid var(--border);
  padding: 32px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: auto auto 0;
  width: 100%;
}

.footer-nav {
  display: flex;
  gap: 32px;
  list-style: none;
}

.footer-nav li a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav li a:hover { color: var(--text); }

.copyright {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ── Overflow guard (global) ───────────────────────────────── */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

.hero {
  overflow: hidden;
}

/* ── Tablet (~900px) ───────────────────────────────────────── */
@media (max-width: 900px) {
  .toggle-btn {
    padding: 10px 18px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
  }
}

/* ── Mid-range (780px) ─────────────────────────────────────── */
@media (max-width: 780px) {
  .hero { padding: 80px 24px 60px; }
  .view { padding: 0 24px 80px; }
  .card-grid { grid-template-columns: 1fr; }
  .card-content { padding: 28px 24px; }
  .card-image { height: 160px; }
  .ent-hero { height: auto; min-height: 400px; padding: 32px 24px; }
  #pgz-footer { flex-direction: column; gap: 20px; padding: 32px 24px; }
  .footer-nav { flex-wrap: wrap; justify-content: center; gap: 16px; }
  .pgz-divider { margin-bottom: 40px; }
}

/* ── Mobile (~480px) ───────────────────────────────────────── */
@media (max-width: 480px) {
  .hero { padding: 60px 20px 48px; }
  .view { padding: 0 16px 60px; }
  .card-content { padding: 24px 20px; }
  .card-image { height: 140px; }

  .toggle-wrap {
    display: flex;
    flex-direction: column;
    width: calc(100% - 40px);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .toggle-btn {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    font-size: 0.75rem;
  }

  .footer-nav { gap: 12px; }

  .ent-hero { padding: 24px 20px; min-height: 360px; }
  .ent-actions { flex-direction: column; }
  .btn-primary, .btn-ghost { text-align: center; }
}

/* ── Entertainment Social Icons ─────────────────────────── */
.ent-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
}
.ent-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.ent-social {
  display: flex;
  gap: 8px;
  align-items: center;
}
.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: #ffffff;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  color: #111;
}
.social-icon:hover {
  background-color: #f9f9f9;
  border-color: #d1d1d1;
  transform: translateY(-1px);
}
.social-icon svg {
  width: 18px;
  height: 18px;
}
@media (max-width: 480px) {
  .ent-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .ent-social {
    align-self: flex-start;
  }
}

/* ── Social icon override (specificity fix) ── */
.ent-hero .social-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  background-color: #ffffff !important;
  border: 1px solid #e2e2e2 !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
  color: #111111 !important;
  text-decoration: none !important;
  transition: all 0.2s ease-in-out !important;
  position: relative !important;
  z-index: 2 !important;
}
.ent-hero .social-icon:hover {
  background-color: #f9f9f9 !important;
  border-color: #d1d1d1 !important;
  transform: translateY(-1px) !important;
}
.ent-hero .social-icon svg {
  width: 18px !important;
  height: 18px !important;
  color: #111111 !important;
}

/* ── Social icon specificity fix ── */
.ent-hero .ent-actions { width: 100%; }
.ent-hero .social-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  background-color: #ffffff !important;
  border: 1px solid #e2e2e2 !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
  color: #111111 !important;
  text-decoration: none !important;
  position: relative !important;
  z-index: 2 !important;
}
.ent-hero .social-icon:hover {
  background-color: #f9f9f9 !important;
  transform: translateY(-1px) !important;
}
.ent-hero .social-icon svg {
  width: 18px !important;
  height: 18px !important;
  color: #111111 !important;
}

/* ── Detail Nav ── */
.detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 65px;
  background-color: #080808;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
}

.detail-nav-back {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 6px;
  color: #c8f135;
  text-decoration: none;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: opacity 0.15s ease;
}

.detail-nav-back:hover { opacity: 0.75; }

.detail-nav-back svg {
  flex-shrink: 0;
  color: #c8f135;
}

.detail-nav-wordmark {
  color: #ffffff;
  text-decoration: none;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: opacity 0.15s ease;
}

.detail-nav-wordmark:hover { opacity: 0.75; }

@media (max-width: 480px) {
  .detail-nav { padding: 0 20px; }
  .detail-nav-wordmark { font-size: 12px; }
}


/* ── Blog Preview Section ────────────────────────────────── */
.blog-preview {
  max-width: 1100px;
  margin: 80px auto 0;
  padding: 0 40px 80px;
}

.blog-preview__heading {
  font-family: var(--ff-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 32px;
}

.blog-preview__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.blog-preview__card,
.blog-preview__card:visited {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.12);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease;
}

.blog-preview__img {
  border-radius: 4px 4px 0 0;
  margin: -24px -24px 0;
  width: calc(100% + 48px);
}

.blog-preview__card:hover {
  border-color: var(--lime);
}

.blog-preview__title {
  font-family: var(--ff-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white, #fff);
  margin: 0;
}

.blog-preview__excerpt {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  margin: 0;
  line-height: 1.6;
}

.blog-preview__link,
.blog-preview__link:visited {
  color: #c8f135;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: auto;
}
.blog-preview__link:hover { opacity: 0.75; }

.blog-preview__all {
  display: inline-block;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-preview__all:hover {
  color: var(--lime);
}

@media (max-width: 768px) {
  .blog-preview__grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Blog Navigation — .blog-nav*
   Sprint 22 — Copied from .detail-nav, adapted for blog
   ═══════════════════════════════════════════════════════════════════ */

.blog-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  width: 100%;
  z-index: 100;
  background: rgb(8,8,8);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.blog-nav .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-nav-back {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 6px;
  color: #c8f135;
  text-decoration: none;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: opacity 0.15s ease;
}

.blog-nav-back:hover { opacity: 0.75; }

.blog-nav-back svg {
  flex-shrink: 0;
  color: #c8f135;
}

.blog-nav-tabs {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.blog-nav-tab {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: opacity 0.15s ease;
}
.blog-nav-tab:hover { opacity: 0.75; color: #f0f0f0; }
.blog-nav-tab.is-active { color: #c8f135; }

.blog-nav-wordmark {
  color: #ffffff;
  text-decoration: none;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: opacity 0.15s ease;
}

.blog-nav-wordmark:hover { opacity: 0.75; }

@media (max-width: 480px) {
  .blog-nav .container { padding: 0 1rem; }
  .blog-nav-wordmark { font-size: 12px; }
  .blog-nav-tabs { gap: 1rem; }
  .blog-nav-tab { font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════════════
   Blog — Code Block & Table Mobile Overflow Fix
   ═══════════════════════════════════════════════════════════════════ */

pre,
pre code {
  overflow-x: auto;
  white-space: pre;
  word-wrap: normal;
  max-width: 100%;
  display: block;
}

code {
  word-break: break-word;
}

/* Prevent inline code from blowing out mobile layout */
p code,
li code {
  word-break: break-all;
}

/* Capability tables and other wide tables in blog content */
.single-post__content table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

/* Gutenberg figure blocks inside single post content */
.single-post__content figure.wp-block-image,
.single-post__content figure {
  max-width: 100%;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.single-post__content figure img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   Callout Block — .pgz-callout*
   Gutenberg custom block: polygonerz/callout
   ═══════════════════════════════════════════════════════════════════ */

.pgz-callout {
  border-left: 3px solid var(--accent, #c8f135);
  background: rgba(200,241,53,0.05);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin: 2em 0;
}

.pgz-callout__label {
  font-family: 'Syne', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent, #c8f135);
  margin: 0 0 8px;
}

.pgz-callout__body {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text, #f0f0f0);
  margin: 0;
}

/* Editor preview */
.wp-block[data-type="polygonerz/callout"] .pgz-callout {
  margin: 0;
}
