/**
 * Najibul How-To — Single Post Stylesheet
 *
 * ⚡ Enterprise-grade single post design
 * ⚡ Scoped to .howto-single (zero global pollution)
 * ⚡ Full HowTo UI: difficulty/time/cost badges, step-by-step list, requirements box
 * ⚡ Step-by-step styled list with numbered circles
 * ⚡ Warning/tip/info/danger callouts
 * ⚡ Table of Contents (auto-generated)
 * ⚡ Reading progress bar
 * ⚡ Related how-tos grid
 * ⚡ Comments styling
 * ⚡ Core Web Vitals friendly (no layout shifts)
 * ⚡ Dark mode aware
 * ⚡ Responsive: mobile / tablet / desktop
 * ⚡ Print styles (clean layout, show URLs)
 * ⚡ Reduced motion support
 * ⚡ High contrast mode
 * ⚡ Accessibility: focus-visible states
 * ⚡ Safe typography (no overflow, hyphens)
 * ⚡ Balanced whitespace + readable line lengths
 * ⚡ Amber color palette matching HowTo identity
 *
 * Location: /wp-content/plugins/najibul-post-type/HowTo/assets/css/howto.css
 *
 * @package NajibulPT\HowTo
 * @version 4.0.0
 */

/* ============================================
   ROOT VARIABLES — Scoped to .howto-single
   ============================================ */

.howto-single {
    /* Brand colors — Amber palette */
    --howto-primary: #f59e0b;
    --howto-primary-dark: #d97706;
    --howto-primary-light: #fef3c7;
    --howto-primary-pale: #fffbeb;
    --howto-secondary: #d97706;
    --howto-accent: #8b5cf6;
    --howto-accent-light: #ede9fe;

    /* Difficulty colors */
    --howto-easy: #16a34a;
    --howto-easy-bg: #dcfce7;
    --howto-easy-text: #166534;
    --howto-medium: #f59e0b;
    --howto-medium-bg: #fef3c7;
    --howto-medium-text: #92400e;
    --howto-hard: #dc2626;
    --howto-hard-bg: #fee2e2;
    --howto-hard-text: #991b1b;

    /* Status colors */
    --howto-success: #16a34a;
    --howto-warning: #d97706;
    --howto-danger: #dc2626;
    --howto-info: #0284c7;

    /* Text */
    --howto-text: #0f172a;
    --howto-text-subtle: #1e293b;
    --howto-text-body: #1e293b;
    --howto-text-muted: #64748b;
    --howto-text-faint: #94a3b8;

    /* Surfaces */
    --howto-bg: #ffffff;
    --howto-bg-subtle: #f8fafc;
    --howto-bg-muted: #f1f5f9;
    --howto-card-bg: #f8fafc;
    --howto-border: #e2e8f0;
    --howto-border-subtle: #f1f5f9;
    --howto-quote-bg: #f8fafc;
    --howto-code-bg: #f1f5f9;
    --howto-requirements-bg: #fffbeb;

    /* Links */
    --howto-link: #2563eb;
    --howto-link-hover: #1d4ed8;

    /* Radii */
    --howto-radius-sm: 6px;
    --howto-radius-md: 8px;
    --howto-radius-lg: 12px;
    --howto-radius-xl: 16px;
    --howto-radius-pill: 20px;
    --howto-radius-circle: 50%;

    /* Shadows */
    --howto-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --howto-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --howto-shadow-lg: 0 12px 28px -8px rgba(245, 158, 11, 0.15);
    --howto-shadow-step: 0 4px 12px rgba(245, 158, 11, 0.3);

    /* Motion */
    --howto-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --howto-max-width: 820px;
    --howto-content-size: 18px;
    --howto-content-line-height: 1.8;

    max-width: var(--howto-max-width);
    margin: 0 auto;
    padding: 24px 20px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, system-ui, sans-serif;
    color: var(--howto-text-body);
    background: var(--howto-bg);
    box-sizing: border-box;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ============================================
   READING PROGRESS BAR
   ============================================ */

.howto-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--howto-primary), var(--howto-primary-dark));
    z-index: 9999;
    transition: width 0.1s linear;
    will-change: width;
}

/* ============================================
   ENTRY TITLE
   ============================================ */

.howto-single .entry-title,
.howto-single h1.entry-title {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 18px 0;
    color: var(--howto-text);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    letter-spacing: -0.01em;
}

/* ============================================
   META LINE — With badges
   ============================================ */

.howto-single .howto-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--howto-text-muted);
    border-bottom: 1px solid var(--howto-border);
    padding-bottom: 15px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.howto-single .howto-meta a {
    color: var(--howto-link);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--howto-transition);
}

.howto-single .howto-meta a:hover,
.howto-single .howto-meta a:focus-visible {
    color: var(--howto-link-hover);
    text-decoration: underline;
}

.howto-single .howto-meta time {
    color: var(--howto-text);
    font-weight: 500;
}

/* Difficulty badge */
.howto-single .howto-difficulty-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: var(--howto-radius-pill);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.4;
    border: 1px solid transparent;
}

.howto-single .howto-badge-easy {
    background: var(--howto-easy-bg);
    color: var(--howto-easy-text);
    border-color: rgba(22, 163, 74, 0.25);
}

.howto-single .howto-badge-medium {
    background: var(--howto-medium-bg);
    color: var(--howto-medium-text);
    border-color: rgba(245, 158, 11, 0.25);
}

.howto-single .howto-badge-hard {
    background: var(--howto-hard-bg);
    color: var(--howto-hard-text);
    border-color: rgba(220, 38, 38, 0.25);
}

/* Time & cost badges */
.howto-single .howto-time-badge,
.howto-single .howto-cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: var(--howto-radius-pill);
    background: var(--howto-bg-muted);
    color: var(--howto-text-subtle);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid var(--howto-border);
}

/* ============================================
   REQUIREMENTS BOX
   ============================================ */

.howto-single .howto-requirements {
    background: linear-gradient(135deg, var(--howto-primary-pale), #ffffff);
    border: 1px solid var(--howto-border);
    border-left: 4px solid var(--howto-primary);
    border-radius: var(--howto-radius-lg);
    padding: 20px 24px;
    margin: 0 0 28px 0;
    position: relative;
    overflow: hidden;
}

.howto-single .howto-requirements::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08), transparent 70%);
    pointer-events: none;
}

.howto-single .howto-requirements-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--howto-text);
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.howto-single .howto-requirements-title::before {
    content: '📋';
    font-size: 1.1em;
}

.howto-single .howto-requirements-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    position: relative;
    z-index: 1;
}

.howto-single .howto-requirements-col h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--howto-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 10px 0;
    padding-top: 0;
    line-height: 1.4;
}

.howto-single .howto-requirements-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.howto-single .howto-requirements-col li {
    font-size: 15px;
    line-height: 1.6;
    color: var(--howto-text-body);
    padding: 4px 0 4px 22px;
    position: relative;
}

.howto-single .howto-requirements-col li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 4px;
    color: var(--howto-success);
    font-weight: 700;
    font-size: 14px;
}

/* ============================================
   TABLE OF CONTENTS (auto-generated)
   ============================================ */

.howto-single .howto-toc {
    background: var(--howto-bg-subtle);
    border: 1px solid var(--howto-border-subtle);
    border-radius: var(--howto-radius-lg);
    padding: 18px 22px;
    margin: 24px 0 28px 0;
}

.howto-single .howto-toc-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--howto-text);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.howto-single .howto-toc-title::before {
    content: '📑';
    font-size: 1.1em;
}

.howto-single .howto-toc ol {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}

.howto-single .howto-toc li {
    counter-increment: toc-counter;
    padding: 6px 0;
    border-bottom: 1px solid var(--howto-border-subtle);
    font-size: 14px;
    line-height: 1.5;
}

.howto-single .howto-toc li:last-child {
    border-bottom: none;
}

.howto-single .howto-toc li::before {
    content: counter(toc-counter) '.';
    color: var(--howto-primary);
    font-weight: 700;
    margin-right: 8px;
    font-variant-numeric: tabular-nums;
}

.howto-single .howto-toc a {
    color: var(--howto-text-body);
    text-decoration: none;
    transition: color var(--howto-transition);
}

.howto-single .howto-toc a:hover,
.howto-single .howto-toc a:focus-visible {
    color: var(--howto-primary);
    text-decoration: underline;
}

/* ============================================
   ENTRY CONTENT
   ============================================ */

.howto-single .entry-content {
    font-size: var(--howto-content-size);
    line-height: var(--howto-content-line-height);
    color: var(--howto-text-body);
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-top: 8px;
}

.howto-single .entry-content > * + * {
    margin-top: 1.5em;
}

.howto-single .entry-content p {
    margin: 0 0 1.5em 0;
}

.howto-single .entry-content p:last-child {
    margin-bottom: 0;
}

/* Headings */
.howto-single .entry-content h2,
.howto-single .entry-content h3,
.howto-single .entry-content h4,
.howto-single .entry-content h5,
.howto-single .entry-content h6 {
    color: var(--howto-text);
    line-height: 1.3;
    margin: 2em 0 0.6em 0;
    font-weight: 700;
    word-wrap: break-word;
    letter-spacing: -0.005em;
}

.howto-single .entry-content h2 {
    font-size: 1.5em;
    padding-left: 14px;
    border-left: 4px solid var(--howto-primary);
    padding-bottom: 4px;
}

.howto-single .entry-content h3 {
    font-size: 1.25em;
    color: var(--howto-primary-dark);
}

.howto-single .entry-content h4 { font-size: 1.1em; }
.howto-single .entry-content h5 { font-size: 1.05em; }
.howto-single .entry-content h6 { font-size: 1em; }

/* ============================================
   STEP-BY-STEP LIST — NUMBERED CIRCLES
   ============================================ */

.howto-single .howto-steps {
    counter-reset: howto-step;
    list-style: none;
    padding: 0;
    margin: 28px 0;
}

.howto-single .howto-step {
    counter-increment: howto-step;
    position: relative;
    padding: 0 0 0 64px;
    margin: 0 0 28px 0;
    min-height: 48px;
}

.howto-single .howto-step:last-child {
    margin-bottom: 0;
}

/* Numbered circle */
.howto-single .howto-step::before {
    content: counter(howto-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--howto-primary), var(--howto-primary-dark));
    color: #ffffff;
    border-radius: var(--howto-radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    line-height: 1;
    box-shadow: var(--howto-shadow-step);
    font-variant-numeric: tabular-nums;
}

/* Connector line between steps */
.howto-single .howto-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 21px;
    top: 48px;
    bottom: -28px;
    width: 2px;
    background: linear-gradient(180deg, var(--howto-primary) 0%, transparent 100%);
    opacity: 0.4;
}

/* Step title */
.howto-single .howto-step-title {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--howto-text);
    margin: 0 0 8px 0;
    line-height: 1.4;
    padding-top: 4px;
}

/* Step body */
.howto-single .howto-step-content {
    font-size: var(--howto-content-size);
    line-height: var(--howto-content-line-height);
    color: var(--howto-text-body);
    margin: 0;
}

.howto-single .howto-step-content > *:first-child {
    margin-top: 0;
}

.howto-single .howto-step-content > *:last-child {
    margin-bottom: 0;
}

/* Step image */
.howto-single .howto-step img {
    max-width: 100%;
    height: auto;
    border-radius: var(--howto-radius-md);
    margin: 12px 0;
    display: block;
}

/* Step time badge */
.howto-single .howto-step-time {
    display: inline-block;
    background: var(--howto-primary-light);
    color: var(--howto-medium-text);
    padding: 2px 10px;
    border-radius: var(--howto-radius-pill);
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

/* ============================================
   CALLOUT BLOCKS — Tip / Warning / Info / Danger
   ============================================ */

.howto-single .howto-callout {
    padding: 14px 18px;
    border-radius: var(--howto-radius-md);
    margin: 20px 0;
    border-left: 4px solid;
    font-size: 0.95em;
    line-height: 1.65;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.howto-single .howto-callout::before {
    flex-shrink: 0;
    font-size: 1.3em;
    line-height: 1.4;
}

.howto-single .howto-callout > *:first-child {
    margin-top: 0;
}

.howto-single .howto-callout > *:last-child {
    margin-bottom: 0;
}

/* Tip */
.howto-single .howto-callout.tip {
    background: var(--howto-easy-bg);
    border-left-color: var(--howto-success);
    color: var(--howto-easy-text);
}
.howto-single .howto-callout.tip::before { content: '💡'; }

/* Warning */
.howto-single .howto-callout.warning {
    background: var(--howto-medium-bg);
    border-left-color: var(--howto-warning);
    color: var(--howto-medium-text);
}
.howto-single .howto-callout.warning::before { content: '⚠️'; }

/* Info */
.howto-single .howto-callout.info {
    background: #e0f2fe;
    border-left-color: var(--howto-info);
    color: #075985;
}
.howto-single .howto-callout.info::before { content: 'ℹ️'; }

/* Danger */
.howto-single .howto-callout.danger {
    background: var(--howto-hard-bg);
    border-left-color: var(--howto-danger);
    color: var(--howto-hard-text);
}
.howto-single .howto-callout.danger::before { content: '🚨'; }

/* ============================================
   LISTS (normal)
   ============================================ */

.howto-single .entry-content ul,
.howto-single .entry-content ol {
    margin: 0 0 1.5em 0;
    padding-left: 1.5em;
}

.howto-single .entry-content li {
    margin-bottom: 0.5em;
}

.howto-single .entry-content li:last-child {
    margin-bottom: 0;
}

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

.howto-single .entry-content a {
    color: var(--howto-link);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color var(--howto-transition),
                text-decoration-thickness var(--howto-transition);
}

.howto-single .entry-content a:hover,
.howto-single .entry-content a:focus-visible {
    color: var(--howto-link-hover);
    text-decoration-thickness: 2px;
}

/* ============================================
   IMAGES
   ============================================ */

.howto-single .entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--howto-radius-md);
    display: block;
    margin: 20px 0;
}

.howto-single .entry-content figure {
    margin: 20px 0;
    max-width: 100%;
}

.howto-single .entry-content figcaption {
    font-size: 0.875em;
    color: var(--howto-text-muted);
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

/* ============================================
   BLOCKQUOTES
   ============================================ */

.howto-single .entry-content blockquote {
    border-left: 4px solid var(--howto-primary);
    padding: 12px 20px;
    margin: 20px 0;
    background: var(--howto-quote-bg);
    border-radius: 0 var(--howto-radius-md) var(--howto-radius-md) 0;
    font-style: italic;
    color: var(--howto-text-body);
}

.howto-single .entry-content blockquote p {
    margin: 0;
}

.howto-single .entry-content blockquote cite {
    display: block;
    font-style: normal;
    font-size: 0.875em;
    color: var(--howto-text-muted);
    margin-top: 8px;
}

/* ============================================
   CODE
   ============================================ */

.howto-single .entry-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    background: var(--howto-code-bg);
    padding: 2px 6px;
    border-radius: var(--howto-radius-sm);
    word-break: break-word;
    color: var(--howto-primary-dark);
}

.howto-single .entry-content pre {
    background: var(--howto-code-bg);
    padding: 16px;
    border-radius: var(--howto-radius-md);
    overflow-x: auto;
    font-size: 0.9em;
    line-height: 1.5;
    margin: 20px 0;
}

.howto-single .entry-content pre code {
    background: transparent;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

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

.howto-single .entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
    display: table;
    overflow-x: auto;
}

.howto-single .entry-content th,
.howto-single .entry-content td {
    padding: 10px 14px;
    border: 1px solid var(--howto-border);
    text-align: left;
}

.howto-single .entry-content th {
    background: var(--howto-bg-subtle);
    font-weight: 700;
    color: var(--howto-text);
}

/* ============================================
   HR & EMBEDS
   ============================================ */

.howto-single .entry-content hr {
    border: none;
    border-top: 1px solid var(--howto-border);
    margin: 2em 0;
}

.howto-single .entry-content iframe,
.howto-single .entry-content video,
.howto-single .entry-content embed,
.howto-single .entry-content object {
    max-width: 100%;
    border-radius: var(--howto-radius-md);
    display: block;
    margin: 20px 0;
}

/* ============================================
   WORDPRESS ALIGNMENT CLASSES
   ============================================ */

.howto-single .entry-content .alignleft {
    float: left;
    margin: 0 1.5em 1em 0;
    max-width: 50%;
}

.howto-single .entry-content .alignright {
    float: right;
    margin: 0 0 1em 1.5em;
    max-width: 50%;
}

.howto-single .entry-content .aligncenter {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.howto-single .entry-content .alignwide {
    max-width: 100%;
}

.howto-single .entry-content .alignfull {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
}

.howto-single .entry-content::after {
    content: '';
    display: table;
    clear: both;
}

/* ============================================
   SHARE SECTION
   ============================================ */

.howto-single .howto-share,
.howto-single .share {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--howto-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.howto-single .howto-share .share-label,
.howto-single .share .share-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--howto-text-muted);
    margin-right: 8px;
}

.howto-single .howto-share a,
.howto-single .share a {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--howto-radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    transition: transform var(--howto-transition),
                box-shadow var(--howto-transition),
                opacity var(--howto-transition);
    line-height: 1.3;
    border: none;
    cursor: pointer;
}

.howto-single .howto-share a:hover,
.howto-single .howto-share a:focus-visible,
.howto-single .share a:hover,
.howto-single .share a:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    opacity: 0.95;
}

.howto-single .howto-share a:focus-visible,
.howto-single .share a:focus-visible {
    outline: 2px solid var(--howto-primary);
    outline-offset: 2px;
}

/* Network colors */
.howto-single .share-twitter   { background: #1DA1F2; }
.howto-single .share-facebook  { background: #1877F2; }
.howto-single .share-linkedin  { background: #0A66C2; }
.howto-single .share-whatsapp  { background: #25D366; }
.howto-single .share-telegram  { background: #0088CC; }
.howto-single .share-reddit    { background: #FF4500; }
.howto-single .share-pinterest { background: #BD081C; }
.howto-single .share-email     { background: #64748b; }

/* Copy button (alternative style) */
.howto-single .howto-share .share-copy,
.howto-single .share .share-copy {
    background: var(--howto-bg-muted);
    color: var(--howto-text);
    border: 1px solid var(--howto-border);
}

.howto-single .howto-share .share-copy:hover,
.howto-single .share .share-copy:hover {
    background: var(--howto-primary-light);
    border-color: var(--howto-primary);
    color: var(--howto-primary-dark);
}

/* ============================================
   RELATED HOW-TOS
   ============================================ */

.howto-single .howto-related {
    margin-top: 45px;
    padding-top: 28px;
    border-top: 1px solid var(--howto-border);
}

.howto-single .howto-related-title {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--howto-text);
    margin: 0 0 18px 0;
    letter-spacing: -0.005em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.howto-single .howto-related-title::before {
    content: '🔗';
    font-size: 0.9em;
}

.howto-single .howto-related-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.howto-single .howto-related-item {
    background: var(--howto-card-bg);
    border: 1px solid var(--howto-border);
    border-radius: var(--howto-radius-md);
    transition: border-color var(--howto-transition),
                transform var(--howto-transition),
                box-shadow var(--howto-transition);
}

.howto-single .howto-related-item:hover {
    border-color: var(--howto-primary);
    transform: translateY(-2px);
    box-shadow: var(--howto-shadow-md);
}

.howto-single .howto-related-item a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
}

.howto-single .related-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--howto-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

.howto-single .related-difficulty {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: var(--howto-radius-pill);
}

.howto-single .related-difficulty.easy   { background: var(--howto-easy-bg);   color: var(--howto-easy-text); }
.howto-single .related-difficulty.medium { background: var(--howto-medium-bg); color: var(--howto-medium-text); }
.howto-single .related-difficulty.hard   { background: var(--howto-hard-bg);   color: var(--howto-hard-text); }

/* ============================================
   COMMENTS
   ============================================ */

.howto-single #comments {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--howto-border);
}

.howto-single #comments .comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.howto-single #comments .comment-list .children {
    list-style: none;
    padding-left: 24px;
    margin: 0;
}

.howto-single #comments .comment {
    padding: 16px 0;
    border-bottom: 1px solid var(--howto-border-subtle);
}

.howto-single #comments .comment:last-child {
    border-bottom: none;
}

.howto-single #comments .comment-author {
    font-weight: 600;
    color: var(--howto-text);
    font-size: 15px;
}

.howto-single #comments .comment-meta {
    font-size: 12px;
    color: var(--howto-text-muted);
    margin-top: 2px;
}

.howto-single #comments .comment-content {
    font-size: 15px;
    line-height: 1.6;
    margin-top: 8px;
    color: var(--howto-text-body);
}

/* ============================================
   FOCUS STATES (accessibility)
   ============================================ */

.howto-single a:focus-visible,
.howto-single button:focus-visible {
    outline: 2px solid var(--howto-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   RESPONSIVE — Tablet
   ============================================ */

@media (max-width: 768px) {
    .howto-single {
        padding: 18px 15px 40px;
        --howto-content-size: 16px;
    }

    .howto-single .entry-title {
        font-size: clamp(22px, 6vw, 28px);
    }

    .howto-single .howto-meta {
        font-size: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .howto-single .howto-share,
    .howto-single .share {
        justify-content: flex-start;
    }

    .howto-single .howto-share a,
    .howto-single .share a {
        padding: 6px 12px;
        font-size: 12px;
    }

    .howto-single .entry-content h2 { font-size: 1.3em; }
    .howto-single .entry-content h3 { font-size: 1.15em; }
    .howto-single .entry-content h4 { font-size: 1.05em; }

    .howto-single .entry-content .alignleft,
    .howto-single .entry-content .alignright {
        float: none;
        max-width: 100%;
        margin: 20px 0;
    }

    /* Steps adjust for narrow screens */
    .howto-single .howto-step {
        padding-left: 54px;
    }

    .howto-single .howto-step::before {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .howto-single .howto-step:not(:last-child)::after {
        left: 18px;
    }

    .howto-single .howto-requirements-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .howto-single .howto-related-list {
        grid-template-columns: 1fr;
    }

    .howto-single #comments .comment-list .children {
        padding-left: 16px;
    }
}

/* ============================================
   RESPONSIVE — Small Mobile
   ============================================ */

@media (max-width: 480px) {
    .howto-single {
        padding: 14px 12px 32px;
        --howto-content-size: 15px;
    }

    .howto-single .entry-title {
        font-size: 20px;
        margin-bottom: 14px;
    }

    .howto-single .howto-meta {
        font-size: 11px;
        padding-bottom: 12px;
        margin-bottom: 18px;
    }

    .howto-single .howto-difficulty-badge,
    .howto-single .howto-time-badge,
    .howto-single .howto-cost-badge {
        font-size: 10px;
        padding: 2px 10px;
    }

    .howto-single .entry-content h2 { font-size: 1.2em; }
    .howto-single .entry-content h3 { font-size: 1.1em; }
    .howto-single .entry-content h4 { font-size: 1em; }

    .howto-single .entry-content blockquote {
        padding: 10px 14px;
        font-size: 0.95em;
    }

    .howto-single .entry-content pre {
        padding: 12px;
        font-size: 0.85em;
    }

    /* Steps even smaller */
    .howto-single .howto-step {
        padding-left: 46px;
        margin-bottom: 22px;
    }

    .howto-single .howto-step::before {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .howto-single .howto-step:not(:last-child)::after {
        left: 15px;
        top: 36px;
    }

    .howto-single .howto-step-title {
        font-size: 1.05em;
    }

    /* Requirements box */
    .howto-single .howto-requirements {
        padding: 16px 16px;
    }

    .howto-single .howto-requirements-title {
        font-size: 13px;
    }

    .howto-single .howto-requirements-col li {
        font-size: 14px;
    }

    /* TOC */
    .howto-single .howto-toc {
        padding: 14px 16px;
    }

    .howto-single .howto-toc li {
        font-size: 13px;
    }

    /* Callouts */
    .howto-single .howto-callout {
        padding: 12px 14px;
        font-size: 0.9em;
    }

    .howto-single .howto-share,
    .howto-single .share {
        margin-top: 28px;
        padding-top: 18px;
    }

    .howto-single .howto-share a,
    .howto-single .share a {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* ============================================
   DARK MODE
   ============================================ */

@media (prefers-color-scheme: dark) {
    .howto-single {
        --howto-text: #f1f5f9;
        --howto-text-subtle: #e2e8f0;
        --howto-text-body: #cbd5e1;
        --howto-text-muted: #94a3b8;
        --howto-text-faint: #64748b;

        --howto-bg: #0f172a;
        --howto-bg-subtle: #1e293b;
        --howto-bg-muted: #1e293b;
        --howto-card-bg: #1e293b;
        --howto-border: #334155;
        --howto-border-subtle: #1e293b;
        --howto-quote-bg: #1e293b;
        --howto-code-bg: #1e293b;

        --howto-link: #60a5fa;
        --howto-link-hover: #93bbfc;

        --howto-primary-light: #78350f;
        --howto-primary-pale: #451a03;

        --howto-easy-bg: #14532d;
        --howto-easy-text: #86efac;
        --howto-medium-bg: #78350f;
        --howto-medium-text: #fcd34d;
        --howto-hard-bg: #7f1d1d;
        --howto-hard-text: #fca5a5;
    }

    .howto-single .entry-title {
        color: #f1f5f9;
    }

    .howto-single .howto-meta {
        color: #94a3b8;
        border-bottom-color: #334155;
    }

    .howto-single .howto-meta a {
        color: #60a5fa;
    }

    .howto-single .howto-meta a:hover,
    .howto-single .howto-meta a:focus-visible {
        color: #93bbfc;
    }

    .howto-single .howto-meta time {
        color: #e2e8f0;
    }

    .howto-single .howto-time-badge,
    .howto-single .howto-cost-badge {
        background: #1e293b;
        color: #e2e8f0;
        border-color: #334155;
    }

    .howto-single .howto-requirements {
        background: linear-gradient(135deg, #1e293b, #0f172a);
        border-color: #334155;
        border-left-color: var(--howto-primary);
    }

    .howto-single .howto-toc {
        background: #1e293b;
        border-color: #334155;
    }

    .howto-single .howto-toc li {
        border-bottom-color: #0f172a;
    }

    .howto-single .howto-toc a {
        color: #cbd5e1;
    }

    .howto-single .entry-content {
        color: #cbd5e1;
    }

    .howto-single .entry-content h2,
    .howto-single .entry-content h3,
    .howto-single .entry-content h4,
    .howto-single .entry-content h5,
    .howto-single .entry-content h6 {
        color: #f1f5f9;
    }

    .howto-single .entry-content h3 {
        color: #fbbf24;
    }

    .howto-single .entry-content blockquote {
        background: #1e293b;
        color: #cbd5e1;
    }

    .howto-single .entry-content code {
        background: #1e293b;
        color: #fbbf24;
    }

    .howto-single .entry-content pre {
        background: #1e293b;
        color: #e2e8f0;
    }

    .howto-single .entry-content th {
        background: #1e293b;
        color: #f1f5f9;
    }

    .howto-single .entry-content th,
    .howto-single .entry-content td {
        border-color: #334155;
    }

    .howto-single .entry-content hr {
        border-top-color: #334155;
    }

    .howto-single .howto-related-item {
        background: #1e293b;
        border-color: #334155;
    }

    .howto-single .related-title {
        color: #f1f5f9;
    }

    .howto-single .howto-share,
    .howto-single .share {
        border-top-color: #334155;
    }

    .howto-single .howto-share .share-label,
    .howto-single .share .share-label {
        color: #94a3b8;
    }

    .howto-single .howto-share .share-copy,
    .howto-single .share .share-copy {
        background: #1e293b;
        color: #e2e8f0;
        border-color: #334155;
    }

    .howto-single #comments {
        border-top-color: #334155;
    }

    .howto-single #comments .comment {
        border-bottom-color: #1e293b;
    }

    .howto-single #comments .comment-author {
        color: #f1f5f9;
    }

    .howto-single #comments .comment-meta {
        color: #64748b;
    }

    .howto-single #comments .comment-content {
        color: #cbd5e1;
    }

    .howto-single .howto-callout.info {
        background: #0c4a6e;
        color: #bae6fd;
    }

    .howto-single .howto-callout.tip {
        background: #14532d;
        color: #bbf7d0;
    }

    .howto-single .howto-callout.warning {
        background: #78350f;
        color: #fde68a;
    }

    .howto-single .howto-callout.danger {
        background: #7f1d1d;
        color: #fecaca;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

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

    .howto-single .howto-share a:hover,
    .howto-single .howto-share a:focus-visible,
    .howto-single .share a:hover,
    .howto-single .share a:focus-visible {
        transform: none;
    }

    .howto-single .howto-related-item:hover {
        transform: none;
    }

    .howto-progress {
        transition: none;
    }
}

/* ============================================
   PRINT
   ============================================ */

@media print {
    .howto-progress {
        display: none;
    }

    .howto-single {
        max-width: 100%;
        padding: 0;
        background: #ffffff;
        color: #000000;
        --howto-content-size: 12pt;
        --howto-content-line-height: 1.5;
    }

    .howto-single .entry-title {
        font-size: 20pt;
        page-break-after: avoid;
        color: #000000;
    }

    .howto-single .howto-meta {
        color: #333333;
        border-bottom-color: #cccccc;
    }

    .howto-single .howto-meta a {
        color: #000000;
        text-decoration: none;
    }

    .howto-single .howto-difficulty-badge,
    .howto-single .howto-time-badge,
    .howto-single .howto-cost-badge {
        background: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #000000 !important;
    }

    .howto-single .howto-requirements {
        background: #f5f5f5 !important;
        border: 1px solid #cccccc;
        border-left: 4px solid #000000;
        page-break-inside: avoid;
    }

    .howto-single .howto-toc {
        background: #f5f5f5;
        border-color: #cccccc;
        page-break-after: avoid;
    }

    .howto-single .howto-toc a {
        color: #000000;
        text-decoration: none;
    }

    .howto-single .howto-toc a[href]::after {
        content: ' (' attr(href) ')';
        font-size: 0.85em;
        color: #555555;
    }

    .howto-single .entry-content {
        color: #000000;
    }

    .howto-single .entry-content a {
        color: #000000;
        text-decoration: underline;
    }

    .howto-single .entry-content a[href]::after {
        content: ' (' attr(href) ')';
        font-size: 0.85em;
        color: #555555;
    }

    .howto-single .entry-content img {
        max-width: 100%;
        page-break-inside: avoid;
    }

    .howto-single .entry-content h2,
    .howto-single .entry-content h3,
    .howto-single .entry-content h4 {
        page-break-after: avoid;
        color: #000000;
        border-left-color: #000000;
    }

    .howto-single .entry-content blockquote,
    .howto-single .entry-content pre {
        page-break-inside: avoid;
    }

    /* Steps in print — keep circle, remove shadow */
    .howto-single .howto-step {
        page-break-inside: avoid;
    }

    .howto-single .howto-step::before {
        background: #000000 !important;
        box-shadow: none !important;
    }

    .howto-single .howto-step:not(:last-child)::after {
        background: #000000 !important;
        opacity: 0.5;
    }

    /* Callouts in print */
    .howto-single .howto-callout {
        border: 1px solid #000000;
        background: #ffffff !important;
        color: #000000 !important;
        page-break-inside: avoid;
    }

    .howto-single .howto-share,
    .howto-single .share,
    .howto-single #comments {
        display: none;
    }

    .howto-single .howto-related {
        page-break-before: always;
        border-top-color: #cccccc;
    }

    .howto-single .howto-related-item {
        background: #ffffff;
        border-color: #cccccc;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */

@media (prefers-contrast: more) {
    .howto-single .entry-content a {
        text-decoration-thickness: 2px;
    }

    .howto-single .howto-meta a {
        text-decoration: underline;
    }

    .howto-single a:focus-visible,
    .howto-single button:focus-visible {
        outline-width: 3px;
    }

    .howto-single .howto-requirements {
        border-left-width: 6px;
    }

    .howto-single .howto-step::before {
        border: 2px solid currentColor;
    }

    .howto-single .entry-content h2 {
        border-left-width: 6px;
    }

    .howto-single .howto-callout {
        border-width: 2px;
        border-left-width: 6px;
    }
}