/**
 * ThepExcel Standalone Theme - Main Stylesheet
 * No parent theme dependency - complete CSS for all elements
 * Version: 2.0.0
 */

/* ================================================
   UNIVERSAL RESET
   ================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* ================================================
   HTML & BODY
   ================================================ */

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --thepexcel-font-base: var(--wp--preset--font-family--roboto, "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    --thepexcel-color-text: var(--wp--preset--color--black, #111111);
    --thepexcel-color-bg: var(--wp--preset--color--white, #ffffff);
    --thepexcel-color-surface-alt: #fffbea;
    --thepexcel-color-soft-bg: #f5f5f5;
    --thepexcel-color-soft-alt: #f9f9f9;
    --thepexcel-color-panel: #f8f9fa;
    --thepexcel-color-placeholder: #80775f;
    --thepexcel-color-muted: var(--wp--preset--color--dark-gray, #666666);
    --thepexcel-color-muted-text: #444444;
    --thepexcel-color-border: var(--wp--preset--color--light-gray, #eeeeee);
    --thepexcel-color-border-muted: #dddddd;
    --thepexcel-color-accent: var(--wp--preset--color--gold, #f1c40f);
    --thepexcel-color-accent-dark: #e0b80f;
    --thepexcel-color-link: #b8860b;
    --thepexcel-color-link-active: #8a6b00;
    --thepexcel-radius-sm: 4px;
    --thepexcel-radius-md: 6px;
    --thepexcel-radius-lg: 12px;
    --thepexcel-radius-card: 8px;
    --thepexcel-shadow-header: 0 2px 8px rgba(0, 0, 0, 0.05);
    --thepexcel-shadow-soft: 0 2px 8px rgba(17, 17, 17, 0.08);
    --thepexcel-shadow-card: 0 6px 18px rgba(17, 17, 17, 0.06);
    --thepexcel-shadow-lift: 0 6px 16px rgba(241, 196, 15, 0.4);
    --thepexcel-shadow-pressed: 0 2px 8px rgba(241, 196, 15, 0.2);
    --thepexcel-space-xs: 0.5rem;
    --thepexcel-space-sm: 0.75rem;
    --thepexcel-space-md: 1rem;
    --thepexcel-space-lg: 1.25rem;
    --thepexcel-space-xl: 1.75rem;
    --thepexcel-space-2xl: 2.25rem;
    --thepexcel-card-padding: 1.5rem;
    --thepexcel-gap-navigation: clamp(1rem, 2vw, 2rem);
    --thepexcel-transition-base: 0.3s ease;
    --thepexcel-focus-shadow: 0 0 0 5px rgba(0, 86, 179, 0.1);
}

body {
    font-family: var(--thepexcel-font-base);
    background-color: var(--thepexcel-color-bg);
    color: var(--thepexcel-color-text);
    line-height: 1.6;
    font-size: 1rem;
    font-weight: 400;

    /* Override WordPress spacing presets to reduce gaps */
    --wp--preset--spacing--xs: var(--thepexcel-space-xs) !important;
    --wp--preset--spacing--sm: var(--thepexcel-space-sm) !important;
    --wp--preset--spacing--md: var(--thepexcel-space-md) !important;
    --wp--preset--spacing--lg: var(--thepexcel-space-lg) !important;
    --wp--preset--spacing--xl: var(--thepexcel-space-xl) !important;
    --wp--preset--spacing--2xl: var(--thepexcel-space-2xl) !important;
}

/* ================================================
   HOMEPAGE & QUERY BLOCK
   ================================================ */

/* Hide page title only in page templates and single posts with displayTitle:false */
/* Keep titles visible in query loops (homepage, category, archive pages) */
body.page .wp-block-post-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.page-template .wp-block-post-title,
body.wp-template-page .wp-block-post-title,
body[class*="wp-template-page"] .wp-block-post-title,
body[class*="page-template"] .wp-block-post-title {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure post titles in query loops are always visible and readable */
.wp-block-query :is(.wp-block-post-title, h5.wp-block-post-title) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    color: var(--thepexcel-color-text) !important;
}

.wp-block-query :is(.wp-block-post-title, h5.wp-block-post-title) a {
    color: var(--thepexcel-color-text) !important;
    text-decoration: none;
}

/* Force smaller variants (used by cards) to inherit readability rules */
h5.wp-block-post-title {
    color: var(--thepexcel-color-text) !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    line-height: 1.2 !important;
    font-size: 1.25rem !important;
    overflow: visible !important;
    padding: 0.5rem 0 !important;
}

/* Override ANY color styling (including inline) on query loop titles */
.wp-block-query .wp-block-post-title {
    --wp--preset--color--white: var(--thepexcel-color-text);
    --wp--preset--color--black: var(--thepexcel-color-text);
}

/* Remove heading spacing */
.entry-content h5 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* ================================================
   HEADER SPACING
   ================================================ */

/* Reduce header bottom padding and margin */
header.wp-block-group,
.wp-block-group[class*="wp-block-group-is-layout"] header,
header.wp-block-group.is-content-justification-space-between {
    padding-bottom: 8px !important;
    margin-bottom: 12px !important;
}

/* Also target the header tag directly */
body header {
    margin-bottom: 12px !important;
}

/* ================================================
   TYPOGRAPHY
   ================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--thepexcel-font-base);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--thepexcel-color-text);
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
}

.wp-block-post-title::after {
    display: none !important;
}

footer :is(h2, h3, h4, h5)::after,
.wp-block-group.site-footer :is(h2, h3, h4, h5)::after,
.site-footer :is(h2, h3, h4, h5)::after {
    display: none !important;
}

h3 {
    font-size: 2rem;
}

h4 {
    font-size: 1.5rem;
    font-weight: 600;
}

h5 {
    font-size: 1.25rem;
    font-weight: 600;
}

h6 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.entry-content h2,
.wp-block-post-content h2 {
    position: relative;
    padding-bottom: 0.75rem;
}

.entry-content h2::after,
.wp-block-post-content h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background-color: var(--thepexcel-color-accent);
    border-radius: 999px;
}

p {
    margin-top: 0;
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-family: var(--thepexcel-font-base);
    font-size: 1rem;
}

strong,
b {
    font-weight: 700;
}

em,
i {
    font-style: italic;
}

/* ================================================
   LINKS
   ================================================ */

a {
    color: var(--thepexcel-color-link);
    text-decoration: none;
    transition: color var(--thepexcel-transition-base), background-color var(--thepexcel-transition-base), box-shadow var(--thepexcel-transition-base);
    cursor: pointer;
    font-weight: 500;
}

a:hover {
    color: var(--thepexcel-color-text);
    text-decoration: underline;
}

a:focus-visible {
    border-radius: var(--thepexcel-radius-sm);
}

a:active {
    color: var(--thepexcel-color-link-active);
}

/* ================================================
   IMAGES & MEDIA
   ================================================ */

img {
    max-width: 100%;
    height: auto;
}

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

iframe {
    max-width: 100%;
}

/* ================================================
   LISTS
   ================================================ */

ul,
ol {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
    font-family: var(--thepexcel-font-base);
    font-size: 1rem;
}

ul ul,
ol ol,
ul ol,
ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

dl {
    margin-bottom: 1.5rem;
}

dt {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

dd {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

/* ================================================
   BLOCKQUOTES & CODE
   ================================================ */

blockquote {
    border: none;
    border-left: 6px solid var(--thepexcel-color-accent);
    padding: 1.5rem 1.75rem 1.5rem 2rem;
    margin: 2rem auto;
    font-style: italic;
    font-weight: 600;
    font-size: 1rem;
    color: var(--thepexcel-color-text);
    background: linear-gradient(
        120deg,
        rgba(241, 196, 15, 0.18),
        rgba(255, 255, 255, 0)
    );
    border-radius: var(--thepexcel-radius-card);
    position: relative;
    box-shadow: 0 8px 24px rgba(17, 17, 17, 0.08);
}

blockquote::before {
    content: "“";
    font-family: "Georgia", serif;
    font-size: 4rem;
    position: absolute;
    left: 0.65rem;
    top: -0.25rem;
    color: rgba(241, 196, 15, 0.35);
    line-height: 1;
}

blockquote p {
    margin: 0;
    padding-left: 1rem;
    text-indent: 1rem;
}

code,
pre {
    font-family: "Courier New", monospace;
    font-size: 1.1rem;
    background-color: var(--thepexcel-color-soft-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

pre {
    overflow-x: auto;
    padding: 1rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--thepexcel-color-accent);
}

pre code {
    background-color: transparent;
    padding: 0;
}

/* ================================================
   BUTTONS
   ================================================ */

button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.wp-block-button__link,
[role="button"] {
    background-color: var(--thepexcel-color-accent);
    color: var(--thepexcel-color-text);
    border: none;
    border-radius: var(--thepexcel-radius-md);
    padding: var(--thepexcel-space-sm) var(--thepexcel-space-xl);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--thepexcel-transition-base), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-block;
    text-decoration: none;
    line-height: 1;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
.wp-block-button__link:hover,
[role="button"]:hover {
    background-color: var(--thepexcel-color-accent-dark);
    transform: translateY(-3px);
    box-shadow: var(--thepexcel-shadow-lift);
    text-decoration: none;
}

button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active,
.wp-block-button__link:active,
[role="button"]:active {
    transform: translateY(-1px);
    box-shadow: var(--thepexcel-shadow-pressed);
}

button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled,
input[type="reset"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================================================
   FORMS
   ================================================ */

input,
textarea,
select {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid var(--thepexcel-color-border);
    border-radius: var(--thepexcel-radius-sm);
    padding: var(--thepexcel-space-sm);
    width: 100%;
    max-width: 100%;
    transition: border-color var(--thepexcel-transition-base), box-shadow var(--thepexcel-transition-base);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--thepexcel-color-link);
    box-shadow: var(--thepexcel-focus-shadow);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    color: var(--thepexcel-color-text);
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
}

/* ================================================
   TABLES
   ================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 1rem;
}

thead {
    background-color: var(--thepexcel-color-border);
}

th,
td {
    border: 1px solid var(--thepexcel-color-border);
    padding: 0.75rem;
    text-align: left;
}

th {
    font-weight: 700;
    background-color: var(--thepexcel-color-soft-bg);
}

tr:nth-child(even) {
    background-color: var(--thepexcel-color-soft-alt);
}

/* ================================================
   HEADER
   ================================================ */

header,
.wp-block-group[role="region"] {
    background-color: var(--thepexcel-color-bg);
    border-bottom: 1px solid var(--thepexcel-color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--thepexcel-shadow-header);
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: var(--thepexcel-space-md) var(--thepexcel-card-padding);
    gap: var(--thepexcel-space-xl);
}

.site-logo {
    max-width: 200px;
    height: auto;
}

.site-title,
.wp-block-site-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.wp-block-site-title a {
    color: inherit;
}

.site-tagline {
    font-size: 0.875rem;
    color: var(--thepexcel-color-muted);
    margin: 0;
}

/* ================================================
   NAVIGATION
   ================================================ */

nav,
.wp-block-navigation {
    display: flex;
    gap: var(--thepexcel-gap-navigation);
    flex-wrap: wrap;
    align-items: center;
    font-size: var(--wp--preset--font-size--lg, 1.25rem);
}

nav a,
.wp-block-navigation a {
    color: var(--thepexcel-color-text);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    display: inline-block;
}

nav a::after,
.wp-block-navigation a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--thepexcel-color-accent);
    transition: width 0.3s ease;
}

nav a:hover,
.wp-block-navigation a:hover {
    color: var(--thepexcel-color-text);
    text-decoration: none;
}

nav a:hover::after,
.wp-block-navigation a:hover::after {
    width: 100%;
}

.wp-block-navigation .wp-block-navigation__submenu-container {
    padding: var(--thepexcel-space-md) var(--thepexcel-card-padding);
}

.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
    font-size: 1rem;
    padding: 0.35rem 0;
}

/* ================================================
   FOOTER
   ================================================ */

footer,
.wp-block-group.site-footer {
    background-color: var(--thepexcel-color-text);
    color: var(--thepexcel-color-bg);
    margin-top: calc(var(--thepexcel-space-xl) + var(--thepexcel-space-2xl));
    border-top: none;
}

.site-footer a {
    color: var(--thepexcel-color-accent);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--thepexcel-color-bg);
}

.footer-newsletter {
    display: flex;
    align-items: center;
    gap: var(--thepexcel-space-lg);
}

.footer-newsletter__form {
    display: flex;
    gap: var(--thepexcel-space-sm);
    flex-wrap: wrap;
    align-items: center;
}

.footer-newsletter__form input {
    background-color: #111111;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--thepexcel-color-bg);
    padding: 0.85rem 1.25rem;
    border-radius: 999px;
    min-width: 280px;
}

.footer-newsletter__form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.footer-newsletter__form button {
    background: var(--thepexcel-color-accent);
    color: var(--thepexcel-color-text);
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.footer-newsletter__form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(241, 196, 15, 0.35);
}

.footer-columns {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--thepexcel-space-md);
}

.footer-columns .wp-block-column {
    gap: var(--thepexcel-space-sm);
    flex: 1 1 calc(25% - var(--thepexcel-space-md));
    min-width: 220px;
}

.footer-columns .wp-block-column:first-child {
    flex: 1.6 1 340px;
    max-width: 360px;
}

.footer-columns .wp-block-column:last-child {
    flex: 1.4 1 300px;
    max-width: 340px;
}

.footer-columns ul {
    list-style: none;
    padding: 0;
    margin: var(--thepexcel-space-sm) 0 0 0;
}

.footer-columns li {
    margin-bottom: var(--thepexcel-space-xs);
}

.footer-columns li a {
    color: rgba(255, 255, 255, 0.85);
}

.footer-columns li a:hover {
    color: var(--thepexcel-color-accent);
}

footer a,
.site-footer a {
    color: var(--thepexcel-color-accent);
    text-decoration: none;
    font-weight: 600;
}

footer a:hover,
.site-footer a:hover {
    color: var(--thepexcel-color-bg);
    text-decoration: underline;
}

footer h3,
footer h4,
.site-footer h3,
.site-footer h4 {
    border: none;
    margin-top: 0;
    color: var(--thepexcel-color-bg);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: var(--thepexcel-space-xl);
    padding: var(--thepexcel-space-xl) var(--thepexcel-card-padding);
}

.footer-column {
    flex: 1;
    min-width: 250px;
}

/* ================================================
   MAIN CONTENT
   ================================================ */

main,
.wp-site-blocks {
    min-height: 60vh;
}

:where(main, .wp-site-blocks, .entry-content, .wp-block-post-content):not(.alignfull):not(.alignwide) {
    width: min(95%, 1280px);
    margin-left: auto;
    margin-right: auto;
}

.entry-content,
.wp-block-post-content {
    margin: 2rem 0;
}

.entry-content > *,
.wp-block-post-content > * {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.entry-content > :first-child,
.wp-block-post-content > :first-child {
    margin-top: 0;
}

/* ================================================
   POSTS & CARDS
   ================================================ */

.wp-block-post,
.post-card,
article {
    background-color: var(--thepexcel-color-bg);
    border-radius: var(--thepexcel-radius-card);
    overflow: hidden;
}

.wp-block-post-featured-image,
.featured-image {
    overflow: hidden;
    margin: 0 0 1rem 0;
    aspect-ratio: 16 / 9;
    height: auto !important;
    border-radius: var(--thepexcel-radius-card);
}

/* Padding for text content only, not image */
.wp-block-post .wp-block-post-title,
.wp-block-post .wp-block-post-excerpt,
.wp-block-post .wp-block-post-date,
.wp-block-post .wp-block-post-terms,
.wp-block-post .wp-block-group:not(:first-child),
.post-card > *:not(.featured-image),
article > *:not(.wp-block-post-featured-image):not(.featured-image) {
    padding-left: var(--thepexcel-card-padding) !important;
    padding-right: var(--thepexcel-card-padding) !important;
}

/* Bottom padding for last element */
.wp-block-post .wp-block-group:last-child,
.post-card > *:last-child,
article > *:last-child {
    padding-bottom: var(--thepexcel-card-padding) !important;
}

.wp-block-post-featured-image img,
.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.wp-block-post:hover .wp-block-post-featured-image img,
.post-card:hover .featured-image img,
article:hover .wp-block-post-featured-image img,
article:hover .featured-image img {
    transform: scale(1.05);
}

/* Query loop post cards styling */
.wp-block-query .wp-block-post,
.wp-block-post-template .wp-block-post {
    border: 1px solid rgba(17, 17, 17, 0.08);
    box-shadow: var(--thepexcel-shadow-card);
    background-color: var(--thepexcel-color-bg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.wp-block-query .wp-block-post:hover,
.wp-block-post-template .wp-block-post:hover {
    border-color: var(--thepexcel-color-accent);
    background-color: var(--thepexcel-color-surface-alt);
}

.post-title,
.wp-block-post-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 1rem 0;
    color: var(--thepexcel-color-text);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Optimize titles in query loops for card hierarchy */
.wp-block-query .wp-block-post-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
}

.post-meta,
.wp-block-post-meta {
    font-size: 0.875rem;
    color: var(--thepexcel-color-muted-text);
    margin-bottom: 1rem;
    font-weight: 500;
}

.post-excerpt,
.wp-block-post-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--thepexcel-color-muted-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta-card {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--thepexcel-space-xl);
    background-color: var(--thepexcel-color-border) !important;
    padding: var(--thepexcel-card-padding) !important;
    border-radius: var(--thepexcel-radius-card);
    border-left: 4px solid var(--thepexcel-color-accent);
    margin: var(--thepexcel-space-xl) auto !important;
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
}

.single .single-post-wrapper .post-meta-card {
    max-width: min(1200px, calc(100% - 4rem)) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.post-meta-card .meta-left {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem !important;
    column-gap: 1.25rem !important;
    row-gap: 0.75rem !important;
}

/* Semantic HTML improvements for metadata card */
.post-meta-card .wp-block-post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-meta-card .wp-block-post-date::before {
    content: "📅 ";
    margin-right: 0.25rem;
    opacity: 0.7;
}

.post-meta-card .wp-block-post-author__name a {
    color: var(--thepexcel-color-text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.post-meta-card .wp-block-post-author__name a:hover {
    color: var(--thepexcel-color-link);
    text-decoration: underline;
}

.post-meta-card h4 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--thepexcel-color-muted);
    margin: 0 !important;
}

.post-meta-card a {
    color: var(--thepexcel-color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-meta-card a:hover {
    color: var(--thepexcel-color-link-active);
    text-decoration: underline;
}

.post-meta-card .wp-block-post-terms a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.post-meta-card .wp-block-post-terms a::before {
    content: "🏷️";
    font-size: 0.95rem;
    opacity: 0.8;
}

.post-meta-card .wp-block-group:not(.meta-left):not(.meta-right),
.post-meta-card .wp-block-post-author,
.post-meta-card .wp-block-post-date,
.post-meta-card .wp-block-post-terms,
.post-meta-card .wp-block-post-author__avatar,
.post-meta-card .wp-block-post-author__content,
.post-meta-card .wp-block-post-author__content p,
.post-meta-card .wp-block-group.is-layout-flow,
.post-meta-card .wp-block-group.is-layout-flex {
    margin: 0;
    padding: 0;
    gap: 0;
}

/* ================================================
   GRID & COLUMNS
   ================================================ */

.wp-block-columns {
    display: grid;
    gap: var(--thepexcel-space-xl);
    margin: var(--thepexcel-space-xl) 0;
}

.wp-block-column {
    min-width: 0;
}

.wp-block-columns.is-layout-flex {
    display: flex;
    gap: var(--thepexcel-space-xl);
}

@media (min-width: 768px) {
    .wp-block-columns.has-2-columns {
        grid-template-columns: 1fr 1fr;
    }

    .wp-block-columns.has-3-columns {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .wp-block-columns.has-4-columns {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

/* ================================================
   GROUPS & CONTAINERS
   ================================================ */

.wp-block-group {
    margin: var(--thepexcel-space-xl) 0;
}

.wp-block-group.has-background {
    padding: var(--thepexcel-space-xl);
    border-radius: var(--thepexcel-radius-card);
}

.wp-block-group.alignfull {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.hero-intro {
    text-align: center;
    background-color: var(--thepexcel-color-bg);
    border-bottom: 1px solid rgba(17, 17, 17, 0.06);
    box-shadow: 0 30px 55px rgba(17, 17, 17, 0.04);
    border-radius: 0 0 40px 40px;
}

/* ================================================
   SEARCH
   ================================================ */

.wp-block-search,
.search-form {
    display: flex;
    gap: var(--thepexcel-space-xs);
    margin-bottom: var(--thepexcel-space-xl);
}

.wp-block-search__input,
.search-input {
    flex: 1;
    padding: var(--thepexcel-space-sm);
    border: 1px solid var(--thepexcel-color-border);
    border-radius: 3.125rem;
    font-family: inherit;
    font-size: 1rem;
}

.wp-block-search__input:focus,
.search-input:focus {
    border-color: var(--thepexcel-color-link);
}

.wp-block-search__button,
.search-button {
    background-color: var(--thepexcel-color-accent);
    color: var(--thepexcel-color-text);
    border: none;
    border-radius: 3.125rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wp-block-search__button:hover,
.search-button:hover {
    background-color: var(--thepexcel-color-accent-dark);
}

.hero-search,
.wp-block-search.is-style-hero-search {
    max-width: 900px;
    margin: 1.5rem auto 0 auto;
}

.hero-search .wp-block-search__label,
.wp-block-search.is-style-hero-search .wp-block-search__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
}

.hero-search .wp-block-search__inside-wrapper,
.wp-block-search.is-style-hero-search .wp-block-search__inside-wrapper {
    border-radius: 99px;
    border: 2px solid rgba(241, 196, 15, 0.45);
    padding: 0.35rem 0.35rem 0.35rem 3.25rem;
    position: relative;
    background-color: var(--thepexcel-color-bg);
    box-shadow: 0 12px 28px rgba(17, 17, 17, 0.08);
}

.hero-search .wp-block-search__inside-wrapper::before,
.wp-block-search.is-style-hero-search .wp-block-search__inside-wrapper::before {
    content: "🔍";
    position: absolute;
    left: 1.35rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    opacity: 0.75;
}

.hero-search .wp-block-search__input,
.wp-block-search.is-style-hero-search .wp-block-search__input {
    border-radius: 99px;
    border: none;
    padding: 0.95rem 1.25rem;
    font-size: 1.1rem;
    background: transparent;
}

.hero-search .wp-block-search__input::placeholder,
.wp-block-search.is-style-hero-search .wp-block-search__input::placeholder {
    color: var(--thepexcel-color-placeholder);
}

.hero-search .wp-block-search__button,
.wp-block-search.is-style-hero-search .wp-block-search__button {
    border-radius: 99px;
    font-size: 1rem;
    padding: 0.95rem 2.5rem;
}

/* ================================================
   SOCIAL LINKS
   ================================================ */

.wp-block-social-links {
    justify-content: center;
    --thepexcel-social-size: 44px;
    gap: 0.5rem;
}

.wp-block-social-links .wp-social-link {
    width: var(--thepexcel-social-size);
    height: var(--thepexcel-social-size);
}

.wp-block-social-links .wp-block-social-link-anchor {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(241, 196, 15, 0.15);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.wp-block-social-links .wp-block-social-link-anchor svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.wp-block-social-links .wp-block-social-link-anchor:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(17, 17, 17, 0.15);
}

/* ================================================
   PAGINATION
   ================================================ */

.wp-block-query-pagination,
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--thepexcel-space-xs);
    margin: var(--thepexcel-space-xl) 0;
    flex-wrap: wrap;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers,
.pagination a,
.pagination .page-numbers {
    padding: var(--thepexcel-space-xs) calc(var(--thepexcel-space-sm) + 0.25rem);
    border: 1px solid var(--thepexcel-color-border);
    border-radius: var(--thepexcel-radius-sm);
    color: var(--thepexcel-color-text);
    text-decoration: none;
    transition: background-color var(--thepexcel-transition-base), border-color var(--thepexcel-transition-base), color var(--thepexcel-transition-base);
    display: inline-block;
}

.wp-block-query-pagination a:hover,
.pagination a:hover {
    background-color: var(--thepexcel-color-accent);
    border-color: var(--thepexcel-color-accent);
    color: var(--thepexcel-color-text);
}

.wp-block-query-pagination .page-numbers.current,
.pagination .page-numbers.current {
    background-color: var(--thepexcel-color-accent);
    border-color: var(--thepexcel-color-accent);
    font-weight: 700;
}

/* ================================================
   SEPARATORS & DIVIDERS
   ================================================ */

hr,
.wp-block-separator {
    border: none;
    border-top: 2px solid rgba(17, 17, 17, 0.15);
    margin: var(--thepexcel-space-xl) auto;
    width: min(320px, 80%);
    height: 0;
}

/* ================================================
   UTILITIES
   ================================================ */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-justify {
    text-align: justify;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--thepexcel-space-xs); }
.mt-2 { margin-top: var(--thepexcel-space-sm); }
.mt-3 { margin-top: var(--thepexcel-space-md); }
.mt-4 { margin-top: var(--thepexcel-space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--thepexcel-space-xs); }
.mb-2 { margin-bottom: var(--thepexcel-space-sm); }
.mb-3 { margin-bottom: var(--thepexcel-space-md); }
.mb-4 { margin-bottom: var(--thepexcel-space-xl); }

.pt-2 { padding-top: var(--thepexcel-space-sm); }
.pb-2 { padding-bottom: var(--thepexcel-space-sm); }
.px-2 { padding-left: var(--thepexcel-space-sm); padding-right: var(--thepexcel-space-sm); }
.py-2 { padding-top: var(--thepexcel-space-sm); padding-bottom: var(--thepexcel-space-sm); }

/* ================================================
   ACCESSIBILITY
   ================================================ */

:where(
    a,
    button,
    input,
    textarea,
    select,
    .wp-block-button__link,
    [role="button"]
):focus-visible {
    outline: 2px solid var(--thepexcel-color-link);
    outline-offset: 3px;
    box-shadow: var(--thepexcel-focus-shadow);
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--thepexcel-color-link);
    color: var(--thepexcel-color-bg);
    padding: var(--thepexcel-space-sm) var(--thepexcel-card-padding);
    text-decoration: none;
    z-index: 100;
    font-weight: 600;
    border-radius: var(--thepexcel-radius-sm);
}

.skip-link:focus {
    top: 0;
}

.screen-reader-text {
    position: absolute;
    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 {
    clip: auto;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0.5rem;
    background: var(--thepexcel-color-link);
    color: var(--thepexcel-color-bg);
    z-index: 1000;
}

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

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

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

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    /* Mobile header: Keep flex row, adjust spacing */
    .site-header,
    header.wp-block-group {
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 1rem !important;
        flex-wrap: nowrap !important;
    }

    /* Hide site title on mobile */
    .wp-block-site-title {
        display: none !important;
    }

    /* Show logo at smaller size */
    .wp-block-site-logo {
        flex-shrink: 0;
    }

    .wp-block-site-logo img {
        width: 50px !important;
        height: 50px !important;
    }

    /* Position hamburger menu where site title was */
    .wp-block-navigation {
        order: 2;
        flex-grow: 0;
        flex-shrink: 0;
    }

    /* Make hamburger button visible and styled */
    .wp-block-navigation__responsive-container-open {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 8px;
        position: relative;
    }

    /* Hide default WordPress icon */
    .wp-block-navigation__responsive-container-open svg {
        display: none !important;
    }

    /* Create custom 3-line hamburger */
    .wp-block-navigation__responsive-container-open::before {
        content: "";
        position: absolute;
        width: 24px;
        height: 2px;
        background-color: var(--thepexcel-color-text);
        box-shadow:
            0 -7px 0 0 var(--thepexcel-color-text),
            0 7px 0 0 var(--thepexcel-color-text);
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    /* Mobile search buttons - shared icon-only styling */
    body header form[role="search"] .wp-block-search__button,
    .hero-search .wp-block-search__button,
    .wp-block-search.is-style-hero-search .wp-block-search__button {
        min-width: unset !important;
        padding: 0 !important;
        border-radius: 50% !important;
        background: var(--thepexcel-color-accent) !important;
        position: relative !important;
        overflow: hidden !important;
        text-indent: -9999px !important;
    }

    body header form[role="search"] .wp-block-search__button::before,
    .hero-search .wp-block-search__button::before,
    .wp-block-search.is-style-hero-search .wp-block-search__button::before {
        content: "🔍" !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        text-indent: 0 !important;
        display: block !important;
    }

    /* Size variations */
    body header form[role="search"] .wp-block-search__button {
        width: 40px !important;
        height: 40px !important;
    }

    body header form[role="search"] .wp-block-search__button::before {
        font-size: 20px !important;
    }

    .hero-search .wp-block-search__button,
    .wp-block-search.is-style-hero-search .wp-block-search__button {
        width: 50px !important;
        height: 50px !important;
    }

    .hero-search .wp-block-search__button::before,
    .wp-block-search.is-style-hero-search .wp-block-search__button::before {
        font-size: 22px !important;
    }

    .wp-block-columns {
        grid-template-columns: 1fr;
    }

    /* Mobile stacking for metadata card */
    .post-meta-card {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: flex-start !important;
    }

    .post-meta-card .meta-left,
    .post-meta-card .meta-right {
        width: 100%;
    }

    .post-meta-card .meta-right {
        text-align: left;
        border-top: 1px solid var(--thepexcel-color-border-muted);
        padding-top: 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    table {
        font-size: 0.875rem;
    }

    th,
    td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.125rem;
    }

    body {
        font-size: 0.95rem;
    }

    button,
    .wp-block-button__link {
        width: 100%;
        padding: 12px 16px;
    }

    input,
    textarea,
    select {
        font-size: 16px;
    }
}


/* ================================================
   SINGLE POST TOC SIDEBAR LAYOUT
   ================================================ */

.single-post-wrapper {
    width: min(95%, 1280px);
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.single-post-layout {
    display: grid !important;
    grid-template-columns: minmax(240px, 320px) 1fr !important;
    grid-template-rows: min-content auto;
    column-gap: 2rem !important;
    row-gap: var(--thepexcel-space-xl);
    margin-top: 2rem;
    width: 100%;
    align-items: start;
    grid-auto-flow: row;
}

.single-post-side-column {
    display: flex;
    flex-direction: column;
    gap: var(--thepexcel-space-xl);
    grid-column: 1;
    grid-row: 1 / span 2;
}

.single-post-layout > .single-post-toc-sidebar {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
}

.single-post-layout > .single-post-right-sidebar {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    margin-top: var(--thepexcel-space-xl);
}

.single-post-wrapper .alignfull {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.single-post-layout .wp-block-post-content {
    min-width: 0;
    overflow-x: hidden;
}

.single-post-layout .wp-block-post-content img,
.single-post-layout .wp-block-post-content figure {
    max-width: 100%;
    width: 100%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.single-post-content-wrapper .wp-block-post-content img {
    max-height: 400px;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.single-post-toc-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 1.5rem;
    background-color: var(--thepexcel-color-panel);
    border-radius: var(--thepexcel-radius-card);
    border-left: 4px solid var(--thepexcel-color-accent);
    font-size: 0.95rem;
    line-height: 1.6;
    min-height: 200px;
}

.single-post-content-wrapper {
    min-width: 0;
    overflow: hidden;
    width: 100%;
    grid-column: 2;
    grid-row: 1 / span 2;
}

.single .single-post-wrapper .is-layout-constrained,
.single .single-post-wrapper .wp-block-group {
    max-width: 100% !important;
    width: 100% !important;
}

.single-post-content-wrapper .wp-block-post-content,
.single-post-content-wrapper .wp-block-post-content.is-layout-constrained,
.single-post-content-wrapper .entry-content,
.single-post-content-wrapper .entry-content.is-layout-constrained {
    max-width: 100% !important;
    width: 100% !important;
}

.single-post-right-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
}

.toc-container {
    width: 100%;
}

.toc-container ul,
.toc-container ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-container li {
    margin: 0.5rem 0;
}

.toc-container a {
    color: var(--thepexcel-color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

.toc-container a:hover {
    color: var(--thepexcel-color-accent);
    text-decoration: underline;
}

.toc-container ul ul,
.toc-container ol ol {
    margin-left: 1.5rem;
    margin-top: 0.25rem;
}

#ez-toc-container {
    margin: 0;
    padding: 0;
    background-color: transparent;
    border: none;
}

#ez-toc-container .ez-toc-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--thepexcel-color-text);
    margin: 0 0 1rem 0;
    padding: 0;
    border: none;
    cursor: default !important;
}

#ez-toc-container ul,
#ez-toc-container ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

#ez-toc-container li {
    margin: 0.5rem 0;
    padding: var(--thepexcel-space-xs) 0;
    border-bottom: 1px solid rgba(17, 17, 17, 0.12);
}

#ez-toc-container li:last-child {
    border-bottom: none;
}

#ez-toc-container li ul li {
    border-bottom: none;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

#ez-toc-container a {
    color: var(--thepexcel-color-link);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

#ez-toc-container a:hover {
    color: var(--thepexcel-color-accent);
    text-decoration: underline;
}

#ez-toc-container ul ul,
#ez-toc-container ol ol {
    margin-left: 1.5rem;
    margin-top: 0.25rem;
}

#ez-toc-container .ez-toc-cssicon-toggle-label {
    display: none;
}

#ez-toc-container input[type="checkbox"] {
    display: none;
}

/* Mobile: Stack TOC above content */
@media (max-width: 768px) {
    .single-post-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .single-post-content-wrapper {
        order: 1;
    }

    .single-post-side-column {
        order: 2;
        gap: var(--thepexcel-space-lg);
    }

    .single-post-toc-sidebar {
        position: static;
        max-height: none;
    }

    .single-post-right-sidebar {
        position: static;
    }
}

/* ================================================
   FUNCTION EXPLAINER HUB
   ================================================ */

.function-explainer-hero {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 230, 0.98));
    border-radius: 32px;
    box-shadow: var(--thepexcel-shadow-card);
    margin-top: var(--thepexcel-space-xl);
    padding: clamp(1.5rem, 3vw, 3rem);
}

.function-explainer-hero-inner {
    display: flex;
    gap: var(--thepexcel-space-2xl);
    align-items: center;
}

.function-explainer-hero-text {
    flex: 1;
}

.function-explainer-hero-text h1 {
    margin: 0 0 var(--thepexcel-space-sm) 0;
    letter-spacing: -0.02em;
}

.function-explainer-one-line {
    font-size: 1.25rem;
    color: var(--thepexcel-color-muted-text);
    margin-bottom: var(--thepexcel-space-md);
}

.function-explainer-summary p {
    font-size: 1.1rem;
}

.function-explainer-hero-media {
    flex: 0 0 360px;
    max-width: 360px;
}

.function-explainer-hero-media img {
    width: 100%;
    border-radius: 32px;
    box-shadow: var(--thepexcel-shadow-soft);
    object-fit: cover;
}

.function-explainer-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--thepexcel-space-sm);
    list-style: none;
    padding: 0;
    margin: 0 0 var(--thepexcel-space-sm) 0;
}

.function-explainer-pill-list span,
.function-explainer-pill-list a {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.85rem;
    border-radius: 50px;
    background-color: rgba(241, 196, 15, 0.15);
    color: var(--thepexcel-color-link-active);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}

.function-explainer-pill-list.is-small a {
    font-size: 0.85rem;
    padding: 0.2rem 0.65rem;
}

.function-explainer-platform-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--thepexcel-space-xs);
    margin-bottom: var(--thepexcel-space-sm);
}

.function-explainer-platform-badges span {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--thepexcel-color-border);
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
}

.function-explainer-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--thepexcel-space-md);
    color: var(--thepexcel-color-muted);
    font-size: 0.95rem;
    margin-top: var(--thepexcel-space-md);
}

.function-explainer-version-badge {
    background: rgba(0, 0, 0, 0.08);
    padding: 0.2rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    color: var(--thepexcel-color-text);
}

.function-explainer-version-notes,
.function-explainer-summary,
.function-explainer-note-card {
    color: var(--thepexcel-color-muted-text);
}

.function-explainer-behaviors {
    display: flex;
    flex-wrap: wrap;
    gap: var(--thepexcel-space-xs);
    margin-top: var(--thepexcel-space-md);
}

.function-explainer-behaviors span {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.function-explainer-shell {
    background: #ffffff;
    border-radius: 32px;
    box-shadow: var(--thepexcel-shadow-card);
    margin-top: -40px;
    position: relative;
    padding: clamp(1.5rem, 3vw, 3rem);
}

.function-explainer-section {
    padding-bottom: var(--thepexcel-space-2xl);
    border-bottom: 1px solid var(--thepexcel-color-border-muted);
    margin-bottom: var(--thepexcel-space-2xl);
}

.function-explainer-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.function-explainer-section-heading h2 {
    margin-bottom: var(--thepexcel-space-md);
}

.function-explainer-syntax-code {
    background: #0b1626;
    color: #f5f5f5;
    padding: 1.25rem 1.5rem;
    border-radius: 18px;
    font-size: 1.05rem;
    overflow-x: auto;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.function-explainer-syntax-variants {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--thepexcel-space-lg);
    margin-top: var(--thepexcel-space-lg);
}

.function-explainer-syntax-variant {
    background: var(--thepexcel-color-panel);
    padding: var(--thepexcel-space-lg);
    border-radius: 16px;
    box-shadow: var(--thepexcel-shadow-soft);
}

.function-explainer-argument-table-wrapper {
    margin-top: var(--thepexcel-space-xl);
    overflow-x: auto;
}

.function-explainer-argument-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.function-explainer-argument-table th,
.function-explainer-argument-table td {
    border-bottom: 1px solid var(--thepexcel-color-border-muted);
    padding: 0.85rem;
    text-align: left;
    vertical-align: top;
}

.function-explainer-argument-table th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--thepexcel-color-muted);
}

.function-explainer-usage-overview {
    font-size: 1.05rem;
    color: var(--thepexcel-color-text);
}

.function-explainer-scenario-grid {
    margin-top: var(--thepexcel-space-xl);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--thepexcel-space-lg);
}

.function-explainer-scenario-card {
    border: 1px solid var(--thepexcel-color-border);
    border-radius: 16px;
    padding: var(--thepexcel-space-lg);
    background: #fffefa;
}

.function-explainer-note-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--thepexcel-space-lg);
    margin-top: var(--thepexcel-space-xl);
}

.function-explainer-note-card {
    border: 1px solid var(--thepexcel-color-border);
    border-radius: 16px;
    padding: var(--thepexcel-space-lg);
    background: #ffffff;
    box-shadow: var(--thepexcel-shadow-soft);
}

.function-explainer-example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--thepexcel-space-xl);
}

.function-explainer-example-card {
    border: 1px solid var(--thepexcel-color-border);
    border-radius: 18px;
    padding: var(--thepexcel-space-xl);
    box-shadow: var(--thepexcel-shadow-soft);
    background: #ffffff;
}

.function-explainer-example-card pre {
    background: var(--thepexcel-color-panel);
    border-radius: 12px;
    padding: var(--thepexcel-space-sm);
    font-size: 0.95rem;
    overflow-x: auto;
}

.function-explainer-example-card ol {
    padding-left: 1.25rem;
    margin-top: var(--thepexcel-space-sm);
}

.function-explainer-example-context {
    color: var(--thepexcel-color-muted);
    font-size: 0.9rem;
    margin-bottom: var(--thepexcel-space-sm);
}

.function-explainer-example-result {
    margin-top: var(--thepexcel-space-sm);
    color: var(--thepexcel-color-muted-text);
}

.function-explainer-faq-item {
    border: 1px solid var(--thepexcel-color-border);
    border-radius: 16px;
    padding: var(--thepexcel-space-md);
    margin-bottom: var(--thepexcel-space-sm);
    background: #fffdfa;
}

.function-explainer-faq-item summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: var(--thepexcel-space-xs);
}

.function-explainer-resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--thepexcel-space-xl);
}

.function-explainer-resource-list,
.function-explainer-related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.function-explainer-resource-list li,
.function-explainer-related-list li {
    margin-bottom: var(--thepexcel-space-sm);
    font-weight: 600;
}

.function-explainer-resource-list a {
    color: var(--thepexcel-color-link);
    text-decoration: none;
}

.function-explainer-resource-list a:hover {
    text-decoration: underline;
}

.function-explainer-bottom-panels {
    margin-top: var(--thepexcel-space-2xl);
}

.function-explainer-aside-card {
    background: #fffefa;
    border: 1px solid var(--thepexcel-color-border);
    border-radius: 18px;
    padding: var(--thepexcel-space-lg);
    box-shadow: var(--thepexcel-shadow-soft);
    flex: 1 1 320px;
}

.function-explainer-aside-card h4,
.function-explainer-aside-card h5 {
    margin: 0 0 var(--thepexcel-space-sm) 0;
}

.function-explainer-latest .function-explainer-latest-item {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--thepexcel-color-border-muted);
}

.function-explainer-latest .function-explainer-latest-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.function-explainer-latest .wp-block-post-title {
    margin: 0 !important;
}

.function-explainer-latest .wp-block-post-title a {
    color: var(--thepexcel-color-text);
    text-decoration: none;
    transition: color var(--thepexcel-transition-base);
}

.function-explainer-latest .wp-block-post-title a:hover {
    color: var(--thepexcel-color-accent-dark);
}

.function-explainer-grid .wp-block-post-template {
    gap: var(--thepexcel-space-xl);
}

.function-explainer-card {
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: var(--thepexcel-shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    min-height: 100%;
}

.function-explainer-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--thepexcel-shadow-lift);
}

.function-explainer-card .wp-block-post-title {
    margin-top: var(--thepexcel-space-sm);
}

.function-explainer-card .wp-block-post-title a {
    color: inherit;
    text-decoration: none;
}

.function-explainer-card .wp-block-post-excerpt {
    margin-bottom: 0;
    color: var(--thepexcel-color-muted-text);
}

.function-explainer-outline {
    box-shadow: var(--thepexcel-shadow-soft);
}

@media (max-width: 1024px) {
    .function-explainer-hero-inner {
        flex-direction: column;
    }

    .function-explainer-hero-media {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .function-explainer-shell {
        margin-top: -20px;
        padding: var(--thepexcel-space-lg);
    }

    .function-explainer-section {
        padding-bottom: var(--thepexcel-space-xl);
        margin-bottom: var(--thepexcel-space-xl);
    }
}
/* ================================================
   PRINT STYLES
   ================================================ */

@media print {
    body {
        background: white;
        color: black;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }

    img {
        max-width: 100%;
    }

    @page {
        margin: 2cm;
    }

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

    ul, ol {
        page-break-inside: avoid;
    }
}
.profile-gallery-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.profile-gallery-wrapper .wp-block-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    justify-items: center;
    align-items: center;
    gap: 2rem;
}

.profile-gallery-wrapper figure.wp-block-image {
    margin: 0;
}

/* Specific profile gallery centering */
.wp-block-gallery-3 {
    display: flex !important;
    justify-content: center !important;
    gap: 2rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.wp-block-gallery-3 .wp-block-image {
    flex: 0 0 auto !important;
    margin: 0 !important;
    width: auto !important;
}
