/*
Theme Name: KSI Market Redesign
Theme URI: https://koreastockinsight.com/
Template: kadence
Author: Korean Stock Insight
Description: A responsive financial-media child theme for Korean Stock Insight. The custom homepage is optimized for desktop, tablet, and mobile while regular posts and pages retain Kadence layouts.
Version: 1.1.1
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v3.0 (or later)
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: ksi-market-redesign
Domain Path: /languages
*/


/*
 * Increase the breathing room between the global navigation and single-post
 * content. The previous top offset was too tight, especially on large screens.
 */
.single-post .content-container.site-container {
    padding-top: clamp(5.5rem, 7vw, 7.5rem) !important;
}

@media (max-width: 1024px) {
    .single-post .content-container.site-container {
        padding-top: clamp(4rem, 7vw, 5.5rem) !important;
    }
}

@media (max-width: 767px) {
    .single-post .content-container.site-container {
        padding-top: 3.25rem !important;
    }
}

/* Article typography: optimized for readable Korean and English posts. */
.type-post p {
    text-align: justify;
}

/*
 * Many legacy articles were authored in a Custom HTML block and contain
 * inline text colors. Keep published headings readable by overriding those
 * inline colors and using a clean editorial treatment that matches the editor.
 */
.single-post .entry-content h1 {
    margin: 2em 0 0.75em;
    padding: 0;
    border: 0;
    background: transparent !important;
    box-shadow: none;
    color: #071f39 !important;
    font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(30px, 2.2vw, 34px) !important;
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.32 !important;
    text-align: left;
    text-wrap: balance;
}

.single-post .entry-content h2 {
    margin: 2.2em 0 0.75em;
    padding: 0 0 0.42em;
    border: 0;
    border-bottom: 3px solid #d9e4ec;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
    color: #071f39 !important;
    font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(25px, 1.8vw, 28px) !important;
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.35 !important;
    text-align: left;
    text-wrap: balance;
}

.single-post .entry-content h3 {
    margin: 1.9em 0 0.75em;
    padding: 0.25em 0 0.25em 0.75em;
    border: 0;
    border-left: 6px solid #168a91;
    background: transparent !important;
    color: #071f39 !important;
    font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(20px, 1.5vw, 22px) !important;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.4 !important;
    text-align: left;
    text-wrap: balance;
}

.single-post .entry-content h4 {
    margin: 1.25em 0 0.55em;
    padding-left: 0.75em;
    border-left: 4px solid #168a91;
    background: transparent !important;
    color: #17324d !important;
    font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(1.08rem, 1.5vw, 1.28rem);
    font-weight: 750;
    line-height: 1.5;
    text-align: left;
}

/* Override inline colors inside legacy HTML headings. */
.single-post .entry-content h1 *,
.single-post .entry-content h2 *,
.single-post .entry-content h3 *,
.single-post .entry-content h4 * {
    color: inherit !important;
    background: transparent !important;
    text-shadow: none !important;
}

@media (min-width: 768px) and (max-width: 1199px) {
    .single-post .entry-content h1 {
        font-size: clamp(27px, 3vw, 30px) !important;
    }

    .single-post .entry-content h2 {
        font-size: clamp(23px, 2.5vw, 25px) !important;
    }

    .single-post .entry-content h3 {
        font-size: clamp(19px, 2.1vw, 21px) !important;
    }
}

@media (max-width: 767px) {
    .single-post .entry-content h1 {
        margin-top: 1.8em;
        font-size: clamp(25px, 7vw, 28px) !important;
        line-height: 1.35 !important;
    }

    .single-post .entry-content h2 {
        margin-top: 2em;
        font-size: clamp(22px, 6vw, 24px) !important;
        line-height: 1.38 !important;
    }

    .single-post .entry-content h3 {
        margin-top: 1.75em;
        font-size: clamp(18px, 5vw, 20px) !important;
        line-height: 1.42 !important;
    }

    .single-post .entry-content h4 {
        font-size: 1.08rem;
    }
}

u,
span[style*="text-decoration: underline"] {
    padding: 2px 5px;
    background: linear-gradient(to top, rgba(255, 241, 54, 0.7) 30%, transparent 40%);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    text-decoration: none !important;
}

/*
 * Single-post composition: keep category, title and metadata directly above
 * the article, center the header group, and keep the reading column itself
 * centered on the page. Paragraph text remains left/justified for readability.
 */
.single-post .entry-content-wrap > .entry-header,
.single-post .entry-content-wrap .entry-header {
    max-width: 980px;
    margin: 0 auto clamp(1.35rem, 2.5vw, 2rem);
    padding: 0;
    text-align: center !important;
}

.single-post .entry-content-wrap .entry-taxonomies,
.single-post .entry-content-wrap .entry-title,
.single-post .entry-content-wrap .entry-meta {
    text-align: center !important;
}

.single-post .entry-content-wrap .entry-taxonomies {
    display: flex;
    justify-content: center;
}

.single-post .entry-content-wrap .entry-title {
    max-width: 980px;
    margin: 0.32em auto 0.42em;
    color: #18202a;
    font-size: clamp(36px, 2.6vw, 40px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.24;
    text-wrap: balance;
}

.single-post .entry-content-wrap .entry-meta {
    justify-content: center !important;
    margin-top: 0.45rem;
}

/* Center the article column and media without centering long paragraph lines. */
.single-post .entry-content-wrap .entry-content {
    width: 100%;
    max-width: 1120px;
    margin-right: auto;
    margin-left: auto;
}

.single-post .entry-content-wrap .entry-content > figure,
.single-post .entry-content-wrap .entry-content > .wp-block-image,
.single-post .entry-content-wrap .entry-content > .wp-block-gallery,
.single-post .entry-content-wrap .entry-content > .wp-block-embed {
    margin-right: auto;
    margin-left: auto;
}

/* Fallback for posts that retain a per-post Above Content override. */
.single-post .entry-hero-container-inner {
    min-height: 0 !important;
}

.single-post .entry-hero-container-inner .entry-header {
    max-width: 980px;
    margin-right: auto;
    margin-left: auto;
    padding-top: clamp(1.25rem, 2.5vw, 2rem);
    padding-bottom: clamp(1.25rem, 2.5vw, 2rem);
    text-align: center !important;
}

/* Legal pages stay published but are intentionally absent from navigation. */
.menu-item a[href*="privacy-policy"],
.menu-item a[href*="%EA%B0%9C%EC%9D%B8%EC%A0%95%EB%B3%B4"],
.menu-item a[href*="terms-of-use"],
.menu-item a[href*="terms-of-service"],
.menu-item a[href*="terms-and-conditions"],
.menu-item a[href*="terms-conditions"],
.menu-item a[href*="%EC%9D%B4%EC%9A%A9%EC%95%BD%EA%B4%80"] {
    display: none;
}

@media (min-width: 768px) and (max-width: 1199px) {
    .single-post .entry-content-wrap .entry-title {
        font-size: clamp(32px, 3.1vw, 35px);
        line-height: 1.25;
    }
}

@media (max-width: 767px) {
    .single-post .entry-content-wrap > .entry-header,
    .single-post .entry-content-wrap .entry-header {
        margin-bottom: 1.25rem;
    }

    .single-post .entry-content-wrap .entry-title {
        font-size: clamp(28px, 7vw, 32px);
        line-height: 1.28;
    }

    .single-post .entry-content-wrap .entry-meta {
        gap: 0.35rem 0.6rem;
        font-size: 0.92rem;
    }
}
