/* B2e Magazine Theme — Byte Cod3 Edition */

:root {
    --color-primary:       #07101d;
    --color-primary-light: #0f2139;
    --color-accent:        #1677ff;
    --color-accent-hover:  #0958d9;
    --color-cyan:          #40c9ff;
    --color-lime:          #ccff55;
    --color-accent2:       #40c9ff;
    --color-accent2-hover: #1677ff;
    --color-bg:            #f8fafc;
    --color-bg-card:       #ffffff;
    --color-text:          #0f172a;
    --color-text-body:     #334155;
    --color-muted:         #64748b;
    --color-border:        #e2e8f0;
    --color-border-subtle: #f1f5f9;
    --font-heading:        system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-body:           system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono:           ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    --radius-sm:           4px;
    --radius:              8px;
    --radius-lg:           12px;
    --radius-full:         9999px;
    --shadow-sm:           0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow:              0 4px 12px rgba(15, 23, 42, .08);
    --shadow-md:           0 8px 24px rgba(15, 23, 42, .10);
    --shadow-lg:           0 16px 36px rgba(15, 23, 42, .14);
    --shadow-hover:        0 10px 28px rgba(15, 23, 42, .12);
    --transition:          all .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--color-text); background: var(--color-bg); line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ─── LAYOUT ─────────────────────────────────────────── */

.mg-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.mg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 44px; align-items: start; }
.mg-full { grid-column: 1 / -1; }

/* Scoped layout widening for single article & hero */
.mg-wrap.mg-article-layout,
.mg-wrap.mg-article-layout-header,
.mg-post-hero-wrap {
    max-width: 1340px;
}

.mg-article-layout .mg-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 36px;
}

/* ─── HEADER ─────────────────────────────────────────── */

.mg-header {
    background: rgba(7, 16, 29, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.mg-header .mg-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.mg-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.mg-brand-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    transition: var(--transition);
}
.mg-brand-link:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}
.mg-brand-link:focus-visible {
    outline: 2px solid var(--color-cyan);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}
.mg-brand-logo {
    height: 58px;
    max-height: 64px;
    width: auto;
    object-fit: contain;
    display: block;
}
.mg-brand-tagline {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--color-cyan);
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin-top: 3px;
    padding-left: 2px;
}

.mg-nav {
    display: flex;
    align-items: center;
}
.mg-nav ul {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}
.mg-nav a {
    display: block;
    padding: 8px 18px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: var(--transition);
    letter-spacing: 0.3px;
}
.mg-nav a:hover,
.mg-nav a.active {
    background: var(--color-accent);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(22, 119, 255, 0.35);
}
.mg-nav a:focus-visible {
    outline: 2px solid var(--color-cyan);
    outline-offset: 2px;
}
/* Link externo de venda do livro: contorno para diferenciar da navegação interna */
.mg-nav a.mg-nav-book {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    border: 1px solid rgba(64, 201, 255, 0.55);
    color: var(--color-cyan);
}
.mg-nav a.mg-nav-book svg {
    flex-shrink: 0;
}
.mg-nav a.mg-nav-book:hover {
    background: var(--color-cyan);
    border-color: var(--color-cyan);
    color: #07101d;
    box-shadow: none;
}

/* Hamburger Menu Toggle */
.mg-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    transition: var(--transition);
}
.mg-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.35);
}
.mg-menu-toggle:focus-visible {
    outline: 2px solid var(--color-cyan);
    outline-offset: 2px;
}
.mg-menu-bar {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.mg-menu-toggle.is-active .mg-menu-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.mg-menu-toggle.is-active .mg-menu-bar:nth-child(2) {
    opacity: 0;
}
.mg-menu-toggle.is-active .mg-menu-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Nav Dropdown */
.mg-nav.is-open {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #091322;
    border-bottom: 2px solid var(--color-border);
    padding: 16px 20px 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
.mg-nav.is-open ul {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}
.mg-nav.is-open a {
    padding: 12px 16px;
    font-size: 0.95rem;
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.mg-header-search form {
    display: flex;
    align-items: center;
}
.mg-header-search input {
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 0.85rem;
    width: 180px;
    min-height: 40px;
    transition: var(--transition);
}
.mg-header-search input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}
.mg-header-search input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--color-cyan);
    box-shadow: 0 0 0 2px rgba(64, 201, 255, 0.25);
}
.mg-header-search button {
    min-height: 40px;
    min-width: 44px;
    padding: 8px 14px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mg-header-search button:hover {
    background: var(--color-cyan);
    color: #07101d;
}
.mg-header-search button:focus-visible {
    outline: 2px solid var(--color-lime);
    outline-offset: 2px;
}

/* ─── BREADCRUMB ─────────────────────────────────────── */

.mg-breadcrumb {
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 0;
    margin-bottom: 36px;
    font-size: .84rem;
    color: var(--color-muted);
}
.mg-breadcrumb .mg-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.mg-breadcrumb ol,
.mg-breadcrumb ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.mg-breadcrumb li {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}
.mg-breadcrumb a {
    color: var(--color-accent2);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}
.mg-breadcrumb a:hover {
    color: var(--color-accent2-hover);
    text-decoration: underline;
}
.mg-breadcrumb a:focus-visible {
    outline: 2px solid var(--color-accent2);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
.mg-breadcrumb span + span::before {
    content: ' › ';
    margin: 0 6px;
    color: var(--color-muted);
}
.mg-breadcrumb [aria-current="page"],
.mg-breadcrumb span[aria-current="page"],
.mg-breadcrumb li[aria-current="page"] {
    color: var(--color-text);
    font-weight: 600;
}

/* ─── CATEGORY BADGE ─────────────────────────────────── */

.mg-badge-link { display: inline-block; vertical-align: middle; }
.mg-badge { display: inline-flex; align-items: center; padding: 4px 12px; background: var(--color-accent); color: #fff; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; border-radius: var(--radius-sm); transition: var(--transition); box-shadow: 0 2px 6px rgba(230, 57, 70, .3); }
.mg-badge:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.mg-badge-blue { background: var(--color-accent2); box-shadow: 0 2px 6px rgba(79, 70, 229, .3); }
.mg-badge-blue:hover { background: var(--color-accent2-hover); }

/* ─── FEATURED POST ──────────────────────────────────── */

.mg-featured { margin: 32px 0; }
.mg-featured-link { display: block; }
.mg-featured-inner { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #0f172a; box-shadow: var(--shadow-md); }
.mg-featured-media { width: 100%; height: 480px; }
.mg-featured-img { width: 100%; height: 480px; object-fit: cover; opacity: .75; transition: transform .4s ease, opacity .3s ease; }
.mg-featured-inner:hover .mg-featured-img { opacity: .65; transform: scale(1.02); }
.mg-featured-placeholder { width: 100%; height: 480px; display: flex; align-items: center; justify-content: center; color: #475569; font-size: 2.4rem; background: linear-gradient(135deg, #1e293b, #0f172a); }
/* Overlay carries the absolute positioning and gradient; mg-wrap inside keeps the same 1200px/24px grid as the rest of the page, so the text below aligns with mg-featured-wrap */
.mg-featured-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(180deg, transparent 0%, rgba(15,23,42,.4) 30%, rgba(15,23,42,.92) 85%, #0f172a 100%); }
.mg-featured-wrap { width: 100%; }
.mg-featured-body { padding: 40px 0 44px; max-width: 760px; }
.mg-featured-body .mg-badge { margin-bottom: 14px; }
.mg-featured-body h1 { font-family: var(--font-heading); font-size: 2.2rem; color: #fff; line-height: 1.25; margin-bottom: 12px; font-weight: 800; letter-spacing: -0.02em; }
.mg-featured-body h1 a { color: #fff; }
.mg-featured-body h1 a:hover { color: rgba(255,255,255,.9); text-decoration: underline; }
.mg-featured-body p { color: rgba(255,255,255,.85); font-size: 1rem; max-width: 680px; line-height: 1.6; }
.mg-featured-meta { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin-top: 16px; color: rgba(255,255,255,.7); font-size: .82rem; }

/* ─── SECTION TITLE ──────────────────────────────────── */

.mg-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.mg-section-title h2 { font-family: var(--font-heading); font-size: 1.25rem; color: var(--color-primary); font-weight: 800; text-transform: uppercase; letter-spacing: .8px; }
.mg-section-title::after { content: ''; flex: 1; height: 2px; background: var(--color-border); }
.mg-section-title::before { content: ''; width: 4px; height: 22px; background: var(--color-accent); border-radius: 2px; }

/* ─── POST CARDS ─────────────────────────────────────── */

.mg-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; margin-bottom: 36px; }

.mg-card { background: var(--color-bg-card); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--color-border-subtle); transition: var(--transition); display: flex; flex-direction: column; }
.mg-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); border-color: var(--color-border); }

.mg-card-thumb { position: relative; overflow: hidden; height: 230px; background: #e2e8f0; }
.mg-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s cubic-bezier(.16, 1, .3, 1); }
.mg-card:hover .mg-card-thumb img { transform: scale(1.05); }
.mg-card-thumb .mg-badge { position: absolute; top: 14px; left: 14px; z-index: 2; }
.mg-card-thumb-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, #e2e8f0, #cbd5e1); display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 2.2rem; }

.mg-card-body { padding: 22px 24px; flex: 1; display: flex; flex-direction: column; }
.mg-card-body h3 { font-family: var(--font-heading); font-size: 1.18rem; line-height: 1.4; margin-bottom: 10px; font-weight: 700; letter-spacing: -0.01em; }
.mg-card-body h3 a { color: var(--color-text); transition: var(--transition); }
.mg-card-body h3 a:hover { color: var(--color-accent); }
.mg-card-excerpt { font-size: .9rem; color: var(--color-muted); line-height: 1.6; flex: 1; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mg-card-meta { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-top: auto; font-size: .8rem; color: var(--color-muted); border-top: 1px solid var(--color-border-subtle); padding-top: 14px; }

/* ─── PRODUCTS ───────────────────────────────────────── */

.mg-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Listagem: a foto é o card. Sem moldura, sombra ou elevação no hover. */

.mg-pdt-grid { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; margin: 0 0 56px; padding: 0; }

.mg-pdt-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 14px; background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease; }

.mg-pdt-card:hover { transform: scale(1.02); border-color: var(--color-accent); box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15); }

.mg-pdt-card-thumb { display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--color-border); background: var(--color-bg-card); }
.mg-pdt-card-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.mg-pdt-card-placeholder { display: block; width: 100%; height: 100%; background: var(--color-border-subtle); }

.mg-pdt-card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mg-pdt-card-title { font-size: 1rem; font-weight: 600; line-height: 1.35; color: var(--color-text); letter-spacing: -0.005em; }
.mg-pdt-card-title a { text-decoration: none; }
.mg-pdt-card-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mg-pdt-card-subtitle { font-size: .875rem; line-height: 1.5; color: var(--color-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mg-pdt-card-body .mg-pdt-price { margin-top: auto; padding-top: 6px; }

.mg-pdt-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-variant-numeric: tabular-nums; color: var(--color-primary); }
.mg-pdt-price-old { font-size: .875rem; color: var(--color-muted); }
.mg-pdt-price-offer,
.mg-pdt-price-current { font-size: 1.125rem; font-weight: 700; color: var(--color-primary); }

.mg-pdt-saving { font-size: .875rem; font-weight: 600; color: var(--color-accent-hover); }

/* Detalhe: galeria à esquerda, informação à direita. */

.mg-pdt-detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; align-items: start; margin: 32px 0 64px; }
.mg-pdt-gallery { min-width: 0; }

.mg-pdt-main { aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--color-border); background: var(--color-bg-card); }
.mg-pdt-main img { width: 100%; height: 100%; object-fit: contain; padding: 20px; }
.mg-pdt-main .mg-pdt-card-placeholder { height: 100%; }

.mg-pdt-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.mg-pdt-thumb { display: block; width: 72px; height: 72px; overflow: hidden; border-radius: var(--radius-sm); border: 2px solid var(--color-border); background: var(--color-bg-card); transition: border-color .2s ease; }
.mg-pdt-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.mg-pdt-thumb:hover { border-color: var(--color-muted); }
.mg-pdt-thumb.is-active { border-color: var(--color-primary); }

.mg-pdt-info { min-width: 0; }
.mg-pdt-title { font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; color: var(--color-primary); }
.mg-pdt-subtitle { margin-top: 10px; font-size: 1.05rem; line-height: 1.6; color: var(--color-muted); }

.mg-pdt-info .mg-pdt-price { margin-top: 24px; }
.mg-pdt-info .mg-pdt-price-offer,
.mg-pdt-info .mg-pdt-price-current { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.mg-pdt-info .mg-pdt-price-old s { font-size: 1rem; }

.mg-pdt-notice { margin-top: 20px; padding: 10px 14px; border-left: 3px solid var(--color-primary); background: var(--color-bg-card); font-size: .95rem; font-weight: 600; color: var(--color-text); }

.mg-pdt-cta { margin: 28px 0 36px; }
.mg-pdt-cta .mg-btn { width: 100%; min-height: 52px; }

.mg-pdt-content { max-width: 68ch; padding-top: 24px; border-top: 1px solid var(--color-border); font-size: 1rem; line-height: 1.7; color: var(--color-text-body); }
.mg-pdt-content img { max-width: 100%; height: auto; }

/* Foco visível em todos os controles, contraste alto */
.mg-pdt-card-title a:focus-visible,
.mg-pdt-thumb:focus-visible,
.mg-pdt-cta .mg-btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }

@media (min-width: 1025px) {
    .mg-pdt-info { position: sticky; top: 24px; }
}

@media (max-width: 1024px) {
    .mg-pdt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mg-pdt-detail { gap: 40px; }
}

@media (max-width: 768px) {
    .mg-pdt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; }
    .mg-pdt-detail { grid-template-columns: minmax(0, 1fr); gap: 28px; margin: 24px 0 48px; }
    .mg-pdt-cta .mg-btn { min-height: 52px; }
}

@media (min-width: 769px) {
    .mg-pdt-cta .mg-btn { width: auto; min-width: 280px; }
}

@media (prefers-reduced-motion: reduce) {
    .mg-pdt-thumb,
    .mg-pdt-card { transition: none; transform: none !important; }
}

/* ─── PAGINATION ─────────────────────────────────────── */

.mg-pager { margin: 40px 0; text-align: center; }
.mg-pager .paginator,
ul.paginator {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.mg-pager .paginator li,
ul.paginator li {
    display: inline-flex;
    margin: 0;
    padding: 0;
}
.mg-pager a,
.mg-pager span,
.paginator a,
.paginator span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: .88rem;
    font-weight: 600;
    color: var(--color-text);
    background: var(--color-bg-card);
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
}
.mg-pager a:hover,
.paginator a:hover {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(230, 57, 70, .25);
    transform: translateY(-1px);
}
.mg-pager .active,
.mg-pager .current,
.paginator .active,
.paginator .current,
.paginator span.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(230, 57, 70, .25);
    cursor: default;
}
.mg-pager a:focus-visible,
.paginator a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ─── PILLAR 1: HERO BANNER DINÂMICO E IMERSIVO ──────── */

.mg-post-hero { position: relative; background: #0f172a; overflow: hidden; min-height: 460px; max-height: 520px; display: flex; align-items: flex-end; }
.mg-post-hero-media { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.mg-post-hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .8; transform: scale(1.01); transition: transform 6s ease-out; }
.mg-post-hero:hover .mg-post-hero-media img { transform: scale(1.04); }

.mg-post-hero-overlay { position: relative; z-index: 2; width: 100%; background: linear-gradient(180deg, rgba(15, 23, 42, .2) 0%, rgba(15, 23, 42, .6) 35%, rgba(15, 23, 42, .92) 80%, #0f172a 100%); padding-top: 100px; }
.mg-post-hero-wrap { width: 100%; }
.mg-post-hero-body { padding: 40px 0 44px; max-width: 1000px; }
.mg-post-hero-body .mg-badge-link { margin-bottom: 18px; }

.mg-post-title { font-family: var(--font-heading); font-size: clamp(1.85rem, 4vw, 2.65rem); color: #fff; line-height: 1.22; font-weight: 800; letter-spacing: -0.025em; text-shadow: 0 2px 8px rgba(0,0,0,.45); }
.mg-post-hero-subtitle { font-size: 1.15rem; color: rgba(255,255,255,.9); line-height: 1.6; margin-top: 14px; font-weight: 400; text-shadow: 0 1px 4px rgba(0,0,0,.3); max-width: 900px; }

.mg-post-hero-meta { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin-top: 22px; color: rgba(255,255,255,.8); font-size: .85rem; font-weight: 500; }
.mg-meta-group { display: inline-flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mg-meta-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.mg-meta-icon { flex-shrink: 0; opacity: .85; }

/* Author chip: shared across hero destaque, cards and post headers (light + dark backgrounds) */
.mg-author-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: inherit; }
.mg-author-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1.5px solid rgba(0,0,0,.08); }
.mg-author-avatar-placeholder { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(148,163,184,.3); color: var(--color-primary); font-size: .72rem; font-weight: 800; }
.mg-featured-meta .mg-author-avatar,
.mg-post-hero-meta .mg-author-avatar { border-color: rgba(255,255,255,.4); }
.mg-featured-meta .mg-author-avatar-placeholder,
.mg-post-hero-meta .mg-author-avatar-placeholder { background: rgba(255,255,255,.2); color: #fff; }

/* Post Header Fallback (No-Hero) */
.mg-post-no-hero { padding: 36px 0 20px; max-width: 1000px; }
.mg-post-no-hero .mg-badge-link { margin-bottom: 14px; }
.mg-post-no-hero .mg-post-title { color: var(--color-primary); text-shadow: none; }
.mg-post-lead-subtitle { font-size: 1.18rem; color: var(--color-muted); line-height: 1.6; margin: 12px 0 16px; }
.mg-post-no-hero .mg-post-meta { display: flex; flex-wrap: wrap; gap: 20px; color: var(--color-muted); font-size: .85rem; font-weight: 500; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--color-border); }

/* ─── PILLAR 2: OTIMIZAÇÃO DA LEITURA (TYPOGRAPHY & CONTENT) ─ */

.mg-article-layout { margin-top: 40px; margin-bottom: 64px; }
.mg-article-main,
.mg-post-card { width: 100%; min-width: 0; max-width: 100%; }

.mg-post-card { background: var(--color-bg-card); padding: 36px 40px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--color-border-subtle); margin-bottom: 40px; }

.mg-video-wrapper { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; margin-bottom: 32px; box-shadow: var(--shadow-md); background: #000; }
.mg-video-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.mg-post-subtitle-box { background: #f8fafc; border-left: 4px solid var(--color-accent); padding: 18px 24px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 32px; box-shadow: inset 0 1px 2px rgba(0,0,0,.03); }
.mg-post-subtitle { font-size: 1.12rem; color: var(--color-text-body); font-style: italic; line-height: 1.65; margin-bottom: 0; }

.mg-post-content.htmlchars {
    min-width: 0;
    max-width: 100%;
    line-height: 1.85;
    font-size: 1.1rem;
    color: var(--color-text-body);
    letter-spacing: -0.005em;
    overflow-wrap: anywhere;
}

/* Leitura focada */
.mg-reader-bar { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 22px; }
.mg-reader-bar[hidden] { display: none; }
.mg-reader-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-bg-card);
    color: var(--color-primary);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.mg-reader-toggle:hover { border-color: var(--color-accent); background: #f5f9ff; color: var(--color-accent); }
.mg-reader-toggle:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
.mg-reader-toggle[aria-pressed="true"] { border-color: var(--color-accent-hover); background: var(--color-accent-hover); color: #fff; }
.mg-reader-toggle[aria-pressed="true"]:hover { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.mg-reader-icon { flex: none; width: 18px; height: 18px; }

.mg-reading-mode .mg-header,
.mg-reading-mode .mg-breadcrumb,
.mg-reading-mode .mg-footer,
.mg-reading-mode .mg-sidebar,
.mg-reading-mode .mg-related,
.mg-reading-mode .mg-share-section { display: none !important; }

.mg-reading-mode .mg-post-hero { display: block; min-height: 0; max-height: none; background: var(--color-bg); }
.mg-reading-mode .mg-post-hero-media { display: none; }
.mg-reading-mode .mg-post-hero-overlay { background: none; padding-top: 0; }
.mg-reading-mode .mg-post-hero-body { max-width: 680px; margin: 0 auto; padding: 40px 0 8px; }
.mg-reading-mode .mg-post-title { color: var(--color-primary); text-shadow: none; }
.mg-reading-mode .mg-post-hero-subtitle { color: var(--color-muted); text-shadow: none; }
.mg-reading-mode .mg-post-hero-meta { color: var(--color-muted); }
.mg-reading-mode .mg-post-hero-meta .mg-author-avatar { border-color: var(--color-border); }
.mg-reading-mode .mg-post-hero-meta .mg-author-avatar-placeholder { background: var(--color-border-subtle); color: var(--color-primary); }

.mg-reading-mode .mg-post-no-hero { max-width: 680px; margin: 0 auto; padding: 40px 0 8px; }
.mg-reading-mode .mg-article-layout { max-width: 680px; padding-left: 0; padding-right: 0; margin-top: 16px; margin-bottom: 72px; }
.mg-reading-mode .mg-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
.mg-reading-mode .mg-post-card { padding: 0; margin-bottom: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.mg-reading-mode .mg-post-content.htmlchars { max-width: 100%; padding: 0; font-size: 1.15rem; line-height: 1.9; }

.mg-reading-mode .mg-reader-bar {
    position: fixed;
    top: auto;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    left: auto;
    z-index: 9999;
    margin: 0;
}
.mg-reading-mode .mg-reader-toggle { box-shadow: var(--shadow-md); }

@media (max-width: 728px) {
    .mg-reading-mode .mg-article-layout { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 520px) {
    .mg-reading-mode .mg-reader-toggle { width: 48px; height: 48px; padding: 0; }
    .mg-reading-mode .mg-reader-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .mg-reader-toggle { transition: none; }
}

.mg-post-content.htmlchars p { margin-bottom: 24px; }
.mg-post-content.htmlchars > * { max-width: 100%; }
.mg-post-content.htmlchars iframe,
.mg-post-content.htmlchars video,
.mg-post-content.htmlchars svg { max-width: 100%; }
.mg-post-content.htmlchars table { display: block; overflow-x: auto; }
.mg-post-content.htmlchars th,
.mg-post-content.htmlchars td { min-width: 7rem; }

.mg-post-content.htmlchars h2 { font-family: var(--font-heading); font-size: 1.65rem; font-weight: 800; color: var(--color-primary); margin: 44px 0 16px; letter-spacing: -0.02em; padding-bottom: 10px; border-bottom: 2px solid var(--color-border-subtle); }
.mg-post-content.htmlchars h3 { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 700; color: var(--color-primary-light); margin: 32px 0 14px; letter-spacing: -0.015em; }
.mg-post-content.htmlchars h4 { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 600; color: var(--color-text); margin: 24px 0 10px; }

.mg-post-content.htmlchars a { color: var(--color-accent2); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; transition: var(--transition); }
.mg-post-content.htmlchars a:hover { color: var(--color-accent); }

.mg-post-content.htmlchars blockquote { border-left: 4px solid var(--color-accent); margin: 32px 0; padding: 20px 24px; background: #fff5f5; color: #4b5563; font-size: 1.1rem; font-style: italic; border-radius: 0 var(--radius) var(--radius) 0; box-shadow: inset 0 1px 2px rgba(0,0,0,.02); }

.mg-post-content.htmlchars ul, .mg-post-content.htmlchars ol { margin: 0 0 24px 28px; line-height: 1.8; }
.mg-post-content.htmlchars li { margin-bottom: 8px; }

.mg-post-content.htmlchars img { border-radius: var(--radius); margin: 32px auto; box-shadow: var(--shadow); }

.mg-post-content.htmlchars pre { background: #0f172a; color: #e2e8f0; padding: 22px 24px; border-radius: var(--radius); overflow-x: auto; font-family: var(--font-mono); font-size: .92rem; line-height: 1.65; margin: 28px 0; border: 1px solid #1e293b; box-shadow: inset 0 1px 3px rgba(0,0,0,.5); }
.mg-post-content.htmlchars code { background: #f1f5f9; color: #0f172a; padding: 3px 7px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: .9em; border: 1px solid #e2e8f0; }
.mg-post-content.htmlchars pre code { background: none; padding: 0; border: none; color: inherit; font-size: inherit; }

.mg-post-content.htmlchars table { width: 100%; border-collapse: collapse; margin: 32px 0; font-size: .95rem; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.mg-post-content.htmlchars th { background: #f1f5f9; padding: 14px 18px; text-align: left; font-weight: 700; color: var(--color-primary); border-bottom: 2px solid var(--color-border); }
.mg-post-content.htmlchars td { padding: 12px 18px; border-bottom: 1px solid var(--color-border); color: var(--color-text-body); }
.mg-post-content.htmlchars tr:last-child td { border-bottom: none; }
.mg-post-content.htmlchars tr:hover td { background: #f8fafc; }
.mg-post-content.htmlchars tr[style*="background"]:hover td { background-color: transparent; }
.mg-post-content.htmlchars tr,
.mg-post-content.htmlchars th,
.mg-post-content.htmlchars td { border-color: inherit; }

/* Social Share in Article */
.mg-share-section { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--color-border); }

/* Related Posts */
.mg-related { margin-top: 48px; }
.mg-related-cards { grid-template-columns: repeat(4, 1fr); gap: 20px; }
.mg-related .mg-card-thumb { height: 140px; }
.mg-related .mg-card-body { padding: 14px; }
.mg-related .mg-card-title { font-size: .95rem; line-height: 1.35; margin-bottom: 6px; }

/* ─── PILLAR 3: SIDEBAR (BARRA LATERAL) MODERNA ──────── */

.mg-sidebar { display: flex; flex-direction: column; gap: 28px; }

.mg-widget { background: var(--color-bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--color-border-subtle); overflow: hidden; transition: var(--transition); }
.mg-widget:hover { box-shadow: var(--shadow); border-color: var(--color-border); }

.mg-widget-title { background: #f8fafc; border-bottom: 1px solid var(--color-border); padding: 14px 20px; display: flex; align-items: center; gap: 10px; }
.mg-widget-title h3 { font-family: var(--font-heading); font-size: .88rem; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: var(--color-primary); margin: 0; }
.mg-widget-title::before { content: ''; width: 4px; height: 16px; background: var(--color-accent); border-radius: 2px; }

.mg-widget-body { padding: 18px 20px; }

.mg-search-form { display: flex; position: relative; }
.mg-search-form input { flex: 1; padding: 11px 14px; border: 1.5px solid var(--color-border); border-right: none; border-radius: var(--radius) 0 0 var(--radius); font-size: .9rem; color: var(--color-text); background: #fff; min-height: 44px; transition: var(--transition); }
.mg-search-form input:focus-visible { outline: none; border-color: var(--color-accent2); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); z-index: 1; }
.mg-search-form button { min-height: 44px; min-width: 44px; padding: 0 16px; background: var(--color-accent); color: #fff; border: 1.5px solid var(--color-accent); border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; font-size: .9rem; transition: var(--transition); display: flex; align-items: center; justify-content: center; }
.mg-search-form button:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
.mg-search-form button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.mg-post-mini { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--color-border-subtle); align-items: center; }
.mg-post-mini:first-child { padding-top: 0; }
.mg-post-mini:last-child { border-bottom: none; padding-bottom: 0; }
.mg-post-mini-thumb { position: relative; width: 72px; height: 72px; border-radius: var(--radius); overflow: hidden; flex-shrink: 0; background: #e2e8f0; }
.mg-post-mini-img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.mg-post-mini:hover .mg-post-mini-img { transform: scale(1.08); }
.mg-post-mini-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #e2e8f0, #cbd5e1); color: #94a3b8; font-size: 1.2rem; }

.mg-post-mini-body { flex: 1; min-width: 0; }
.mg-post-mini-title { font-family: var(--font-heading); font-size: .9rem; font-weight: 700; line-height: 1.35; margin-bottom: 6px; color: var(--color-text); }
.mg-post-mini-title a { color: var(--color-text); transition: var(--transition); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mg-post-mini-title a:hover { color: var(--color-accent); }
.mg-post-mini-meta { font-size: .75rem; color: var(--color-muted); display: flex; align-items: center; gap: 6px; }

.mg-cat-list li { border-bottom: 1px solid var(--color-border-subtle); }
.mg-cat-list li:last-child { border-bottom: none; }
.mg-cat-list a { display: flex; justify-content: space-between; align-items: center; padding: 11px 4px; font-size: .9rem; font-weight: 600; color: var(--color-text-body); transition: var(--transition); min-height: 44px; }
.mg-cat-list a:hover { color: var(--color-accent); padding-left: 8px; }
.mg-cat-list .mg-arrow-icon { opacity: .4; transition: var(--transition); }
.mg-cat-list a:hover .mg-arrow-icon { opacity: 1; transform: translateX(3px); color: var(--color-accent); }
.mg-empty-notice { font-size: .88rem; color: var(--color-muted); font-style: italic; }

/* ─── PILLAR 4: SEÇÃO DE COMENTÁRIOS ACOLHEDORA ──────── */

.mg-comments-section { margin-top: 48px; }
.mg-comments-wrapper { width: 100%; }

/* Reset de Floats e Isolamento do Widget de Comentários */
.mg-comments-wrapper .comments { float: none; width: 100%; padding: 0; text-align: left; }
.mg-comments-wrapper .comments > header { display: none; }

.mg-comments-wrapper .comments_count { float: none; width: 100%; padding: 14px 20px; background: #f1f5f9; border-radius: var(--radius); font-size: .88rem; font-weight: 700; color: var(--color-primary); text-transform: none; text-align: left; margin-bottom: 24px; border: 1px solid var(--color-border-subtle); }

.mg-comments-wrapper .comments_single { float: none; width: 100%; padding: 24px; margin-bottom: 20px; background: var(--color-bg-card); border-radius: var(--radius-lg); border: 1px solid var(--color-border-subtle); border-top: 3px solid #cbd5e1; box-shadow: var(--shadow-sm); display: flex; flex-wrap: wrap; gap: 16px; }

.mg-comments-wrapper .comments_single_avatar { float: none; width: 48px; height: 48px; flex-shrink: 0; }
.mg-comments-wrapper .comments_single_avatar img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid #e2e8f0; }

.mg-comments-wrapper .comments_single_content { float: none; width: calc(100% - 64px); padding-left: 0; flex: 1; min-width: 0; }
.mg-comments-wrapper .comments_single header h1 { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; color: var(--color-primary); margin-bottom: 4px; }

.mg-comments-wrapper .comments_single_comment { float: none; width: 100%; margin: 8px 0 14px 0; font-size: .95rem; line-height: 1.6; color: var(--color-text-body); }

.mg-comments-wrapper .comments_single_ui { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: .82rem; color: var(--color-muted); }
.mg-comments-wrapper .comments_single_ui span { margin: 0; display: inline-flex; align-items: center; gap: 4px; }
.mg-comments-wrapper .comments_single_ui .stars { color: #f59e0b; font-weight: 700; }
.mg-comments-wrapper .comments_single_ui .date { color: #94a3b8; }
.mg-comments-wrapper .comments_single_ui .like { color: var(--color-accent2); font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); transition: var(--transition); }
.mg-comments-wrapper .comments_single_ui .like:hover { background: rgba(79, 70, 229, .08); text-decoration: none; }
.mg-comments-wrapper .comments_single_ui .response { color: #059669; font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); transition: var(--transition); }
.mg-comments-wrapper .comments_single_ui .response:hover { background: rgba(5, 150, 105, .08); text-decoration: none; }

.mg-comments-wrapper .comments_single_likes { display: block; width: 100%; padding: 10px 14px; background: #f8fafc; border-radius: var(--radius-sm); font-size: .78rem; text-transform: uppercase; color: var(--color-muted); margin-bottom: 16px; border: 1px solid var(--color-border-subtle); }
.mg-comments-wrapper .comments_single_likes:before { content: "♥"; margin-right: 8px; color: var(--color-accent); font-weight: bold; }

/* Respostas Encadeadas */
.mg-comments-wrapper .comment_response { width: 100%; margin: 16px 0 0 0; padding: 16px 0 0 16px; border-top: 1px solid var(--color-border-subtle); border-left: 2px solid #e2e8f0; }

/* Formulário de Comentário */
.mg-comments-wrapper .comments > form,
.mg-comments-wrapper .comments_single form { float: none; width: 100%; background: #f8fafc; border: 1.5px solid var(--color-border); border-top: 4px solid var(--color-accent); border-radius: var(--radius-lg); padding: 28px; margin-top: 28px; box-shadow: var(--shadow-sm); }

.mg-comments-wrapper .comments > form label span,
.mg-comments-wrapper .comments_single label span { font-size: .92rem; font-weight: 700; font-variant: normal; color: var(--color-primary); margin-bottom: 8px; display: block; }

.mg-comments-wrapper textarea { width: 100%; min-height: 110px; padding: 14px; border: 1.5px solid var(--color-border); border-radius: var(--radius); font-family: var(--font-body); font-size: .95rem; color: var(--color-text); background: #fff; line-height: 1.6; resize: vertical; transition: var(--transition); }
.mg-comments-wrapper textarea:focus-visible { outline: none; border-color: var(--color-accent2); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }

.mg-comments-wrapper input,
.mg-comments-wrapper select { min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--color-border); border-radius: var(--radius); font-size: .9rem; color: var(--color-text); background: #fff; transition: var(--transition); }
.mg-comments-wrapper input:focus-visible,
.mg-comments-wrapper select:focus-visible { outline: none; border-color: var(--color-accent2); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }

.mg-comments-wrapper .label_50 { display: flex; gap: 16px; margin-bottom: 12px; }
.mg-comments-wrapper .label_50 label { flex: 1; float: none; width: auto; }
.mg-comments-wrapper .label_50 label:nth-of-type(2n+0) { margin-left: 0; }

.mg-comments-wrapper .btn { min-height: 44px; padding: 10px 28px; background: var(--color-accent); color: #fff; font-weight: 700; font-size: .92rem; border: none; border-radius: var(--radius); cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(230, 57, 70, .25); }
.mg-comments-wrapper .btn:hover { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(230, 57, 70, .35); }
.mg-comments-wrapper .btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Modal de Login de Comentários */
.comment_login_box { position: fixed; left: 0; top: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, .75); backdrop-filter: blur(4px); z-index: 1000; display: none; }
.comment_login_content { width: 480px; max-width: 90%; background: #fff; margin: 5% auto; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--color-border); }
.comment_login_content header { background: var(--color-primary); color: #fff; padding: 24px; text-align: center; position: relative; }
.comment_login_content header h1 { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 800; line-height: 1.3; }
.comment_login_close { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: .9rem; background: rgba(255,255,255,.15); color: #fff; cursor: pointer; border-radius: 50%; transition: var(--transition); }
.comment_login_close:hover { background: var(--color-accent); }
.comment_login_fields { padding: 28px 24px 14px; }
.comment_login_actions { padding: 20px 24px; background: #f8fafc; border-top: 1px solid var(--color-border); text-align: center; }
.comment_login_actions .btn { width: 100%; }

/* ─── CATEGORY ARCHIVE ───────────────────────────────── */

.mg-cat-header { background: var(--color-primary); color: #fff; padding: 36px 0; margin-bottom: 0; }
.mg-cat-header h1 { font-family: var(--font-heading); font-size: 2rem; font-weight: 800; }
.mg-cat-header p { color: rgba(255,255,255,.7); font-size: .95rem; margin-top: 6px; }

/* ─── SEARCH RESULTS ─────────────────────────────────── */

.mg-search-header { padding: 32px 0 24px; }
.mg-search-header h1 { font-family: var(--font-heading); font-size: 1.8rem; color: var(--color-primary); font-weight: 800; }
.mg-search-header p { color: var(--color-muted); font-size: .95rem; margin-top: 6px; }

/* ─── PAGE ───────────────────────────────────────────── */

.mg-page-content { background: var(--color-bg-card); padding: 44px 48px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--color-border-subtle); }
.mg-page-content h1 { font-family: var(--font-heading); font-size: 2.2rem; font-weight: 800; color: var(--color-primary); margin-bottom: 24px; padding-bottom: 18px; border-bottom: 2px solid var(--color-accent); }
.mg-page-content .htmlchars { line-height: 1.85; font-size: 1.08rem; color: var(--color-text-body); }
.mg-page-content .htmlchars p { margin-bottom: 20px; }
.mg-page-content .htmlchars a { color: var(--color-accent2); text-decoration: underline; }

/* ─── 404 ────────────────────────────────────────────── */

.mg-404 { text-align: center; padding: 90px 20px; }
.mg-404 .code { font-size: 8rem; font-weight: 900; color: var(--color-accent); line-height: 1; font-family: var(--font-heading); text-shadow: 0 4px 16px rgba(230, 57, 70, .2); }
.mg-404 h1 { font-size: 2rem; color: var(--color-primary); margin: 18px 0 12px; font-weight: 800; }
.mg-404 p { color: var(--color-muted); margin-bottom: 32px; font-size: 1.05rem; }
.mg-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 12px 32px; background: var(--color-accent); color: #fff; border-radius: var(--radius); font-weight: 700; font-size: .92rem; transition: var(--transition); box-shadow: 0 2px 8px rgba(230, 57, 70, .25); }
.mg-btn:hover { background: var(--color-accent-hover); transform: translateY(-2px); box-shadow: 0 4px 14px rgba(230, 57, 70, .35); }

/* ─── ABOUT PAGE (SOBRE) ─────────────────────────────── */

.mg-about-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1a2a40 100%);
    color: #fff;
    padding: 56px 0 48px;
    margin-bottom: 0;
    text-align: center;
    position: relative;
}
.mg-about-hero-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-accent);
    background: rgba(230, 57, 70, 0.15);
    padding: 4px 16px;
    border-radius: 999px;
    margin-bottom: 16px;
    border: 1px solid rgba(230, 57, 70, 0.3);
}
.mg-about-hero-title {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 14px;
    color: #fff;
}
.mg-about-hero-subtitle {
    font-size: 1.12rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.85);
    max-width: 680px;
    margin: 0 auto;
}

.mg-about-main-content {
    display: flex;
    flex-direction: column;
    gap: 36px;
}
.mg-about-section {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 36px 36px;
    border: 1px solid var(--color-border-subtle);
    box-shadow: var(--shadow-sm);
}
.mg-about-section-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-accent);
}
.mg-about-prose {
    line-height: 1.85;
    font-size: 1.06rem;
    color: var(--color-text-body);
}

.mg-about-mvv-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.mg-mvv-card {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 26px 22px;
    border: 1px solid var(--color-border-subtle);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.mg-mvv-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.mg-mvv-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.mg-mvv-mission .mg-mvv-icon { background: #e0f2fe; color: #0284c7; }
.mg-mvv-vision .mg-mvv-icon  { background: #fef3c7; color: #d97706; }
.mg-mvv-values .mg-mvv-icon  { background: #dcfce7; color: #16a34a; }
.mg-mvv-values {
    grid-column: 1 / -1;
}
.mg-mvv-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 8px;
}
.mg-mvv-text {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--color-text-body);
}

.mg-about-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.mg-about-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: #f8fafc;
    border-radius: var(--radius);
    border: 1px solid var(--color-border-subtle);
}
.mg-about-contact-full {
    grid-column: 1 / -1;
}
.mg-contact-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #e2e8f0;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mg-contact-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-muted);
    margin-bottom: 2px;
}
.mg-contact-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-primary);
    word-break: break-word;
    text-decoration: none;
}
a.mg-contact-value:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.mg-about-socials-wrapper {
    padding-top: 22px;
    border-top: 1px solid var(--color-border-subtle);
}
.mg-about-socials-heading {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 12px;
}
.mg-about-socials-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mg-about-social-btn,
.mg-sidebar-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    min-height: 44px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--color-border-subtle);
    background: #f8fafc;
    color: var(--color-primary);
}
.mg-about-social-btn:focus-visible,
.mg-sidebar-social-btn:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}
.mg-about-social-btn:hover,
.mg-sidebar-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.mg-social-instagram:hover { background: #e1306c; color: #fff; border-color: #e1306c; }
.mg-social-facebook:hover  { background: #1877f2; color: #fff; border-color: #1877f2; }
.mg-social-youtube:hover   { background: #ff0000; color: #fff; border-color: #ff0000; }
.mg-social-linkedin:hover  { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.mg-social-twitter:hover   { background: #0f1419; color: #fff; border-color: #0f1419; }
.mg-social-github:hover    { background: #24292e; color: #fff; border-color: #24292e; }

.mg-sidebar-socials {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mg-sidebar-socials .mg-sidebar-social-btn {
    width: 100%;
    justify-content: flex-start;
}

/* ─── CONTACT PAGE ───────────────────────────────────── */

.mg-contact-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: #ffffff;
    padding: 48px 0 54px;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mg-contact-hero-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(22, 119, 255, 0.25);
    color: var(--color-cyan);
    border: 1px solid rgba(64, 201, 255, 0.35);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}
.mg-contact-hero-title {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}
.mg-contact-hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.82);
    max-width: 680px;
    line-height: 1.6;
}

.mg-contact-container {
    margin-bottom: 60px;
}
.mg-contact-main-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Canais Oficiais */
.mg-contact-channels-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}
.mg-contact-channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.mg-channel-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius);
    transition: var(--transition);
}
.mg-channel-card:hover {
    border-color: var(--color-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.mg-channel-full {
    grid-column: 1 / -1;
}
.mg-channel-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #e0f2fe;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mg-channel-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.mg-channel-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-muted);
}
.mg-channel-value {
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--color-primary);
    word-break: break-word;
    text-decoration: none;
    transition: var(--transition);
}
a.mg-channel-value:hover {
    color: var(--color-accent);
    text-decoration: underline;
}
a.mg-channel-value:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

.mg-contact-socials-wrap {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-subtle);
}
.mg-contact-socials-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 12px;
}
.mg-contact-socials-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.mg-contact-social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    min-height: 44px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    background: #f8fafc;
    border: 1px solid var(--color-border-subtle);
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition);
}
.mg-contact-social-link:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}
.mg-contact-social-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Formulário de Contato */
.mg-contact-form-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-sm);
}
.mg-contact-form-header {
    margin-bottom: 24px;
}
.mg-contact-form-title {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 6px;
}
.mg-contact-form-desc {
    font-size: 0.92rem;
    color: var(--color-muted);
    line-height: 1.5;
}

/* Feedback Acessível */
.mg-contact-feedback {
    margin-bottom: 20px;
    border-radius: var(--radius);
    transition: var(--transition);
}
.mg-contact-feedback:empty {
    display: none;
}
.mg-alert-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.5;
}
.mg-alert-content svg {
    flex-shrink: 0;
    margin-top: 1px;
}
.mg-feedback-success .mg-alert-content {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.mg-feedback-error .mg-alert-content {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Campos do Form */
.mg-hp-field {
    display: none !important;
    visibility: hidden;
    position: absolute;
    left: -9999px;
}

.mg-contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.mg-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.mg-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mg-form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-primary);
}
.mg-required {
    color: #e11d48;
    font-weight: 700;
}
.mg-form-input,
.mg-form-textarea {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    background: #f8fafc;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    transition: var(--transition);
    min-height: 46px;
}
.mg-form-textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.6;
}
.mg-form-input:hover,
.mg-form-textarea:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}
.mg-form-input:focus,
.mg-form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.18);
}
.mg-form-input:focus-visible,
.mg-form-textarea:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
}

/* Ações e Botão */
.mg-form-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 6px;
}
.mg-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 28px;
    font-family: var(--font-body);
    font-size: 0.98rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--color-accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.mg-btn-submit:hover:not(:disabled) {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.mg-btn-submit:focus-visible {
    outline: 3px solid var(--color-cyan);
    outline-offset: 3px;
}
.mg-btn-submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}
.mg-btn-spinner {
    display: none;
}
.mg-btn-submit.is-loading .mg-btn-text {
    opacity: 0.8;
}
.mg-btn-submit.is-loading .mg-btn-spinner {
    display: inline-flex;
    animation: mg-spin 0.9s linear infinite;
}

@keyframes mg-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@media (max-width: 640px) {
    .mg-form-grid-2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .mg-contact-form-section {
        padding: 24px 18px;
    }
    .mg-contact-hero-title {
        font-size: 1.75rem;
    }
    .mg-btn-submit {
        width: 100%;
    }
}

/* ─── FOOTER ─────────────────────────────────────────── */

.mg-footer { background: var(--color-primary); color: rgba(255,255,255,.7); margin-top: 64px; }
.mg-footer-main { padding: 56px 0 36px; }
.mg-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; }
.mg-footer-brand .name { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 800; color: #fff; margin-bottom: 12px; }
.mg-footer-brand .name span { color: var(--color-accent); }
.mg-footer-brand p { font-size: .88rem; line-height: 1.65; color: rgba(255,255,255,.65); }
.mg-footer-col h4 { color: #fff; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.12); }
.mg-footer-col ul li { margin-bottom: 10px; }
.mg-footer-col a { font-size: .88rem; color: rgba(255,255,255,.65); transition: var(--transition); display: inline-block; }
.mg-footer-col a:hover { color: var(--color-accent); transform: translateX(3px); }
.mg-footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 22px 0; display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: rgba(255,255,255,.5); }

/* ─── MESSAGES ───────────────────────────────────────── */

.trigger { padding: 14px 20px; border-radius: var(--radius); margin: 14px 0; font-size: .92rem; font-weight: 500; }
.trigger_success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.trigger_info    { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.trigger_alert   { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }
.trigger_error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ─── RESPONSIVE ─────────────────────────────────────── */

@media (max-width: 1024px) {
    .mg-grid,
    .mg-article-layout .mg-grid { grid-template-columns: 1fr; gap: 36px; }
    .mg-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .mg-related-cards { grid-template-columns: repeat(2, 1fr); }
    .mg-post-card { padding: 32px 24px; }
}

@media (max-width: 768px) {
    .mg-wrap { padding: 0 16px; }
    .mg-cards { grid-template-columns: 1fr 1fr; gap: 18px; }

    /* Hero: min-height flexible */
    .mg-featured-inner { min-height: 380px; height: auto; }
    .mg-featured-media { position: absolute; inset: 0; height: auto; }
    .mg-featured-img,
    .mg-featured-media,
    .mg-featured-placeholder { height: 100%; }
    .mg-featured-body { padding: 28px 0 24px; max-width: 100%; }
    .mg-featured-body h1 { font-size: clamp(1.35rem, 5vw, 1.75rem); line-height: 1.3; }
    .mg-featured-meta { gap: 14px; font-size: .78rem; }

    /* Hamburger Menu Toggle */
    .mg-menu-toggle { display: flex; }
    .mg-nav { display: none; }
    .mg-nav.is-open { display: block; }
    /* Top Overlap Prevention & Mobile Spacing */
    .mg-breadcrumb { margin-top: 16px; margin-bottom: 22px; padding: 10px 0; }
    .mg-post-no-hero { padding: 24px 0 16px; }
    .mg-article-layout { margin-top: 24px; margin-bottom: 48px; }
    .mg-post-hero { min-height: 380px; }
    .mg-post-hero-body { padding: 24px 0 28px; }
    .mg-post-hero-subtitle { font-size: 1rem; }
    .mg-post-hero-meta,
    .mg-post-no-hero .mg-post-meta { gap: 10px 16px; }
    .mg-meta-group { gap: 10px 14px; }
    .mg-post-card { padding: 28px 20px; }
    .mg-post-content.htmlchars { font-size: 1.02rem; word-break: break-word; overflow-wrap: break-word; }
    .mg-header .mg-wrap { flex-wrap: wrap; justify-content: space-between; }
    .mg-brand-logo { height: 48px; }
    .mg-brand-tagline { font-size: 0.62rem; letter-spacing: 1.2px; }
    .mg-header-search { display: none; }
    .mg-nav ul { gap: 6px; }
    .mg-nav a { padding: 6px 12px; font-size: 0.85rem; }
    .mg-footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .mg-footer-main { padding: 36px 0 24px; }
    .mg-footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
    .mg-comments-wrapper .label_50 { flex-direction: column; gap: 12px; }
    .mg-comments-wrapper .comments_single_avatar { display: none; }
    .mg-comments-wrapper .comments_single_content { width: 100%; }
    .mg-sidebar { margin-top: 36px; }
}

@media (max-width: 480px) {
    .mg-cards { grid-template-columns: 1fr; }
    .mg-related-cards { grid-template-columns: 1fr; }

    /* Hero: smaller min-height for very narrow screens */
    .mg-featured-inner { min-height: 340px; }
    .mg-featured-body { padding: 20px 0 18px; }
    .mg-featured-body h1 { font-size: clamp(1.15rem, 5.2vw, 1.45rem); line-height: 1.28; }
    .mg-featured-meta { gap: 10px 14px; }
    .mg-brand-logo { height: 42px; }
    .mg-brand-tagline { font-size: 0.58rem; letter-spacing: 1px; }
    .mg-nav a { padding: 5px 8px; font-size: 0.8rem; }
    .mg-breadcrumb { margin-top: 12px; margin-bottom: 16px; font-size: 0.78rem; }
    .mg-post-hero-meta,
    .mg-post-no-hero .mg-post-meta { gap: 8px 12px; font-size: .8rem; }
    .mg-meta-group { gap: 8px 12px; }
    .mg-post-card { padding: 22px 18px; border-radius: var(--radius); }
    .mg-post-content.htmlchars ul,
    .mg-post-content.htmlchars ol { margin-left: 20px; }
    .mg-post-content.htmlchars blockquote { padding: 14px 16px; margin: 20px 0; }
    .mg-post-content.htmlchars pre { padding: 14px 16px; }
    .mg-comments-wrapper .comments_single { padding: 18px 14px; }
    .mg-comments-wrapper .comments > form { padding: 18px 14px; }
    .mg-author-avatar,
    .mg-author-avatar-placeholder { width: 20px; height: 20px; }
}
