/* ───────────────────────────────────────────────
   PianoHouse — RTL magazine theme
   ─────────────────────────────────────────────── */

:root {
    --ph-accent: #c19a3d;
    --ph-accent-rgb: 193, 154, 61;
    --ph-dark: #0f172a;
    --ph-dark-2: #1e293b;
    --ph-bg: #f6f5f2;
    --ph-surface: #ffffff;
    --ph-text: #1f2430;
    --ph-muted: #6b7280;
    --ph-border: #e8e7e3;
    --ph-radius: 16px;
    --ph-radius-sm: 10px;
    --ph-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
    --ph-shadow-lg: 0 10px 34px rgba(16, 24, 40, .12);
    --ph-font: "Vazirmatn", "Vazir", "Segoe UI", Tahoma, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--ph-font);
    font-size: 16px;
    line-height: 1.8;
    color: var(--ph-text);
    background: var(--ph-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }
a { color: var(--ph-accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: #0f172a; }

h1, h2, h3, h4, h5, h6 {
    line-height: 1.5;
    margin: 0 0 .5em;
    font-weight: 800;
    color: var(--ph-dark);
}

.screen-reader-text {
    border: 0; clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%); height: 1px; width: 1px;
    margin: -1px; overflow: hidden; padding: 0; position: absolute;
}
.screen-reader-text:focus {
    clip: auto; clip-path: none; height: auto; width: auto; margin: 0;
    padding: 12px 18px; background: #fff; color: #000; z-index: 9999;
    top: 8px; right: 8px;
}

.ph-container {
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 20px;
}

.ph-skip-link { position: absolute; top: -60px; right: 12px; z-index: 9999; background: var(--ph-dark); color: #fff; padding: 8px 14px; border-radius: 6px; }
.ph-skip-link:focus { top: 8px; color: #fff; }

/* ── Header ──────────────────────────────────── */

.ph-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--ph-dark);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 6px 22px rgba(15, 23, 42, .30);
}

.ph-header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 100px;
}

.ph-brand { display: flex; align-items: center; gap: 12px; }
.ph-brand .custom-logo { max-height: 64px; width: auto; }
.ph-blogname {
    font-size: 1.35rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -.02em;
}
.ph-blogname:hover { color: var(--ph-accent); }
.ph-tagline {
    font-size: .78rem;
    color: rgba(255, 255, 255, .55);
    border-right: 2px solid var(--ph-accent);
    padding-right: 10px;
    margin-right: 4px;
}

.ph-nav { margin-inline-start: 6px; }

.ph-search-btn,
.ph-nav-toggle { margin-inline-start: auto; }

.ph-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 6px;
}

.ph-menu > li { position: relative; }

.ph-menu a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, .88);
    font-size: .95rem;
    font-weight: 500;
    border-radius: 8px;
}
.ph-menu a:hover,
.ph-menu li.current-menu-item > a,
.ph-menu li.current-menu-ancestor > a {
    color: var(--ph-accent);
    background: rgba(255, 255, 255, .06);
}

.ph-menu > li > a.has-sub::after {
    content: "";
    border: 5px solid transparent;
    border-top-color: currentColor;
    margin-inline-start: 6px;
    margin-top: 4px;
}

.ph-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background: var(--ph-dark-2);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--ph-shadow-lg);
    list-style: none;
    margin: 4px 0 0;
    z-index: 300;
}
.ph-menu li:hover > .sub-menu,
.ph-menu li:focus-within > .sub-menu { display: block; }
.ph-menu .sub-menu a { border-radius: 8px; white-space: nowrap; padding: 9px 14px; font-size: .9rem; }
.ph-menu .sub-menu .sub-menu { top: -8px; right: 100%; }

.ph-search-btn,
.ph-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: transparent;
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s ease;
}
.ph-search-btn:hover,
.ph-nav-toggle:hover { background: rgba(255, 255, 255, .08); color: var(--ph-accent); }

.ph-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
}
.ph-nav-toggle span {
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}
.ph-nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.ph-nav-toggle.open span:nth-child(2) { opacity: 0; }
.ph-nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.ph-search-overlay {
    display: none;
    padding: 18px 0 22px;
    background: var(--ph-dark-2);
    border-top: 1px solid rgba(255, 255, 255, .07);
}
.ph-search-overlay.open { display: block; }

/* Search form */
.ph-searchform { display: flex; gap: 10px; }
.ph-search-input {
    flex: 1;
    font-family: var(--ph-font);
    font-size: 1rem;
    padding: 12px 18px;
    border: 1px solid var(--ph-border);
    border-radius: 12px;
    background: #fff;
    color: var(--ph-text);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.ph-search-input::-webkit-search-decoration,
.ph-search-input::-webkit-search-cancel-button,
.ph-search-input::-webkit-search-results-button,
.ph-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none;
}
.ph-search-input:focus { border-color: var(--ph-accent); box-shadow: 0 0 0 3px rgba(var(--ph-accent-rgb), .18); }
.ph-search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    background: var(--ph-accent);
    color: #16110a;
    border: 0;
    border-radius: 12px;
    font-family: var(--ph-font);
    font-weight: 700;
    cursor: pointer;
    transition: filter .2s ease;
}
.ph-search-submit:hover { filter: brightness(.92); }
.ph-search-submit svg {
    width: 13px;
    height: 13px;
}

/* ── Hero ────────────────────────────────────── */

.ph-hero { padding: 28px 0 6px; }

.ph-hero-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 20px;
}

.ph-hero-main {
    grid-column: 1;
    grid-row: 1 / span 2;
    position: relative;
    border-radius: var(--ph-radius);
    overflow: hidden;
    background: var(--ph-dark);
    box-shadow: var(--ph-shadow-lg);
    min-height: 420px;
}
.ph-hero-main-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}
.ph-hero-main-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph-hero-main:hover .ph-hero-main-thumb { transform: scale(1.035); }
.ph-hero-main::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6, 10, 20, .88) 8%, rgba(6, 10, 20, .35) 48%, rgba(6, 10, 20, 0) 70%);
    pointer-events: none;
}
.ph-hero-main-body {
    position: absolute;
    inset: auto 0 0 0;
    padding: 30px;
    z-index: 2;
}
.ph-hero-main .ph-cats { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.ph-hero-title { margin: 0 0 10px; }
.ph-hero-title a {
    color: #fff;
    font-size: 1.55rem;
    line-height: 1.55;
}
.ph-hero-title a:hover { color: var(--ph-accent); }
.ph-hero-excerpt { color: rgba(255, 255, 255, .82); margin: 0 0 14px; font-size: .95rem; max-width: 52ch; }
.ph-hero-main .ph-meta { color: rgba(255, 255, 255, .72); font-size: .85rem; }
.ph-hero-main .ph-author { color: var(--ph-accent); }

.ph-hero-small {
    display: flex;
    flex-direction: column;
    background: var(--ph-surface);
    border-radius: var(--ph-radius);
    overflow: hidden;
    box-shadow: var(--ph-shadow);
    border: 1px solid var(--ph-border);
    transition: transform .25s ease, box-shadow .25s ease;
}
.ph-hero-small:hover { transform: translateY(-4px); box-shadow: var(--ph-shadow-lg); }
.ph-hero-small-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.ph-hero-small-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph-hero-small-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ph-hero-small-title { margin: 0; }
.ph-hero-small-title a {
    color: var(--ph-text);
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ph-hero-small-title a:hover { color: var(--ph-accent); }
.ph-meta-small { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* Category badges */
.ph-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.ph-badge {
    display: inline-block;
    background: rgba(var(--ph-accent-rgb), .12);
    color: var(--cat-color, var(--ph-accent));
    font-size: .75rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 100px;
    border: 1px solid transparent;
}
a.ph-badge:hover {
    background: var(--cat-color, var(--ph-accent));
    color: #fff;
}

/* Placeholder for missing thumbnails */
.ph-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 80% 20%, rgba(var(--ph-accent-rgb), .35), transparent 55%),
        linear-gradient(135deg, var(--ph-dark-2), var(--ph-dark));
    color: rgba(var(--ph-accent-rgb), .9);
    font-size: 3rem;
}

/* ── Topics ──────────────────────────────────── */

.ph-topics { padding: 34px 0 10px; }

.ph-section-head { margin-bottom: 18px; }

.ph-section-title {
    display: inline-block;
    position: relative;
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    padding-bottom: 10px;
    color: var(--ph-dark);
}
.ph-section-title::after {
    content: "";
    position: absolute;
    right: 2px;
    bottom: 0;
    width: 42px;
    height: 4px;
    border-radius: 3px;
    background: var(--ph-accent);
}

.ph-topics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.ph-topic {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 26px 24px;
    border-radius: var(--ph-radius);
    background: linear-gradient(135deg, var(--cat-color, var(--ph-accent)) 0%, var(--ph-dark) 120%);
    color: #fff;
    box-shadow: var(--ph-shadow);
    min-height: 118px;
    transition: transform .25s ease, box-shadow .25s ease;
}
.ph-topic::before {
    content: "♫";
    position: absolute;
    left: 10px;
    bottom: -14px;
    font-size: 4.5rem;
    color: rgba(255, 255, 255, .14);
    transform: rotate(-12deg);
}
.ph-topic:hover { transform: translateY(-4px); box-shadow: var(--ph-shadow-lg); }
.ph-topic-name { font-size: 1.15rem; font-weight: 800; z-index: 1; }
.ph-topic-count { font-size: .82rem; color: rgba(255, 255, 255, .82); z-index: 1; }

/* ── Main layout ─────────────────────────────── */

.ph-section { padding-bottom: 40px; }
.ph-news { padding: 20px 0 40px; }
.ph-front-intro { padding-top: 28px; }
.ph-front-content { margin-top: 0; }

.ph-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
    padding-block: 26px 40px;
}

.ph-main-col { min-width: 0; }

.ph-archive-title {
    font-size: 1.5rem;
    margin: 0 0 4px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ph-border);
    position: relative;
}
.ph-archive-title::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -2px;
    width: 64px;
    height: 4px;
    border-radius: 3px;
    background: var(--ph-accent);
}
.ph-archive-desc { color: var(--ph-muted); margin: 6px 0 22px; }
.ph-overtitle {
    font-size: .9rem;
    font-weight: 400;
    color: var(--ph-muted);
    margin: 0 0 6px;
}

/* ── Cards grid ──────────────────────────────── */

.ph-cards {
    display: grid;
    gap: 22px;
    margin-top: 24px;
}
.ph-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.ph-card {
    display: flex;
    flex-direction: column;
    background: var(--ph-surface);
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius);
    overflow: hidden;
    box-shadow: var(--ph-shadow);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.ph-card:hover { transform: translateY(-5px); box-shadow: var(--ph-shadow-lg); border-color: rgba(var(--ph-accent-rgb), .4); }

.ph-card-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.ph-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ph-card:hover .ph-card-thumb img { transform: scale(1.06); }

.ph-card-body { display: flex; flex-direction: column; flex: 1; gap: 10px; padding: 20px 22px 22px; }

.ph-card-title { margin: 0; font-size: 1.12rem; line-height: 1.7; }
.ph-card-title a {
    color: var(--ph-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ph-card-title a:hover { color: var(--ph-accent); }

.ph-excerpt {
    color: var(--ph-muted);
    font-size: .92rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ph-card-footer { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--ph-border); }

.ph-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: .84rem;
    color: var(--ph-muted);
}
.ph-author { color: var(--ph-accent); font-weight: 600; }
.ph-sep { color: var(--ph-border); font-weight: 700; }
.ph-date { white-space: nowrap; }

/* ── Sidebar ─────────────────────────────────── */

.ph-sidebar {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.ph-sidebar .widget {
    background: var(--ph-surface);
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius);
    padding: 20px 20px 8px;
    box-shadow: var(--ph-shadow);
}
.ph-sidebar .widget:last-child { margin-bottom: 0; }

.widget-title {
    position: relative;
    margin: 0 0 16px;
    padding-bottom: 12px;
    font-size: 1.05rem;
    font-weight: 800;
    border-bottom: 2px solid var(--ph-border);
}
.widget-title::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -2px;
    width: 34px;
    height: 4px;
    border-radius: 3px;
    background: var(--ph-accent);
}

.ph-sidebar .widget ul { list-style: none; margin: 0 0 12px; padding: 0; }
.ph-cat-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 2px;
    border-bottom: 1px dashed var(--ph-border);
}
.ph-cat-list li::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cat-color, var(--ph-accent));
    margin-inline-end: 10px;
}
.ph-cat-list a { color: var(--ph-text); font-weight: 500; flex: 1; }
.ph-cat-list a:hover { color: var(--ph-accent); }
.ph-cat-count {
    font-size: .72rem;
    font-weight: 700;
    color: var(--ph-muted);
    background: var(--ph-bg);
    border-radius: 100px;
    padding: 1px 10px;
}

.ph-widget-posts { display: flex; flex-direction: column; gap: 14px; }
.ph-widget-post-item { display: flex; gap: 12px; align-items: flex-start; }
.ph-widget-thumb { flex: none; width: 84px; height: 60px; border-radius: 8px; overflow: hidden; }
.ph-widget-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph-widget-post-info { min-width: 0; }
.ph-widget-post-title {
    display: block;
    color: var(--ph-text);
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.7;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ph-widget-post-title:hover { color: var(--ph-accent); }
.ph-widget-post-info .ph-date { font-size: .75rem; }

.ph-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ph-tag {
    background: var(--ph-bg);
    color: var(--ph-muted);
    font-size: .78rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 100px;
    transition: all .2s ease;
}
.ph-tag:hover { background: var(--ph-accent); color: #16110a; }

/* Widgets with images inside (custom) */
.ph-sidebar .widget img { border-radius: 8px; }

/* ── Pagination ──────────────────────────────── */

.ph-pagination { margin-top: 30px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.ph-pagination .page-numbers,
.ph-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--ph-surface);
    border: 1px solid var(--ph-border);
    border-radius: 10px;
    color: var(--ph-text);
    font-weight: 600;
    font-family: var(--ph-font);
    transition: all .2s ease;
}
.ph-pagination .page-numbers.current,
.ph-pagination a:hover {
    background: var(--ph-dark);
    color: #fff;
    border-color: var(--ph-dark);
}

/* ── Single post ─────────────────────────────── */

.ph-post-header { margin: 8px 0 26px; }
.ph-post-header .ph-cats { margin-bottom: 14px; }
.ph-post-title { color: var(--ph-dark); font-size: 2rem; line-height: 1.65; margin: 0 0 12px; }
.ph-post-header .ph-meta { color: var(--ph-muted); font-size: .92rem; }
.ph-post-header .ph-author { color: var(--ph-accent); font-weight: 700; }

.ph-entry-content {
    background: var(--ph-surface);
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius);
    padding: 34px 38px;
    box-shadow: var(--ph-shadow);
    margin-top: 28px;
    font-size: 1.02rem;
}
.ph-entry-content p { margin: 0 0 1.4em; }
.ph-entry-content h2 { font-size: 1.5rem; margin: 1.6em 0 .6em; }
.ph-entry-content h3 { font-size: 1.25rem; margin: 1.5em 0 .6em; }
.ph-entry-content h4 { font-size: 1.1rem; margin: 1.4em 0 .5em; }
.ph-entry-content ul,
.ph-entry-content ol { margin: 0 0 1.4em; padding-inline-start: 1.5em; }
.ph-entry-content li { margin-bottom: .4em; }
.ph-entry-content blockquote {
    margin: 1.8em 0;
    padding: 18px 26px;
    border-inline-start: 4px solid var(--ph-accent);
    background: var(--ph-bg);
    border-radius: 10px;
    color: var(--ph-dark);
    font-style: normal;
}
.ph-entry-content blockquote p:last-child { margin-bottom: 0; }
.ph-entry-content img { border-radius: 12px; }

/* Featured image placed after the intro paragraph, content-width */
.ph-post-image { margin: 0 0 1.8em; }
.ph-post-image .ph-post-image-img { width: 100%; height: auto; display: block; }
.ph-post-image figcaption, .ph-post-image + figcaption { text-align: center; font-size: .82rem; color: var(--ph-muted); margin-top: 8px; }
.ph-post-image::after { content: ""; display: table; clear: both; }
.ph-entry-content a { text-decoration: underline; text-underline-offset: 4px; }
.ph-entry-content a:hover { color: var(--ph-dark); }
.ph-entry-content code, .ph-entry-content kbd {
    background: var(--ph-bg);
    border: 1px solid var(--ph-border);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: .9em;
    direction: ltr;
    display: inline-block;
}
.ph-entry-content pre {
    background: var(--ph-dark);
    color: #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
}
.ph-entry-content pre code { background: none; border: 0; color: inherit; }
.ph-entry-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; }
.ph-entry-content th, .ph-entry-content td { border: 1px solid var(--ph-border); padding: 10px 14px; }
.ph-entry-content th { background: var(--ph-bg); }
.ph-entry-content .wp-block-image figcaption, .ph-entry-content figcaption {
    text-align: center; font-size: .82rem; color: var(--ph-muted); margin-top: 6px;
}
.ph-entry-content hr { border: 0; border-top: 2px solid var(--ph-border); margin: 2.2em 0; }

.ph-page-links { margin: 1.6em 0; font-weight: 700; }
.ph-page-links .post-page-numbers { display: inline-flex; min-width: 34px; height: 34px; align-items: center; justify-content: center; margin-inline-end: 6px; border: 1px solid var(--ph-border); border-radius: 8px; }
.ph-page-links .post-page-numbers.current { background: var(--ph-dark); color: #fff; }
.ph-page-links .post-page-numbers:hover { background: var(--ph-accent); color: #16110a; }

.ph-entry-content input[type="password"] {
    font-family: var(--ph-font);
    border: 1px solid var(--ph-border);
    border-radius: 8px;
    padding: 10px 14px;
}

.ph-single-tags { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.ph-single-tags .ph-tag { background: var(--ph-surface); border: 1px solid var(--ph-border); }

.ph-post-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 26px;
}
.ph-nav-item a {
    display: flex;
    flex-direction: column;
    background: var(--ph-surface);
    border: 1px solid var(--ph-border);
    border-radius: 12px;
    padding: 16px 20px;
    color: var(--ph-text);
    font-size: .9rem;
    font-weight: 700;
    transition: all .2s ease;
}
.ph-nav-item a:hover { border-color: var(--ph-accent); color: var(--ph-accent); box-shadow: var(--ph-shadow); }
.ph-nav-item::before { content: attr(data-label); }
.ph-nav-prev a::before { content: "→ مطلب قبلی"; display: block; font-size: .72rem; color: var(--ph-muted); margin-bottom: 4px; font-weight: 500; }
.ph-nav-next a::before { content: "مطلب بعدی ←"; display: block; font-size: .72rem; color: var(--ph-muted); margin-bottom: 4px; font-weight: 500; }
.ph-nav-next { text-align: left; }

.ph-author-box {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--ph-bg);
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius);
    padding: 20px 24px;
    margin-top: 26px;
}
.ph-author-avatar { flex: none; }
.ph-author-img { border-radius: 50%; }
.ph-author-eyebrow { display: block; font-size: .72rem; color: var(--ph-muted); margin-bottom: 2px; }
.ph-author-name { display: block; font-size: 1rem; color: var(--ph-dark); margin-bottom: 6px; }
.ph-author-bio { margin: 0; font-size: .9rem; color: var(--ph-muted); }

.ph-related { margin-top: 34px; }
.ph-related .ph-cards { margin-top: 16px; }

/* ── Comments ────────────────────────────────── */

.ph-comments { margin-top: 34px; }
.ph-comments-title {
    font-size: 1.3rem;
    position: relative;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ph-border);
    margin-bottom: 22px;
}
.ph-comment-list { list-style: none; margin: 0; padding: 0; }
.ph-comment-body {
    background: var(--ph-surface);
    border: 1px solid var(--ph-border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
}
.ph-comment-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ph-comment-avatar { border-radius: 50%; }
.ph-comment-author { font-weight: 700; color: var(--ph-dark); }
.ph-comment-author a { color: inherit; }
.ph-comment-date { display: block; font-size: .75rem; color: var(--ph-muted); }
.ph-comment-awaiting { color: var(--ph-accent); font-size: .85rem; }
.ph-comment-text { font-size: .95rem; }
.ph-comment-body .comment-reply-link {
    font-size: .8rem;
    font-weight: 600;
    color: var(--ph-accent);
    margin-top: 6px;
    display: inline-block;
}
.ph-edit-link { font-size: .8rem; margin-inline-start: 10px; }
.ph-comments-closed { color: var(--ph-muted); }

.ph-comments .comment-form { background: var(--ph-surface); border: 1px solid var(--ph-border); border-radius: 12px; padding: 24px; }
.ph-comments .comment-form label { display: block; font-weight: 600; margin-bottom: 6px; }
.ph-comments .comment-form input[type="text"],
.ph-comments .comment-form input[type="email"],
.ph-comments .comment-form input[type="url"],
.ph-comments .comment-form textarea {
    width: 100%;
    font-family: var(--ph-font);
    border: 1px solid var(--ph-border);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: #fff;
    color: var(--ph-text);
}
.ph-comments .comment-form input:focus,
.ph-comments .comment-form textarea:focus { border-color: var(--ph-accent); outline: none; box-shadow: 0 0 0 3px rgba(var(--ph-accent-rgb), .15); }
.ph-comments .comment-form .submit {
    background: var(--ph-accent);
    color: #16110a;
    border: 0;
    border-radius: 10px;
    padding: 10px 26px;
    font-family: var(--ph-font);
    font-weight: 700;
    cursor: pointer;
}
.ph-comments .comment-form .submit:hover { filter: brightness(.92); }

/* ── Empty / 404 ─────────────────────────────── */

.ph-empty {
    background: var(--ph-surface);
    border: 1px dashed var(--ph-border);
    border-radius: var(--ph-radius);
    padding: 48px 30px;
    text-align: center;
    margin-top: 24px;
}
.ph-empty-icon { font-size: 3.5rem; color: var(--ph-accent); line-height: 1; }
.ph-empty-title { margin: 12px 0 4px; }
.ph-empty p { color: var(--ph-muted); margin: 0 0 18px; }
.ph-empty-search { max-width: 420px; margin-inline: auto; }

.ph-node { padding: 60px 0; }
.ph-node-box {
    max-width: 560px;
    margin-inline: auto;
    background: var(--ph-surface);
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius);
    padding: 50px 40px;
    text-align: center;
    box-shadow: var(--ph-shadow);
}
.ph-node-code {
    display: block;
    font-size: 5.5rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, var(--ph-accent), #8a6a20);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.ph-node-title { font-size: 1.6rem; margin: 10px 0 8px; }
.ph-node-text { color: var(--ph-muted); margin: 0 0 16px; }
.ph-node-search { margin-top: 22px; }

/* ── Footer ──────────────────────────────────── */

.ph-footer { background: var(--ph-dark); color: rgba(255, 255, 255, .78); margin-top: 20px; }

.ph-footer-widgets { padding: 48px 0 20px; }
.ph-footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
}
.ph-footer-col .widget-title { color: #fff; border-bottom-color: rgba(255, 255, 255, .12); }
.ph-footer-col .widget-title::after { background: var(--ph-accent); }
.ph-footer-col .widget ul { list-style: none; margin: 0; padding: 0; }
.ph-footer-col .widget li { padding: 5px 0; }
.ph-footer-col .widget a { color: rgba(255, 255, 255, .7); }
.ph-footer-col .widget a:hover { color: var(--ph-accent); }
.ph-footer-col p { color: rgba(255, 255, 255, .55); font-size: .9rem; }

.ph-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 20px 0; }
.ph-footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ph-copyright { margin: 0; font-size: .85rem; color: rgba(255, 255, 255, .5); }
.ph-copyright a { color: rgba(255, 255, 255, .85); }
.ph-copyright a:hover { color: var(--ph-accent); }
.ph-footer-menu { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; margin: 0; padding: 0; }
.ph-footer-menu a { color: rgba(255, 255, 255, .6); font-size: .85rem; }
.ph-footer-menu a:hover { color: var(--ph-accent); }

/* ── Responsive ──────────────────────────────── */

.ph-header.ph-stuck { box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 12px 30px rgba(15, 23, 42, .45); }

@media (max-width: 1024px) {
    .ph-with-sidebar { grid-template-columns: 1fr; }
    .ph-sidebar { position: static; }

    .ph-hero-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: auto;
    }
    .ph-hero-main { grid-column: 1 / -1; grid-row: auto; min-height: 340px; }
    .ph-hero-small:nth-child(2) { /* first small after main */ }

    .ph-topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .ph-nav { display: none; }
    .ph-nav-toggle { display: inline-flex; }
    .ph-brand { margin-inline-end: auto; }

    .ph-nav.mobile-open {
        display: block;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: var(--ph-dark-2);
        padding: 14px 18px 20px;
        box-shadow: var(--ph-shadow-lg);
        z-index: 150;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    .ph-menu { flex-direction: column; gap: 2px; }
    .ph-menu a { padding: 12px 14px; font-size: 1rem; }
    .ph-menu .sub-menu { position: static; box-shadow: none; padding: 0 0 4px 14px; min-width: 0; }
    .ph-menu li:hover > .sub-menu { display: block; }

    .ph-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .ph-container { padding-inline: 16px; }

    .ph-hero { display: block; }
    .ph-hero-grid { grid-template-columns: 1fr; }
    .ph-hero-main { min-height: 280px; }
    .ph-hero-main-body { padding: 20px; }
    .ph-hero-title a { font-size: 1.25rem; }
    .ph-hero-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

    .ph-cards-2 { grid-template-columns: 1fr; }
    .ph-topics-grid { grid-template-columns: 1fr; }
    .ph-post-header { margin: 0 0 20px; }
    .ph-post-title { font-size: 1.5rem; }
    .ph-entry-content { padding: 22px 18px; }
    .ph-post-nav { grid-template-columns: 1fr; }
    .ph-nav-next { text-align: right; }
    .ph-footer-grid { grid-template-columns: 1fr; }
}

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

/* WordPress core align classes inside content */
.alignleft { float: left; margin: 6px 20px 16px 0; }
.alignright { float: right; margin: 6px 0 16px 20px; }
.aligncenter { margin-inline: auto; }