/*
Theme Name:   Hello RedGrid
Theme URI:    https://redgridworks.com/
Description:  RedGrid Works child theme for Hello Elementor: dark futuristic header with accessible mega menu, branded footer, 404 page, blog styling and mobile call-to-action bar. Works with Elementor Free; Elementor Pro Theme Builder headers/footers override it automatically.
Author:       RedGrid Works
Template:     hello-elementor
Version:      1.1.0
Requires at least: 6.3
Requires PHP: 7.4
License:      GPL-2.0-or-later
Text Domain:  hello-redgrid
*/

/* Fallback tokens when RedGrid Core is inactive (plugin CSS defines the full set). */
body { --rgw-red: var(--e-global-color-accent, #EF233C); --rgw-black: #09090B; --rgw-carbon: #111113; --rgw-graphite: #18181B; --rgw-white: var(--e-global-color-primary, #F5F5F5); --rgw-muted: var(--e-global-color-secondary, #A1A1AA); --rgw-text: var(--e-global-color-text, #D4D4D8); --rgw-line: rgba(255,255,255,.08); --rgw-line-strong: rgba(255,255,255,.14); background: #09090B; color: #D4D4D8; }
html { scroll-padding-top: 96px; }
.rgw-skip:focus { clip: auto !important; clip-path: none; width: auto; height: auto; z-index: 100000; top: 10px; left: 10px; padding: 12px 18px; background: #fff; color: #09090B; border-radius: 8px; font-weight: 600; }
.rgw-content-anchor { position: absolute; }

/* ============ Header ============ */
.rgw-header { position: sticky; top: 0; z-index: 999; background: rgba(9, 9, 11, .72); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid transparent; transition: background .3s, border-color .3s, box-shadow .3s; }
.admin-bar .rgw-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .rgw-header { top: 0; } }
.rgw-header.is-scrolled { background: rgba(9, 9, 11, .9); border-bottom-color: var(--rgw-line); box-shadow: 0 12px 30px -20px #000; }
.rgw-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--rgw-red), transparent); opacity: .55; }
.rgw-header__inner { max-width: 1480px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 28px); height: 76px; display: flex; align-items: center; gap: 24px; }
.rgw-header__brand { flex: none; display: flex; align-items: center; }
.rgw-logo { display: inline-flex; align-items: center; color: #fff; text-decoration: none; }
.rgw-logo svg { height: 40px; width: auto; display: block; }
.rgw-header .custom-logo { max-height: 44px; width: auto; }
.rgw-nav { flex: 1; min-width: 0; display: flex; justify-content: center; align-self: stretch; }
.rgw-nav__list { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 6px; height: 100%; }
/* Each item fills the full header height, so moving the mouse down into a panel never leaves the item. */
.rgw-nav__item { position: static; display: flex; align-items: center; height: 100%; }
.rgw-nav__item.has-dropdown { position: relative; }
.rgw-nav__link { display: block; padding: 10px 10px; font-family: var(--rgw-head, "Space Grotesk", system-ui, sans-serif); font-size: 15px; font-weight: 500; color: var(--rgw-text); text-decoration: none; border-radius: 8px; white-space: nowrap; transition: color .2s; position: relative; }
.rgw-nav__link::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 4px; height: 1.5px; background: var(--rgw-red); transform: scaleX(0); transform-origin: left; transition: transform .3s cubic-bezier(.2,.7,.2,1); box-shadow: 0 0 8px var(--rgw-red); }
.rgw-nav__item:hover > .rgw-nav__link, .rgw-nav__item.is-open > .rgw-nav__link, .rgw-nav__item.is-current > .rgw-nav__link, .rgw-nav__link:focus-visible { color: #fff; }
.rgw-nav__item:hover > .rgw-nav__link::after, .rgw-nav__item.is-open > .rgw-nav__link::after, .rgw-nav__item.is-current > .rgw-nav__link::after { transform: scaleX(1); }
.rgw-nav__toggle { background: none; border: 0; padding: 8px 4px; margin-left: -8px; color: var(--rgw-muted); cursor: pointer; border-radius: 6px; display: inline-flex; }
.rgw-nav__toggle:hover, .rgw-nav__toggle[aria-expanded="true"], .rgw-nav__item:hover > .rgw-nav__toggle { color: var(--rgw-red); background: none; }
.rgw-nav__toggle svg { transition: transform .25s; }
.rgw-nav__item.is-open > .rgw-nav__toggle svg, .rgw-nav__item.has-panel:hover > .rgw-nav__toggle svg { transform: rotate(180deg); }

/* Panels (mega + dropdown). Panels start flush with the header (padding, not margin), and closing is delayed slightly. */
.rgw-panel { position: absolute; top: 100%; visibility: hidden; opacity: 0; transform: translateY(6px); pointer-events: none;
	transition: opacity .18s ease .15s, transform .18s ease .15s, visibility 0s linear .33s; z-index: 1000; }
.rgw-nav__item.has-panel:hover > .rgw-panel, .rgw-nav__item.has-panel:focus-within > .rgw-panel, .rgw-nav__item.is-open > .rgw-panel {
	visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition: opacity .18s ease, transform .18s ease, visibility 0s; }
.rgw-mega { left: 0; right: 0; padding: 0 clamp(16px, 3vw, 28px); }
.rgw-mega__inner { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px 22px; padding: 26px 28px 20px; border-radius: 0 0 16px 16px; background: #111113; border: 1px solid var(--rgw-line-strong); border-top-color: transparent; box-shadow: 0 40px 80px -30px #000, 0 0 0 1px rgba(239, 35, 60, .08); position: relative; overflow: hidden; }
.rgw-mega__inner::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--rgw-red), transparent 70%); }
.rgw-mega__col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rgw-mega__heading { font-family: var(--rgw-head, system-ui); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; padding: 6px 0 4px; border-bottom: 1px solid var(--rgw-line); }
.rgw-mega__heading:hover { color: var(--rgw-red); }
.rgw-mega__text { color: var(--rgw-muted); font-size: 12.5px; line-height: 1.45; margin: 2px 0 4px; }
.rgw-mega__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.rgw-mega__links a { display: block; padding: 6px 8px; margin: 0 -8px; border-radius: 7px; color: var(--rgw-text); font-size: 14px; text-decoration: none; transition: background .15s, color .15s; }
.rgw-mega__links a:hover, .rgw-mega__links a:focus-visible { background: rgba(239, 35, 60, .09); color: #fff; }
.rgw-mega__foot { grid-column: 1 / -1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--rgw-line); }
.rgw-mega__all { color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; }
.rgw-mega__all:hover { color: var(--rgw-red); }
.rgw-mega__all--cta { color: var(--rgw-muted); font-weight: 500; }
.rgw-dropdown { left: 0; min-width: 270px; }
.rgw-dropdown__list { list-style: none; margin: 0; padding: 10px; background: #111113; border: 1px solid var(--rgw-line-strong); border-top: 2px solid var(--rgw-red); border-radius: 0 0 14px 14px; box-shadow: 0 30px 60px -25px #000; }
.rgw-dropdown__link { display: block; padding: 10px 12px; border-radius: 9px; text-decoration: none; transition: background .15s; }
.rgw-dropdown__link:hover, .rgw-dropdown__link:focus-visible { background: rgba(239, 35, 60, .09); }
.rgw-dropdown__title { display: block; color: #fff; font-weight: 600; font-size: 14.5px; }
.rgw-dropdown__text { display: block; color: var(--rgw-muted); font-size: 12.5px; margin-top: 2px; }

.rgw-header__actions { display: flex; align-items: center; gap: 10px; flex: none; }
.rgw-header__cta.rgw-button { min-height: 44px; padding: 11px 20px; font-size: 14.5px; }
@media (max-width: 1240px) { .rgw-mega__inner { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Mobile nav */
.rgw-mnav { display: none; position: relative; }
.rgw-mnav > summary { list-style: none; cursor: pointer; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--rgw-line-strong); }
.rgw-mnav > summary::-webkit-details-marker { display: none; }
.rgw-burger { width: 20px; height: 14px; position: relative; display: block; }
.rgw-burger i { position: absolute; left: 0; right: 0; height: 2px; background: #fff; border-radius: 2px; transition: transform .25s, opacity .2s, top .25s; }
.rgw-burger i:nth-child(1) { top: 0; } .rgw-burger i:nth-child(2) { top: 6px; background: var(--rgw-red); } .rgw-burger i:nth-child(3) { top: 12px; }
.rgw-mnav[open] .rgw-burger i:nth-child(1) { top: 6px; transform: rotate(45deg); }
.rgw-mnav[open] .rgw-burger i:nth-child(2) { opacity: 0; }
.rgw-mnav[open] .rgw-burger i:nth-child(3) { top: 6px; transform: rotate(-45deg); }
.rgw-mnav__panel { position: fixed; left: 0; right: 0; top: 76px; bottom: 0; overflow-y: auto; padding: 18px clamp(16px, 4vw, 28px) 120px; background: rgba(9, 9, 11, .985); border-top: 1px solid var(--rgw-line); }
.admin-bar .rgw-mnav__panel { top: 122px; }
.rgw-mnav__panel ul { list-style: none; margin: 0; padding: 0; }
.rgw-mnav__panel > ul > li { border-bottom: 1px solid var(--rgw-line); }
.rgw-mnav__panel a, .rgw-mnav__panel summary { display: block; padding: 15px 4px; color: #fff; font-family: var(--rgw-head, system-ui); font-size: 17px; font-weight: 500; text-decoration: none; cursor: pointer; list-style: none; }
.rgw-mnav__panel summary::-webkit-details-marker { display: none; }
.rgw-mnav__panel summary::after { content: "+"; float: right; color: var(--rgw-red); font-family: var(--rgw-mono, monospace); }
.rgw-mnav__panel details[open] > summary::after { content: "–"; }
.rgw-mnav__panel details details summary { font-size: 15px; padding: 11px 4px; color: var(--rgw-text); }
.rgw-mnav__panel details ul { padding: 0 0 10px 12px; border-left: 1px solid rgba(239, 35, 60, .4); margin-bottom: 10px; }
.rgw-mnav__panel details a { font-size: 15px; padding: 10px 4px; color: var(--rgw-text); }
.rgw-mnav__cta { width: 100%; margin-top: 22px; }

@media (max-width: 1180px) { .rgw-nav__link { padding: 10px 8px; font-size: 14px; } }
@media (max-width: 1040px) {
	.rgw-nav { display: none; }
	.rgw-mnav { display: block; }
	.rgw-header__inner { justify-content: space-between; }
}
@media (max-width: 520px) { .rgw-header__cta { display: none !important; } .rgw-logo svg { height: 34px; } .rgw-header__inner { height: 68px; } .rgw-mnav__panel { top: 68px; } }

/* ============ Footer ============ */
.rgw-footer { background: #070708; border-top: 1px solid var(--rgw-line); position: relative; overflow: hidden; color: var(--rgw-muted); font-size: 14.5px; }
.rgw-footer::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--rgw-line) 1px, transparent 1px), linear-gradient(90deg, var(--rgw-line) 1px, transparent 1px); background-size: 48px 48px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 55%); mask-image: linear-gradient(180deg, #000, transparent 55%); opacity: .5; pointer-events: none; }
.rgw-footer > * { position: relative; }
.rgw-footer__cta { border-bottom: 1px solid var(--rgw-line); }
.rgw-footer__cta-inner { max-width: 1240px; margin: 0 auto; padding: clamp(48px, 7vw, 84px) clamp(18px, 4vw, 32px); display: grid; grid-template-columns: 1fr auto; gap: 18px 40px; align-items: end; }
.rgw-footer__kicker { grid-column: 1 / -1; font-family: var(--rgw-mono, monospace); color: var(--rgw-red); letter-spacing: .14em; text-transform: uppercase; font-size: 12.5px; margin: 0; }
.rgw-footer__headline { font-family: var(--rgw-head, system-ui); font-size: clamp(1.7rem, 3.4vw, 2.8rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.08; color: #fff; margin: 0; max-width: 720px; }
.rgw-footer__cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 860px) { .rgw-footer__cta-inner { grid-template-columns: 1fr; } }
.rgw-footer__main { max-width: 1240px; margin: 0 auto; padding: 56px clamp(18px, 4vw, 32px) 40px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 40px; }
@media (max-width: 1000px) { .rgw-footer__main { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .rgw-footer__main { grid-template-columns: 1fr; } }
.rgw-footer__brand .rgw-logo svg { height: 42px; }
.rgw-footer__about { color: #fff; margin: 18px 0 8px; font-weight: 500; }
.rgw-footer__areas { line-height: 1.6; margin: 0 0 18px; }
.rgw-footer__title { font-family: var(--rgw-mono, monospace); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #fff; margin: 0 0 16px; }
.rgw-footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rgw-footer__links a, .rgw-footer__legal a { color: var(--rgw-muted); text-decoration: none; transition: color .2s; }
.rgw-footer__links a:hover, .rgw-footer__legal a:hover { color: #fff; }
.rgw-footer .rgw-contact-list li { padding: 0; border: 0; background: none; }
.rgw-footer__bottom { max-width: 1240px; margin: 0 auto; padding: 24px clamp(18px, 4vw, 32px) 40px; border-top: 1px solid var(--rgw-line); display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; }
.rgw-footer__copy { margin: 0; }
.rgw-footer__legal { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.rgw-footer__disclaimer { flex-basis: 100%; font-size: 12.5px; line-height: 1.6; color: #71717a; margin: 6px 0 0; }

/* Mobile CTA bar */
.rgw-mobile-cta { display: none; }
@media (max-width: 767px) {
	.rgw-mobile-cta { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 998; gap: 8px; padding: 8px; border-radius: 14px; background: rgba(17, 17, 19, .92); border: 1px solid var(--rgw-line-strong); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 20px 40px -10px #000; }
	.rgw-mobile-cta a { flex: 1; min-height: 46px; display: grid; place-items: center; border-radius: 10px; font-weight: 600; font-size: 15px; text-decoration: none; }
	.rgw-mobile-cta__main { background: var(--rgw-red); color: #fff; flex: 1.6 !important; }
	.rgw-mobile-cta__alt { color: #fff; border: 1px solid var(--rgw-line-strong); }
	body.rgw-site { padding-bottom: 76px; }
}

/* ============ Default templates (blog, posts, pages, search) ============ */
.site-main:not(.rgw-404) { max-width: 1140px; margin: 0 auto; padding: clamp(40px, 6vw, 80px) clamp(18px, 4vw, 32px); }
.site-main .page-header .entry-title, .site-main h1.entry-title { font-family: var(--rgw-head, system-ui); font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: -.03em; line-height: 1.08; color: #fff; margin: 0 0 24px; max-width: 900px; }
.site-main .page-content { color: var(--rgw-text); line-height: 1.75; font-size: 1.05rem; }
.single-post .site-main .page-content, .page:not(.elementor-page) .site-main .page-content { max-width: 760px; }
.site-main .page-content h2, .site-main .page-content h3 { font-family: var(--rgw-head, system-ui); color: #fff; letter-spacing: -.02em; line-height: 1.2; margin: 2em 0 .6em; }
.site-main .page-content a { color: #fff; text-decoration: underline; text-decoration-color: var(--rgw-red); text-underline-offset: 3px; }
.site-main .page-content a:hover { color: var(--rgw-red); }
.site-main .page-content blockquote { border-left: 3px solid var(--rgw-red); margin: 1.5em 0; padding: .4em 0 .4em 1.2em; color: #fff; }
.site-main .page-content img { border-radius: 12px; }
.site-main .page-content code { font-family: var(--rgw-mono, monospace); background: var(--rgw-graphite); padding: 2px 6px; border-radius: 4px; }
.site-main .page-content table { border-collapse: collapse; width: 100%; }
.site-main .page-content th, .site-main .page-content td { border: 1px solid var(--rgw-line-strong); padding: 10px 12px; }
.blog .site-main .page-content, .archive .site-main .page-content, .search .site-main .page-content { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: none; }
@media (max-width: 1000px) { .blog .site-main .page-content, .archive .site-main .page-content, .search .site-main .page-content { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .blog .site-main .page-content, .archive .site-main .page-content, .search .site-main .page-content { grid-template-columns: 1fr; } }
.site-main article.post, .site-main article.page { display: flex; flex-direction: column; border: 1px solid var(--rgw-line); border-radius: 14px; background: #111113; overflow: hidden; transition: border-color .3s, transform .3s; margin: 0; padding: 0 0 20px; }
.site-main article.post:hover, .site-main article.page:hover { border-color: rgba(239, 35, 60, .4); transform: translateY(-3px); }
.site-main article .entry-title { order: 2; font-family: var(--rgw-head, system-ui); font-size: 1.2rem; line-height: 1.3; margin: 18px 20px 8px; }
.site-main article .entry-title a { color: #fff; text-decoration: none; }
.site-main article > a:has(img) { order: 1; display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.site-main article > a img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.site-main article p { order: 3; margin: 0 20px; color: var(--rgw-muted); font-size: .95rem; line-height: 1.6; }
.pagination, .navigation.pagination { margin-top: 40px; display: flex; gap: 8px; justify-content: center; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--rgw-line-strong); border-radius: 8px; color: #fff; text-decoration: none; }
.pagination .current { background: var(--rgw-red); border-color: var(--rgw-red); }
.post-tags { margin-top: 32px; color: var(--rgw-muted); font-size: .9rem; }
.post-tags a { color: #fff; }
.search-form { display: flex; gap: 8px; max-width: 520px; }
.search-form .search-field, .search-form input[type="search"] { flex: 1; min-height: 48px; padding: 12px 14px; background: rgba(255, 255, 255, .03); color: #fff; border: 1px solid var(--rgw-line-strong); border-radius: 10px; font: inherit; }
.search-form .search-submit, .search-form button { min-height: 48px; padding: 0 18px; border-radius: 10px; border: 0; background: var(--rgw-red); color: #fff; font-weight: 600; cursor: pointer; }
.comments-area { max-width: 760px; margin-top: 48px; }
.comments-area input, .comments-area textarea { background: rgba(255, 255, 255, .03); color: #fff; border: 1px solid var(--rgw-line-strong); border-radius: 8px; }

/* ============ 404 ============ */
.rgw-404 { min-height: 72vh; display: grid; place-items: center; padding: 80px clamp(18px, 4vw, 32px); position: relative; overflow: hidden; }
.rgw-404::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--rgw-line) 1px, transparent 1px), linear-gradient(90deg, var(--rgw-line) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%); }
.rgw-404__inner { position: relative; max-width: 720px; text-align: center; }
.rgw-404__code { font-family: var(--rgw-head, system-ui); font-size: clamp(6rem, 20vw, 12rem); font-weight: 700; line-height: .9; letter-spacing: -.06em; margin: 0; color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .25); }
.rgw-404__code span { -webkit-text-stroke: 0; color: var(--rgw-red); text-shadow: 0 0 40px rgba(239, 35, 60, .6); }
.rgw-404__kicker { font-family: var(--rgw-mono, monospace); color: var(--rgw-red); letter-spacing: .14em; font-size: 13px; margin: 12px 0; }
.rgw-404__title { font-family: var(--rgw-head, system-ui); color: #fff; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.03em; margin: 0 0 12px; }
.rgw-404__text { color: var(--rgw-muted); margin: 0 auto 24px; max-width: 520px; }
.rgw-404__search .search-form { margin: 0 auto 24px; }
.rgw-404__links { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rgw-404__links a { display: block; padding: 9px 14px; border-radius: 99px; border: 1px solid var(--rgw-line-strong); color: #fff; text-decoration: none; font-size: 14px; }
.rgw-404__links a:hover { border-color: var(--rgw-red); background: rgba(239, 35, 60, .1); }
.rgw-404__term { display: inline-block; text-align: left; font-family: var(--rgw-mono, monospace); font-size: 12.5px; color: var(--rgw-muted); background: #111113; border: 1px solid var(--rgw-line); border-radius: 10px; padding: 14px 18px; margin: 0; white-space: pre-wrap; }
