/*
Theme Name: Joyful
Theme URI: https://www.joyfuldancevinita.com
Author: JoyfulDanceVinita
Description: A minimalistic, lightweight, SEO-optimised theme built for dance content and affiliate publishing.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: joyful
Tags: minimalist, blog, affiliate, seo, responsive
*/

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

:root {
  --color-bg:        #FFFFFF;
  --color-surface:   #F8F7F5;
  --color-text:      #1C1C1E;
  --color-muted:     #6E6E73;
  --color-accent:    #C8102E;
  --color-accent-h:  #A00D24;
  --color-border:    #E5E5EA;
  --color-tag-bg:    #F2F2F7;
  --font-sans:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif:      Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --radius:          6px;
  --shadow-sm:       0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:       0 4px 16px rgba(0,0,0,.08);
  --max-w:           1200px;
  --content-w:       740px;
  --transition:      .18s ease;
}

html { font-size: 17px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent-h); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.4em; }

/* ─── Layout Helpers ───────────────────────────────────────── */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.content-wrap { max-width: var(--content-w); margin: 0 auto; }

/* ─── Sitewide Header ──────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: 64px;
  display: flex; align-items: center;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo a {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -.02em;
  display: flex; align-items: center; gap: 8px;
}

.site-logo a span.accent { color: var(--color-accent); }

.site-logo img { height: 36px; width: auto; }

/* ─── Navigation ───────────────────────────────────────────── */
.primary-nav { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.primary-nav li { list-style: none; }

.primary-nav a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-text);
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav a.current-menu-item { background: var(--color-surface); color: var(--color-accent); }

.nav-search { margin-left: 8px; }
.nav-search a { padding: 6px 10px; color: var(--color-muted); }
.nav-search a:hover { color: var(--color-text); }

/* Hamburger — mobile */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; color: var(--color-text); }
.nav-toggle svg { display: block; }

/* ─── Hero (single-post top image) ────────────────────────── */
.post-hero {
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  border-radius: 0;
  margin-bottom: 48px;
}

.post-hero img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

/* ─── Page / Main ──────────────────────────────────────────── */
.site-main { padding: 56px 0 80px; min-height: 60vh; }

/* ─── Post Grid (Index / Archive) ─────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* Featured first post spans full width */
.posts-grid .post-card:first-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}

.posts-grid .post-card:first-child .card-img { height: 340px; }
.posts-grid .post-card:first-child .card-title { font-size: 1.75rem; }

/* ─── Post Card ────────────────────────────────────────────── */
.post-card {
  display: flex; flex-direction: column;
  border-radius: calc(var(--radius) * 2);
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition), transform var(--transition);
}

.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-img {
  display: block;
  overflow: hidden;
  height: 200px;
  background: var(--color-surface);
}

.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

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

.card-body {
  padding: 20px 22px 24px;
  display: flex; flex-direction: column; flex: 1;
}

.card-category {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.35;
  color: var(--color-text);
  margin-bottom: 10px;
  font-weight: 700;
}

.card-title a { color: inherit; }
.card-title a:hover { color: var(--color-accent); }

.card-excerpt {
  font-size: .875rem;
  color: var(--color-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: .75rem;
  color: var(--color-muted);
  margin-top: auto;
}

.card-meta span::before { content: "·"; margin-right: 10px; }
.card-meta span:first-child::before { content: none; }

/* ─── Pagination ───────────────────────────────────────────── */
.pagination { margin-top: 56px; display: flex; justify-content: center; }

.pagination ul.page-numbers {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  list-style: none; margin: 0; padding: 0;
}
.pagination ul.page-numbers li { list-style: none; }

.pagination a.page-numbers,
.pagination span.page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  border-radius: var(--radius);
  font-size: .875rem; font-weight: 500;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

.pagination a.page-numbers:hover,
.pagination span.page-numbers.current {
  background: var(--color-accent);
  color: #fff; border-color: var(--color-accent);
}

.pagination span.page-numbers.dots {
  border-color: transparent; background: none; color: var(--color-muted);
}

/* ─── Single Post ──────────────────────────────────────────── */
.entry-header { margin-bottom: 36px; }

.entry-category {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-accent);
  display: inline-block;
  margin-bottom: 14px;
}

.entry-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.22;
  color: var(--color-text);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 18px;
}

.entry-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: .8rem; color: var(--color-muted);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.entry-meta .sep { opacity: .4; }

/* ─── Entry Content ────────────────────────────────────────── */
.entry-content {
  font-size: 1rem;
  line-height: 1.78;
  color: var(--color-text);
}

.entry-content h2 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  line-height: 1.3;
  font-weight: 700;
  margin: 2.2em 0 .7em;
  color: var(--color-text);
  letter-spacing: -.01em;
}

.entry-content h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.8em 0 .6em;
  color: var(--color-text);
}

.entry-content p { margin-bottom: 1.4em; }

.entry-content ul, .entry-content ol {
  margin-bottom: 1.4em;
  padding-left: 1.6em;
}

.entry-content li { margin-bottom: .45em; }

.entry-content strong { font-weight: 700; color: var(--color-text); }
.entry-content em { font-style: italic; }

.entry-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.entry-content a:hover { color: var(--color-accent-h); }

.entry-content blockquote {
  border-left: 3px solid var(--color-accent);
  margin: 1.6em 0;
  padding: .8em 1.2em;
  background: var(--color-surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-muted);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: .9rem;
}

.entry-content th {
  background: var(--color-surface);
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
}

.entry-content td {
  padding: 9px 14px;
  border: 1px solid var(--color-border);
  vertical-align: top;
}

.entry-content tr:nth-child(even) td { background: var(--color-surface); }

.entry-content img {
  border-radius: var(--radius);
  margin: 1.6em 0;
  max-width: 100%;
}

.entry-content code {
  background: var(--color-surface);
  font-size: .875em;
  padding: .15em .4em;
  border-radius: 3px;
  font-family: "SF Mono", "Cascadia Mono", Consolas, monospace;
}

.entry-content pre {
  background: var(--color-surface);
  padding: 1.2em;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.6em 0;
  font-size: .875rem;
}

/* ─── Entry Footer (tags) ──────────────────────────────────── */
.entry-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}

.tag-label { font-size: .8rem; color: var(--color-muted); margin-right: 4px; }

.tag-pill {
  display: inline-block;
  background: var(--color-tag-bg);
  color: var(--color-text);
  font-size: .78rem;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  transition: background var(--transition);
}

.tag-pill:hover { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

/* ─── Related Posts ────────────────────────────────────────── */
.related-posts {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 2px solid var(--color-border);
}

.related-posts h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--color-text);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--color-border); }

.related-card-img { height: 140px; overflow: hidden; background: var(--color-surface); }
.related-card-img img { width: 100%; height: 100%; object-fit: cover; }

.related-card-body { padding: 14px 16px; }
.related-card-body .card-category { font-size: .68rem; margin-bottom: 6px; }
.related-card-title { font-size: .9rem; font-weight: 700; line-height: 1.35; color: var(--color-text); }
.related-card-title a { color: inherit; }
.related-card-title a:hover { color: var(--color-accent); }

/* ─── Page (Static) ────────────────────────────────────────── */
.page-header { margin-bottom: 36px; }

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--color-text);
}

/* ─── Archive Header ───────────────────────────────────────── */
.archive-header {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 40px;
}

.archive-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.archive-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -.02em;
}

/* ─── 404 ──────────────────────────────────────────────────── */
.error-404 { text-align: center; padding: 80px 0; }

.error-404 .error-code {
  font-family: var(--font-serif);
  font-size: 8rem;
  font-weight: 700;
  color: var(--color-surface);
  line-height: 1;
  -webkit-text-stroke: 2px var(--color-border);
}

.error-404 h1 { font-family: var(--font-serif); font-size: 1.8rem; margin: 16px 0 12px; }
.error-404 p { color: var(--color-muted); margin-bottom: 28px; }

/* ─── Search ───────────────────────────────────────────────── */
.search-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.search-header .archive-title span { color: var(--color-accent); }

/* ─── Search Form ──────────────────────────────────────────── */
.search-form {
  display: flex; gap: 0;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 480px;
  transition: border-color var(--transition);
}

.search-form:focus-within { border-color: var(--color-accent); }

.search-form input[type="search"] {
  flex: 1;
  border: none; outline: none;
  padding: 10px 16px;
  font-size: .9rem;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
}

.search-form button {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  transition: background var(--transition);
}

.search-form button:hover { background: var(--color-accent-h); }

/* ─── CTA Button ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-h); color: #fff; }
.btn-outline { border: 1.5px solid var(--color-border); color: var(--color-text); }
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ─── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: #18181B;
  color: #A1A1AA;
  padding: 56px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.footer-brand .brand-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  display: block;
}

.footer-brand p {
  font-size: .875rem;
  line-height: 1.65;
  color: #A1A1AA;
}

.footer-col h4 {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: .875rem; color: #A1A1AA; transition: color var(--transition); }
.footer-col ul li a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
}

.footer-bottom p { font-size: .78rem; color: #71717A; }

.footer-legal { display: flex; gap: 16px; }
.footer-legal a { font-size: .78rem; color: #71717A; }
.footer-legal a:hover { color: #A1A1AA; }

/* ─── Breadcrumbs ──────────────────────────────────────────── */
.breadcrumbs {
  font-size: .78rem;
  color: var(--color-muted);
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 40px;
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}

.breadcrumbs a { color: var(--color-muted); }
.breadcrumbs a:hover { color: var(--color-accent); }
.breadcrumbs .sep { opacity: .4; }
.breadcrumbs .current { color: var(--color-text); }

/* ─── No-content Notice ────────────────────────────────────── */
.no-results { text-align: center; padding: 60px 0; color: var(--color-muted); }
.no-results h2 { font-family: var(--font-serif); font-size: 1.4rem; margin-bottom: 10px; color: var(--color-text); }

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .posts-grid .post-card:first-child { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  html { font-size: 16px; }
  .site-header { height: 56px; }
  .primary-nav { display: none; }
  .primary-nav.open { display: flex; flex-direction: column; align-items: flex-start; position: fixed; top: 56px; left: 0; right: 0; background: var(--color-bg); border-bottom: 1px solid var(--color-border); padding: 16px 24px 24px; gap: 2px; z-index: 99; }
  .nav-toggle { display: flex; }
  .posts-grid { grid-template-columns: 1fr; }
  .posts-grid .post-card:first-child { display: flex; flex-direction: column; }
  .posts-grid .post-card:first-child .card-img { height: 220px; }
  .posts-grid .post-card:first-child .card-title { font-size: 1.25rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .related-grid { grid-template-columns: 1fr; }
  .site-main { padding: 36px 0 60px; }
  .post-hero { margin-bottom: 32px; }
  .post-hero img { max-height: 280px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .entry-title { font-size: 1.6rem; }
  .card-body { padding: 16px 18px 20px; }
}

/* ─── Gutenberg Block Compatibility ────────────────────────── */
.wp-block-image img { border-radius: var(--radius); }
.wp-block-quote { border-left: 3px solid var(--color-accent); background: var(--color-surface); padding: .8em 1.2em; margin: 1.6em 0; border-radius: 0 var(--radius) var(--radius) 0; }
.wp-block-table table { width: 100%; border-collapse: collapse; }
.wp-block-table td, .wp-block-table th { padding: 9px 14px; border: 1px solid var(--color-border); }

/* ─── Utility ──────────────────────────────────────────────── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; top: -100%; left: 8px; background: var(--color-accent); color: #fff; padding: 8px 16px; border-radius: 0 0 var(--radius) var(--radius); font-size: .875rem; font-weight: 600; z-index: 9999; }
.skip-link:focus { top: 0; }
