/* =================================================
   IP Blog — Single Post Premium Styles v2.0
   Uses CSS variables set inline via PHP settings
   ================================================= */

/* ── Reset & Base ─────────────────────────────── */
.ip-single-wrap {
    background: var(--ip-bg, #f8f9fa);
    font-family: 'Outfit', sans-serif;
    font-size: var(--ip-body-size, 17px);
    color: var(--ip-body-color, #3d3d3d);
    line-height: 1.75;
}

/* ── Reading Progress Bar ─────────────────────── */
.ip-reading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.08);
    z-index: 9999;
}
.ip-reading-bar__fill {
    height: 100%;
    width: 0;
    background: var(--ip-primary, #fece00);
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* ── Hero ─────────────────────────────────────── */
.ip-hero {
    position: relative;
    background: var(--ip-dark, #152032);
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.ip-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.35;
    transform: scale(1.03);
}
.ip-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.1) 0%,
        rgba(21,32,50,0.55) 40%,
        rgba(21,32,50,0.95) 100%
    );
}
.ip-hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 80px 24px 56px;
}

/* Breadcrumb */
.ip-hero__breadcrumb {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.ip-hero__breadcrumb a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.2s;
}
.ip-hero__breadcrumb a:hover { color: var(--ip-primary, #fece00); }
.ip-bc-sep { opacity: 0.4; }

/* Badge */
.ip-hero__badge {
    display: inline-block;
    background: var(--ip-primary, #fece00);
    color: var(--ip-dark, #152032);
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 6px;
    margin-bottom: 18px;
}

/* Title */
.ip-hero__title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 800;
    font-size: var(--ip-heading-size, 38px);
    line-height: 1.2;
    color: #fff;
    margin: 0 0 28px;
}

/* Meta row */
.ip-hero__meta {
    display: flex;
    align-items: center;
    gap: 14px;
}
.ip-hero__avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    border: 2px solid var(--ip-primary, #fece00);
    flex-shrink: 0;
    object-fit: cover;
}
.ip-hero__meta-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ip-hero__author {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}
.ip-hero__author a {
    color: var(--ip-primary, #fece00);
    text-decoration: none;
}
.ip-hero__author a:hover { text-decoration: underline; }
.ip-hero__meta-row {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.ip-sep { opacity: 0.4; }

/* ── Main Layout ──────────────────────────────── */
.ip-single-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.ip-single-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    padding: 48px 0 80px;
    align-items: start;
}

/* ── Content Column ───────────────────────────── */
.ip-single-content {
    min-width: 0;
    background: var(--ip-card-bg, #fff);
    border-radius: 20px;
    padding: 48px 52px;
    box-shadow: 0 2px 24px rgba(0,0,0,0.06);
}

/* Typography */
.ip-single-content h1,
.ip-single-content h2,
.ip-single-content h3,
.ip-single-content h4,
.ip-single-content h5,
.ip-single-content h6 {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    color: var(--ip-dark, #152032);
    line-height: 1.3;
    margin: 1.8em 0 0.6em;
}
.ip-single-content h2 { font-size: 1.7em; }
.ip-single-content h3 { font-size: 1.35em; }
.ip-single-content h4 { font-size: 1.15em; }

.ip-single-content h2 { 
    border-left: 4px solid var(--ip-primary, #fece00);
    padding-left: 14px;
}

.ip-single-content p { margin: 0 0 1.4em; }

.ip-single-content a {
    color: var(--ip-dark, #152032);
    text-decoration: underline;
    text-decoration-color: var(--ip-primary, #fece00);
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.ip-single-content a:hover { color: var(--ip-accent, #fece00); }

.ip-single-content ul,
.ip-single-content ol {
    margin: 0 0 1.4em 1.2em;
    padding: 0;
}
.ip-single-content li { margin-bottom: 0.4em; }

.ip-single-content blockquote {
    margin: 2em 0;
    padding: 20px 28px;
    background: color-mix(in srgb, var(--ip-primary, #fece00) 12%, transparent);
    border-left: 5px solid var(--ip-primary, #fece00);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--ip-dark, #152032);
    font-size: 1.05em;
}
.ip-single-content blockquote p { margin: 0; }

.ip-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 1.5em auto;
}

.ip-single-content pre {
    background: var(--ip-dark, #152032);
    color: #e2e8f0;
    padding: 20px 24px;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 0.88em;
    line-height: 1.7;
    margin: 1.5em 0;
}
.ip-single-content code {
    background: rgba(254,206,0,0.15);
    color: var(--ip-dark, #152032);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.87em;
}
.ip-single-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.ip-single-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95em;
}
.ip-single-content th {
    background: var(--ip-dark, #152032);
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-family: 'Exo 2', sans-serif;
}
.ip-single-content td {
    padding: 11px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.07);
}
.ip-single-content tr:nth-child(even) td {
    background: rgba(0,0,0,0.025);
}

/* ── Table of Contents (inline) ───────────────── */
.ip-toc {
    background: color-mix(in srgb, var(--ip-primary, #fece00) 10%, transparent);
    border: 1.5px solid color-mix(in srgb, var(--ip-primary, #fece00) 40%, transparent);
    border-radius: 14px;
    margin: 0 0 2em;
    overflow: hidden;
}
.ip-toc__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--ip-dark, #152032);
    background: color-mix(in srgb, var(--ip-primary, #fece00) 20%, transparent);
    cursor: default;
}
.ip-toc__icon { font-size: 16px; }
.ip-toc__toggle {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: var(--ip-dark, #152032);
    padding: 0 4px;
    transition: transform 0.2s;
}
.ip-toc__toggle:hover { color: var(--ip-accent, #fece00); }
.ip-toc__nav { padding: 16px 20px 18px 28px; }
.ip-toc__list {
    margin: 0;
    padding: 0 0 0 16px;
    list-style: decimal;
}
.ip-toc__item { margin-bottom: 6px; }
.ip-toc-h3 { margin-left: 20px; font-size: 0.93em; }
.ip-toc__list a {
    color: var(--ip-dark, #152032);
    text-decoration: none;
    font-size: 14.5px;
    line-height: 1.4;
    transition: color 0.2s;
}
.ip-toc__list a:hover { color: var(--ip-accent, #fece00); text-decoration: underline; }

/* ── Page Links ───────────────────────────────── */
.ip-page-links {
    margin: 2em 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ip-page-links span span,
.ip-page-links a span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
}
.ip-page-links a span {
    background: var(--ip-dark, #152032);
    color: #fff;
    transition: background 0.2s;
}
.ip-page-links a span:hover { background: var(--ip-accent, #fece00); }
.ip-page-links > span > span {
    background: var(--ip-primary, #fece00);
    color: var(--ip-dark, #152032);
}

/* ── Tags ─────────────────────────────────────── */
.ip-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 2em 0 1.5em;
    padding-top: 1.5em;
    border-top: 1px solid rgba(0,0,0,0.07);
}
.ip-tags__label {
    font-size: 13px;
    color: var(--ip-meta-color, #888);
    font-weight: 500;
}
.ip-tag {
    background: rgba(0,0,0,0.05);
    color: var(--ip-dark, #152032);
    font-size: 12.5px;
    font-weight: 500;
    padding: 5px 13px;
    border-radius: 50px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    border: 1px solid rgba(0,0,0,0.08);
}
.ip-tag:hover {
    background: var(--ip-primary, #fece00);
    color: var(--ip-dark, #152032);
    border-color: var(--ip-primary, #fece00);
}

/* ── Share ────────────────────────────────────── */
.ip-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0 0 2em;
    padding: 20px 24px;
    background: var(--ip-bg, #f8f9fa);
    border-radius: 14px;
}
.ip-share__label {
    font-weight: 600;
    font-size: 14px;
    color: var(--ip-dark, #152032);
    white-space: nowrap;
}
.ip-share__buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ip-share__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    text-decoration: none;
    background: #152032;
    color: #fff;
    transition: transform 0.25s ease, opacity 0.25s ease, background 0.25s ease;
    border: none;
    cursor: pointer;
}
.ip-share__btn:hover { transform: translateY(-2px); opacity: 0.85; }
.ip-share__btn svg { width: 18px; height: 18px; fill: #fff; color: #fff; }
.ip-share--twitter   { background: #152032; }
.ip-share--facebook  { background: #152032; }
.ip-share--linkedin  { background: #152032; }
.ip-share--whatsapp  { background: #152032; }
.ip-share--copy      { background: #152032; }

/* ── Author Box ───────────────────────────────── */
.ip-author-box {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 28px 32px;
    background: var(--ip-bg, #f8f9fa);
    border-radius: 18px;
    margin: 2em 0;
    border: 1.5px solid rgba(0,0,0,0.06);
}
.ip-author-box__img {
    width: 80px !important;
    height: 80px !important;
    border-radius: 50%;
    border: 3px solid var(--ip-primary, #fece00);
    object-fit: cover;
    flex-shrink: 0;
}
.ip-author-box__info { flex: 1; min-width: 0; }
.ip-author-box__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ip-meta-color, #888);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}
.ip-author-box__name {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 1.2em;
    margin: 0 0 8px;
}
.ip-author-box__name a {
    color: var(--ip-dark, #152032);
    text-decoration: none;
}
.ip-author-box__name a:hover { color: var(--ip-accent, #fece00); }
.ip-author-box__bio {
    font-size: 14px;
    color: var(--ip-meta-color, #888);
    margin: 0 0 12px;
    line-height: 1.6;
}
.ip-author-box__link {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--ip-dark, #152032);
    text-decoration: none;
    transition: color 0.2s;
}
.ip-author-box__link:hover { color: var(--ip-accent, #fece00); }

/* ── Comments Wrap ────────────────────────────── */
.ip-comments-wrap {
    margin-top: 2em;
    padding-top: 2em;
    border-top: 1px solid rgba(0,0,0,0.07);
}

/* ── Sidebar ──────────────────────────────────── */
.ip-single-sidebar {
    position: sticky;
    top: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.ip-sticky-widget {
    background: var(--ip-card-bg, #fff);
    border-radius: 16px;
    box-shadow: 0 2px 18px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* Sidebar TOC */
.ip-sidebar-toc__header {
    padding: 14px 20px;
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ip-dark, #152032);
    background: color-mix(in srgb, var(--ip-primary, #fece00) 18%, transparent);
    border-bottom: 1.5px solid color-mix(in srgb, var(--ip-primary, #fece00) 35%, transparent);
}
.ip-sidebar-toc .ip-sidebar-toc__header + nav {
    padding: 14px 20px 18px;
}
.ip-sidebar-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.ip-sidebar-toc__list li { margin-bottom: 5px; }
.ip-sidebar-toc__list .ip-toc-h3 { padding-left: 16px; }
.ip-stoc-link {
    font-size: 13.5px;
    color: var(--ip-meta-color, #888);
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
    display: block;
    padding: 3px 0;
    border-left: 2px solid transparent;
    padding-left: 8px;
    line-height: 1.4;
}
.ip-stoc-link:hover,
.ip-stoc-link.is-active {
    color: var(--ip-dark, #152032);
    border-left-color: var(--ip-primary, #fece00);
    padding-left: 12px;
}

/* Sidebar Info */
.ip-sidebar-info h4 {
    font-family: 'Exo 2', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ip-dark, #152032);
    margin: 0;
    padding: 14px 20px;
    background: color-mix(in srgb, var(--ip-primary, #fece00) 18%, transparent);
    border-bottom: 1.5px solid color-mix(in srgb, var(--ip-primary, #fece00) 35%, transparent);
}
.ip-sidebar-info__list {
    margin: 0;
    padding: 14px 20px;
    list-style: none;
}
.ip-sidebar-info__list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.ip-sidebar-info__list li:last-child { border-bottom: none; }
.ip-info-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.ip-sidebar-info__list div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.ip-sidebar-info__list small {
    font-size: 11px;
    color: var(--ip-meta-color, #888);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.ip-sidebar-info__list strong {
    font-size: 14px;
    color: var(--ip-dark, #152032);
    font-weight: 600;
}
.ip-sidebar-info__list a {
    color: var(--ip-dark, #152032);
    text-decoration: none;
}
.ip-sidebar-info__list a:hover { color: var(--ip-accent, #fece00); }

/* ── Related Posts ────────────────────────────── */
.ip-related {
    background: var(--ip-dark, #152032);
    padding: 64px 0;
}
.ip-related__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.ip-related__title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 800;
    font-size: 28px;
    color: #fff;
    text-align: center;
    margin: 0 0 40px;
}
.ip-related__title span {
    position: relative;
    padding-bottom: 10px;
    display: inline-block;
}
.ip-related__title span::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--ip-primary, #fece00);
    border-radius: 2px;
}
.ip-related__grid {
    display: grid;
    gap: 24px;
}
.ip-related__grid.ip-cols-1 { grid-template-columns: 1fr; }
.ip-related__grid.ip-cols-2 { grid-template-columns: repeat(2,1fr); }
.ip-related__grid.ip-cols-3 { grid-template-columns: repeat(3,1fr); }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 1024px) {
    .ip-single-layout {
        grid-template-columns: 1fr;
    }
    .ip-single-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .ip-related__grid.ip-cols-3 { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 768px) {
    .ip-hero { min-height: 360px; }
    .ip-hero__title { font-size: calc(var(--ip-heading-size, 38px) * 0.72); }
    .ip-hero__inner { padding: 60px 20px 40px; }
    .ip-single-content { padding: 28px 22px; }
    .ip-single-sidebar { grid-template-columns: 1fr; }
    .ip-author-box { flex-direction: column; align-items: center; text-align: center; }
    .ip-author-box__link::before { display: none; }
    .ip-related__grid.ip-cols-2,
    .ip-related__grid.ip-cols-3 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .ip-single-container { padding: 0 16px; }
    .ip-single-layout { padding: 24px 0 48px; }
    .ip-hero__meta { flex-wrap: wrap; }
}

/* ── Sidebar Categories Widget ────────────────── */
.ip-sidebar-categories .ip-sidebar-categories__header {
    padding: 14px 20px;
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ip-dark, #152032);
    background: color-mix(in srgb, var(--ip-primary, #fece00) 18%, transparent);
    border-bottom: 1.5px solid color-mix(in srgb, var(--ip-primary, #fece00) 35%, transparent);
}
.ip-sidebar-categories__list {
    margin: 0;
    padding: 14px 20px;
    list-style: none;
}
.ip-sidebar-categories__list li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.ip-sidebar-categories__list li:last-child {
    border-bottom: none;
}
.ip-sidebar-categories__list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 4px;
    font-size: 14px;
    color: var(--ip-dark, #152032);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    transition: color 0.25s ease, padding-left 0.25s ease;
}
.ip-sidebar-categories__list a:hover {
    color: var(--ip-accent, #fecd04);
    padding-left: 6px;
}
.ip-sidebar-categories__list a .ip-cat-count {
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.06);
    color: var(--ip-meta-color, #888);
    border-radius: 50px;
    padding: 2px 8px;
    transition: background 0.25s ease, color 0.25s ease;
    flex-shrink: 0;
}
.ip-sidebar-categories__list a:hover .ip-cat-count {
    background: var(--ip-primary, #fecd04);
    color: var(--ip-dark, #152032);
}
