/*
Theme Name: Joyenergizer Night
Theme URI: https://joyenergizer.com/
Author: Joyenergizer Media
Description: A dark, energetic editorial WordPress theme for humour, pop culture, design, food and internet discoveries.
Version: 1.3.1
Requires at least: 6.2
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: joyenergizer-night
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --je-bg: #07101b;
  --je-bg-soft: #0c1725;
  --je-panel: #0b1420;
  --je-panel-light: #111d2b;
  --je-text: #f7f9fc;
  --je-muted: #a7b1bf;
  --je-line: rgba(255, 255, 255, 0.16);
  --je-accent: #c8ff3d;
  --je-accent-ink: #07101b;
  --je-orange: #ff824d;
  --je-cyan: #4ed7f1;
  --je-radius: 12px;
  --je-max: 1200px;
  --je-display: "Oswald JE", "Arial Narrow", sans-serif;
  --je-sans: "Inter JE", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --je-base-size: 16px;
  --je-heading-weight: 700;
  --je-button-radius: 999px;
  --je-logo-width: 235px;
  --je-mobile-logo-width: 180px;
  --je-footer-logo-width: 235px;
  --je-footer-bg: #040a12;
  --je-footer-text: #9aa5b3;
  --je-quick-joy-bg: #c8ff3d;
  --je-quick-joy-text: #07101b;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 90% 5%, rgba(52, 92, 127, .14), transparent 28rem),
    var(--je-bg);
  color: var(--je-text);
  font-family: var(--je-sans);
  font-size: var(--je-base-size);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--je-accent); }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.site-shell { min-height: 100vh; overflow: clip; }
.je-container { width: min(calc(100% - 40px), var(--je-max)); margin-inline: auto; }
.je-sr-only, .screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus, .skip-link:focus {
  clip: auto !important; width: auto; height: auto; margin: 0; padding: 12px 18px;
  left: 12px; top: 12px; z-index: 99999; background: var(--je-accent); color: var(--je-accent-ink);
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: 78px;
  background: rgba(7, 16, 27, .9); border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.admin-bar .site-header { top: 32px; }
.site-header .je-container { width: min(calc(100% - 40px), 1600px); }
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.site-branding { display: flex; min-width: 100px; max-width: calc(100% - 150px); align-items: center; flex: 0 1 auto; }
.custom-logo-link { display: block; width: var(--je-logo-width); max-width: 100%; }
.custom-logo { width: 100%; height: auto; max-height: 52px; object-fit: contain; object-position: left center; }
.site-title {
  display: inline-flex; align-items: center; gap: 8px; color: #fff;
  font-family: var(--je-display); font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-stretch: condensed; font-weight: var(--je-heading-weight); letter-spacing: -.055em; line-height: 1;
}
.site-title::after { content: "⚡"; color: var(--je-accent); font-size: .82em; letter-spacing: 0; }
.primary-navigation { margin-left: auto; }
.primary-navigation ul { padding: 0; margin: 0; list-style: none; }
.primary-navigation > ul { display: flex; align-items: center; gap: 25px; }
.primary-navigation li { position: relative; }
.primary-navigation a { color: #fff; font-size: .84rem; font-weight: 750; }
.primary-navigation a:hover,
.primary-navigation .current-menu-item > a,
.primary-navigation .current-menu-ancestor > a { color: var(--je-accent); }
.primary-navigation .menu-item-has-children > a { padding-right: 28px; }
.submenu-toggle {
  position: absolute; right: 0; top: 50%; display: grid; width: 24px; height: 24px; padding: 0;
  place-items: center; color: #fff; background: transparent; border: 0; border-radius: 50%;
  transform: translateY(-50%); cursor: pointer;
}
.submenu-toggle:hover, .submenu-toggle:focus-visible { color: var(--je-accent); background: rgba(255,255,255,.08); outline: 0; }
.submenu-toggle svg { width: 13px; height: 13px; transition: transform .2s ease; }
.menu-item-has-children.submenu-open > .submenu-toggle svg { transform: rotate(180deg); }
.primary-navigation .sub-menu a { display: block; padding: 11px 40px 11px 14px; font-size: .82rem; line-height: 1.35; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-search, .menu-toggle {
  display: grid; place-items: center; width: 43px; height: 43px; padding: 0;
  background: transparent; border: 0; border-radius: 50%; cursor: pointer;
}
.header-search:hover, .menu-toggle:hover { background: rgba(255,255,255,.08); color: var(--je-accent); }
.je-button {
  display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 9px;
  padding: 0 23px; border: 1px solid transparent; border-radius: var(--je-button-radius);
  background: var(--je-accent); color: var(--je-accent-ink); font-size: .85rem; font-weight: 850;
  transition: transform .2s ease, background .2s ease;
}
.je-button:hover { color: var(--je-accent-ink); transform: translateY(-2px); filter: brightness(1.05); }
.je-button--outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.je-button--outline:hover { color: var(--je-accent); border-color: var(--je-accent); }
.wp-block-button__link { border-radius: var(--je-button-radius); }
.menu-toggle { display: none; }

.search-panel {
  position: fixed; inset: 78px 0 auto; z-index: 45; padding: 18px 0;
  background: rgba(7,16,27,.98); border-bottom: 1px solid var(--je-line);
  transform: translateY(-120%); visibility: hidden; transition: transform .22s ease, visibility .22s;
}
.admin-bar .search-panel { top: 110px; }
.search-panel.is-open { transform: translateY(0); visibility: visible; }
.search-form { display: flex; gap: 10px; }
.search-field {
  width: 100%; min-height: 50px; padding: 0 18px; color: #fff;
  background: var(--je-panel-light); border: 1px solid var(--je-line); border-radius: 8px; outline: 0;
}
.search-field:focus { border-color: var(--je-accent); box-shadow: 0 0 0 3px rgba(200,255,61,.13); }
.search-submit { min-width: 112px; border: 0; cursor: pointer; }

/* Shared content */
.site-main { min-height: 65vh; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 24px; }
.section-heading h1, .section-heading h2, .archive-title {
  margin: 0; font-family: var(--je-display); font-size: clamp(2.2rem, 4.2vw, 4rem);
  font-weight: var(--je-heading-weight); letter-spacing: -.045em; line-height: .95;
}
.section-heading p { max-width: 470px; margin: 0; color: var(--je-muted); }
.eyebrow { color: var(--je-accent); font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: #d5dbe2; font-size: .72rem; }
.post-meta svg { width: 14px; height: 14px; }
.je-empty { padding: 70px 30px; text-align: center; border: 1px dashed var(--je-line); border-radius: var(--je-radius); }

/* Hero */
.home-hero { padding: 28px 0 20px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, 1fr); gap: 12px; min-height: 570px; }
.hero-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
.hero-card { position: relative; overflow: hidden; min-height: 0; border-radius: var(--je-radius); background: var(--je-panel-light); isolation: isolate; }
.hero-card__link { display: flex; height: 100%; min-height: 100%; align-items: end; padding: 28px; }
.hero-card--large .hero-card__link { padding: 34px; }
.hero-card__image, .card-image {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .55s cubic-bezier(.2,.7,.2,1);
}
.hero-card:hover .hero-card__image { transform: scale(1.035); }
.hero-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(3,8,14,.02) 24%, rgba(3,8,14,.35) 57%, rgba(3,8,14,.96) 100%);
}
.hero-card.no-image::before, .card-media.no-image::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 25% 22%, var(--je-cyan) 0 7%, transparent 8%),
    linear-gradient(135deg, #274c64, #6a3458 52%, #dd7048);
}
.hero-card:nth-child(2).no-image::before { background: linear-gradient(135deg, #b54731, #ff9160 48%, #472132); }
.hero-card__content { position: relative; z-index: 2; max-width: 720px; }
.hero-card__title { margin: 10px 0 13px; font-family: var(--je-display); font-size: clamp(1.65rem, 3vw, 2.55rem); font-weight: var(--je-heading-weight); letter-spacing: -.035em; line-height: 1; text-wrap: balance; }
.hero-card--large .hero-card__title { font-size: clamp(2.55rem, 4.7vw, 4.9rem); }
.hero-card__category { color: var(--je-accent); font-size: .68rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }

/* Topic pills */
.topic-bar { padding: 0 0 34px; }
.topic-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.topic-pill {
  display: flex; min-height: 54px; align-items: center; justify-content: center; gap: 11px;
  padding: 10px 14px; border: 1px solid rgba(255,255,255,.38); border-radius: 999px;
  color: #fff; font-size: .79rem; font-weight: 800; transition: .2s ease;
}
.topic-pill svg { width: 19px; height: 19px; color: var(--je-accent); }
.topic-pill:hover { color: #fff; background: rgba(200,255,61,.08); border-color: var(--je-accent); transform: translateY(-2px); }

/* Feed and rankings */
.worth-section { padding: 0 0 72px; }
.worth-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .85fr); align-items: start; gap: 48px; }
.story-list { display: grid; gap: 22px; }
.story-card { display: grid; grid-template-columns: minmax(240px, 1.15fr) minmax(230px, .75fr); min-height: 205px; gap: 28px; align-items: center; }
.story-card__media { position: relative; overflow: hidden; height: 100%; min-height: 205px; border-radius: 6px; background: var(--je-panel-light); }
.story-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.story-card:hover .story-card__media img { transform: scale(1.035); }
.story-card__title { margin: 7px 0 9px; font-family: var(--je-display); font-size: clamp(1.45rem, 2.2vw, 2.1rem); font-weight: var(--je-heading-weight); letter-spacing: -.03em; line-height: 1.05; }
.story-card__excerpt { display: -webkit-box; margin: 0 0 16px; overflow: hidden; color: #c3cbd5; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.story-list__footer { margin-top: 26px; text-align: center; }
.most-viewed { position: sticky; top: 102px; padding: 25px 25px 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 3px; }
.most-viewed h2 { margin: 0 0 20px; font-family: var(--je-display); font-size: 1.8rem; letter-spacing: -.025em; }
.ranked-post { display: grid; grid-template-columns: 46px 1fr; gap: 14px; padding: 0 0 20px; margin: 0 0 20px; border-bottom: 1px solid var(--je-line); }
.ranked-post:last-child { margin-bottom: 0; border: 0; }
.ranked-post__number { color: var(--je-accent); font-family: var(--je-display); font-size: 3.1rem; font-weight: 900; line-height: 1; }
.ranked-post__thumb { display: block; overflow: hidden; aspect-ratio: 16/8; margin: 0 0 10px; border-radius: 4px; background: var(--je-panel-light); }
.ranked-post__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ranked-post__title { margin: 0 0 7px; font-family: var(--je-display); font-size: 1.12rem; font-weight: var(--je-heading-weight); letter-spacing: -.02em; line-height: 1.1; }

/* Random CTA */
.random-cta { background: var(--je-quick-joy-bg); color: var(--je-quick-joy-text); }
.random-cta__inner { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.random-cta__copy { display: flex; align-items: center; gap: 22px; }
.random-cta__image {
  display: block; width: min(var(--je-quick-joy-image-size), 28vw); height: auto; max-height: 125px;
  flex: 0 0 auto; object-fit: contain;
}
.random-cta__burst {
  display: grid; width: 76px; height: 76px; place-items: center; flex: 0 0 auto;
  background: var(--je-bg); color: var(--je-quick-joy-bg); font-size: 1.7rem;
  clip-path: polygon(50% 0,61% 15%,78% 6%,82% 24%,100% 27%,89% 43%,100% 57%,82% 63%,78% 82%,60% 74%,50% 100%,39% 76%,20% 84%,18% 64%,0 57%,11% 42%,0 26%,20% 23%,23% 5%,40% 15%);
}
.random-cta h2 { margin: 0; font-family: var(--je-display); font-size: clamp(2rem, 4vw, 3.8rem); font-weight: var(--je-heading-weight); letter-spacing: -.045em; line-height: .95; }
.random-cta .je-button { min-width: 190px; background: var(--je-bg); color: #fff; }
.random-cta .je-button:hover { color: var(--je-accent); }

/* Archives and card grids */
.archive-header { padding: 70px 0 35px; }
.archive-description { max-width: 680px; color: var(--je-muted); }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 18px; padding-bottom: 70px; }
.grid-card { min-width: 0; }
.card-media { position: relative; display: block; overflow: hidden; aspect-ratio: 16/10; border-radius: 8px; background: var(--je-panel-light); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.grid-card:hover .card-media img { transform: scale(1.04); }
.grid-card__body { padding: 16px 2px 0; }
.grid-card__title { margin: 6px 0 10px; font-family: var(--je-display); font-size: 1.65rem; line-height: 1.05; letter-spacing: -.025em; }
.grid-card__excerpt { margin: 0 0 12px; color: var(--je-muted); font-size: .92rem; }
.pagination, .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-bottom: 70px; }
.page-numbers { display: grid; min-width: 42px; min-height: 42px; place-items: center; padding: 0 12px; border: 1px solid var(--je-line); border-radius: var(--je-button-radius); }
.page-numbers.current, .page-numbers:hover { background: var(--je-accent); border-color: var(--je-accent); color: var(--je-accent-ink); }

/* Article and page */
.article-header { padding: 65px 0 32px; }
.article-header__inner { max-width: 920px; }
.article-title { margin: 12px 0 18px; font-family: var(--je-display); font-size: clamp(3.1rem, 7vw, 6.8rem); font-weight: var(--je-heading-weight); letter-spacing: -.055em; line-height: .9; text-wrap: balance; }
.article-deck { max-width: 760px; margin: 0 0 24px; color: #c8d0d9; font-size: clamp(1.1rem, 2vw, 1.4rem); }
.article-featured { width: min(calc(100% - 40px), 1320px); max-height: 760px; margin: 0 auto 48px; object-fit: cover; border-radius: var(--je-radius); }
.article-layout { display: grid; grid-template-columns: 72px minmax(0, 760px) minmax(220px, 1fr); gap: 35px; align-items: start; }
.article-layout--no-aside { grid-template-columns: 72px minmax(0, 760px); justify-content: center; }
.share-rail { position: sticky; top: 110px; display: grid; gap: 9px; }
.share-link {
  display: grid; width: 42px; height: 42px; padding: 0; place-items: center; overflow: hidden;
  border: 1px solid transparent; border-radius: 50%; color: #fff; cursor: pointer;
  box-shadow: 0 5px 16px rgba(0,0,0,.2); transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}
.share-link svg { width: 19px; height: 19px; fill: currentColor; }
.share-link:hover, .share-link:focus-visible { color: #fff; filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.3); }
.share-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.share-link--facebook { background: #1877f2; border-color: #1877f2; }
.share-link--x { background: #000; border-color: #424954; }
.share-link--pinterest { background: #e60023; border-color: #e60023; }
.share-link--whatsapp { background: #25d366; border-color: #25d366; }
.share-link--tiktok { background: #000; border-color: #25f4ee; box-shadow: inset -2px -1px 0 #fe2c55, inset 2px 1px 0 #25f4ee, 0 5px 16px rgba(0,0,0,.2); }
.share-feedback {
  position: fixed; left: 50%; bottom: 24px; z-index: 70; max-width: calc(100% - 32px); padding: 10px 15px;
  border: 1px solid var(--je-line); border-radius: 7px; background: #111d2b; color: #fff; font-size: .78rem;
  opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease;
}
.share-feedback:empty { display: none; }
.share-feedback.is-visible { opacity: 1; transform: translate(-50%, 0); }
.entry-content { min-width: 0; color: #e5e9ee; font-size: 1.08rem; }
.entry-content > * { max-width: 100%; }
.entry-content h2, .entry-content h3, .entry-content h4 { font-family: var(--je-display); line-height: 1.02; letter-spacing: -.03em; }
.entry-content h2 { margin: 1.8em 0 .65em; font-size: clamp(2rem, 4vw, 3.3rem); }
.entry-content h3 { margin-top: 1.6em; font-size: 1.9rem; }
.entry-content p { margin: 0 0 1.35em; }
.entry-content a { color: var(--je-accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content img { border-radius: 7px; }
.entry-content blockquote { margin: 2em 0; padding: 8px 0 8px 24px; border-left: 4px solid var(--je-accent); color: #fff; font-size: 1.35rem; }
.entry-content figcaption, .wp-caption-text { color: var(--je-muted); font-size: .78rem; }
.article-aside { position: sticky; top: 110px; padding: 20px; border: 1px solid var(--je-line); }
.article-aside h2 { margin: 0 0 18px; font-family: var(--je-display); font-weight: var(--je-heading-weight); }
.trending-list { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
.trending-card { min-width: 0; padding-bottom: 20px; border-bottom: 1px solid var(--je-line); }
.trending-card:last-child { padding-bottom: 0; border-bottom: 0; }
.trending-card__media {
  position: relative; display: block; overflow: hidden; width: 100%; aspect-ratio: 16/9;
  margin-bottom: 11px; border-radius: 5px; background: var(--je-panel-light);
}
.trending-card__media.no-image::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, #23445b, #763a62 52%, #dc7048);
}
.trending-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.trending-card:hover .trending-card__media img { transform: scale(1.045); }
.trending-card__title { margin: 5px 0 8px; font-family: var(--je-display); font-size: 1.08rem; font-weight: var(--je-heading-weight); line-height: 1.15; }
.trending-card__title a:hover { color: var(--je-accent); }
.trending-card .post-meta { color: var(--je-muted); font-size: .65rem; }
.article-footer { max-width: 760px; margin: 42px auto 75px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags a { padding: 7px 12px; border: 1px solid var(--je-line); border-radius: 999px; color: var(--je-muted); font-size: .75rem; }
.post-navigation { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--je-line); }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 0; }
.post-navigation a { display: grid; min-width: 0; overflow: hidden; border: 1px solid var(--je-line); border-radius: 9px; background: var(--je-panel); }
.post-navigation a:hover { color: #fff; border-color: rgba(255,255,255,.34); }
.post-navigation__media { position: relative; display: block; overflow: hidden; aspect-ratio: 16/9; background: var(--je-panel-light); }
.post-navigation__media.no-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, #23445b, #763a62 52%, #dc7048); }
.post-navigation__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-navigation a:hover .post-navigation__media img { transform: scale(1.045); }
.post-navigation__body { display: grid; gap: 7px; padding: 16px 18px 18px; }
.post-navigation__title { font-family: var(--je-display); font-size: 1.25rem; font-weight: var(--je-heading-weight); letter-spacing: -.02em; line-height: 1.08; }
.post-navigation .nav-next:only-child { grid-column: 2; }
.post-navigation .nav-next .post-navigation__body { text-align: right; }
.related-posts { padding-bottom: 75px; }
.related-posts .section-heading { padding-top: 6px; border-top: 1px solid var(--je-line); }
.related-posts__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.related-posts__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.related-posts__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.related-card { min-width: 0; }
.related-card__media { position: relative; display: block; overflow: hidden; aspect-ratio: 16/10; border-radius: 8px; background: var(--je-panel-light); }
.related-card__media.no-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, #23445b, #763a62 52%, #dc7048); }
.related-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.related-card:hover .related-card__media img { transform: scale(1.045); }
.related-card__body { padding-top: 15px; }
.related-card__title { margin: 6px 0 0; font-family: var(--je-display); font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: var(--je-heading-weight); letter-spacing: -.025em; line-height: 1.05; }
.related-card__title a:hover { color: var(--je-accent); }
.page-content-shell { max-width: 820px; padding: 70px 0; }
.page-content-shell .entry-title { font-family: var(--je-display); font-size: clamp(3rem, 6vw, 5.5rem); line-height: .95; letter-spacing: -.05em; }

/* Comments */
.comments-area { max-width: 760px; margin: 0 auto 70px; }
.comments-title, .comment-reply-title { font-family: var(--je-display); font-size: 2rem; }
.comment-list { padding: 0; list-style: none; }
.comment-body { margin-bottom: 18px; padding: 20px; background: var(--je-panel); border: 1px solid var(--je-line); border-radius: 8px; }
.comment-meta { font-size: .8rem; color: var(--je-muted); }
.comment-form input:not([type="submit"]), .comment-form textarea { width: 100%; padding: 13px; color: #fff; background: var(--je-panel-light); border: 1px solid var(--je-line); border-radius: 6px; }
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid var(--je-accent); outline-offset: 1px; }
.form-submit .submit { padding: 12px 20px; background: var(--je-accent); color: var(--je-accent-ink); border: 0; border-radius: var(--je-button-radius); font-weight: 850; cursor: pointer; }

/* Footer */
.site-footer { padding: 60px 0 28px; background: var(--je-footer-bg); border-top: 1px solid rgba(255,255,255,.08); }
.site-footer__grid { display: grid; grid-template-columns: 1.2fr 2fr; gap: 60px; align-items: start; }
.footer-brand p { max-width: 390px; color: var(--je-footer-text); }
.footer-brand .custom-logo-link { width: var(--je-footer-logo-width); max-width: 100%; }
.footer-brand .custom-logo { max-height: none; }
.footer-menus { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.footer-menu h2 { margin: 0 0 12px; color: var(--je-accent); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.footer-menu ul { margin: 0; padding: 0; list-style: none; }
.footer-menu li + li { margin-top: 7px; }
.footer-menu a { color: var(--je-footer-text); font-size: .84rem; }
.footer-menu a:hover, .site-info a:hover { color: var(--je-accent); }
.site-info { display: flex; justify-content: space-between; gap: 20px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--je-line); color: var(--je-footer-text); font-size: .75rem; }
.site-info > span a { color: var(--je-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* 404 */
.error-404 { display: grid; min-height: 65vh; place-items: center; padding: 70px 20px; text-align: center; }
.error-404__code { margin: 0; color: var(--je-accent); font-family: var(--je-display); font-size: clamp(7rem, 18vw, 14rem); font-weight: var(--je-heading-weight); line-height: .75; }
.error-404 h1 { font-family: var(--je-display); font-size: clamp(2.2rem, 5vw, 4rem); }
.error-404 p { color: var(--je-muted); }

@media (min-width: 1021px) {
  .primary-navigation > ul > li > .sub-menu,
  .primary-navigation .sub-menu .sub-menu {
    position: absolute; z-index: 60; min-width: 230px; padding: 10px;
    background: #0b1420; border: 1px solid rgba(255,255,255,.16); border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0,0,0,.38); opacity: 0; visibility: hidden;
    pointer-events: none; transition: opacity .18s ease, transform .18s ease, visibility .18s;
  }
  .primary-navigation > ul > li > .sub-menu { top: calc(100% + 20px); left: 0; transform: translateY(-7px); }
  .primary-navigation > ul > li:last-child > .sub-menu { right: 0; left: auto; }
  .primary-navigation .sub-menu .sub-menu { top: -11px; left: calc(100% + 9px); transform: translateX(-7px); }
  .primary-navigation .sub-menu::before { content: ""; position: absolute; inset: -21px 0 auto; height: 21px; }
  .primary-navigation .sub-menu .sub-menu::before { inset: 0 auto 0 -10px; width: 10px; height: auto; }
  .primary-navigation .menu-item-has-children:hover > .sub-menu,
  .primary-navigation .menu-item-has-children.submenu-open > .sub-menu {
    opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  }
  .primary-navigation > ul > li:hover > .sub-menu,
  .primary-navigation > ul > li.submenu-open > .sub-menu { transform: translateY(0); }
  .primary-navigation .sub-menu .menu-item-has-children > .submenu-toggle { right: 8px; }
  .primary-navigation .sub-menu .menu-item-has-children > .submenu-toggle svg { transform: rotate(-90deg); }
  .primary-navigation .sub-menu .menu-item-has-children.submenu-open > .submenu-toggle svg { transform: rotate(90deg); }
}

@media (max-width: 1020px) {
  .primary-navigation { display: none; position: fixed; inset: 78px 0 0; overflow-y: auto; padding: 35px 24px; background: rgba(7,16,27,.99); }
  .admin-bar .primary-navigation { inset-block-start: 110px; }
  .primary-navigation.is-open { display: block; }
  .primary-navigation > ul { align-items: stretch; flex-direction: column; gap: 0; }
  .primary-navigation li { border-bottom: 1px solid var(--je-line); }
  .primary-navigation a { display: block; padding: 16px 54px 16px 0; font-family: var(--je-display); font-size: 1.6rem; }
  .primary-navigation .submenu-toggle { top: 10px; width: 44px; height: 44px; }
  .primary-navigation .sub-menu { display: none; padding: 0 0 12px 18px; }
  .primary-navigation .submenu-open > .sub-menu { display: block; }
  .primary-navigation .sub-menu li { border-bottom: 0; border-top: 1px solid rgba(255,255,255,.09); }
  .primary-navigation .sub-menu a { padding: 11px 52px 11px 0; font-family: var(--je-sans); font-size: 1rem; }
  .primary-navigation .sub-menu .submenu-toggle { top: 5px; }
  .menu-toggle { display: grid; }
  .header-actions { margin-left: auto; }
  .hero-grid { min-height: 510px; }
  .worth-layout { gap: 26px; }
  .article-layout { grid-template-columns: 55px minmax(0, 1fr); }
  .article-aside { display: none; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .related-posts__grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .admin-bar .site-header { top: 46px; }
  .je-container { width: min(calc(100% - 28px), var(--je-max)); }
  .site-header .je-container { width: min(calc(100% - 28px), 1600px); }
  .site-header { height: 68px; }
  .primary-navigation { inset-block-start: 68px; }
  .admin-bar .primary-navigation { inset-block-start: 114px; }
  .header-cta { display: none; }
  .site-title { font-size: 1.35rem; }
  .custom-logo-link { width: var(--je-mobile-logo-width); max-width: 48vw; }
  .search-panel { top: 68px; }
  .admin-bar .search-panel { top: 114px; }
  .home-hero { padding-top: 14px; }
  .hero-grid { display: block; min-height: 0; }
  .hero-card { min-height: 470px; }
  .hero-stack { grid-template-columns: 1fr 1fr; grid-template-rows: none; margin-top: 10px; }
  .hero-stack .hero-card { min-height: 250px; }
  .hero-card__link, .hero-card--large .hero-card__link { padding: 20px; }
  .hero-card--large .hero-card__title { font-size: clamp(2.4rem, 10vw, 4rem); }
  .hero-card__title { font-size: 1.45rem; }
  .post-meta { font-size: .65rem; }
  .topic-list { display: flex; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .topic-list::-webkit-scrollbar { display: none; }
  .topic-list li { flex: 0 0 150px; scroll-snap-align: start; }
  .worth-layout { grid-template-columns: 1fr; }
  .story-card { grid-template-columns: 1fr; gap: 15px; }
  .story-card__media { min-height: auto; aspect-ratio: 16/10; }
  .most-viewed { position: static; }
  .random-cta__inner, .random-cta__copy { align-items: flex-start; flex-direction: column; }
  .random-cta__inner { padding: 34px 0; }
  .random-cta__image { width: min(var(--je-quick-joy-image-size), 52vw); max-height: 150px; }
  .random-cta .je-button { align-self: stretch; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .article-header { padding-top: 38px; }
  .article-title { font-size: clamp(2.7rem, 14vw, 5.2rem); }
  .article-featured { width: calc(100% - 28px); margin-bottom: 30px; }
  .article-layout { display: block; }
  .share-rail { position: static; display: flex; margin-bottom: 24px; }
  .related-posts__grid, .related-posts__grid--2, .related-posts__grid--4 { grid-template-columns: 1fr 1fr; }
  .footer-menus { grid-template-columns: 1fr 1fr; }
  .site-info { flex-direction: column; }
}

@media (max-width: 500px) {
  .header-search, .menu-toggle { width: 38px; height: 38px; }
  .hero-card { min-height: 390px; }
  .hero-stack { display: grid; grid-template-columns: 1fr; }
  .hero-stack .hero-card { min-height: 275px; }
  .section-heading { align-items: start; flex-direction: column; }
  .card-grid { grid-template-columns: 1fr; }
  .post-navigation .nav-links { grid-template-columns: 1fr; }
  .post-navigation .nav-next:only-child { grid-column: auto; }
  .related-posts__grid, .related-posts__grid--2, .related-posts__grid--4 { grid-template-columns: 1fr; }
  .footer-menus { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
