/*
Theme Name: Macabre Media
Theme URI: https://macabremedia.net/
Author: Macabre Media
Author URI: https://macabremedia.net/
Description: A dark, retro-horror WordPress theme built for Macabre Media — a home for VHS restorations, creature features, and vintage sci-fi/horror coverage. Featured hero post, tag-driven archives, and a Contribute page template built in.
Version: 1.0.8
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: macabre-media
Tags: dark, black, red, one-column, two-columns, grid-layout, custom-logo, custom-menu, featured-images, footer-widgets, threaded-comments, translation-ready

Macabre Media WordPress Theme is distributed under the terms of the GNU GPL v2 or later.
*/

/* =========================================================
   0. DESIGN TOKENS
   ========================================================= */
:root{
  --mm-black:        #0b0a0c;
  --mm-black-soft:    #131114;
  --mm-panel:         #17151a;
  --mm-panel-2:       #201c22;
  --mm-line:          #322c34;
  --mm-red:           #b5121b;
  --mm-red-bright:    #e8232d;
  --mm-red-dim:       #6e1216;
  --mm-red-text:      #eb3f47; /* readable-red: tuned for ≥4.5:1 text contrast on --mm-black/--mm-panel, used for red text; --mm-red / --mm-red-bright stay reserved for backgrounds, borders, and large decorative type */
  --mm-bone:          #ece5d8;
  --mm-bone-dim:      #b8b0a4;
  --mm-mute:          #8a8390;
  --mm-purple:        #4a2c4f;

  --mm-font-display: 'Bebas Neue', 'Oswald', Impact, sans-serif;
  --mm-font-mono:    'Special Elite', 'Courier New', monospace;
  --mm-font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --mm-radius: 2px;
  --mm-container: 1180px;
}

/* =========================================================
   1. RESET
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--mm-black);
  color: var(--mm-bone);
  font-family: var(--mm-font-body);
  font-size: 16px;
  line-height: 1.65;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 3px);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--mm-red-text); text-decoration: none; transition: color .15s ease, opacity .15s ease; }
a:hover { color: var(--mm-bone); }
ul, ol { padding-left: 1.2em; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--mm-font-display);
  letter-spacing: .03em;
  line-height: 1.1;
  color: var(--mm-bone);
  margin: 0 0 .5em;
  text-transform: uppercase;
}
h1 { font-size: 3rem; }
h2 { font-size: 2.1rem; }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1.2em; }
blockquote {
  border-left: 3px solid var(--mm-red);
  margin: 1.5em 0;
  padding: .3em 1.2em;
  color: var(--mm-bone-dim);
  font-style: italic;
}
hr { border: none; border-top: 1px solid var(--mm-line); margin: 2.5em 0; }
figcaption { color: var(--mm-mute); font-size: .85rem; margin-top: .4em; }
table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
table th, table td { border: 1px solid var(--mm-line); padding: .6em .8em; text-align: left; }
code, pre { font-family: var(--mm-font-mono); background: var(--mm-panel); }
pre { padding: 1em; overflow-x: auto; border: 1px solid var(--mm-line); }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0,0,0,0); border: 0; white-space: nowrap;
}
.skip-link {
  position: absolute; top: -100px; left: 0;
  background: var(--mm-red); color: #fff;
  padding: .8em 1.2em; z-index: 10000;
}
.skip-link:focus { top: 0; }

/* =========================================================
   2. LAYOUT HELPERS
   ========================================================= */
.mm-container {
  max-width: var(--mm-container);
  margin: 0 auto;
  padding: 0 24px;
}
.mm-eyebrow {
  font-family: var(--mm-font-mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  color: var(--mm-red-text);
  display: inline-block;
  margin-bottom: .6em;
}
.mm-tag, .mm-cat-pill {
  display: inline-block;
  font-family: var(--mm-font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mm-black);
  background: var(--mm-bone);
  padding: .3em .7em;
  border-radius: var(--mm-radius);
  margin: 0 .4em .4em 0;
}
.mm-cat-pill--red { background: var(--mm-red); color: #fff; }
.mm-meta {
  font-family: var(--mm-font-mono);
  font-size: .8rem;
  color: var(--mm-mute);
}
.mm-meta a { color: var(--mm-mute); }
.mm-meta a:hover { color: var(--mm-red-text); }
.mm-meta > * + *::before { content: '\2022'; margin: 0 .5em; color: var(--mm-line); }

/* =========================================================
   3. SITE HEADER
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 500;
  background: rgba(11,10,12,.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--mm-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
}
.site-branding { display: flex; align-items: center; gap: 12px; }
.site-branding img.custom-logo { max-height: 48px; width: auto; }
.site-title {
  font-family: var(--mm-font-display);
  font-size: 1.9rem;
  letter-spacing: .04em;
  margin: 0;
  color: var(--mm-bone);
}
.site-title a { color: inherit; }
.site-title a:hover { color: var(--mm-red-text); }
.site-description {
  font-family: var(--mm-font-mono);
  font-size: .7rem;
  color: var(--mm-mute);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 2px 0 0;
}

.main-navigation { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.main-navigation ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.main-navigation li { position: relative; }
.main-navigation a {
  display: block;
  padding: 10px 14px;
  font-family: var(--mm-font-mono);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--mm-bone-dim);
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: var(--mm-red-text);
}
.main-navigation ul ul {
  display: none;
  position: absolute; left: 0; top: 100%;
  background: var(--mm-panel);
  border: 1px solid var(--mm-line);
  min-width: 200px;
  flex-direction: column;
  padding: 6px 0;
}
.main-navigation li:hover > ul { display: flex; }

.header-search { display: flex; align-items: center; }
.header-search .search-form { display: flex; }
.header-search input[type="search"] {
  background: var(--mm-panel);
  border: 1px solid var(--mm-line);
  color: var(--mm-bone);
  padding: 8px 10px;
  font-family: var(--mm-font-body);
  font-size: .85rem;
  width: 160px;
}
.header-search button {
  background: var(--mm-red);
  border: 1px solid var(--mm-red);
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
}
.header-search button:hover { background: var(--mm-red-bright); }

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--mm-line);
  color: var(--mm-bone);
  padding: 8px 12px;
  font-family: var(--mm-font-mono);
  font-size: .8rem;
  text-transform: uppercase;
  cursor: pointer;
}

@media (max-width: 860px) {
  .menu-toggle { display: inline-block; }
  .main-navigation { display: none; width: 100%; order: 3; justify-content: flex-start; }
  .main-navigation.is-open { display: flex; }
  .main-navigation ul { flex-direction: column; width: 100%; }
  .main-navigation ul ul { position: static; border: none; padding-left: 1em; }
  .site-header__inner { flex-wrap: wrap; }
  .header-search { order: 2; }
}

/* =========================================================
   4. HERO / FEATURED POST
   ========================================================= */
.mm-hero {
  position: relative;
  border-bottom: 1px solid var(--mm-line);
  overflow: hidden;
}
.mm-hero__media {
  display: block; /* it's an <a>, which is inline by default — aspect-ratio has no effect on inline boxes */
  position: relative;
  aspect-ratio: 21 / 9;
  background: var(--mm-panel) center/cover no-repeat;
}
.mm-hero__media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,10,12,0.15) 0%, rgba(11,10,12,0.55) 55%, rgba(11,10,12,0.96) 100%);
}
.mm-hero__content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding-top: 32px;
  padding-bottom: 40px;
}
.mm-hero__title { font-size: clamp(2rem, 5vw, 3.6rem); max-width: 900px; }
.mm-hero__title a { color: var(--mm-bone); }
.mm-hero__title a:hover { color: var(--mm-red-text); }
.mm-hero__excerpt { max-width: 640px; color: var(--mm-bone-dim); }
.mm-hero:not(:has(img)) .mm-hero__media { aspect-ratio: 32 / 9; }

.mm-hero-social {
  background: var(--mm-panel);
  border-bottom: 1px solid var(--mm-line);
}
.mm-hero-social .mm-container {
  display: flex;
  justify-content: center;
  padding-top: 16px;
  padding-bottom: 16px;
}

/* Below this width the hero's wide aspect-ratio leaves too little height
   for the overlaid title/excerpt/meta text, which then gets clipped by
   .mm-hero's overflow:hidden. Stop overlaying and stack instead: image
   on top (its own shorter, less-cropped ratio), text panel below it.
   This has to come after the base .mm-hero__content rule above (not in
   the earlier @media block near the nav styles) — a media query doesn't
   add specificity, so if it appeared before that unconditional rule in
   source order, the unconditional rule would still win even inside the
   narrow viewport. */
@media (max-width: 860px) {
  .mm-hero__media { aspect-ratio: 16 / 9; }
  .mm-hero:not(:has(img)) .mm-hero__media { aspect-ratio: 16 / 9; }
  .mm-hero__content {
    position: static;
    padding: 24px 24px 28px;
  }
}

/* =========================================================
   5. POST GRID / CARDS
   ========================================================= */
.mm-section-heading {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 2px solid var(--mm-red);
  padding-bottom: 10px;
  margin: 48px 0 24px;
}
.mm-section-heading h2 { margin: 0; }
.mm-section-heading a { font-family: var(--mm-font-mono); font-size: .8rem; text-transform: uppercase; }

.mm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 900px) { .mm-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .mm-grid { grid-template-columns: 1fr; } }

.mm-card {
  background: var(--mm-panel);
  border: 1px solid var(--mm-line);
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease, transform .15s ease;
}
.mm-card:hover { border-color: var(--mm-red); transform: translateY(-2px); }
.mm-card__thumb { display: block; aspect-ratio: 16/10; background: var(--mm-panel-2) center/cover no-repeat; position: relative; }
.mm-card__thumb .mm-cat-pill { position: absolute; top: 10px; left: 10px; margin: 0; }
.mm-card__body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mm-card__body h3 { font-size: 1.2rem; margin: 0; }
.mm-card__body h3 a { color: var(--mm-bone); }
.mm-card__body h3 a:hover { color: var(--mm-red-text); }
.mm-card__excerpt { color: var(--mm-bone-dim); font-size: .92rem; margin: 0; }

/* Horizontal list variant (archives/search) */
.mm-list { display: flex; flex-direction: column; gap: 24px; }
.mm-list-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  border-bottom: 1px solid var(--mm-line);
  padding-bottom: 24px;
}
.mm-list-item__thumb { display: block; aspect-ratio: 4/3; background: var(--mm-panel) center/cover no-repeat; }
.mm-list-item__body h2 { font-size: 1.4rem; margin: 0 0 .3em; }
.mm-list-item__body h2 a { color: var(--mm-bone); }
.mm-list-item__body h2 a:hover { color: var(--mm-red-text); }
@media (max-width: 640px) {
  .mm-list-item { grid-template-columns: 1fr; }
}

/* =========================================================
   6. SINGLE POST / PAGE
   ========================================================= */
.mm-content-wrap { padding: 48px 0 64px; }
.mm-article-header { max-width: 820px; margin: 0 auto 28px; text-align: center; }
.mm-article-header h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.mm-article-thumb { max-width: var(--mm-container); margin: 0 auto 36px; border: 1px solid var(--mm-line); }
.mm-article-thumb img { width: 100%; }
.mm-article-body {
  max-width: 760px; margin: 0 auto;
  font-size: 1.08rem;
}
.mm-article-body img { border: 1px solid var(--mm-line); margin: 1.5em 0; }
.mm-article-body h2 { margin-top: 1.6em; }
.mm-article-body h2, .mm-article-body h3 { border-left: 3px solid var(--mm-red); padding-left: .5em; }
.mm-article-footer { max-width: 760px; margin: 40px auto 0; border-top: 1px solid var(--mm-line); padding-top: 24px; }
.mm-tags-list { margin-bottom: 1em; }

.page-content .mm-article-header { text-align: left; }

/* =========================================================
   7. COMMENTS
   ========================================================= */
.comments-area { max-width: 760px; margin: 48px auto 0; }
.comments-title { border-bottom: 2px solid var(--mm-red); padding-bottom: 10px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment {
  background: var(--mm-panel);
  border: 1px solid var(--mm-line);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.comment-list .children { list-style: none; padding-left: 28px; margin-top: 16px; }
.comment-author { font-family: var(--mm-font-mono); font-size: .85rem; color: var(--mm-bone); }
.comment-metadata { font-size: .78rem; color: var(--mm-mute); margin-bottom: .6em; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--mm-panel);
  border: 1px solid var(--mm-line);
  color: var(--mm-bone);
  padding: 10px 12px;
  font-family: var(--mm-font-body);
  margin-bottom: 14px;
}
.comment-form label { display: block; font-family: var(--mm-font-mono); font-size: .78rem; text-transform: uppercase; margin-bottom: .4em; color: var(--mm-mute); }

/* =========================================================
   8. BUTTONS / FORMS
   ========================================================= */
.mm-btn, .comment-form input[type="submit"], input#submit {
  display: inline-block;
  background: var(--mm-red);
  color: #fff !important;
  border: 1px solid var(--mm-red);
  padding: 12px 22px;
  font-family: var(--mm-font-mono);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background .15s ease;
}
.mm-btn:hover, .comment-form input[type="submit"]:hover { background: var(--mm-red-bright); border-color: var(--mm-red-bright); }

.search-form { display: flex; }
.search-form__control { display: flex; flex: 1; }

/* =========================================================
   9. SIDEBAR / WIDGETS
   ========================================================= */
.widget { margin-bottom: 36px; }
.widget-title {
  font-family: var(--mm-font-display);
  font-size: 1.2rem;
  border-bottom: 2px solid var(--mm-red);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li { padding: 6px 0; border-bottom: 1px solid var(--mm-line); }

/* =========================================================
   10. FOOTER
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--mm-line);
  background: var(--mm-black-soft);
  padding: 48px 0 28px;
  margin-top: 64px;
}
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-bottom: 36px;
}
.footer-bottom {
  border-top: 1px solid var(--mm-line);
  padding-top: 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.site-info { font-family: var(--mm-font-mono); font-size: .78rem; color: var(--mm-mute); }
.site-info a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--mm-line); }
.site-info a:hover { color: var(--mm-red-text); text-decoration-color: currentColor; }
.social-links { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; }
.social-links a {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--mm-line);
  color: var(--mm-bone-dim);
  border-radius: 50%;
}
.social-links a:hover { border-color: var(--mm-red); color: var(--mm-red-text); }
.social-links svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  display: block;
}

/* =========================================================
   11. CONTRIBUTE / CTA
   ========================================================= */
.mm-cta {
  background: var(--mm-panel);
  border: 1px solid var(--mm-line);
  border-left: 4px solid var(--mm-red);
  padding: 28px 30px;
  margin: 32px 0;
}

/* =========================================================
   12. 404
   ========================================================= */
.mm-404 { text-align: center; padding: 100px 0; }
.mm-404 h1 { font-size: 6rem; color: var(--mm-red-text); }

/* =========================================================
   13. PAGINATION
   ========================================================= */
.mm-pagination { display: flex; justify-content: center; gap: 8px; margin: 48px 0 0; }
.mm-pagination a, .mm-pagination span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--mm-line);
  font-family: var(--mm-font-mono);
  font-size: .82rem;
  color: var(--mm-bone-dim);
}
.mm-pagination .current { background: var(--mm-red); border-color: var(--mm-red); color: #fff; }
.mm-pagination a:hover { border-color: var(--mm-red); color: var(--mm-red-text); }

/* =========================================================
   14. ALIGNMENTS (core block support)
   ========================================================= */
.alignwide { max-width: 1000px; margin-left: auto; margin-right: auto; }
.alignfull { max-width: none; width: 100%; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
