/*
Theme Name: MetallurgyZone
Theme URI: https://metallurgyzone.com
Author: MetallurgyZone
Author URI: https://metallurgyzone.com
Description: A professional educational metallurgy blog theme with industrial dark aesthetic.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: metallurgyzone
Tags: blog, education, custom-colors, custom-menu, featured-images, post-formats
*/

/* ============================================================
   GLOBAL VARIABLES & RESET
   ============================================================ */
:root {
  --iron:     #1a1a1a;
  --steel:    #2c2c2c;
  --slag:     #3d3d3d;
  --oxide:    #c8622a;
  --gold:     #d4a843;
  --silver:   #e8e4dc;
  --light:    #f4f1eb;
  --white:    #fdfcfa;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--white);
  color: var(--iron);
  overflow-x: hidden;
}

/* ============================================================
   HEADER & NAV
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--iron);
  border-bottom: 3px solid var(--oxide);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  height: 70px;
}
.site-logo {
  display: flex; align-items: baseline; gap: .2rem; text-decoration: none;
}
.logo-main {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem; color: var(--silver); letter-spacing: .05em;
}
.logo-zone {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem; color: var(--oxide); letter-spacing: .05em;
}
.site-nav { display: flex; gap: 2rem; align-items: center; }
.site-nav a {
  font-size: .78rem; font-weight: 500; letter-spacing: .12em;
  text-transform: uppercase; color: #aaa; text-decoration: none;
  transition: color .2s;
}
.site-nav a:hover, .site-nav .current-menu-item a { color: var(--gold); }
.site-nav .menu-subscribe a {
  background: var(--oxide); color: var(--white) !important;
  padding: .5rem 1.2rem; border-radius: 2px;
  transition: background .2s !important;
}
.site-nav .menu-subscribe a:hover { background: #b8541e !important; }

/* ============================================================
   PAGE HERO BANNER
   ============================================================ */
.page-hero {
  background: var(--iron);
  padding: clamp(3rem, 7vw, 6rem) clamp(1.5rem, 5vw, 5rem);
  position: relative; overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, transparent, transparent 20px,
    rgba(200,98,42,.03) 20px, rgba(200,98,42,.03) 21px);
  pointer-events: none;
}
.page-hero-inner { position: relative; z-index: 1; }
.page-tag {
  font-size: .7rem; letter-spacing: .25em; text-transform: uppercase;
  color: var(--oxide); font-weight: 500; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .8rem;
}
.page-tag::before { content: ''; display: block; width: 24px; height: 2px; background: var(--oxide); }
.page-hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 6vw, 5rem);
  color: var(--silver); letter-spacing: .03em; line-height: 1;
}
.page-hero p {
  font-size: 1rem; color: #777; margin-top: 1rem;
  font-weight: 300; max-width: 500px;
}

/* ============================================================
   FILTER BAR (Blog)
   ============================================================ */
.filter-bar {
  background: var(--light);
  border-bottom: 1px solid #e0dbd2;
  padding: 1.2rem clamp(1.5rem, 5vw, 5rem);
  display: flex; gap: .8rem; flex-wrap: wrap; align-items: center;
}
.filter-label {
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: #999; font-weight: 500; margin-right: .5rem;
}
.filter-btn {
  background: none; border: 1.5px solid #d4cfc5; color: #888;
  padding: .4rem 1rem; font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; font-family: 'DM Sans', sans-serif;
  cursor: pointer; border-radius: 2px; transition: all .2s;
  text-decoration: none; display: inline-block;
}
.filter-btn:hover, .filter-btn.active, .current-cat .filter-btn {
  background: var(--oxide); border-color: var(--oxide); color: var(--white);
}

/* ============================================================
   BLOG / ARTICLES GRID
   ============================================================ */
.articles-section {
  padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 5vw, 5rem);
}
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}
.article-card {
  background: var(--white); border: 1.5px solid #e5e0d7;
  overflow: hidden; cursor: pointer;
  transition: border-color .2s, transform .2s;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
}
.article-card:hover { border-color: var(--oxide); transform: translateY(-4px); }
.card-thumb {
  height: 160px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem; color: rgba(200,98,42,.2);
  letter-spacing: .1em;
}
.card-body { padding: 1.8rem; flex: 1; display: flex; flex-direction: column; }
.card-category {
  font-size: .62rem; letter-spacing: .2em; text-transform: uppercase;
  font-weight: 500; margin-bottom: .8rem; display: inline-block; padding: .25rem .7rem;
}
.cat-heat    { background: #3a1a0a; color: var(--oxide); }
.cat-alloy   { background: #0a1a2a; color: #5a9fd4; }
.cat-corrosion { background: #0a2a1a; color: #5abf8a; }
.cat-welding { background: #2a1a2a; color: #bf7abf; }
.cat-crystal { background: #1a1a2a; color: #7a8abf; }
.cat-nonferrous { background: #2a2a0a; color: #bfbf5a; }
.cat-manufacturing { background: #2a1a0a; color: var(--gold); }
.card-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem; line-height: 1.3; color: var(--iron); margin-bottom: .7rem;
}
.card-excerpt { font-size: .83rem; color: #888; line-height: 1.65; font-weight: 300; flex: 1; }
.card-footer {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid #eee; padding-top: 1rem; margin-top: 1.5rem;
  font-size: .68rem; color: #bbb; text-transform: uppercase; letter-spacing: .08em;
}
.card-read { color: var(--oxide); font-size: .72rem; letter-spacing: .12em; font-weight: 500; }

/* ============================================================
   SINGLE ARTICLE
   ============================================================ */
.art-hero {
  background: var(--iron);
  padding: clamp(3rem, 7vw, 6rem) clamp(1.5rem, 5vw, 5rem);
  position: relative; overflow: hidden;
}
.art-hero::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, transparent, transparent 20px,
    rgba(200,98,42,.03) 20px, rgba(200,98,42,.03) 21px);
  pointer-events: none;
}
.art-hero-inner { position: relative; z-index: 1; }
.breadcrumb {
  font-size: .68rem; letter-spacing: .15em; text-transform: uppercase;
  color: #555; margin-bottom: 1.5rem;
}
.breadcrumb a { color: #555; text-decoration: none; transition: color .2s; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { margin: 0 .5rem; }
.art-category-tag {
  display: inline-block; background: var(--oxide); color: var(--white);
  font-size: .62rem; letter-spacing: .2em; text-transform: uppercase;
  padding: .3rem .8rem; margin-bottom: 1.2rem;
}
.art-hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4.5vw, 3.5rem); color: var(--silver);
  line-height: 1.15; max-width: 800px; margin-bottom: 1.5rem;
}
.art-hero h1 em { font-style: italic; color: var(--gold); }
.art-meta-bar {
  display: flex; gap: 2rem; flex-wrap: wrap;
}
.art-meta-bar span {
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: #666; display: flex; align-items: center; gap: .4rem;
}

.article-layout {
  display: grid; grid-template-columns: 1fr 300px;
  gap: 4rem;
  padding: clamp(3rem, 5vw, 5rem) clamp(1.5rem, 5vw, 5rem);
  max-width: 1200px; margin: 0 auto;
}
.article-body h2 {
  font-family: 'DM Serif Display', serif; font-size: 1.7rem;
  color: var(--iron); margin: 2.5rem 0 1rem; line-height: 1.25;
}
.article-body h2 em { font-style: italic; color: var(--oxide); }
.article-body h3 {
  font-family: 'DM Serif Display', serif; font-size: 1.25rem;
  color: var(--iron); margin: 2rem 0 .8rem;
}
.article-body p { font-size: 1rem; line-height: 1.8; color: #444; margin-bottom: 1.4rem; font-weight: 300; }
.article-body p strong { color: var(--iron); font-weight: 500; }
.article-body ul, .article-body ol { padding-left: 1.5rem; margin-bottom: 1.4rem; }
.article-body li { font-size: 1rem; line-height: 1.8; color: #444; margin-bottom: .5rem; font-weight: 300; }
.article-body li strong { color: var(--iron); font-weight: 500; }
.article-body img { max-width: 100%; height: auto; margin: 1.5rem 0; }
.article-body blockquote {
  border-left: 4px solid var(--oxide); padding: 1.2rem 1.8rem;
  background: var(--light); margin: 2rem 0; font-style: italic; color: #666;
}
.callout {
  background: var(--light); border-left: 4px solid var(--oxide);
  padding: 1.5rem 1.8rem; margin: 2rem 0; border-radius: 0 4px 4px 0;
}
.callout p { margin: 0; color: #555; font-size: .95rem; }
.callout strong { color: var(--oxide); }
.diagram-box { background: var(--iron); padding: 2rem; margin: 2.5rem 0; text-align: center; }
.diagram-caption { font-size: .72rem; color: #666; letter-spacing: .1em; text-transform: uppercase; margin-top: 1rem; }
.facts-table { width: 100%; border-collapse: collapse; margin: 2rem 0; font-size: .9rem; }
.facts-table th { background: var(--iron); color: var(--silver); padding: .8rem 1rem; text-align: left; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; }
.facts-table td { padding: .8rem 1rem; border-bottom: 1px solid #e5e0d7; color: #555; line-height: 1.5; }
.facts-table tr:nth-child(even) td { background: var(--light); }
.divider { width: 60px; height: 3px; background: var(--oxide); margin: 2.5rem 0; }
.tags-wrap { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #e5e0d7; }
.tag { background: var(--light); color: #777; padding: .3rem .8rem; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; border-radius: 2px; }
.author-box { background: var(--light); padding: 2rem; margin-top: 3rem; border-top: 3px solid var(--gold); display: flex; gap: 1.5rem; align-items: flex-start; }
.author-avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--iron); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem; color: var(--gold); overflow: hidden; }
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-name { font-family: 'DM Serif Display', serif; font-size: 1.1rem; color: var(--iron); margin-bottom: .3rem; }
.author-bio { font-size: .85rem; color: #777; line-height: 1.65; font-weight: 300; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-widget {
  background: var(--light); padding: 1.5rem;
  margin-bottom: 1.5rem; border-top: 3px solid var(--oxide);
}
.sidebar-widget h4 {
  font-size: .7rem; letter-spacing: .2em; text-transform: uppercase;
  color: #888; margin-bottom: 1.2rem; font-weight: 500;
}
.toc-list { list-style: none; padding: 0; }
.toc-list li { padding: .5rem 0; border-bottom: 1px solid #e0dbd2; font-size: .85rem; }
.toc-list li:last-child { border-bottom: none; }
.toc-list li a { color: #777; text-decoration: none; transition: color .2s; }
.toc-list li a:hover { color: var(--oxide); }
.toc-list li a::before { content: '→ '; font-size: .7rem; color: var(--oxide); }
.related-article { padding: .8rem 0; border-bottom: 1px solid #e0dbd2; }
.related-article:last-child { border-bottom: none; }
.related-article a { text-decoration: none; }
.rel-cat { font-size: .6rem; letter-spacing: .15em; text-transform: uppercase; color: var(--oxide); font-weight: 500; margin-bottom: .3rem; }
.rel-title { font-size: .88rem; color: var(--iron); line-height: 1.35; font-family: 'DM Serif Display', serif; }
.related-article:hover .rel-title { color: var(--oxide); }
.widget-newsletter { background: var(--iron) !important; border-top-color: var(--gold) !important; }
.widget-newsletter h4 { color: #666 !important; }
.widget-newsletter p { font-size: .82rem; color: #666; margin-bottom: 1rem; line-height: 1.6; }
.nl-input-sm {
  width: 100%; background: #2a2a2a; border: 1px solid #3a3a3a;
  color: #aaa; padding: .6rem .8rem; font-family: 'DM Sans', sans-serif;
  font-size: .82rem; margin-bottom: .6rem; outline: none;
}
.nl-btn-sm {
  width: 100%; background: var(--oxide); color: white; border: none;
  padding: .6rem; font-family: 'DM Sans', sans-serif;
  font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
  transition: background .2s;
}
.nl-btn-sm:hover { background: #b8541e; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; justify-content: center; gap: .5rem; padding: 3rem 0 1rem; }
.page-numbers {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #e0dbd2; font-size: .82rem; color: #888; text-decoration: none; transition: all .2s;
}
.page-numbers:hover, .page-numbers.current {
  background: var(--oxide); border-color: var(--oxide); color: var(--white);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #111; border-top: 3px solid var(--oxide);
  padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 5vw, 5rem) 2rem;
}
.footer-top {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem; margin-bottom: 3rem;
}
.footer-tagline { font-size: .82rem; color: #555; line-height: 1.65; margin-top: 1rem; }
.footer-col h4 {
  font-size: .7rem; letter-spacing: .2em; text-transform: uppercase;
  color: #555; margin-bottom: 1.2rem; font-weight: 500;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .7rem; }
.footer-col ul li a { font-size: .85rem; color: #666; text-decoration: none; transition: color .2s; }
.footer-col ul li a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid #222; padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer-copy { font-size: .72rem; color: #444; }
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a { font-size: .72rem; color: #444; text-decoration: none; transition: color .2s; }
.footer-legal a:hover { color: #666; }

/* ============================================================
   HOMEPAGE SPECIFIC
   ============================================================ */
.hero-section {
  display: grid; grid-template-columns: 1fr 1fr; min-height: 88vh; overflow: hidden;
}
.hero-left {
  background: var(--iron);
  padding: clamp(3rem, 8vw, 7rem) clamp(1.5rem, 5vw, 5rem);
  display: flex; flex-direction: column; justify-content: center; position: relative; z-index: 2;
}
.hero-tag {
  font-size: .72rem; letter-spacing: .25em; text-transform: uppercase;
  color: var(--oxide); font-weight: 500; margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: .8rem;
}
.hero-tag::before { content: ''; display: block; width: 32px; height: 2px; background: var(--oxide); }
.hero-left h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.5rem, 7vw, 6rem); line-height: .95; color: var(--silver);
  margin-bottom: 1.8rem; letter-spacing: .02em;
}
.hero-left h1 em { font-style: normal; color: var(--gold); display: block; }
.hero-desc { font-size: 1rem; line-height: 1.7; color: #999; max-width: 420px; margin-bottom: 2.5rem; font-weight: 300; }
.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary {
  background: var(--oxide); color: var(--white); padding: .85rem 2rem;
  text-decoration: none; font-size: .82rem; letter-spacing: .12em;
  text-transform: uppercase; font-weight: 500; border-radius: 2px;
  transition: background .2s, transform .15s; display: inline-block;
}
.btn-primary:hover { background: #b8541e; transform: translateY(-2px); }
.btn-outline {
  border: 1px solid #444; color: #aaa; padding: .85rem 2rem; text-decoration: none;
  font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 500; border-radius: 2px; transition: border-color .2s, color .2s; display: inline-block;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.hero-stats { position: absolute; bottom: 3rem; left: clamp(1.5rem, 5vw, 5rem); display: flex; gap: 3rem; }
.stat-num { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; color: var(--gold); line-height: 1; }
.stat-label { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: #666; margin-top: .2rem; }
.hero-right {
  background: linear-gradient(135deg, #2a1a0e 0%, #1a1a1a 40%, #0d0d0d 100%);
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.marquee-wrap { background: var(--oxide); overflow: hidden; white-space: nowrap; padding: .7rem 0; }
.marquee-track { display: inline-flex; gap: 3rem; animation: marquee 25s linear infinite; }
.marquee-track span { font-family: 'Bebas Neue', sans-serif; font-size: 1rem; color: rgba(255,255,255,.85); letter-spacing: .12em; }
.marquee-track span.dot { color: rgba(255,255,255,.4); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 3.5rem; flex-wrap: wrap; gap: 1.5rem; }
.section-tag {
  font-size: .7rem; letter-spacing: .25em; text-transform: uppercase;
  color: var(--oxide); font-weight: 500; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .8rem;
}
.section-tag::before { content: ''; display: block; width: 24px; height: 2px; background: var(--oxide); }
.section-title { font-family: 'DM Serif Display', serif; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; color: var(--iron); }
.section-title em { font-style: italic; color: var(--oxide); }
.section-sub { font-size: 1rem; color: #777; line-height: 1.7; max-width: 520px; font-weight: 300; }
.topics-section { background: var(--light); padding: clamp(4rem, 8vw, 7rem) clamp(1.5rem, 5vw, 5rem); }
.topics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5px; background: #d4cfc5; border: 1.5px solid #d4cfc5; }
.topic-card { background: var(--white); padding: 2rem 1.8rem; cursor: pointer; transition: background .2s; position: relative; overflow: hidden; text-decoration: none; display: block; }
.topic-card::after { content: ''; position: absolute; bottom: 0; left: 0; height: 3px; width: 0; background: var(--oxide); transition: width .3s ease; }
.topic-card:hover { background: var(--iron); }
.topic-card:hover::after { width: 100%; }
.topic-card:hover .topic-icon { color: var(--gold); }
.topic-card:hover .topic-name { color: var(--silver); }
.topic-card:hover .topic-count { color: #666; }
.topic-icon { font-size: 1.8rem; margin-bottom: 1rem; transition: color .2s; }
.topic-name { font-family: 'DM Serif Display', serif; font-size: 1.1rem; color: var(--iron); margin-bottom: .4rem; transition: color .2s; }
.topic-count { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #aaa; transition: color .2s; }
.newsletter-section { background: var(--iron); padding: clamp(4rem, 8vw, 7rem) clamp(1.5rem, 5vw, 5rem); position: relative; overflow: hidden; }
.newsletter-section::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, transparent, transparent 20px, rgba(200,98,42,.03) 20px, rgba(200,98,42,.03) 21px); }
.newsletter-inner { position: relative; z-index: 1; max-width: 600px; }
.newsletter-section .section-tag { color: var(--gold); }
.newsletter-section .section-tag::before { background: var(--gold); }
.newsletter-section .section-title { color: var(--silver); }
.newsletter-section .section-sub { color: #777; }
.newsletter-form { display: flex; margin-top: 2.5rem; max-width: 500px; }
.nl-input { flex: 1; background: #2a2a2a; border: 1px solid #3a3a3a; border-right: none; color: var(--silver); padding: .9rem 1.2rem; font-size: .88rem; font-family: 'DM Sans', sans-serif; outline: none; transition: border-color .2s; }
.nl-input:focus { border-color: var(--oxide); }
.nl-input::placeholder { color: #555; }
.nl-btn { background: var(--oxide); color: var(--white); border: none; padding: .9rem 1.8rem; font-size: .78rem; letter-spacing: .15em; text-transform: uppercase; font-family: 'DM Sans', sans-serif; font-weight: 500; cursor: pointer; transition: background .2s; }
.nl-btn:hover { background: #b8541e; }
.nl-note { margin-top: 1rem; font-size: .72rem; color: #555; letter-spacing: .05em; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 900px) {
  .hero-section { grid-template-columns: 1fr; min-height: auto; }
  .hero-right { height: 300px; }
  .hero-stats { position: static; margin-top: 2.5rem; }
  .site-nav { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .articles-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .newsletter-form { flex-direction: column; }
  .nl-input { border-right: 1px solid #3a3a3a; border-bottom: none; }
}

/* ============================================================
   WORDPRESS CORE OVERRIDES
   ============================================================ */
.wp-block-image img { max-width: 100%; height: auto; }
.alignwide { margin-left: -2rem; margin-right: -2rem; }
.alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); width: 100vw; }
