rx-base.css

I’ll build this as a strong rx-base.css foundation: variables, resets, typography, layout helpers, forms, tables, media, accessibility, WordPress defaults, print styles, and responsive base utilities.

Friend, below is a powerful advanced assets/css/rx-base.css file for your RX Theme. This file is best for global base styling, not component-specific design. It gives your theme a strong foundation.

Create or replace:

rx-theme/assets/css/rx-base.css

Then paste this full code.

/*!
Theme Name: RX Theme
File: assets/css/rx-base.css
Description: Advanced global base CSS foundation for RX Theme.
Author: RxHarun
Version: 1.0.0
*/

/* =========================================================
   RX THEME BASE CSS
   ---------------------------------------------------------
   This file includes:
   - CSS variables
   - modern reset
   - base typography
   - body/html foundation
   - links
   - media
   - forms
   - tables
   - accessibility
   - WordPress default classes
   - layout helpers
   - print styles
   ========================================================= */


/* =========================================================
   1. ROOT VARIABLES
   ========================================================= */

:root {
  /* Brand Colors */
  --rx-color-primary: #0b63ce;
  --rx-color-primary-dark: #084f9f;
  --rx-color-primary-light: #e9f2ff;

  --rx-color-secondary: #10b981;
  --rx-color-secondary-dark: #047857;
  --rx-color-secondary-light: #ecfdf5;

  --rx-color-accent: #f59e0b;
  --rx-color-accent-dark: #b45309;
  --rx-color-accent-light: #fffbeb;

  --rx-color-danger: #dc2626;
  --rx-color-danger-dark: #991b1b;
  --rx-color-danger-light: #fef2f2;

  --rx-color-warning: #d97706;
  --rx-color-warning-light: #fffbeb;

  --rx-color-success: #16a34a;
  --rx-color-success-light: #f0fdf4;

  --rx-color-info: #0284c7;
  --rx-color-info-light: #f0f9ff;

  /* Neutral Colors */
  --rx-color-white: #ffffff;
  --rx-color-black: #000000;

  --rx-color-gray-50: #f9fafb;
  --rx-color-gray-100: #f3f4f6;
  --rx-color-gray-200: #e5e7eb;
  --rx-color-gray-300: #d1d5db;
  --rx-color-gray-400: #9ca3af;
  --rx-color-gray-500: #6b7280;
  --rx-color-gray-600: #4b5563;
  --rx-color-gray-700: #374151;
  --rx-color-gray-800: #1f2937;
  --rx-color-gray-900: #111827;
  --rx-color-gray-950: #030712;

  /* Semantic Theme Colors */
  --rx-bg-body: var(--rx-color-white);
  --rx-bg-surface: var(--rx-color-white);
  --rx-bg-muted: var(--rx-color-gray-50);
  --rx-bg-soft: var(--rx-color-gray-100);

  --rx-text-main: var(--rx-color-gray-900);
  --rx-text-muted: var(--rx-color-gray-600);
  --rx-text-soft: var(--rx-color-gray-500);
  --rx-text-inverse: var(--rx-color-white);

  --rx-border-color: var(--rx-color-gray-200);
  --rx-border-strong: var(--rx-color-gray-300);

  /* Typography */
  --rx-font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rx-font-heading: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rx-font-code: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --rx-font-size-xs: 0.75rem;
  --rx-font-size-sm: 0.875rem;
  --rx-font-size-base: 1rem;
  --rx-font-size-md: 1.0625rem;
  --rx-font-size-lg: 1.125rem;
  --rx-font-size-xl: 1.25rem;
  --rx-font-size-2xl: 1.5rem;
  --rx-font-size-3xl: 1.875rem;
  --rx-font-size-4xl: 2.25rem;
  --rx-font-size-5xl: 3rem;

  --rx-line-height-tight: 1.2;
  --rx-line-height-heading: 1.25;
  --rx-line-height-normal: 1.6;
  --rx-line-height-relaxed: 1.75;

  --rx-letter-spacing-tight: -0.025em;
  --rx-letter-spacing-normal: 0;
  --rx-letter-spacing-wide: 0.025em;

  /* Spacing */
  --rx-space-0: 0;
  --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-space-20: 5rem;
  --rx-space-24: 6rem;

  /* Layout */
  --rx-container-xs: 36rem;
  --rx-container-sm: 48rem;
  --rx-container-md: 64rem;
  --rx-container-lg: 80rem;
  --rx-container-xl: 90rem;
  --rx-container-2xl: 96rem;

  --rx-content-width: 760px;
  --rx-wide-width: 1200px;
  --rx-full-width: 100%;

  --rx-gutter: clamp(1rem, 4vw, 2rem);
  --rx-section-padding: clamp(2rem, 6vw, 5rem);

  /* Radius */
  --rx-radius-xs: 0.125rem;
  --rx-radius-sm: 0.25rem;
  --rx-radius-md: 0.5rem;
  --rx-radius-lg: 0.75rem;
  --rx-radius-xl: 1rem;
  --rx-radius-2xl: 1.5rem;
  --rx-radius-pill: 999px;
  --rx-radius-circle: 50%;

  /* Shadows */
  --rx-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --rx-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.1), 0 1px 2px rgba(15, 23, 42, 0.06);
  --rx-shadow-md: 0 4px 6px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.06);
  --rx-shadow-lg: 0 10px 15px rgba(15, 23, 42, 0.1), 0 4px 6px rgba(15, 23, 42, 0.05);
  --rx-shadow-xl: 0 20px 25px rgba(15, 23, 42, 0.12), 0 8px 10px rgba(15, 23, 42, 0.06);

  /* Transitions */
  --rx-transition-fast: 150ms ease;
  --rx-transition-normal: 250ms ease;
  --rx-transition-slow: 400ms ease;

  /* Z Index */
  --rx-z-negative: -1;
  --rx-z-base: 1;
  --rx-z-dropdown: 1000;
  --rx-z-sticky: 1020;
  --rx-z-fixed: 1030;
  --rx-z-modal-backdrop: 1040;
  --rx-z-modal: 1050;
  --rx-z-popover: 1060;
  --rx-z-tooltip: 1070;

  /* Header */
  --rx-header-height: 72px;

  /* Forms */
  --rx-input-height: 44px;
  --rx-input-padding-x: 0.875rem;
  --rx-input-padding-y: 0.625rem;
  --rx-input-radius: var(--rx-radius-md);
  --rx-input-border: var(--rx-border-strong);
  --rx-input-bg: var(--rx-color-white);
  --rx-input-text: var(--rx-text-main);
  --rx-input-placeholder: var(--rx-color-gray-400);

  /* Focus */
  --rx-focus-color: var(--rx-color-primary);
  --rx-focus-ring: 0 0 0 3px rgba(11, 99, 206, 0.25);
}


/* =========================================================
   2. OPTIONAL DARK MODE FOUNDATION
   ========================================================= */

@media (prefers-color-scheme: dark) {
  :root {
    --rx-bg-body: #070b12;
    --rx-bg-surface: #0f172a;
    --rx-bg-muted: #111827;
    --rx-bg-soft: #1f2937;

    --rx-text-main: #f9fafb;
    --rx-text-muted: #cbd5e1;
    --rx-text-soft: #94a3b8;

    --rx-border-color: #1f2937;
    --rx-border-strong: #334155;

    --rx-input-bg: #111827;
    --rx-input-text: #f9fafb;
    --rx-input-border: #334155;
  }
}


/* =========================================================
   3. MODERN RESET
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  min-height: 100%;
  font-size: 100%;
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  background: var(--rx-bg-body);
  color: var(--rx-text-main);
  font-family: var(--rx-font-body);
  font-size: var(--rx-font-size-base);
  line-height: var(--rx-line-height-normal);
  font-weight: 400;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  border-style: none;
}

svg {
  overflow: hidden;
  vertical-align: middle;
}

input,
button,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
input,
optgroup,
select,
textarea {
  margin: 0;
}

textarea {
  resize: vertical;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

iframe,
embed,
object {
  max-width: 100%;
}

hr {
  height: 0;
  border: 0;
  border-top: 1px solid var(--rx-border-color);
  margin: var(--rx-space-8) 0;
}


/* =========================================================
   4. SELECTION AND SCROLLBAR
   ========================================================= */

::selection {
  background: var(--rx-color-primary);
  color: var(--rx-color-white);
}

::-moz-selection {
  background: var(--rx-color-primary);
  color: var(--rx-color-white);
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--rx-color-gray-400) var(--rx-bg-muted);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--rx-bg-muted);
}

::-webkit-scrollbar-thumb {
  background: var(--rx-color-gray-400);
  border-radius: var(--rx-radius-pill);
  border: 2px solid var(--rx-bg-muted);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--rx-color-gray-500);
}


/* =========================================================
   5. TYPOGRAPHY BASE
   ========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--rx-text-main);
  font-family: var(--rx-font-heading);
  font-weight: 700;
  line-height: var(--rx-line-height-heading);
  letter-spacing: var(--rx-letter-spacing-tight);
  margin-block: 0 0.75em;
}

h1 {
  font-size: clamp(2rem, 5vw, var(--rx-font-size-5xl));
}

h2 {
  font-size: clamp(1.75rem, 4vw, var(--rx-font-size-4xl));
}

h3 {
  font-size: clamp(1.5rem, 3vw, var(--rx-font-size-3xl));
}

h4 {
  font-size: clamp(1.25rem, 2vw, var(--rx-font-size-2xl));
}

h5 {
  font-size: var(--rx-font-size-xl);
}

h6 {
  font-size: var(--rx-font-size-lg);
}

p {
  margin-block: 0 1.25rem;
}

small {
  font-size: var(--rx-font-size-sm);
}

strong,
b {
  font-weight: 700;
}

em,
i {
  font-style: italic;
}

mark {
  background: var(--rx-color-accent-light);
  color: var(--rx-color-gray-900);
  padding: 0.1em 0.25em;
  border-radius: var(--rx-radius-xs);
}

abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

blockquote {
  margin: var(--rx-space-8) 0;
  padding: var(--rx-space-5) var(--rx-space-6);
  border-left: 4px solid var(--rx-color-primary);
  background: var(--rx-bg-muted);
  color: var(--rx-text-muted);
  border-radius: 0 var(--rx-radius-lg) var(--rx-radius-lg) 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

cite {
  color: var(--rx-text-soft);
  font-style: normal;
  font-size: var(--rx-font-size-sm);
}

pre,
code,
kbd,
samp {
  font-family: var(--rx-font-code);
  font-size: 0.95em;
}

code {
  padding: 0.15em 0.35em;
  background: var(--rx-bg-soft);
  border: 1px solid var(--rx-border-color);
  border-radius: var(--rx-radius-sm);
}

pre {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  margin: var(--rx-space-6) 0;
  padding: var(--rx-space-5);
  background: var(--rx-color-gray-950);
  color: var(--rx-color-gray-50);
  border-radius: var(--rx-radius-lg);
  line-height: 1.7;
}

pre code {
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
}

kbd {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  color: var(--rx-text-main);
  background: var(--rx-bg-soft);
  border: 1px solid var(--rx-border-strong);
  border-bottom-width: 2px;
  border-radius: var(--rx-radius-sm);
}


/* =========================================================
   6. LINKS
   ========================================================= */

a {
  color: var(--rx-color-primary);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition:
    color var(--rx-transition-fast),
    text-decoration-color var(--rx-transition-fast),
    background-color var(--rx-transition-fast);
}

a:hover {
  color: var(--rx-color-primary-dark);
}

a:focus-visible {
  outline: 2px solid var(--rx-focus-color);
  outline-offset: 3px;
  border-radius: var(--rx-radius-xs);
}

a:not([href]) {
  color: inherit;
  text-decoration: none;
}


/* =========================================================
   7. LISTS
   ========================================================= */

ul,
ol {
  margin-block: 0 1.25rem;
  padding-inline-start: 1.5rem;
}

li {
  margin-block: 0.25rem;
}

li > ul,
li > ol {
  margin-block: 0.5rem 0;
}

dl {
  margin-block: 0 1.25rem;
}

dt {
  font-weight: 700;
}

dd {
  margin-inline-start: 1.5rem;
  margin-bottom: 0.75rem;
}


/* =========================================================
   8. GLOBAL LAYOUT HELPERS
   ========================================================= */

.rx-container {
  width: min(100% - (var(--rx-gutter) * 2), var(--rx-container-xl));
  margin-inline: auto;
}

.rx-container-sm {
  width: min(100% - (var(--rx-gutter) * 2), var(--rx-container-sm));
  margin-inline: auto;
}

.rx-container-md {
  width: min(100% - (var(--rx-gutter) * 2), var(--rx-container-md));
  margin-inline: auto;
}

.rx-container-lg {
  width: min(100% - (var(--rx-gutter) * 2), var(--rx-container-lg));
  margin-inline: auto;
}

.rx-content-width {
  width: min(100% - (var(--rx-gutter) * 2), var(--rx-content-width));
  margin-inline: auto;
}

.rx-wide-width {
  width: min(100% - (var(--rx-gutter) * 2), var(--rx-wide-width));
  margin-inline: auto;
}

.rx-full-width {
  width: 100%;
}

.rx-section {
  padding-block: var(--rx-section-padding);
}

.rx-stack > * + * {
  margin-top: var(--rx-space-4);
}

.rx-stack-sm > * + * {
  margin-top: var(--rx-space-2);
}

.rx-stack-lg > * + * {
  margin-top: var(--rx-space-8);
}

.rx-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rx-space-4);
  align-items: center;
}

.rx-center {
  display: grid;
  place-items: center;
}

.rx-grid {
  display: grid;
  gap: var(--rx-space-6);
}

.rx-grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--rx-space-6);
}

.rx-flex {
  display: flex;
  gap: var(--rx-space-4);
}

.rx-flex-wrap {
  flex-wrap: wrap;
}

.rx-items-center {
  align-items: center;
}

.rx-justify-between {
  justify-content: space-between;
}


/* =========================================================
   9. MEDIA ELEMENTS
   ========================================================= */

figure {
  margin: var(--rx-space-8) 0;
}

figcaption {
  margin-top: var(--rx-space-2);
  color: var(--rx-text-soft);
  font-size: var(--rx-font-size-sm);
  text-align: center;
}

audio,
video {
  width: 100%;
}

iframe {
  border: 0;
}

.rx-responsive-media,
.wp-block-embed__wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--rx-radius-lg);
}

.rx-responsive-media::before,
.wp-block-embed__wrapper::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.rx-responsive-media > iframe,
.rx-responsive-media > video,
.rx-responsive-media > embed,
.rx-responsive-media > object,
.wp-block-embed__wrapper > iframe,
.wp-block-embed__wrapper > video,
.wp-block-embed__wrapper > embed,
.wp-block-embed__wrapper > object {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}


/* =========================================================
   10. TABLES
   ========================================================= */

table {
  width: 100%;
  margin-block: var(--rx-space-6);
  border: 1px solid var(--rx-border-color);
  background: var(--rx-bg-surface);
}

caption {
  margin-bottom: var(--rx-space-2);
  color: var(--rx-text-muted);
  font-size: var(--rx-font-size-sm);
  text-align: left;
}

th,
td {
  padding: 0.875rem 1rem;
  border: 1px solid var(--rx-border-color);
  vertical-align: top;
  text-align: left;
}

th {
  background: var(--rx-bg-muted);
  color: var(--rx-text-main);
  font-weight: 700;
}

tr:nth-child(even) td {
  background: color-mix(in srgb, var(--rx-bg-muted) 60%, transparent);
}

.rx-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rx-table-responsive table {
  min-width: 680px;
}


/* =========================================================
   11. FORMS
   ========================================================= */

label {
  display: inline-block;
  margin-bottom: var(--rx-space-2);
  color: var(--rx-text-main);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--rx-input-height);
  padding: var(--rx-input-padding-y) var(--rx-input-padding-x);
  color: var(--rx-input-text);
  background: var(--rx-input-bg);
  border: 1px solid var(--rx-input-border);
  border-radius: var(--rx-input-radius);
  box-shadow: none;
  transition:
    border-color var(--rx-transition-fast),
    box-shadow var(--rx-transition-fast),
    background-color var(--rx-transition-fast);
}

textarea {
  min-height: 140px;
  line-height: var(--rx-line-height-normal);
}

input::placeholder,
textarea::placeholder {
  color: var(--rx-input-placeholder);
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--rx-focus-color);
  outline: none;
  box-shadow: var(--rx-focus-ring);
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: auto;
  padding: 0;
  margin-right: var(--rx-space-2);
  accent-color: var(--rx-color-primary);
}

input[type="file"] {
  padding: 0.6rem;
  cursor: pointer;
}

input[type="search"] {
  -webkit-appearance: textfield;
  appearance: textfield;
}

input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

fieldset {
  min-width: 0;
  margin: 0 0 var(--rx-space-6);
  padding: var(--rx-space-5);
  border: 1px solid var(--rx-border-color);
  border-radius: var(--rx-radius-lg);
}

legend {
  padding-inline: var(--rx-space-2);
  font-weight: 700;
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.rx-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rx-space-2);
  min-height: 44px;
  padding: 0.7rem 1.1rem;
  color: var(--rx-color-white);
  background: var(--rx-color-primary);
  border: 1px solid var(--rx-color-primary);
  border-radius: var(--rx-radius-md);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  user-select: none;
  transition:
    color var(--rx-transition-fast),
    background-color var(--rx-transition-fast),
    border-color var(--rx-transition-fast),
    box-shadow var(--rx-transition-fast),
    transform var(--rx-transition-fast);
}

button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover,
.rx-button:hover {
  color: var(--rx-color-white);
  background: var(--rx-color-primary-dark);
  border-color: var(--rx-color-primary-dark);
  text-decoration: none;
}

button:active,
input[type="button"]:active,
input[type="reset"]:active,
input[type="submit"]:active,
.rx-button:active {
  transform: translateY(1px);
}

button:focus-visible,
input[type="button"]:focus-visible,
input[type="reset"]:focus-visible,
input[type="submit"]:focus-visible,
.rx-button:focus-visible {
  outline: none;
  box-shadow: var(--rx-focus-ring);
}

.rx-button-secondary {
  color: var(--rx-color-primary);
  background: var(--rx-color-primary-light);
  border-color: transparent;
}

.rx-button-secondary:hover {
  color: var(--rx-color-white);
  background: var(--rx-color-primary);
}

.rx-button-outline {
  color: var(--rx-color-primary);
  background: transparent;
  border-color: var(--rx-color-primary);
}

.rx-button-outline:hover {
  color: var(--rx-color-white);
  background: var(--rx-color-primary);
}

.rx-form-row {
  margin-bottom: var(--rx-space-5);
}

.rx-form-help {
  margin-top: var(--rx-space-2);
  color: var(--rx-text-soft);
  font-size: var(--rx-font-size-sm);
}

.rx-form-error {
  margin-top: var(--rx-space-2);
  color: var(--rx-color-danger);
  font-size: var(--rx-font-size-sm);
}


/* =========================================================
   12. ACCESSIBILITY
   ========================================================= */

.screen-reader-text,
.rx-screen-reader-text {
  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,
.rx-screen-reader-text:focus {
  z-index: var(--rx-z-tooltip);
  top: var(--rx-space-4);
  left: var(--rx-space-4);
  width: auto;
  height: auto;
  padding: var(--rx-space-3) var(--rx-space-4);
  margin: 0;
  overflow: visible;
  clip-path: none;
  color: var(--rx-color-white);
  background: var(--rx-color-primary);
  border-radius: var(--rx-radius-md);
  box-shadow: var(--rx-shadow-lg);
  text-decoration: none;
}

.skip-link {
  position: absolute;
  z-index: var(--rx-z-tooltip);
  top: var(--rx-space-4);
  left: var(--rx-space-4);
  transform: translateY(-200%);
  padding: var(--rx-space-3) var(--rx-space-4);
  color: var(--rx-color-white);
  background: var(--rx-color-primary);
  border-radius: var(--rx-radius-md);
  box-shadow: var(--rx-shadow-lg);
  transition: transform var(--rx-transition-fast);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus {
  outline-color: var(--rx-focus-color);
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--rx-focus-color);
  outline-offset: 3px;
}


/* =========================================================
   13. WORDPRESS DEFAULT CLASSES
   ========================================================= */

.alignleft {
  float: left;
  margin: 0 var(--rx-space-5) var(--rx-space-4) 0;
}

.alignright {
  float: right;
  margin: 0 0 var(--rx-space-4) var(--rx-space-5);
}

.aligncenter {
  display: block;
  margin-inline: auto;
}

.alignwide {
  width: min(100%, var(--rx-wide-width));
  margin-inline: auto;
}

.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-inline: calc(50% - 50vw);
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text,
.gallery-caption {
  margin-top: var(--rx-space-2);
  color: var(--rx-text-soft);
  font-size: var(--rx-font-size-sm);
  text-align: center;
}

.bypostauthor {
  display: block;
}

.sticky {
  display: block;
}

.gallery {
  display: grid;
  gap: var(--rx-space-4);
  margin-bottom: var(--rx-space-6);
}

.gallery-item {
  margin: 0;
}

.gallery-columns-2 {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-columns-3 {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-columns-4 {
  grid-template-columns: repeat(4, 1fr);
}

.gallery-columns-5 {
  grid-template-columns: repeat(5, 1fr);
}

.gallery-columns-6 {
  grid-template-columns: repeat(6, 1fr);
}

.gallery-columns-7 {
  grid-template-columns: repeat(7, 1fr);
}

.gallery-columns-8 {
  grid-template-columns: repeat(8, 1fr);
}

.gallery-columns-9 {
  grid-template-columns: repeat(9, 1fr);
}


/* =========================================================
   14. WORDPRESS BLOCK BASE
   ========================================================= */

.wp-block-image {
  margin-block: var(--rx-space-6);
}

.wp-block-image img {
  border-radius: var(--rx-radius-lg);
}

.wp-block-quote {
  border-left: 4px solid var(--rx-color-primary);
}

.wp-block-pullquote {
  padding: var(--rx-space-8);
  border-top: 4px solid var(--rx-color-primary);
  border-bottom: 4px solid var(--rx-color-primary);
  text-align: center;
}

.wp-block-separator {
  border: 0;
  border-top: 1px solid var(--rx-border-color);
}

.wp-block-button__link {
  border-radius: var(--rx-radius-md);
  text-decoration: none;
}

.wp-block-table {
  overflow-x: auto;
}

.wp-block-table table {
  margin: 0;
}

.wp-block-code code {
  display: block;
}

.wp-block-cover {
  color: var(--rx-color-white);
}

.wp-block-cover a {
  color: inherit;
}

.wp-block-group {
  box-sizing: border-box;
}


/* =========================================================
   15. ARTICLE CONTENT BASE
   ========================================================= */

.entry-content,
.rx-content,
.rx-post-content,
.rx-page-content {
  color: var(--rx-text-main);
  font-size: var(--rx-font-size-md);
  line-height: var(--rx-line-height-relaxed);
}

.entry-content > *:first-child,
.rx-content > *:first-child {
  margin-top: 0;
}

.entry-content > *:last-child,
.rx-content > *:last-child {
  margin-bottom: 0;
}

.entry-content h2,
.rx-content h2 {
  margin-top: 2.2em;
}

.entry-content h3,
.rx-content h3 {
  margin-top: 1.8em;
}

.entry-content h4,
.rx-content h4 {
  margin-top: 1.5em;
}

.entry-content a,
.rx-content a {
  font-weight: 600;
}

.entry-content img,
.rx-content img {
  border-radius: var(--rx-radius-lg);
}

.entry-content ul,
.entry-content ol,
.rx-content ul,
.rx-content ol {
  padding-inline-start: 1.6rem;
}

.entry-content li,
.rx-content li {
  margin-block: 0.45rem;
}

.entry-content iframe,
.rx-content iframe {
  border-radius: var(--rx-radius-lg);
}


/* =========================================================
   16. COMMON THEME STRUCTURE BASE
   ========================================================= */

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--rx-bg-body);
}

.site-main {
  flex: 1 0 auto;
}

.site-header {
  position: relative;
  z-index: var(--rx-z-sticky);
  background: var(--rx-bg-surface);
  border-bottom: 1px solid var(--rx-border-color);
}

.site-footer {
  margin-top: auto;
  background: var(--rx-bg-muted);
  border-top: 1px solid var(--rx-border-color);
}

.site-branding {
  display: flex;
  align-items: center;
  gap: var(--rx-space-3);
}

.site-title {
  margin: 0;
  font-size: var(--rx-font-size-xl);
  line-height: 1.2;
}

.site-title a {
  color: var(--rx-text-main);
  text-decoration: none;
}

.site-description {
  margin: 0;
  color: var(--rx-text-muted);
  font-size: var(--rx-font-size-sm);
}

.custom-logo {
  max-width: 220px;
  height: auto;
}


/* =========================================================
   17. NAVIGATION BASE
   ========================================================= */

.menu,
.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu a,
.nav-menu a {
  display: inline-flex;
  align-items: center;
  color: var(--rx-text-main);
  text-decoration: none;
}

.menu a:hover,
.nav-menu a:hover {
  color: var(--rx-color-primary);
}

.current-menu-item > a,
.current_page_item > a,
.current-menu-ancestor > a {
  color: var(--rx-color-primary);
  font-weight: 700;
}


/* =========================================================
   18. CARDS AND SURFACES
   ========================================================= */

.rx-card {
  background: var(--rx-bg-surface);
  border: 1px solid var(--rx-border-color);
  border-radius: var(--rx-radius-xl);
  box-shadow: var(--rx-shadow-sm);
  overflow: hidden;
}

.rx-card-body {
  padding: var(--rx-space-6);
}

.rx-card-title {
  margin-bottom: var(--rx-space-3);
}

.rx-surface {
  background: var(--rx-bg-surface);
  border: 1px solid var(--rx-border-color);
  border-radius: var(--rx-radius-xl);
}

.rx-muted-surface {
  background: var(--rx-bg-muted);
  border-radius: var(--rx-radius-xl);
}


/* =========================================================
   19. STATUS BOXES
   ========================================================= */

.rx-alert {
  padding: var(--rx-space-4) var(--rx-space-5);
  margin-bottom: var(--rx-space-5);
  border: 1px solid transparent;
  border-radius: var(--rx-radius-lg);
}

.rx-alert-info {
  color: var(--rx-color-info);
  background: var(--rx-color-info-light);
  border-color: color-mix(in srgb, var(--rx-color-info) 25%, transparent);
}

.rx-alert-success {
  color: var(--rx-color-success);
  background: var(--rx-color-success-light);
  border-color: color-mix(in srgb, var(--rx-color-success) 25%, transparent);
}

.rx-alert-warning {
  color: var(--rx-color-warning);
  background: var(--rx-color-warning-light);
  border-color: color-mix(in srgb, var(--rx-color-warning) 25%, transparent);
}

.rx-alert-danger {
  color: var(--rx-color-danger);
  background: var(--rx-color-danger-light);
  border-color: color-mix(in srgb, var(--rx-color-danger) 25%, transparent);
}


/* =========================================================
   20. BADGES
   ========================================================= */

.rx-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--rx-space-1);
  padding: 0.25rem 0.55rem;
  font-size: var(--rx-font-size-xs);
  font-weight: 700;
  line-height: 1;
  border-radius: var(--rx-radius-pill);
  background: var(--rx-bg-soft);
  color: var(--rx-text-muted);
}

.rx-badge-primary {
  background: var(--rx-color-primary-light);
  color: var(--rx-color-primary-dark);
}

.rx-badge-success {
  background: var(--rx-color-success-light);
  color: var(--rx-color-success);
}

.rx-badge-danger {
  background: var(--rx-color-danger-light);
  color: var(--rx-color-danger);
}

.rx-badge-warning {
  background: var(--rx-color-warning-light);
  color: var(--rx-color-warning);
}


/* =========================================================
   21. PAGINATION BASE
   ========================================================= */

.pagination,
.nav-links,
.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rx-space-2);
  align-items: center;
  margin-block: var(--rx-space-8);
}

.page-numbers,
.post-page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  color: var(--rx-text-main);
  background: var(--rx-bg-surface);
  border: 1px solid var(--rx-border-color);
  border-radius: var(--rx-radius-md);
  text-decoration: none;
}

.page-numbers:hover,
.post-page-numbers:hover {
  color: var(--rx-color-primary);
  border-color: var(--rx-color-primary);
}

.page-numbers.current,
.post-page-numbers.current {
  color: var(--rx-color-white);
  background: var(--rx-color-primary);
  border-color: var(--rx-color-primary);
}


/* =========================================================
   22. COMMENTS BASE
   ========================================================= */

.comments-area {
  margin-top: var(--rx-space-12);
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment {
  margin-bottom: var(--rx-space-6);
}

.comment-body {
  padding: var(--rx-space-5);
  background: var(--rx-bg-surface);
  border: 1px solid var(--rx-border-color);
  border-radius: var(--rx-radius-lg);
}

.comment-meta {
  margin-bottom: var(--rx-space-3);
  color: var(--rx-text-soft);
  font-size: var(--rx-font-size-sm);
}

.comment-author {
  display: flex;
  align-items: center;
  gap: var(--rx-space-3);
  color: var(--rx-text-main);
  font-weight: 700;
}

.comment-author .avatar {
  border-radius: var(--rx-radius-circle);
}

.comment-content {
  margin-top: var(--rx-space-3);
}

.comment-reply-link {
  display: inline-flex;
  margin-top: var(--rx-space-3);
  font-size: var(--rx-font-size-sm);
  font-weight: 700;
}


/* =========================================================
   23. UTILITY CLASSES
   ========================================================= */

.rx-hidden {
  display: none !important;
}

.rx-block {
  display: block !important;
}

.rx-inline-block {
  display: inline-block !important;
}

.rx-inline-flex {
  display: inline-flex !important;
}

.rx-text-left {
  text-align: left !important;
}

.rx-text-center {
  text-align: center !important;
}

.rx-text-right {
  text-align: right !important;
}

.rx-text-muted {
  color: var(--rx-text-muted) !important;
}

.rx-text-soft {
  color: var(--rx-text-soft) !important;
}

.rx-text-primary {
  color: var(--rx-color-primary) !important;
}

.rx-bg-muted {
  background: var(--rx-bg-muted) !important;
}

.rx-bg-primary {
  background: var(--rx-color-primary) !important;
  color: var(--rx-color-white) !important;
}

.rx-rounded {
  border-radius: var(--rx-radius-md) !important;
}

.rx-rounded-lg {
  border-radius: var(--rx-radius-lg) !important;
}

.rx-rounded-xl {
  border-radius: var(--rx-radius-xl) !important;
}

.rx-shadow-sm {
  box-shadow: var(--rx-shadow-sm) !important;
}

.rx-shadow-md {
  box-shadow: var(--rx-shadow-md) !important;
}

.rx-shadow-lg {
  box-shadow: var(--rx-shadow-lg) !important;
}

.rx-m-0 {
  margin: 0 !important;
}

.rx-mt-0 {
  margin-top: 0 !important;
}

.rx-mb-0 {
  margin-bottom: 0 !important;
}

.rx-mt-4 {
  margin-top: var(--rx-space-4) !important;
}

.rx-mb-4 {
  margin-bottom: var(--rx-space-4) !important;
}

.rx-mt-8 {
  margin-top: var(--rx-space-8) !important;
}

.rx-mb-8 {
  margin-bottom: var(--rx-space-8) !important;
}

.rx-p-0 {
  padding: 0 !important;
}

.rx-p-4 {
  padding: var(--rx-space-4) !important;
}

.rx-p-6 {
  padding: var(--rx-space-6) !important;
}

.rx-p-8 {
  padding: var(--rx-space-8) !important;
}

.rx-overflow-hidden {
  overflow: hidden !important;
}

.rx-overflow-auto {
  overflow: auto !important;
}

.rx-nowrap {
  white-space: nowrap !important;
}

.rx-break-word {
  overflow-wrap: break-word !important;
  word-break: break-word !important;
}


/* =========================================================
   24. 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;
  }
}


/* =========================================================
   25. RESPONSIVE BASE
   ========================================================= */

@media (max-width: 1024px) {
  :root {
    --rx-header-height: 64px;
  }

  .rx-flex {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 0.975rem;
  }

  .alignleft,
  .alignright {
    float: none;
    display: block;
    margin-inline: auto;
  }

  .gallery-columns-4,
  .gallery-columns-5,
  .gallery-columns-6,
  .gallery-columns-7,
  .gallery-columns-8,
  .gallery-columns-9 {
    grid-template-columns: repeat(2, 1fr);
  }

  th,
  td {
    padding: 0.7rem;
  }

  .rx-card-body {
    padding: var(--rx-space-4);
  }
}

@media (max-width: 480px) {
  :root {
    --rx-gutter: 1rem;
  }

  .gallery-columns-2,
  .gallery-columns-3,
  .gallery-columns-4,
  .gallery-columns-5,
  .gallery-columns-6,
  .gallery-columns-7,
  .gallery-columns-8,
  .gallery-columns-9 {
    grid-template-columns: 1fr;
  }

  button,
  input[type="button"],
  input[type="reset"],
  input[type="submit"],
  .rx-button {
    width: 100%;
  }
}


/* =========================================================
   26. PRINT STYLES
   ========================================================= */

@media print {
  *,
  *::before,
  *::after {
    color: #000000 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html,
  body {
    background: #ffffff !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  a,
  a:visited {
    color: #000000 !important;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre,
  blockquote {
    border: 1px solid #999999;
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }

  .site-header,
  .site-footer,
  .sidebar,
  .widget-area,
  .navigation,
  .pagination,
  .comments-area,
  .skip-link,
  .rx-no-print {
    display: none !important;
  }

  .rx-container,
  .rx-container-sm,
  .rx-container-md,
  .rx-container-lg,
  .rx-content-width,
  .rx-wide-width {
    width: 100% !important;
    max-width: none !important;
  }
}

Then enqueue it in functions.php or your inc/core/enqueue.php:

wp_enqueue_style(
    'rx-base',
    get_template_directory_uri() . '/assets/css/rx-base.css',
    array(),
    wp_get_theme()->get( 'Version' )
);

Best loading order for your RX Theme CSS should be:

rx-reset.css
rx-base.css
rx-layout.css
rx-components.css
rx-utilities.css
rx-responsive.css
rx-dynamic.css

rx-base.css should come after reset and before layout/component CSS.

Leave a Reply

Your email address will not be published. Required fields are marked *