/*
Theme Name: HyperPress
Theme URI: https://svounk.com
Author: Svounk
Author URI: https://svounk.com
Description: High-performance WordPress theme built for speed, SEO, and maximum AdSense monetization. Scores 100/100 on PageSpeed Insights. Optimized for all devices and ad formats.
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hyperpress
Tags: blog, news, editorial, performance, seo, adsense, responsive, speed
*/

/* ============================================
   FONT: HELVETICA LT STD BOLD
   ============================================ */
@font-face {
    font-family: 'Helvetica Std';
    src: url('assets/fonts/HelveticaLTStd-Bold.woff2') format('woff2'),
         url('assets/fonts/HelveticaLTStd-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
    --hp-primary: #1e40af;
    --hp-primary-hover: #1e3a8a;
    --hp-primary-light: #eff6ff;
    --hp-surface: #ffffff;
    --hp-bg: #f8fafc;
    --hp-border: #e2e8f0;
    --hp-text: #0f172a;
    --hp-text-muted: #475569;
    --hp-text-light: #94a3b8;
    --hp-radius: 8px;
    --hp-radius-lg: 12px;
    --hp-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --hp-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --hp-transition: 0.2s cubic-bezier(0.4,0,0.2,1);
    --hp-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --hp-font-heading: 'Helvetica Std', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: var(--hp-font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background-color: var(--hp-bg);
    color: var(--hp-text);
    line-height: 1.75;
    font-size: 16px;
    overflow-x: hidden;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.site-header {
    background-color: #0f172a;
    border-bottom: 1px solid #1e293b;
    min-height: 70px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--hp-shadow);
}

.site-header > .container { min-height: inherit; }

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    min-height: inherit;
    padding: 0.5rem 0;
}

body.no-header-menu .header-content { justify-content: center; }

.site-branding {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex: 1;
    min-width: 0;
}

.site-logo { display: flex; align-items: center; }
.site-logo-link { display: inline-flex; align-items: center; line-height: 0; text-decoration: none; }
.site-logo-link img { max-height: 60px; width: auto; height: auto; display: block; object-fit: contain; }
.site-logo-link h1 { margin: 0; padding: 0; line-height: 1; display: flex; align-items: center; font-size: inherit; }
.site-logo-link h1 img { max-height: 60px; }
.site-header h1.site-logo-link { margin: 0; padding: 0; }

.site-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #f1f5f9;
    text-decoration: none;
    margin: 0;
    line-height: 1.2;
    font-family: var(--hp-font-heading);
    letter-spacing: -0.02em;
}

.site-title a { color: inherit; text-decoration: none; }
.site-title:hover, .site-title a:hover { color: #93c5fd; }

.site-description {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.2;
}

.main-navigation { flex-shrink: 0; }
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
}

.main-navigation li { margin: 0; }
.main-navigation a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    display: block;
    border-radius: 6px;
    transition: color var(--hp-transition), background var(--hp-transition);
}

.main-navigation a:hover { color: #f1f5f9; background: rgba(255,255,255,0.1); }
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
    color: #93c5fd;
    background: rgba(147,197,253,0.15);
    font-weight: 600;
}

/* Mobile toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 6px;
    transition: background var(--hp-transition);
}

.menu-toggle:hover { background: rgba(255,255,255,0.1); }

.menu-toggle-icon {
    display: flex;
    flex-direction: column;
    width: 20px;
    height: 14px;
    justify-content: space-between;
    position: relative;
}

.menu-toggle-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #f1f5f9;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.active { opacity: 1; visibility: visible; }

@media (max-width: 767px) {
    .site-header { min-height: 60px; }
    .header-content { gap: 0; justify-content: center; position: relative; }
    .site-branding { flex: 1; justify-content: center; text-align: center; }
    .site-title { font-size: 1.125rem; text-align: center; }
    .site-description { display: none; }
    .site-logo-link img { max-height: 46px; }

    .menu-toggle {
        display: flex;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 102;
    }

    .main-navigation {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: min(300px, 90vw);
        height: 100vh;
        height: 100dvh;
        background-color: #0f172a;
        z-index: 99;
        transform: translateX(-100%);
        transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.38s ease;
        overflow-y: auto;
        box-shadow: none;
    }

    .main-navigation.active {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0,0,0,0.18);
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 4.5rem 0 2rem;
        margin: 0;
    }

    .main-navigation li {
        width: 100%;
        border-bottom: 1px solid #1e293b;
        opacity: 0;
        transform: translateX(-10px);
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .main-navigation.active li { opacity: 1; transform: translateX(0); }
    .main-navigation.active li:nth-child(1) { transition-delay: 0.04s; }
    .main-navigation.active li:nth-child(2) { transition-delay: 0.08s; }
    .main-navigation.active li:nth-child(3) { transition-delay: 0.12s; }
    .main-navigation.active li:nth-child(4) { transition-delay: 0.16s; }
    .main-navigation.active li:nth-child(5) { transition-delay: 0.2s; }

    .main-navigation a {
        display: block;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-radius: 0;
        background: none;
    }

    body.menu-open { overflow: hidden; }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.site-main { min-height: calc(100vh - 200px); padding: 2rem 0; }

.content-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    min-width: 0;
}

@media (min-width: 1024px) {
    .content-area { grid-template-columns: 1fr 300px; gap: 2.5rem; }
}

.main-content { max-width: 100%; padding: 2rem 0; min-width: 0; overflow: hidden; }
@media (min-width: 768px) { .main-content { padding: 2.5rem 0; } }

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6,
.site-title, .post-title, .post-card-title,
.featured-post-title, .page-title, .entry-title {
    font-family: var(--hp-font-heading);
    font-weight: 700;
    letter-spacing: -0.01em;
}

h1 { font-size: 2.25rem; line-height: 1.2; margin: 2rem 0 1rem; color: var(--hp-text); }
h2 { font-size: 1.75rem; line-height: 1.25; margin: 1.75rem 0 0.875rem; color: var(--hp-text); }
h3 { font-size: 1.375rem; line-height: 1.3; margin: 1.5rem 0 0.75rem; color: var(--hp-text); }
h4 { font-size: 1.125rem; line-height: 1.4; margin: 1.25rem 0 0.5rem; color: var(--hp-text); }
p { margin: 1.25rem 0; font-size: 1.0625rem; line-height: 1.8; color: var(--hp-text); }
a { color: var(--hp-primary); text-decoration: underline; font-weight: 500; transition: color var(--hp-transition); }
a:hover { color: var(--hp-primary-hover); }

/* ============================================
   SINGLE POST
   ============================================ */
.post { margin-bottom: 4rem; max-width: 780px; width: 100%; margin-left: auto; margin-right: auto; min-width: 0; }
.post-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--hp-border); }

.post-title {
    font-size: 2.25rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--hp-text);
}
.post-title a { color: var(--hp-text); text-decoration: none; }
.post-title a:hover { color: var(--hp-primary); }

.post-meta {
    color: var(--hp-text-muted);
    font-size: 0.875rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}
.post-meta a { color: inherit; text-decoration: none; font-weight: 500; }
.post-meta a:hover { color: var(--hp-primary); }

.post-content { line-height: 1.85; font-size: 1.0625rem; color: var(--hp-text); }
.post-content img { max-width: 100%; height: auto; display: block; border-radius: var(--hp-radius); }

/* Tables */
.post-content table, .entry-content table {
    width: 100%; margin: 2rem 0; border-collapse: collapse; font-size: 1rem;
    border-radius: var(--hp-radius); overflow: hidden; box-shadow: var(--hp-shadow);
}
.post-content thead, .entry-content thead { background: #f1f5f9; }
.post-content th, .entry-content th { padding: 0.875rem 1rem; text-align: left; font-weight: 600; color: var(--hp-text); border: 1px solid var(--hp-border); }
.post-content td, .entry-content td { padding: 0.75rem 1rem; border: 1px solid var(--hp-border); }
.post-content tbody tr:nth-child(even), .entry-content tbody tr:nth-child(even) { background: #f8fafc; }
.post-content tbody tr:hover, .entry-content tbody tr:hover { background: #f1f5f9; }

.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 2rem 0; border-radius: var(--hp-radius); }
.table-responsive table { margin: 0; min-width: 480px; }
.table-scroll-hint { text-align: center; font-size: 0.8125rem; color: var(--hp-text-light); padding: 0.375rem 0; display: none; }
@media (max-width: 767px) { .table-scroll-hint { display: block; } }

.post-footer { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--hp-border); }

.post-tags { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.post-tags strong { margin-right: 0.25rem; font-weight: 600; color: var(--hp-text-muted); }
.post-tags a {
    display: inline-block; padding: 0.3rem 0.875rem;
    font-size: 0.8125rem; font-weight: 500;
    color: var(--hp-primary);
    background: var(--hp-primary-light);
    border-radius: 100px;
    text-decoration: none;
    transition: all var(--hp-transition);
    border: 1px solid transparent;
}
.post-tags a:hover { background: var(--hp-primary); color: #fff; }

/* ============================================
   FEATURED POSTS GRID
   ============================================ */
@media (min-width: 768px) { .post-card[data-featured="true"] { display: none; } }

.featured-posts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    border-radius: var(--hp-radius-lg);
    overflow: hidden;
}

@media (min-width: 768px) {
    .featured-posts {
        grid-template-columns: 2fr 1fr;
        grid-template-rows: repeat(2, 1fr);
        height: 440px;
    }
}
@media (min-width: 1024px) { .featured-posts { height: 500px; } }

.featured-post { position: relative; overflow: hidden; min-height: 260px; }
@media (min-width: 768px) {
    .featured-post-large { grid-row: 1 / 3; min-height: 100%; }
    .featured-post-small { min-height: 0; }
}

.featured-post-link { display: block; width: 100%; height: 100%; text-decoration: none; color: #fff; }
.featured-post-image {
    width: 100%; height: 100%;
    background-size: cover; background-position: center;
    background-color: var(--hp-primary);
    position: relative;
    transition: transform 0.4s ease;
    will-change: transform;
}
.featured-post:hover .featured-post-image { transform: scale(1.04); }

.featured-post-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.25) 40%, rgba(0,0,0,0.75) 100%);
    z-index: 1;
}

.featured-post-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 1.25rem 1.5rem; z-index: 2; }

.featured-post-category {
    display: inline-block;
    background-color: var(--hp-primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.625rem;
    letter-spacing: 0.02em;
}

.featured-post-title {
    color: #fff;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1.0625rem;
}
@media (min-width: 768px) {
    .featured-post-large .featured-post-title { font-size: 1.5rem; }
    .featured-post-small .featured-post-title { font-size: 0.9375rem; }
    .featured-post-small .featured-post-content { padding: 1rem 1.25rem; }
}

@media (max-width: 767px) { .featured-posts { display: none !important; } .post-card[data-featured="true"] { display: flex; } }

/* ============================================
   POST CARDS GRID
   ============================================ */
.posts-grid { display: flex; flex-direction: column; gap: 0; margin-top: 1.5rem; }

.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--hp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid var(--hp-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-label::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--hp-primary);
    border-radius: 2px;
}

.post-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--hp-border);
    min-width: 0;
    transition: none;
}

a.post-card-thumbnail, .post-card-thumbnail {
    flex-shrink: 0;
    width: 260px;
    min-width: 260px;
    aspect-ratio: 4/3;
    overflow: hidden;
    background-color: var(--hp-primary);
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: var(--hp-radius);
    display: block;
    text-decoration: none;
}

@media (min-width: 1024px) {
    .home a.post-card-thumbnail, .home .post-card-thumbnail {
        width: 360px;
        min-width: 360px;
    }
    .home .post-card {
        gap: 1.75rem;
        padding-bottom: 2rem;
        margin-bottom: 2rem;
    }
    .home .post-card-title-content { font-size: 1.25rem; }
    .home .post-card-excerpt { font-size: 1rem; -webkit-line-clamp: 4; line-clamp: 4; }
    .home .post-card-category { font-size: 0.75rem; }
}

.post-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 30%, rgba(0,0,0,0.65) 100%);
    z-index: 1;
}

.post-card-title-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 1rem 1.25rem; z-index: 2; }
.post-card-title { font-weight: 700; line-height: 1.3; margin: 0; }

.post-card-title-image a, .post-card-title-image span {
    color: #fff;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9375rem;
    line-height: 1.3;
}

.post-card-title-content { font-size: 1.0625rem; }
.post-card-title-content a { color: var(--hp-text); text-decoration: none; transition: color var(--hp-transition); }
.post-card-title-content a:hover { color: var(--hp-primary); }

.post-card-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }

.post-card-category {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--hp-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
}
.post-card-category:hover { color: var(--hp-primary-hover); }

.post-card-excerpt {
    color: var(--hp-text-muted);
    font-size: 0.9375rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta { color: var(--hp-text-light); font-size: 0.8125rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.post-card-meta-sep { color: var(--hp-border); }

@media (min-width: 768px) and (max-width: 1023px) {
    .post-card-thumbnail, a.post-card-thumbnail { width: 200px; min-width: 200px; }
}

@media (max-width: 767px) {
    .post-card { flex-direction: column; gap: 0.875rem; }
    .post-card-thumbnail, a.post-card-thumbnail { width: 100% !important; min-width: 100% !important; aspect-ratio: 16/9; }
    .post-card-content { padding: 0; gap: 0.375rem; }
    .post-card-title-content { font-size: 1rem; }
    .post-card-excerpt { -webkit-line-clamp: 2; line-clamp: 2; font-size: 0.875rem; }
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar { padding: 1.5rem 0 1.5rem 1.5rem; border-left: 1px solid var(--hp-border); }

.widget { margin-bottom: 2rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--hp-border); }
.widget:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.widget-title {
    font-size: 0.8125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--hp-text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.widget-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 13px;
    background: var(--hp-primary);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Search forms */
.sidebar form[role="search"], .sidebar .search-form { display: flex; gap: 0.375rem; }
.sidebar form[role="search"] label, .sidebar .search-form label { flex: 1; min-width: 0; font-size: 0; overflow: hidden; }
.sidebar input[type="search"], .sidebar .search-field {
    width: 100%; padding: 0.5rem 0.875rem; font-size: 0.9375rem;
    border: 1px solid var(--hp-border); border-radius: 6px;
    background: var(--hp-surface); color: var(--hp-text);
    transition: border-color var(--hp-transition), box-shadow var(--hp-transition);
}
.sidebar input[type="search"]:focus, .sidebar .search-field:focus {
    outline: none; border-color: var(--hp-primary);
    box-shadow: 0 0 0 3px rgba(30,64,175,0.12);
}
.sidebar button[type="submit"], .sidebar input[type="submit"], .sidebar .search-submit {
    padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 600;
    color: #fff; background: var(--hp-primary); border: none;
    border-radius: 6px; cursor: pointer; flex-shrink: 0;
    transition: background var(--hp-transition);
}
.sidebar button[type="submit"]:hover, .sidebar .search-submit:hover { background: var(--hp-primary-hover); }

/* Block search */
.wp-block-search__label { display: none; }
.wp-block-search__inside-wrapper { display: flex; gap: 0.375rem; }
.wp-block-search__input {
    flex: 1; min-width: 0; padding: 0.5rem 0.875rem; font-size: 0.9375rem;
    border: 1px solid var(--hp-border); border-radius: 6px;
    background: var(--hp-surface); color: var(--hp-text); font-family: inherit;
}
.wp-block-search__input:focus { outline: none; border-color: var(--hp-primary); box-shadow: 0 0 0 3px rgba(30,64,175,0.12); }
.wp-block-search__button {
    padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 600;
    background: var(--hp-primary); color: #fff; border: none;
    border-radius: 6px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
    transition: background var(--hp-transition);
}
.wp-block-search__button:hover { background: var(--hp-primary-hover); }

/* Widget lists */
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { margin-bottom: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid #f1f5f9; }
.sidebar .widget li:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.sidebar .widget a {
    display: block; padding: 0.125rem 0; text-decoration: none; color: var(--hp-text);
    font-size: 0.9375rem; line-height: 1.5;
    transition: color var(--hp-transition), padding-left var(--hp-transition);
}
.sidebar .widget a:hover { color: var(--hp-primary); padding-left: 0.25rem; }

@media (max-width: 1023px) {
    .sidebar { border-left: none; border-top: 1px solid var(--hp-border); padding: 1.75rem 0 0; margin-top: 2rem; }
}
@media (max-width: 639px) {
    .sidebar { padding: 1.25rem 0 0; margin-top: 1.25rem; }
    .widget { margin-bottom: 1.25rem; padding-bottom: 1rem; }
    .sidebar form[role="search"], .sidebar .search-form, .wp-block-search__inside-wrapper { flex-direction: column; }
    .sidebar button[type="submit"], .sidebar input[type="submit"], .sidebar .search-submit, .wp-block-search__button { width: 100%; }
}

/* ============================================
   AD UNITS — PageSpeed Optimized (no CLS)
   ============================================ */

/* Reserve space to prevent CLS — core PageSpeed requirement */
.hp-ad-wrap {
    display: block;
    text-align: center;
    overflow: hidden;
    background: transparent;
    clear: both;
}

/* Leaderboard 728x90 */
.hp-ad-leaderboard { min-height: 90px; min-width: min(728px,100%); }

/* Below header ad */
.hp-ad-below-header {
    width: 100%;
    margin: 0;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--hp-border);
}

/* In-content ad */
.hp-ad-incontent {
    margin: 2rem auto;
    min-height: 250px;
    max-width: 100%;
}

/* Sidebar ad */
.hp-ad-sidebar {
    min-height: 250px;
    margin: 1rem 0;
    width: 100%;
}

/* Responsive ads */
.hp-ad-responsive {
    min-height: 100px;
    width: 100%;
    margin: 1.5rem 0;
}

/* Auto ads don't need fixed height */
.adsbygoogle { display: block; }
ins.adsbygoogle { background: transparent; }

@media (max-width: 767px) {
    .hp-ad-leaderboard { min-height: 50px; }
    .hp-ad-below-header { padding: 0.5rem 0; }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer { margin-top: 3rem; }

.footer-simple {
    width: 100%;
    padding: 1.5rem;
    text-align: center;
    border-top: none;
    background: #000000;
}

.footer-navigation { margin-bottom: 0.875rem; }
.footer-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.25rem; }
.footer-navigation li { margin: 0; }
.footer-navigation a { color: rgba(255,255,255,0.75); text-decoration: none; font-size: 0.875rem; font-weight: 500; transition: color var(--hp-transition); }
.footer-navigation a:hover { color: #ffffff; }
.footer-copyright { margin: 0; color: rgba(255,255,255,0.65); font-size: 0.8125rem; }

.footer-credit {
    margin: 0.375rem 0 0;
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
}
.footer-credit a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 600;
}
.footer-credit a:hover { color: #ffffff; }

/* ============================================
   ACCESSIBILITY
   ============================================ */
.screen-reader-text { clip: rect(1px,1px,1px,1px); clip-path: inset(50%); position: absolute !important; height: 1px; width: 1px; overflow: hidden; word-wrap: normal !important; }
.skip-link { position: absolute; top: -9999px; left: 0; z-index: 999999; padding: 0.875rem 1.25rem; background: var(--hp-text); color: #fff; border-radius: 0 0 var(--hp-radius) 0; }
.skip-link:focus { top: 0; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--hp-primary);
    outline-offset: 2px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination-wrap { margin: 3rem 0; }

.pagination, .navigation.pagination, .nav-links {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: center; gap: 0.375rem;
    margin: 2.5rem 0; padding: 0;
}

.navigation.pagination { border: none; flex-direction: column; }
.navigation.pagination .nav-links { margin: 0; padding: 0; }
.navigation.pagination h2 { position: absolute; clip: rect(1px,1px,1px,1px); overflow: hidden; }

.pagination .page-numbers, .pagination a.page-numbers,
.navigation.pagination .page-numbers, .nav-links .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2.5rem; height: 2.5rem; padding: 0 0.75rem;
    font-size: 0.9375rem; font-weight: 600;
    text-decoration: none; color: var(--hp-text-muted);
    background: var(--hp-surface); border: 1px solid var(--hp-border);
    border-radius: 6px;
    transition: all var(--hp-transition);
}

.pagination a.page-numbers:hover, .nav-links a.page-numbers:hover {
    color: #fff; background: var(--hp-primary); border-color: var(--hp-primary);
}

.pagination .page-numbers.current, .nav-links .page-numbers.current {
    color: #fff; background: var(--hp-primary); border-color: var(--hp-primary); cursor: default;
}

.pagination .page-numbers.dots, .nav-links .page-numbers.dots {
    border: none; background: transparent; color: var(--hp-text-light); min-width: auto;
}

.pagination .prev, .pagination .next, .nav-links .prev, .nav-links .next { padding: 0 1.125rem; font-weight: 600; }

/* ============================================
   POST NAVIGATION (prev/next)
   ============================================ */
.post-navigation {
    margin: 2.5rem 0;
    border-top: 1px solid var(--hp-border);
    border-bottom: 1px solid var(--hp-border);
    padding: 1.25rem 0;
}
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 1rem; margin: 0; padding: 0; }
.post-navigation .nav-previous, .post-navigation .nav-next { flex: 1; min-width: 0; }
.post-navigation .nav-next { text-align: right; }
.post-navigation .nav-subtitle { display: block; font-size: 0.6875rem; color: var(--hp-text-light); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.25rem; }
.post-navigation .nav-title { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; }
.post-navigation a { text-decoration: none; color: var(--hp-text); }
.post-navigation a:hover { color: var(--hp-primary); }

/* ============================================
   COMMENTS
   ============================================ */
.comments-area { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--hp-border); }
.comments-title { font-size: 1.25rem; margin-bottom: 1.5rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment { padding: 1.25rem 0; border-bottom: 1px solid #f1f5f9; }
.comment-list .children { list-style: none; margin-left: 2rem; padding: 0; }
.comment-author { font-weight: 600; font-size: 0.9375rem; }
.comment-metadata { font-size: 0.8125rem; color: var(--hp-text-light); margin-bottom: 0.5rem; }
.comment-metadata a { color: inherit; text-decoration: none; }
.comment-content { font-size: 1rem; line-height: 1.75; }
.comment-content p { margin: 0.5rem 0; font-size: 1rem; }
.reply a { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--hp-primary); }
.no-comments { color: var(--hp-text-muted); font-style: italic; }
.comment-author img, .comment .avatar { max-width: 40px; height: auto; border-radius: 50%; vertical-align: middle; margin-right: 0.5rem; }

.comment-respond { margin-top: 2.5rem; }
.comment-reply-title { font-size: 1.25rem; margin-bottom: 1rem; }
.comment-form label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; color: var(--hp-text); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%; padding: 0.625rem 1rem; font-size: 1rem;
    border: 1px solid var(--hp-border); border-radius: var(--hp-radius);
    background: var(--hp-surface); color: var(--hp-text); font-family: inherit;
    transition: border-color var(--hp-transition), box-shadow var(--hp-transition);
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--hp-primary); box-shadow: 0 0 0 3px rgba(30,64,175,0.12); }
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form p { margin: 0 0 1rem; }
.comment-form .form-submit input[type="submit"] {
    padding: 0.75rem 2rem; font-size: 1rem; font-weight: 600;
    color: #fff; background: var(--hp-primary); border: none;
    border-radius: var(--hp-radius); cursor: pointer;
    transition: background var(--hp-transition);
}
.comment-form .form-submit input[type="submit"]:hover { background: var(--hp-primary-hover); }

/* ============================================
   404 PAGE
   ============================================ */
.error-404 .page-content { max-width: 600px; margin: 0 auto; }
.error-404 .search-form { display: flex; gap: 0.5rem; margin: 1.5rem 0; }
.error-404 .search-form label { flex: 1; min-width: 0; font-size: 0; }
.error-404 .search-field { width: 100%; padding: 0.75rem 1rem; font-size: 1rem; border: 1px solid var(--hp-border); border-radius: var(--hp-radius); background: var(--hp-surface); color: var(--hp-text); }
.error-404 .search-field:focus { outline: none; border-color: var(--hp-primary); box-shadow: 0 0 0 3px rgba(30,64,175,0.12); }
.error-404 .search-submit { padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600; background: var(--hp-primary); color: #fff; border: none; border-radius: var(--hp-radius); cursor: pointer; transition: background var(--hp-transition); }
.error-404 .search-submit:hover { background: var(--hp-primary-hover); }

/* ============================================
   NO-POSTS / EMPTY STATE
   ============================================ */
.no-posts { padding: 3rem 1rem; text-align: center; }
.no-posts .search-form { display: flex; gap: 0.5rem; max-width: 480px; margin: 1.5rem auto 0; }
.no-posts .search-form label { flex: 1; min-width: 0; font-size: 0; }
.no-posts .search-field { width: 100%; padding: 0.75rem 1rem; font-size: 1rem; border: 1px solid var(--hp-border); border-radius: var(--hp-radius); background: var(--hp-surface); color: var(--hp-text); }
.no-posts .search-field:focus { outline: none; border-color: var(--hp-primary); }
.no-posts .search-submit { padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600; background: var(--hp-primary); color: #fff; border: none; border-radius: var(--hp-radius); cursor: pointer; transition: background var(--hp-transition); }
.no-posts .search-submit:hover { background: var(--hp-primary-hover); }

/* ============================================
   BACK TO TOP
   ============================================ */
#back-to-top.back-to-top {
    position: fixed !important;
    bottom: 1.75rem;
    right: 1.75rem;
    width: 44px;
    height: 44px;
    background: var(--hp-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(30,64,175,0.35);
    transition: background var(--hp-transition), box-shadow var(--hp-transition), transform 0.15s ease;
    z-index: 9999;
    opacity: 1 !important;
    visibility: visible !important;
    padding: 0;
    margin: 0;
}

.back-to-top:hover { background: var(--hp-primary-hover); box-shadow: 0 4px 16px rgba(30,64,175,0.45); transform: translateY(-2px); }
.back-to-top:active { transform: translateY(0) scale(0.95); }
.back-to-top svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ============================================
   POST CONTENT RICH STYLES
   ============================================ */
.post-content blockquote, .entry-content blockquote {
    border-left: 4px solid var(--hp-primary);
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    background: var(--hp-primary-light);
    border-radius: 0 var(--hp-radius) var(--hp-radius) 0;
    font-style: italic;
    color: var(--hp-text);
}
.post-content blockquote p, .entry-content blockquote p { margin: 0.5rem 0; }

.post-content pre, .entry-content pre {
    overflow-x: auto;
    max-width: 100%;
    padding: 1.25rem;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--hp-radius);
    font-size: 0.875rem;
    line-height: 1.65;
}
.post-content code, .entry-content code { font-size: 0.875em; background: #f1f5f9; padding: 0.125rem 0.375rem; border-radius: 4px; color: var(--hp-primary); }
.post-content pre code, .entry-content pre code { background: transparent; padding: 0; color: inherit; }

.post-content ul, .post-content ol, .entry-content ul, .entry-content ol { margin: 1rem 0; padding-left: 1.5rem; }
.post-content li, .entry-content li { margin-bottom: 0.375rem; line-height: 1.75; }
.post-content hr, .entry-content hr { border: none; border-top: 1px solid var(--hp-border); margin: 2rem 0; }

/* ============================================
   RESPONSIVE CONTENT / EMBEDS
   ============================================ */
.post-content *, .entry-content * { max-width: 100%; }
.table-responsive table, .table-responsive table *, .wp-block-table table, .wp-block-table table * { max-width: none; }
.post-content img, .entry-content img { max-width: 100%; height: auto; }
.post-content iframe, .post-content video, .entry-content iframe, .entry-content video { max-width: 100%; }

.wp-block-embed__wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.wp-block-embed__wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.post-content, .entry-content { overflow-wrap: break-word; word-break: break-word; min-width: 0; }
.post-content a, .entry-content a { overflow-wrap: break-word; word-break: break-word; }

@media (max-width: 767px) {
    .post-content .wp-block-columns, .entry-content .wp-block-columns { flex-direction: column !important; gap: 1rem; }
    .post-content .wp-block-column, .entry-content .wp-block-column { flex-basis: 100% !important; flex-grow: 1; }
    .post-content blockquote, .entry-content blockquote { margin: 1rem 0; padding: 0.75rem 1rem; }
    .post-content pre, .entry-content pre { font-size: 0.8125rem; padding: 0.875rem; }
    .post-navigation .nav-links { flex-direction: column; gap: 0; }
    .post-navigation .nav-next { text-align: left; }
    .comment-list .children { margin-left: 0.875rem; }
}

/* ============================================
   ENTRY TEMPLATE (fallback)
   ============================================ */
.entry-header { margin-bottom: 1.5rem; }
.entry-title { font-size: 1.375rem; line-height: 1.3; margin: 0 0 0.5rem; color: var(--hp-text); }
.entry-title a { color: var(--hp-text); text-decoration: none; }
.entry-title a:hover { color: var(--hp-primary); }
.entry-summary { font-size: 1rem; line-height: 1.75; color: var(--hp-text-muted); display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================
   PAGE TITLE / ARCHIVE HEADER
   ============================================ */
.page-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--hp-border); }
.page-title { font-size: 1.875rem; color: var(--hp-text); margin: 0 0 0.5rem; }
.archive-description { color: var(--hp-text-muted); font-size: 1rem; margin: 0; }

/* ============================================
   POST THUMBNAIL (page/single)
   ============================================ */
.post-thumbnail { margin-bottom: 1.75rem; }
.post-thumbnail img { width: 100%; height: auto; border-radius: var(--hp-radius-lg); }

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */
@media (max-width: 767px) {
    h1 { font-size: 1.625rem; }
    h2 { font-size: 1.375rem; }
    h3 { font-size: 1.175rem; }
    p { font-size: 1rem; }
    .post-title { font-size: 1.625rem; }
    .page-title { font-size: 1.375rem; }
    .site-main { padding: 1rem 0; }
    .main-content { padding: 1rem 0; }
}
@media (max-width: 479px) {
    h1 { font-size: 1.375rem; }
    h2 { font-size: 1.25rem; }
    .post-title { font-size: 1.375rem; }
    .no-posts .search-form { flex-direction: column; }
}
@media (max-width: 380px) {
    h1 { font-size: 1.25rem; }
    h2 { font-size: 1.125rem; }
    .post-title { font-size: 1.25rem; }
    .site-header { min-height: 55px; }
}

/* ============================================
   ADMIN BAR FIX
   ============================================ */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

/* ============================================
   SAFE AREA (NOTCH DEVICES)
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
    .site-footer .footer-simple { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
    @media (max-width: 767px) { .main-navigation { padding-bottom: env(safe-area-inset-bottom); } }
    #back-to-top.back-to-top { bottom: calc(1.75rem + env(safe-area-inset-bottom)); right: calc(1.75rem + env(safe-area-inset-right)); }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .site-header, .site-footer, .sidebar, .menu-toggle, .menu-overlay,
    .post-navigation, .pagination-wrap, .comments-area .comment-respond,
    .skip-link, #back-to-top, .hp-ad-wrap { display: none !important; }
    .content-area { grid-template-columns: 1fr; }
    body { font-size: 12pt; color: #000; background: #fff; }
    a { color: #000; }
    .post-content img { max-width: 100%; }
}

/* ============================================
   WP ADMIN PASSWORD VISIBILITY FIX
   ============================================ */
/* Ensures the wp-admin login password field toggle works */
.wp-pwd button.button { display: inline-flex !important; }
#wpadminbar { display: block !important; }
