I’ll build this as a production-style critical page CSS file for RX Theme: fast above-the-fold layout, medical-site UI, accessibility, responsive rules, and safe WordPress defaults.
Dear friend, for this file:
assets/static/static-css/critical/critical-page.css
use it for above-the-fold page rendering: header, logo, navigation, hero, page title, breadcrumbs, first content block, layout skeleton, accessibility, responsive base, and WordPress core elements.
Critical CSS should normally be small, but below is an advanced full starter version for RX Theme.
/*!
Theme Name: RX Theme
File: assets/static/static-css/critical/critical-page.css
Purpose: Critical above-the-fold CSS for pages
Author: RxHarun
Version: 1.0.0
*/
/* =========================================================
01. ROOT DESIGN TOKENS
========================================================= */
:root {
--rx-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
--rx-font-serif: Georgia, "Times New Roman", serif;
--rx-font-mono: Consolas, Monaco, "Courier New", monospace;
--rx-color-primary: #075985;
--rx-color-primary-dark: #0c4a6e;
--rx-color-primary-light: #e0f2fe;
--rx-color-secondary: #0f766e;
--rx-color-accent: #dc2626;
--rx-color-text: #111827;
--rx-color-text-soft: #374151;
--rx-color-muted: #6b7280;
--rx-color-border: #e5e7eb;
--rx-color-bg: #ffffff;
--rx-color-bg-soft: #f8fafc;
--rx-color-bg-muted: #f1f5f9;
--rx-color-success: #15803d;
--rx-color-warning: #b45309;
--rx-color-danger: #b91c1c;
--rx-color-info: #0369a1;
--rx-container-xs: 640px;
--rx-container-sm: 768px;
--rx-container-md: 1024px;
--rx-container-lg: 1200px;
--rx-container-xl: 1320px;
--rx-space-1: 0.25rem;
--rx-space-2: 0.5rem;
--rx-space-3: 0.75rem;
--rx-space-4: 1rem;
--rx-space-5: 1.25rem;
--rx-space-6: 1.5rem;
--rx-space-8: 2rem;
--rx-space-10: 2.5rem;
--rx-space-12: 3rem;
--rx-space-16: 4rem;
--rx-radius-xs: 4px;
--rx-radius-sm: 6px;
--rx-radius-md: 10px;
--rx-radius-lg: 14px;
--rx-radius-xl: 20px;
--rx-radius-full: 999px;
--rx-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
--rx-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
--rx-shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
--rx-header-height: 72px;
--rx-admin-bar-offset: 0px;
--rx-transition-fast: 150ms ease;
--rx-transition-base: 220ms ease;
--rx-z-header: 1000;
--rx-z-dropdown: 1010;
--rx-z-overlay: 1020;
--rx-z-skip: 9999;
}
.admin-bar {
--rx-admin-bar-offset: 32px;
}
@media (max-width: 782px) {
.admin-bar {
--rx-admin-bar-offset: 46px;
}
}
/* =========================================================
02. MODERN RESET
========================================================= */
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
min-height: 100%;
font-size: 16px;
line-height: 1.5;
text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
scroll-behavior: smooth;
}
body {
min-height: 100%;
margin: 0;
font-family: var(--rx-font-sans);
font-size: 1rem;
line-height: 1.7;
color: var(--rx-color-text);
background: var(--rx-color-bg);
overflow-x: hidden;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
img,
picture,
svg,
video,
canvas {
display: block;
max-width: 100%;
height: auto;
}
img {
border-style: none;
}
iframe,
embed,
object {
max-width: 100%;
}
button,
input,
textarea,
select {
font: inherit;
}
button {
cursor: pointer;
}
table {
width: 100%;
border-collapse: collapse;
}
a {
color: var(--rx-color-primary);
text-decoration-thickness: 0.08em;
text-underline-offset: 0.18em;
}
a:hover {
color: var(--rx-color-primary-dark);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
outline: 3px solid rgba(14, 165, 233, 0.45);
outline-offset: 3px;
}
p,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
figure,
blockquote {
margin-top: 0;
}
p:last-child,
ul:last-child,
ol:last-child,
figure:last-child,
blockquote:last-child {
margin-bottom: 0;
}
/* =========================================================
03. ACCESSIBILITY
========================================================= */
.screen-reader-text,
.sr-only {
position: absolute !important;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
.screen-reader-text:focus,
.sr-only:focus {
position: fixed !important;
top: calc(var(--rx-admin-bar-offset) + 12px);
left: 12px;
z-index: var(--rx-z-skip);
width: auto;
height: auto;
padding: 0.75rem 1rem;
margin: 0;
color: #ffffff;
background: var(--rx-color-primary-dark);
border-radius: var(--rx-radius-sm);
clip-path: none;
white-space: normal;
box-shadow: var(--rx-shadow-lg);
}
.skip-link {
position: fixed;
top: calc(var(--rx-admin-bar-offset) + 12px);
left: 12px;
z-index: var(--rx-z-skip);
transform: translateY(-160%);
padding: 0.75rem 1rem;
color: #ffffff;
background: var(--rx-color-primary-dark);
border-radius: var(--rx-radius-sm);
text-decoration: none;
box-shadow: var(--rx-shadow-lg);
transition: transform var(--rx-transition-fast);
}
.skip-link:focus {
transform: translateY(0);
}
[hidden] {
display: none !important;
}
/* =========================================================
04. LAYOUT CONTAINER
========================================================= */
.rx-site {
min-height: 100vh;
background: var(--rx-color-bg);
}
.rx-container,
.container,
.site-container,
.wrap {
width: min(100% - 32px, var(--rx-container-xl));
margin-inline: auto;
}
.rx-container-narrow {
width: min(100% - 32px, 860px);
margin-inline: auto;
}
.rx-container-wide {
width: min(100% - 32px, 1480px);
margin-inline: auto;
}
.rx-main,
.site-main,
#main {
display: block;
}
.rx-layout {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: var(--rx-space-8);
}
@media (min-width: 1024px) {
.rx-layout.has-sidebar {
grid-template-columns: minmax(0, 1fr) 340px;
align-items: start;
}
.rx-layout.sidebar-left {
grid-template-columns: 340px minmax(0, 1fr);
}
.rx-layout.sidebar-left .rx-content {
order: 2;
}
.rx-layout.sidebar-left .rx-sidebar {
order: 1;
}
}
/* =========================================================
05. SITE HEADER
========================================================= */
.rx-site-header,
.site-header {
position: sticky;
top: var(--rx-admin-bar-offset);
z-index: var(--rx-z-header);
min-height: var(--rx-header-height);
background: rgba(255, 255, 255, 0.96);
border-bottom: 1px solid var(--rx-color-border);
backdrop-filter: blur(14px);
-webkit-backdrop-filter: blur(14px);
}
.rx-header-inner,
.site-header .header-inner {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--rx-space-4);
min-height: var(--rx-header-height);
}
.rx-site-branding,
.site-branding {
display: flex;
align-items: center;
min-width: 0;
gap: var(--rx-space-3);
}
.rx-logo,
.custom-logo-link {
display: inline-flex;
align-items: center;
flex: 0 0 auto;
text-decoration: none;
}
.rx-logo img,
.custom-logo {
width: auto;
max-height: 48px;
}
.rx-site-title,
.site-title {
margin: 0;
font-size: clamp(1.2rem, 2vw, 1.55rem);
line-height: 1.15;
font-weight: 800;
letter-spacing: -0.03em;
}
.rx-site-title a,
.site-title a {
color: var(--rx-color-text);
text-decoration: none;
}
.rx-site-title a:hover,
.site-title a:hover {
color: var(--rx-color-primary);
}
.rx-site-description,
.site-description {
margin: 0.15rem 0 0;
font-size: 0.82rem;
line-height: 1.35;
color: var(--rx-color-muted);
}
/* =========================================================
06. NAVIGATION
========================================================= */
.rx-primary-nav,
.main-navigation {
display: flex;
align-items: center;
justify-content: flex-end;
min-width: 0;
}
.rx-primary-menu,
.main-navigation ul,
.menu {
display: flex;
align-items: center;
gap: 0.15rem;
margin: 0;
padding: 0;
list-style: none;
}
.rx-primary-menu li,
.main-navigation li,
.menu li {
position: relative;
}
.rx-primary-menu a,
.main-navigation a,
.menu a {
display: inline-flex;
align-items: center;
min-height: 42px;
padding: 0.45rem 0.75rem;
color: var(--rx-color-text-soft);
font-size: 0.95rem;
font-weight: 600;
line-height: 1.2;
text-decoration: none;
border-radius: var(--rx-radius-md);
transition:
color var(--rx-transition-fast),
background-color var(--rx-transition-fast);
}
.rx-primary-menu a:hover,
.rx-primary-menu .current-menu-item > a,
.rx-primary-menu .current-menu-ancestor > a,
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a {
color: var(--rx-color-primary-dark);
background: var(--rx-color-primary-light);
}
.rx-primary-menu .sub-menu,
.main-navigation .sub-menu {
position: absolute;
top: calc(100% + 8px);
left: 0;
z-index: var(--rx-z-dropdown);
display: block;
width: 230px;
padding: 0.5rem;
margin: 0;
list-style: none;
background: #ffffff;
border: 1px solid var(--rx-color-border);
border-radius: var(--rx-radius-lg);
box-shadow: var(--rx-shadow-lg);
opacity: 0;
visibility: hidden;
transform: translateY(8px);
transition:
opacity var(--rx-transition-fast),
visibility var(--rx-transition-fast),
transform var(--rx-transition-fast);
}
.rx-primary-menu li:hover > .sub-menu,
.rx-primary-menu li:focus-within > .sub-menu,
.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.rx-primary-menu .sub-menu a,
.main-navigation .sub-menu a {
display: flex;
width: 100%;
min-height: 38px;
padding: 0.55rem 0.7rem;
font-size: 0.9rem;
}
.rx-menu-toggle,
.menu-toggle {
display: none;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
color: var(--rx-color-text);
background: var(--rx-color-bg-soft);
border: 1px solid var(--rx-color-border);
border-radius: var(--rx-radius-md);
}
.rx-menu-toggle span,
.menu-toggle span {
display: block;
width: 20px;
height: 2px;
background: currentColor;
box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor;
}
/* =========================================================
07. HEADER ACTIONS
========================================================= */
.rx-header-actions {
display: flex;
align-items: center;
gap: var(--rx-space-2);
}
.rx-header-search-toggle,
.rx-theme-toggle,
.rx-header-button {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 42px;
min-height: 42px;
padding: 0.5rem 0.75rem;
color: var(--rx-color-text-soft);
background: var(--rx-color-bg-soft);
border: 1px solid var(--rx-color-border);
border-radius: var(--rx-radius-md);
text-decoration: none;
transition:
color var(--rx-transition-fast),
background-color var(--rx-transition-fast),
border-color var(--rx-transition-fast);
}
.rx-header-search-toggle:hover,
.rx-theme-toggle:hover,
.rx-header-button:hover {
color: var(--rx-color-primary-dark);
background: var(--rx-color-primary-light);
border-color: #bae6fd;
}
.rx-emergency-button,
.rx-cta-button {
color: #ffffff;
background: var(--rx-color-accent);
border-color: var(--rx-color-accent);
}
.rx-emergency-button:hover,
.rx-cta-button:hover {
color: #ffffff;
background: #991b1b;
border-color: #991b1b;
}
/* =========================================================
08. MOBILE HEADER
========================================================= */
@media (max-width: 900px) {
.rx-site-header,
.site-header {
position: sticky;
}
.rx-menu-toggle,
.menu-toggle {
display: inline-flex;
}
.rx-primary-nav,
.main-navigation {
position: fixed;
inset: calc(var(--rx-admin-bar-offset) + var(--rx-header-height)) 0 auto 0;
z-index: var(--rx-z-dropdown);
display: none;
max-height: calc(100vh - var(--rx-admin-bar-offset) - var(--rx-header-height));
overflow: auto;
padding: 1rem;
background: #ffffff;
border-bottom: 1px solid var(--rx-color-border);
box-shadow: var(--rx-shadow-lg);
}
.rx-primary-nav.is-open,
.main-navigation.toggled {
display: block;
}
.rx-primary-menu,
.main-navigation ul,
.menu {
display: block;
}
.rx-primary-menu a,
.main-navigation a,
.menu a {
width: 100%;
justify-content: space-between;
min-height: 46px;
padding: 0.75rem 0.85rem;
}
.rx-primary-menu .sub-menu,
.main-navigation .sub-menu {
position: static;
width: auto;
padding: 0.25rem 0 0.25rem 1rem;
margin: 0;
background: transparent;
border: 0;
box-shadow: none;
opacity: 1;
visibility: visible;
transform: none;
}
.rx-header-actions {
gap: 0.35rem;
}
.rx-header-button-text {
display: none;
}
}
/* =========================================================
09. PAGE HERO / TITLE AREA
========================================================= */
.rx-page-hero,
.page-hero,
.rx-archive-hero {
position: relative;
overflow: hidden;
padding: clamp(2rem, 5vw, 4.5rem) 0;
background:
radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 34%),
linear-gradient(135deg, #f8fafc 0%, #eef7ff 45%, #ffffff 100%);
border-bottom: 1px solid var(--rx-color-border);
}
.rx-page-hero::before,
.page-hero::before {
content: "";
position: absolute;
inset: 0;
pointer-events: none;
background-image:
linear-gradient(rgba(14, 165, 233, 0.08) 1px, transparent 1px),
linear-gradient(90deg, rgba(14, 165, 233, 0.08) 1px, transparent 1px);
background-size: 32px 32px;
mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
}
.rx-page-hero-inner,
.page-hero-inner {
position: relative;
z-index: 1;
max-width: 920px;
}
.rx-page-kicker,
.page-kicker {
display: inline-flex;
align-items: center;
gap: 0.45rem;
margin-bottom: 0.9rem;
padding: 0.35rem 0.7rem;
color: var(--rx-color-primary-dark);
font-size: 0.82rem;
font-weight: 800;
line-height: 1.2;
text-transform: uppercase;
letter-spacing: 0.08em;
background: var(--rx-color-primary-light);
border: 1px solid #bae6fd;
border-radius: var(--rx-radius-full);
}
.rx-page-title,
.page-title,
.entry-title {
margin: 0;
color: var(--rx-color-text);
font-size: clamp(2rem, 5vw, 4rem);
line-height: 1.06;
font-weight: 900;
letter-spacing: -0.055em;
}
.rx-page-subtitle,
.page-subtitle,
.archive-description {
max-width: 760px;
margin-top: 1rem;
color: var(--rx-color-text-soft);
font-size: clamp(1rem, 2vw, 1.2rem);
line-height: 1.75;
}
/* =========================================================
10. BREADCRUMBS
========================================================= */
.rx-breadcrumbs,
.breadcrumbs,
.rank-math-breadcrumb,
.yoast-breadcrumb {
margin-bottom: 1rem;
color: var(--rx-color-muted);
font-size: 0.88rem;
line-height: 1.5;
}
.rx-breadcrumbs a,
.breadcrumbs a,
.rank-math-breadcrumb a,
.yoast-breadcrumb a {
color: var(--rx-color-muted);
text-decoration: none;
}
.rx-breadcrumbs a:hover,
.breadcrumbs a:hover,
.rank-math-breadcrumb a:hover,
.yoast-breadcrumb a:hover {
color: var(--rx-color-primary);
text-decoration: underline;
}
/* =========================================================
11. MAIN PAGE CONTENT WRAPPER
========================================================= */
.rx-page-content-wrap,
.page-content-wrap {
padding: clamp(2rem, 4vw, 4rem) 0;
}
.rx-content,
.site-content,
.content-area {
min-width: 0;
}
.rx-card,
.rx-content-card,
.page-card {
background: #ffffff;
border: 1px solid var(--rx-color-border);
border-radius: var(--rx-radius-xl);
box-shadow: var(--rx-shadow-sm);
}
.rx-content-card,
.page-card {
padding: clamp(1.25rem, 3vw, 2.25rem);
}
/* =========================================================
12. ARTICLE / PAGE TYPOGRAPHY
========================================================= */
.rx-entry,
.entry-content,
.page-content {
color: var(--rx-color-text);
font-size: clamp(1rem, 1.2vw, 1.075rem);
line-height: 1.8;
}
.rx-entry > * + *,
.entry-content > * + *,
.page-content > * + * {
margin-top: 1.25em;
}
.rx-entry h1,
.rx-entry h2,
.rx-entry h3,
.rx-entry h4,
.rx-entry h5,
.rx-entry h6,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
color: var(--rx-color-text);
line-height: 1.22;
font-weight: 850;
letter-spacing: -0.035em;
}
.rx-entry h2,
.entry-content h2 {
margin-top: 2em;
font-size: clamp(1.6rem, 3vw, 2.35rem);
}
.rx-entry h3,
.entry-content h3 {
margin-top: 1.8em;
font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}
.rx-entry h4,
.entry-content h4 {
margin-top: 1.6em;
font-size: 1.2rem;
}
.rx-entry p,
.entry-content p {
margin-bottom: 1.15em;
}
.rx-entry strong,
.entry-content strong {
font-weight: 800;
}
.rx-entry ul,
.rx-entry ol,
.entry-content ul,
.entry-content ol {
padding-left: 1.4em;
}
.rx-entry li,
.entry-content li {
margin-bottom: 0.55em;
}
.rx-entry blockquote,
.entry-content blockquote {
margin: 1.75rem 0;
padding: 1.25rem 1.5rem;
color: var(--rx-color-text-soft);
background: var(--rx-color-bg-soft);
border-left: 5px solid var(--rx-color-primary);
border-radius: 0 var(--rx-radius-lg) var(--rx-radius-lg) 0;
}
.rx-entry code,
.entry-content code {
padding: 0.15em 0.35em;
font-family: var(--rx-font-mono);
font-size: 0.9em;
background: var(--rx-color-bg-muted);
border-radius: var(--rx-radius-xs);
}
.rx-entry pre,
.entry-content pre {
overflow: auto;
padding: 1rem;
font-family: var(--rx-font-mono);
font-size: 0.9rem;
line-height: 1.6;
background: #0f172a;
color: #e5e7eb;
border-radius: var(--rx-radius-lg);
}
.rx-entry pre code,
.entry-content pre code {
padding: 0;
color: inherit;
background: transparent;
}
/* =========================================================
13. MEDICAL CONTENT ELEMENTS
========================================================= */
.rx-medical-note,
.rx-health-note,
.rx-alert,
.rx-info-box,
.rx-warning-box,
.rx-danger-box,
.rx-success-box {
padding: 1rem 1.1rem;
border: 1px solid var(--rx-color-border);
border-radius: var(--rx-radius-lg);
background: var(--rx-color-bg-soft);
}
.rx-info-box {
color: #075985;
background: #f0f9ff;
border-color: #bae6fd;
}
.rx-warning-box {
color: #92400e;
background: #fffbeb;
border-color: #fde68a;
}
.rx-danger-box {
color: #991b1b;
background: #fef2f2;
border-color: #fecaca;
}
.rx-success-box {
color: #166534;
background: #f0fdf4;
border-color: #bbf7d0;
}
.rx-medical-disclaimer {
padding: 1rem 1.1rem;
color: var(--rx-color-text-soft);
font-size: 0.95rem;
line-height: 1.65;
background: #fff7ed;
border: 1px solid #fed7aa;
border-radius: var(--rx-radius-lg);
}
.rx-medical-disclaimer strong {
color: #9a3412;
}
.rx-evidence-chip,
.rx-reference-chip {
display: inline-flex;
align-items: center;
gap: 0.3rem;
min-height: 28px;
padding: 0.18rem 0.55rem;
color: var(--rx-color-primary-dark);
font-size: 0.8rem;
font-weight: 800;
line-height: 1;
text-decoration: none;
background: var(--rx-color-primary-light);
border: 1px solid #bae6fd;
border-radius: var(--rx-radius-full);
}
/* =========================================================
14. META INFO
========================================================= */
.rx-entry-meta,
.entry-meta,
.posted-on,
.byline {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.45rem 0.75rem;
color: var(--rx-color-muted);
font-size: 0.9rem;
line-height: 1.4;
}
.rx-entry-meta a,
.entry-meta a {
color: inherit;
text-decoration: none;
}
.rx-entry-meta a:hover,
.entry-meta a:hover {
color: var(--rx-color-primary);
text-decoration: underline;
}
.rx-author-mini {
display: inline-flex;
align-items: center;
gap: 0.55rem;
}
.rx-author-mini img,
.avatar {
width: 34px;
height: 34px;
border-radius: 50%;
}
/* =========================================================
15. FEATURED IMAGE
========================================================= */
.rx-featured-image,
.post-thumbnail {
overflow: hidden;
margin-bottom: clamp(1.25rem, 3vw, 2rem);
border-radius: var(--rx-radius-xl);
background: var(--rx-color-bg-muted);
}
.rx-featured-image img,
.post-thumbnail img {
width: 100%;
aspect-ratio: 16 / 9;
object-fit: cover;
}
/* =========================================================
16. BUTTONS
========================================================= */
.rx-btn,
.button,
.wp-block-button__link,
input[type="submit"],
button[type="submit"] {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.45rem;
min-height: 44px;
padding: 0.7rem 1rem;
color: #ffffff;
font-weight: 750;
line-height: 1.2;
text-align: center;
text-decoration: none;
background: var(--rx-color-primary);
border: 1px solid var(--rx-color-primary);
border-radius: var(--rx-radius-md);
box-shadow: var(--rx-shadow-sm);
transition:
transform var(--rx-transition-fast),
background-color var(--rx-transition-fast),
border-color var(--rx-transition-fast),
box-shadow var(--rx-transition-fast);
}
.rx-btn:hover,
.button:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
color: #ffffff;
background: var(--rx-color-primary-dark);
border-color: var(--rx-color-primary-dark);
transform: translateY(-1px);
box-shadow: var(--rx-shadow-md);
}
.rx-btn-secondary {
color: var(--rx-color-primary-dark);
background: var(--rx-color-primary-light);
border-color: #bae6fd;
}
.rx-btn-secondary:hover {
color: #ffffff;
background: var(--rx-color-primary);
border-color: var(--rx-color-primary);
}
.rx-btn-outline {
color: var(--rx-color-primary-dark);
background: transparent;
border-color: var(--rx-color-primary);
}
.rx-btn-outline:hover {
color: #ffffff;
background: var(--rx-color-primary);
}
/* =========================================================
17. FORMS
========================================================= */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
width: 100%;
min-height: 44px;
padding: 0.65rem 0.8rem;
color: var(--rx-color-text);
background: #ffffff;
border: 1px solid #cbd5e1;
border-radius: var(--rx-radius-md);
transition:
border-color var(--rx-transition-fast),
box-shadow var(--rx-transition-fast);
}
textarea {
min-height: 130px;
resize: vertical;
}
input::placeholder,
textarea::placeholder {
color: #94a3b8;
}
input:focus,
textarea:focus,
select:focus {
border-color: var(--rx-color-primary);
box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}
.search-form {
display: flex;
gap: 0.5rem;
}
.search-form label {
flex: 1 1 auto;
}
.search-form .search-submit {
flex: 0 0 auto;
}
/* =========================================================
18. SIDEBAR CRITICAL STYLE
========================================================= */
.rx-sidebar,
.widget-area {
min-width: 0;
}
.rx-sidebar .widget,
.widget {
padding: 1.1rem;
margin-bottom: 1rem;
background: #ffffff;
border: 1px solid var(--rx-color-border);
border-radius: var(--rx-radius-lg);
box-shadow: var(--rx-shadow-sm);
}
.widget-title,
.wp-block-heading {
margin-bottom: 0.85rem;
color: var(--rx-color-text);
font-size: 1.05rem;
line-height: 1.3;
font-weight: 850;
}
.widget ul {
padding-left: 0;
margin: 0;
list-style: none;
}
.widget li {
padding: 0.45rem 0;
border-bottom: 1px solid var(--rx-color-border);
}
.widget li:last-child {
border-bottom: 0;
}
.widget a {
color: var(--rx-color-text-soft);
text-decoration: none;
}
.widget a:hover {
color: var(--rx-color-primary);
}
/* =========================================================
19. CARDS / POST LIST ABOVE FOLD
========================================================= */
.rx-grid {
display: grid;
gap: var(--rx-space-5);
}
.rx-grid-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rx-grid-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.rx-post-card,
.rx-topic-card,
.rx-category-card {
overflow: hidden;
background: #ffffff;
border: 1px solid var(--rx-color-border);
border-radius: var(--rx-radius-xl);
box-shadow: var(--rx-shadow-sm);
transition:
transform var(--rx-transition-fast),
box-shadow var(--rx-transition-fast),
border-color var(--rx-transition-fast);
}
.rx-post-card:hover,
.rx-topic-card:hover,
.rx-category-card:hover {
transform: translateY(-2px);
border-color: #bae6fd;
box-shadow: var(--rx-shadow-md);
}
.rx-post-card-image {
background: var(--rx-color-bg-muted);
}
.rx-post-card-image img {
width: 100%;
aspect-ratio: 16 / 9;
object-fit: cover;
}
.rx-post-card-body,
.rx-topic-card-body,
.rx-category-card-body {
padding: 1rem;
}
.rx-post-card-title,
.rx-topic-card-title,
.rx-category-card-title {
margin: 0 0 0.55rem;
font-size: 1.1rem;
line-height: 1.35;
font-weight: 850;
}
.rx-post-card-title a,
.rx-topic-card-title a,
.rx-category-card-title a {
color: var(--rx-color-text);
text-decoration: none;
}
.rx-post-card-title a:hover,
.rx-topic-card-title a:hover,
.rx-category-card-title a:hover {
color: var(--rx-color-primary);
}
.rx-post-card-excerpt {
color: var(--rx-color-text-soft);
font-size: 0.95rem;
line-height: 1.65;
}
/* =========================================================
20. TABLE OF CONTENTS CRITICAL
========================================================= */
.rx-toc,
.rx-table-of-contents {
padding: 1rem 1.1rem;
margin-bottom: 1.5rem;
background: #ffffff;
border: 1px solid var(--rx-color-border);
border-radius: var(--rx-radius-lg);
box-shadow: var(--rx-shadow-sm);
}
.rx-toc-title {
margin: 0 0 0.75rem;
color: var(--rx-color-text);
font-size: 1rem;
font-weight: 850;
}
.rx-toc ul {
padding-left: 1.1rem;
margin: 0;
}
.rx-toc li {
margin-bottom: 0.35rem;
}
.rx-toc a {
color: var(--rx-color-text-soft);
text-decoration: none;
}
.rx-toc a:hover {
color: var(--rx-color-primary);
text-decoration: underline;
}
/* =========================================================
21. WORDPRESS BLOCK BASICS
========================================================= */
.alignleft {
float: left;
margin: 0.4rem 1.25rem 1rem 0;
}
.alignright {
float: right;
margin: 0.4rem 0 1rem 1.25rem;
}
.aligncenter {
display: block;
margin-inline: auto;
}
.alignwide {
width: min(100%, 1100px);
margin-inline: auto;
}
.alignfull {
width: 100vw;
max-width: 100vw;
margin-left: calc(50% - 50vw);
}
.wp-caption {
max-width: 100%;
}
.wp-caption-text,
.gallery-caption,
figcaption {
margin-top: 0.55rem;
color: var(--rx-color-muted);
font-size: 0.9rem;
line-height: 1.5;
}
.wp-block-image img {
border-radius: var(--rx-radius-lg);
}
.wp-block-separator {
border: 0;
border-top: 1px solid var(--rx-color-border);
}
.wp-block-quote {
border-left: 5px solid var(--rx-color-primary);
}
/* =========================================================
22. PAGINATION CRITICAL
========================================================= */
.rx-pagination,
.pagination,
.nav-links {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.45rem;
margin-top: 2rem;
}
.page-numbers,
.nav-links a,
.nav-links span {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 38px;
min-height: 38px;
padding: 0.45rem 0.7rem;
color: var(--rx-color-text-soft);
font-weight: 700;
text-decoration: none;
background: #ffffff;
border: 1px solid var(--rx-color-border);
border-radius: var(--rx-radius-md);
}
.page-numbers.current,
.nav-links .current,
.page-numbers:hover,
.nav-links a:hover {
color: #ffffff;
background: var(--rx-color-primary);
border-color: var(--rx-color-primary);
}
/* =========================================================
23. LOADING / SKELETON
========================================================= */
.rx-skeleton {
position: relative;
overflow: hidden;
background: #e5e7eb;
border-radius: var(--rx-radius-md);
}
.rx-skeleton::after {
content: "";
position: absolute;
inset: 0;
transform: translateX(-100%);
background: linear-gradient(
90deg,
transparent,
rgba(255, 255, 255, 0.55),
transparent
);
animation: rx-skeleton-loading 1.4s infinite;
}
@keyframes rx-skeleton-loading {
100% {
transform: translateX(100%);
}
}
.rx-lcp-placeholder {
min-height: 240px;
background: var(--rx-color-bg-muted);
border-radius: var(--rx-radius-xl);
}
/* =========================================================
24. UTILITY CLASSES
========================================================= */
.rx-hidden {
display: none !important;
}
.rx-visible {
display: block !important;
}
.rx-text-center {
text-align: center;
}
.rx-text-left {
text-align: left;
}
.rx-text-right {
text-align: right;
}
.rx-mx-auto {
margin-inline: auto;
}
.rx-mt-0 {
margin-top: 0 !important;
}
.rx-mb-0 {
margin-bottom: 0 !important;
}
.rx-bg-soft {
background: var(--rx-color-bg-soft);
}
.rx-rounded {
border-radius: var(--rx-radius-lg);
}
.rx-shadow {
box-shadow: var(--rx-shadow-md);
}
.rx-overflow-hidden {
overflow: hidden;
}
/* =========================================================
25. DARK MODE READY
========================================================= */
[data-theme="dark"] {
--rx-color-text: #f8fafc;
--rx-color-text-soft: #cbd5e1;
--rx-color-muted: #94a3b8;
--rx-color-border: #1e293b;
--rx-color-bg: #020617;
--rx-color-bg-soft: #0f172a;
--rx-color-bg-muted: #1e293b;
--rx-color-primary-light: rgba(14, 165, 233, 0.18);
}
[data-theme="dark"] body,
body[data-theme="dark"] {
color: var(--rx-color-text);
background: var(--rx-color-bg);
}
[data-theme="dark"] .rx-site-header,
[data-theme="dark"] .site-header {
background: rgba(2, 6, 23, 0.94);
}
[data-theme="dark"] .rx-primary-menu .sub-menu,
[data-theme="dark"] .main-navigation .sub-menu,
[data-theme="dark"] .rx-card,
[data-theme="dark"] .rx-content-card,
[data-theme="dark"] .page-card,
[data-theme="dark"] .rx-sidebar .widget,
[data-theme="dark"] .widget,
[data-theme="dark"] .rx-post-card,
[data-theme="dark"] .rx-topic-card,
[data-theme="dark"] .rx-category-card,
[data-theme="dark"] .rx-toc,
[data-theme="dark"] .rx-table-of-contents {
background: #0f172a;
}
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
color: var(--rx-color-text);
background: #020617;
border-color: #334155;
}
[data-theme="dark"] .rx-page-hero,
[data-theme="dark"] .page-hero,
[data-theme="dark"] .rx-archive-hero {
background:
radial-gradient(circle at top left, rgba(14, 165, 233, 0.22), transparent 34%),
linear-gradient(135deg, #020617 0%, #0f172a 55%, #020617 100%);
}
/* =========================================================
26. RESPONSIVE SYSTEM
========================================================= */
@media (max-width: 1200px) {
.rx-container,
.container,
.site-container,
.wrap {
width: min(100% - 28px, var(--rx-container-lg));
}
}
@media (max-width: 1024px) {
.rx-grid-3 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rx-layout.has-sidebar,
.rx-layout.sidebar-left {
grid-template-columns: minmax(0, 1fr);
}
.rx-layout.sidebar-left .rx-content,
.rx-layout.sidebar-left .rx-sidebar {
order: initial;
}
}
@media (max-width: 768px) {
:root {
--rx-header-height: 64px;
}
body {
font-size: 0.98rem;
}
.rx-container,
.container,
.site-container,
.wrap,
.rx-container-narrow,
.rx-container-wide {
width: min(100% - 24px, 100%);
}
.rx-page-hero,
.page-hero,
.rx-archive-hero {
padding: 2rem 0;
}
.rx-grid-2,
.rx-grid-3 {
grid-template-columns: 1fr;
}
.search-form {
flex-direction: column;
}
.alignleft,
.alignright {
float: none;
margin: 1rem 0;
}
}
@media (max-width: 480px) {
.rx-site-title,
.site-title {
font-size: 1.1rem;
}
.rx-site-description,
.site-description {
display: none;
}
.rx-logo img,
.custom-logo {
max-height: 40px;
}
.rx-header-actions > :not(.rx-menu-toggle):not(.menu-toggle):not(.rx-header-search-toggle) {
display: none;
}
.rx-content-card,
.page-card {
padding: 1rem;
border-radius: var(--rx-radius-lg);
}
.rx-page-title,
.page-title,
.entry-title {
font-size: clamp(1.8rem, 10vw, 2.5rem);
}
}
/* =========================================================
27. PRINT BASIC
========================================================= */
@media print {
*,
*::before,
*::after {
color: #000000 !important;
background: transparent !important;
box-shadow: none !important;
text-shadow: none !important;
}
body {
font-size: 12pt;
line-height: 1.5;
}
a,
a:visited {
text-decoration: underline;
}
.rx-site-header,
.site-header,
.rx-primary-nav,
.main-navigation,
.rx-sidebar,
.widget-area,
.rx-header-actions,
.rx-menu-toggle,
.menu-toggle {
display: none !important;
}
.rx-container,
.container,
.site-container,
.wrap {
width: 100%;
max-width: none;
}
.rx-page-content-wrap,
.page-content-wrap {
padding: 0;
}
}
/* =========================================================
28. REDUCED MOTION
========================================================= */
@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
*,
*::before,
*::after {
animation-duration: 0.001ms !important;
animation-iteration-count: 1 !important;
scroll-behavior: auto !important;
transition-duration: 0.001ms !important;
}
}
/* =========================================================
29. HIGH CONTRAST SUPPORT
========================================================= */
@media (prefers-contrast: more) {
:root {
--rx-color-border: #64748b;
}
a {
text-decoration-thickness: 0.12em;
}
.rx-btn,
.button,
.wp-block-button__link {
border-width: 2px;
}
}
/* =========================================================
30. SAFE FALLBACKS
========================================================= */
.no-js .rx-primary-nav,
.no-js .main-navigation {
display: block;
position: static;
}
.no-js .rx-menu-toggle,
.no-js .menu-toggle {
display: none;
}
img[loading="lazy"] {
content-visibility: auto;
}
.rx-critical-ready {
opacity: 1;
}
For best performance, load this file early in <head>, and keep your larger normal CSS files separate, for example:
assets/static/static-css/main/global.css
assets/static/static-css/components/components.css
assets/static/static-css/layout/layout.css
assets/static/static-css/pages/page.css
This critical-page.css should control only the first visible area, so your page loads fast and avoids layout shifting.