/*
Theme Name: MemeVault
Theme URI: https://wordpress.org/themes/
Author: MemeVault Team
Author URI: https://wordpress.org/
Description: A fast, mobile-first, AdSense-ready editorial theme for meme publications. Bold typography, rounded cards, soft shadows, sticky header, trending & popular sections, random-meme button, breadcrumbs, reading time, share buttons and full schema output. Built for social traffic.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.6
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: memevault
Tags: blog, news, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, block-styles, wide-blocks
*/

/* =========================================================
   MemeVault Design System
   ========================================================= */
:root {
  --mv-ink: #16161d;
  --mv-ink-soft: #3a3a46;
  --mv-muted: #6b6b78;
  --mv-line: #ececf1;
  --mv-bg: #ffffff;
  --mv-bg-soft: #f7f7fb;
  --mv-accent: #ff3d71;      /* hot coral */
  --mv-accent-ink: #d4235a;
  --mv-secondary: #6c5ce7;   /* indigo */
  --mv-secondary-ink: #4d3fc4;
  --mv-yellow: #ffcd39;
  --mv-green: #12c48b;
  --mv-radius: 16px;
  --mv-radius-sm: 10px;
  --mv-radius-lg: 24px;
  --mv-shadow: 0 8px 24px rgba(22,22,29,.08);
  --mv-shadow-hover: 0 14px 40px rgba(22,22,29,.14);
  --mv-shadow-sm: 0 2px 8px rgba(22,22,29,.06);
  --mv-max: 1200px;
  --mv-font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mv-font-display: "Space Grotesk", var(--mv-font-body);
}

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

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

body {
  margin: 0;
  font-family: var(--mv-font-body);
  color: var(--mv-ink);
  background: var(--mv-bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--mv-secondary-ink); text-decoration: none; }
a:hover { color: var(--mv-accent-ink); }

h1, h2, h3, h4, h5 {
  font-family: var(--mv-font-display);
  line-height: 1.15;
  color: var(--mv-ink);
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.2rem, 2.6vw, 1.4rem); }
p { margin: 0 0 1.1em; }

.mv-container { max-width: var(--mv-max); margin-inline: auto; padding-inline: 20px; }
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; word-wrap: normal !important;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--mv-ink); color: #fff; padding: 12px 18px; border-radius: 0 0 var(--mv-radius-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Buttons ---------- */
.mv-btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--mv-font-display); font-weight: 600; font-size: .95rem;
  padding: .7em 1.25em; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--mv-ink); color: #fff; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  line-height: 1; text-align: center;
}
.mv-btn:hover { transform: translateY(-2px); color: #fff; box-shadow: var(--mv-shadow); }
.mv-btn--accent { background: var(--mv-accent); }
.mv-btn--accent:hover { background: var(--mv-accent-ink); }
.mv-btn--secondary { background: var(--mv-secondary); }
.mv-btn--secondary:hover { background: var(--mv-secondary-ink); }
.mv-btn--ghost { background: var(--mv-bg-soft); color: var(--mv-ink); }
.mv-btn--ghost:hover { background: var(--mv-line); color: var(--mv-ink); }
.mv-btn--sm { padding: .5em .9em; font-size: .82rem; }

/* ---------- Header ---------- */
.mv-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--mv-line);
}
.mv-header__inner { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.mv-brand { display: flex; align-items: center; gap: 10px; font-family: var(--mv-font-display); font-weight: 700; font-size: 1.35rem; color: var(--mv-ink); }
.mv-brand img { max-height: 40px; width: auto; }
.mv-brand .mv-brand__mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--mv-accent), var(--mv-secondary)); color: #fff; font-weight: 800;
}
.mv-brand__tag { display: block; font-family: var(--mv-font-body); font-weight: 500; font-size: .68rem; color: var(--mv-muted); letter-spacing: .02em; }
.mv-nav { margin-left: auto; }
.mv-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.mv-nav a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--mv-ink-soft); font-weight: 500; font-size: .95rem; }
.mv-nav a:hover, .mv-nav .current-menu-item > a { background: var(--mv-bg-soft); color: var(--mv-ink); }
.mv-nav .sub-menu {
  position: absolute; display: none; flex-direction: column; background: #fff; border: 1px solid var(--mv-line);
  border-radius: var(--mv-radius-sm); box-shadow: var(--mv-shadow); padding: 8px; min-width: 200px; margin-top: 6px;
}
.mv-nav li { position: relative; }
.mv-nav li:hover > .sub-menu, .mv-nav li:focus-within > .sub-menu { display: flex; }
.mv-header__actions { display: flex; align-items: center; gap: 8px; }
.mv-icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--mv-line); background: #fff;
  display: grid; place-items: center; cursor: pointer; color: var(--mv-ink);
}
.mv-icon-btn:hover { background: var(--mv-bg-soft); }
.mv-burger { display: none; }

/* Search overlay */
.mv-search-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(22,22,29,.55); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; padding-top: 14vh;
}
.mv-search-overlay.is-open { display: flex; }
.mv-search-overlay form { width: min(640px, 92vw); background: #fff; border-radius: var(--mv-radius); padding: 14px; box-shadow: var(--mv-shadow-hover); display: flex; gap: 8px; }
.mv-search-overlay input[type=search] {
  flex: 1; border: 0; font-size: 1.15rem; padding: 14px; border-radius: var(--mv-radius-sm); background: var(--mv-bg-soft); font-family: var(--mv-font-body);
}
.mv-search-overlay input[type=search]:focus { outline: 2px solid var(--mv-secondary); }

/* Mobile drawer */
.mv-drawer {
  position: fixed; inset: 0 0 0 auto; width: min(320px, 85vw); background: #fff; z-index: 320;
  transform: translateX(100%); transition: transform .28s ease; box-shadow: var(--mv-shadow-hover);
  padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
}
.mv-drawer.is-open { transform: translateX(0); }
.mv-drawer a { display: block; padding: 12px 10px; border-radius: var(--mv-radius-sm); color: var(--mv-ink); font-weight: 600; }
.mv-drawer a:hover { background: var(--mv-bg-soft); }
.mv-drawer .sub-menu { list-style: none; padding-left: 12px; margin: 0; }
.mv-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 310; display: none; }
.mv-scrim.is-open { display: block; }

/* ---------- Layout ---------- */
.mv-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 40px; margin: 32px auto; }
.mv-layout--full { grid-template-columns: 1fr; }
.mv-sidebar { display: flex; flex-direction: column; gap: 24px; }

/* ---------- Cards & grids ---------- */
.mv-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.mv-card {
  background: #fff; border: 1px solid var(--mv-line); border-radius: var(--mv-radius); overflow: hidden;
  box-shadow: var(--mv-shadow-sm); transition: transform .18s ease, box-shadow .18s ease; display: flex; flex-direction: column;
}
.mv-card:hover { transform: translateY(-4px); box-shadow: var(--mv-shadow-hover); }
.mv-card__media { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--mv-bg-soft); }
.mv-card__media--empty { background: linear-gradient(135deg, var(--mv-secondary), var(--mv-accent)); }
.mv-card__media img { width: 100%; height: 100%; object-fit: cover; }
.mv-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--mv-ink); color: #fff; font-size: .72rem; font-weight: 700; font-family: var(--mv-font-display);
  padding: 5px 11px; border-radius: 999px; letter-spacing: .02em;
}
.mv-badge--accent { background: var(--mv-accent); }
.mv-badge--secondary { background: var(--mv-secondary); }
.mv-card__body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.mv-card__title { font-size: 1.12rem; line-height: 1.28; margin: 0; }
.mv-card__title a { color: var(--mv-ink); }
.mv-card__title a:hover { color: var(--mv-accent-ink); }
.mv-card__meta { font-size: .8rem; color: var(--mv-muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.mv-card__cta { margin-top: 4px; }

/* Featured / hero */
.mv-hero { margin: 28px auto; }
.mv-hero__grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; }
.mv-hero__main .mv-card__media { aspect-ratio: 16/9; }
.mv-hero__main .mv-card__title { font-size: clamp(1.4rem, 3vw, 2rem); }
.mv-hero__side { display: grid; gap: 24px; }
.mv-hero__side .mv-card { flex-direction: row; }
.mv-hero__side .mv-card__media { width: 42%; aspect-ratio: 1/1; flex-shrink: 0; }
.mv-hero__side .mv-card__title { font-size: 1rem; }

/* Section heads */
.mv-section { margin: 44px auto; }
.mv-section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.mv-section__head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.mv-section__head h2::before { content: ""; width: 10px; height: 26px; border-radius: 4px; background: var(--mv-accent); display: inline-block; }
.mv-section--soft { background: var(--mv-bg-soft); padding: 44px 0; border-radius: var(--mv-radius-lg); }

/* Category pills */
.mv-cats { display: flex; flex-wrap: wrap; gap: 12px; }
.mv-cat-card {
  flex: 1 1 200px; border-radius: var(--mv-radius); padding: 22px 20px; color: #fff; position: relative; overflow: hidden;
  min-height: 120px; display: flex; flex-direction: column; justify-content: flex-end; font-family: var(--mv-font-display); font-weight: 700;
  background: linear-gradient(135deg, var(--mv-secondary), var(--mv-accent));
}
.mv-cat-card:hover { color: #fff; transform: translateY(-3px); box-shadow: var(--mv-shadow); }
.mv-cat-card span { font-size: .78rem; font-weight: 500; opacity: .9; }
.mv-cat-card__count { font-size: .78rem; }

/* ---------- Widgets ---------- */
.mv-widget { background: #fff; border: 1px solid var(--mv-line); border-radius: var(--mv-radius); padding: 20px; box-shadow: var(--mv-shadow-sm); }
.mv-widget__title { font-family: var(--mv-font-display); font-size: 1.05rem; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.mv-widget__title::before { content: ""; width: 8px; height: 20px; border-radius: 3px; background: var(--mv-secondary); }
.mv-widget ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.mv-rank { display: flex; gap: 12px; align-items: flex-start; }
.mv-rank__num { font-family: var(--mv-font-display); font-weight: 800; color: var(--mv-accent); font-size: 1.2rem; line-height: 1; min-width: 22px; }
.mv-rank a { color: var(--mv-ink); font-weight: 600; font-size: .95rem; line-height: 1.3; }
.mv-rank a:hover { color: var(--mv-accent-ink); }
.mv-rank small { display: block; color: var(--mv-muted); font-weight: 400; font-size: .78rem; margin-top: 3px; }

/* Newsletter */
.mv-newsletter { background: linear-gradient(135deg, var(--mv-ink), #2b2b3a); color: #fff; border-radius: var(--mv-radius-lg); padding: 40px; text-align: center; }
.mv-newsletter h2 { color: #fff; }
.mv-newsletter p { color: rgba(255,255,255,.75); max-width: 520px; margin-inline: auto; }
.mv-newsletter form { display: flex; gap: 8px; max-width: 460px; margin: 18px auto 0; }
.mv-newsletter input[type=email] { flex: 1; border: 0; border-radius: 999px; padding: 14px 18px; font-family: var(--mv-font-body); font-size: 1rem; }

/* Social follow */
.mv-social { display: flex; gap: 10px; flex-wrap: wrap; }
.mv-social a { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--mv-bg-soft); color: var(--mv-ink); font-weight: 700; }
.mv-social a:hover { background: var(--mv-accent); color: #fff; }

/* ---------- Single post ---------- */
.mv-article { background: #fff; }
.mv-article__header { margin-bottom: 20px; }
.mv-breadcrumbs { font-size: .82rem; color: var(--mv-muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.mv-breadcrumbs a { color: var(--mv-muted); }
.mv-breadcrumbs a:hover { color: var(--mv-accent-ink); }
.mv-breadcrumbs .sep { opacity: .5; }
.mv-article__meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--mv-muted); font-size: .88rem; align-items: center; margin-bottom: 18px; }
.mv-article__meta .mv-badge { position: static; }
.mv-article__featured { border-radius: var(--mv-radius); overflow: hidden; margin-bottom: 26px; box-shadow: var(--mv-shadow-sm); }
.mv-article__body { font-size: 1.06rem; }
.mv-article__body h2 { margin-top: 1.8em; }
.mv-article__body h3 { margin-top: 1.4em; }
.mv-article__body img { border-radius: var(--mv-radius); margin: 10px auto; box-shadow: var(--mv-shadow-sm); }
.mv-article__body figure { margin: 22px 0; }
.mv-article__body figcaption { text-align: center; color: var(--mv-muted); font-size: .88rem; margin-top: 8px; }
.mv-meme-item { margin: 30px 0; }
.mv-meme-item figcaption { font-size: .95rem; color: var(--mv-ink-soft); }

/* TOC */
.mv-toc { background: var(--mv-bg-soft); border: 1px solid var(--mv-line); border-radius: var(--mv-radius); padding: 20px 24px; margin: 24px 0; }
.mv-toc strong { font-family: var(--mv-font-display); display: block; margin-bottom: 10px; }
.mv-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 30px; }
.mv-toc a { color: var(--mv-ink-soft); }

/* FAQ */
.mv-faq details { border: 1px solid var(--mv-line); border-radius: var(--mv-radius-sm); padding: 4px 18px; margin-bottom: 10px; background: #fff; }
.mv-faq summary { font-family: var(--mv-font-display); font-weight: 600; cursor: pointer; padding: 12px 0; list-style: none; }
.mv-faq summary::-webkit-details-marker { display: none; }
.mv-faq summary::after { content: "+"; float: right; color: var(--mv-accent); font-size: 1.4rem; line-height: 1; }
.mv-faq details[open] summary::after { content: "\2212"; }

/* Share */
.mv-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 26px 0; padding: 16px 0; border-top: 1px solid var(--mv-line); border-bottom: 1px solid var(--mv-line); }
.mv-share strong { font-family: var(--mv-font-display); }
.mv-share a { color: #fff; padding: 8px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.mv-share .s-fb { background: #1877f2; } .mv-share .s-x { background: #16161d; }
.mv-share .s-wa { background: #25d366; } .mv-share .s-pin { background: #e60023; }
.mv-share .s-rd { background: #ff4500; } .mv-share .s-cp { background: var(--mv-secondary); }

/* Author box */
.mv-author { display: flex; gap: 18px; align-items: flex-start; background: var(--mv-bg-soft); border-radius: var(--mv-radius); padding: 22px; margin: 30px 0; }
.mv-author img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.mv-author h4 { margin: 0 0 4px; }
.mv-author p { margin: 0; color: var(--mv-ink-soft); font-size: .95rem; }

/* Related */
.mv-related { margin: 40px 0; }

/* Ads */
.mv-ad {
  background: repeating-linear-gradient(45deg, var(--mv-bg-soft), var(--mv-bg-soft) 12px, #f0f0f6 12px, #f0f0f6 24px);
  border: 1px dashed #cfcfe0; border-radius: var(--mv-radius-sm); text-align: center; color: var(--mv-muted);
  font-size: .78rem; padding: 22px; margin: 26px 0; letter-spacing: .04em; text-transform: uppercase;
}

/* Pagination */
.mv-pagination { display: flex; gap: 8px; justify-content: center; margin: 40px 0; flex-wrap: wrap; }
.mv-pagination .page-numbers {
  display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--mv-line); background: #fff; color: var(--mv-ink); font-weight: 600;
}
.mv-pagination .page-numbers.current { background: var(--mv-accent); color: #fff; border-color: var(--mv-accent); }
.mv-pagination a.page-numbers:hover { background: var(--mv-bg-soft); }

/* Page header for archives */
.mv-archive-head { background: var(--mv-bg-soft); border-radius: var(--mv-radius-lg); padding: 40px; margin: 28px 0; }
.mv-archive-head h1 { margin: 0 0 8px; }
.mv-archive-head p { margin: 0; color: var(--mv-ink-soft); max-width: 680px; }

/* 404 */
.mv-404 { text-align: center; padding: 60px 0; }
.mv-404 .code { font-family: var(--mv-font-display); font-size: clamp(4rem, 16vw, 9rem); font-weight: 800; background: linear-gradient(135deg, var(--mv-accent), var(--mv-secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }

/* Comments */
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { border: 1px solid var(--mv-line); border-radius: var(--mv-radius); padding: 18px; margin-bottom: 14px; }
.comment-form input, .comment-form textarea { width: 100%; border: 1px solid var(--mv-line); border-radius: var(--mv-radius-sm); padding: 12px; font-family: inherit; margin-bottom: 12px; }

/* Footer */
.mv-footer { background: var(--mv-ink); color: rgba(255,255,255,.7); margin-top: 60px; padding: 54px 0 26px; }
.mv-footer a { color: rgba(255,255,255,.7); }
.mv-footer a:hover { color: #fff; }
.mv-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.mv-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.mv-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: .92rem; }
.mv-footer__brand { max-width: 320px; }
.mv-footer__bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 34px; padding-top: 20px; font-size: .85rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Utility */
.mv-eyebrow { font-family: var(--mv-font-display); font-weight: 700; color: var(--mv-accent); text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
.mv-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.mv-tags a { background: var(--mv-bg-soft); padding: 6px 12px; border-radius: 999px; font-size: .82rem; color: var(--mv-ink-soft); }
.mv-tags a:hover { background: var(--mv-accent); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .mv-layout { grid-template-columns: 1fr; }
  .mv-hero__grid { grid-template-columns: 1fr; }
  .mv-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
  .mv-nav, .mv-header__actions .mv-desktop-only { display: none; }
  .mv-burger { display: grid; }
  .mv-toc ol { columns: 1; }
  .mv-footer__grid { grid-template-columns: 1fr; }
  .mv-hero__side .mv-card { flex-direction: column; }
  .mv-hero__side .mv-card__media { width: 100%; aspect-ratio: 16/9; }
}
@media (min-width: 781px) { .mv-drawer, .mv-scrim { display: none !important; } }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
