/*
Theme Name: CelebsWiki 22
Theme URI: https://celebswiki.info
Author: Your Name
Author URI: https://celebswiki.info
Description: A modern, mobile-optimized theme for a celebrity information website.
Version: 1.7.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, two-columns, right-sidebar, custom-menu, custom-logo, post-formats, sticky-post, translation-ready
Text Domain: celebswiki.info
*/

/* --- CSS Variables & Global Styles --- */
:root {
    --primary-color: #007bff;
    --dark-text: #333;
    --light-text: #555;
    --meta-text: #888;
    --background-light: #f8f9fa;
    --background-white: #fff;
    --border-color: #eee;
    --border-color-dark: #ccc;
    --shadow-color: rgba(0,0,0,0.05);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --spacing-small: 10px;
    --spacing-medium: 15px;
    --spacing-large: 20px;
}

html, body {
    overflow-x: hidden;
    overflow-x: clip;
    scroll-behavior: smooth;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
  }

img, video, table {
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
    object-fit: contain;
}

.site,
#page,
.site-content {
  max-width: 100vw;
  overflow-x: clip;
}

body {
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    background: var(--background-light);
    color: var(--dark-text);
    line-height: 1.7;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-large);
    background: var(--background-white);
    box-shadow: 0 0 10px var(--shadow-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Accessibility Improvement for Keyboard Navigation */
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Hide site title if a custom logo is set */
body.has-custom-logo .site-branding .site-title, .site-title {
    display: none;
}

/* --- Header --- */
.site-header {
    padding: var(--spacing-medium) 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.site-branding {
    flex-shrink: 0;
}

.site-branding .site-title a {
    font-size: 2.5em;
    font-weight: bold;
    color: #000;
    text-decoration: none;
}

.site-branding .custom-logo-link img {
    max-height: 40px;
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-large);
    margin-left: auto;
}

.search-form {
    position: relative;
}

.search-form .search-field {
    padding: 8px 30px 8px var(--spacing-small);
    border: 1px solid var(--border-color-dark);
    border-radius: 4px;
    min-width: 220px;
}

.search-form .search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--dark-text);
    color: var(--background-white);
    border: none;
    padding: 5px 8px;
    cursor: pointer;
    border-radius: 4px;
}

/* --- Navigation & Breadcrumbs --- */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    
}

.main-navigation ul li {
    margin-right: var(--spacing-large);
     box-shadow: 0 2px 50px rgba(0, 0, 0, 0.15);
}

.main-navigation ul li a {
    text-decoration: none;
    color: var(--light-text);
    font-weight: bold;
    padding: 5px 0;
    position: relative;
    transition: color 0.2s ease-in-out;
}

.main-navigation ul li a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-color);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.main-navigation ul li a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.main-navigation ul li.current-menu-item a,
.main-navigation ul li a:hover {
    color: var(--primary-color);
    text-decoration: none;
}


/* --- Main Content --- */
.site-content {
    display: flex;
    margin-top: var(--spacing-large);
    flex-wrap: nowrap;
    gap: var(--spacing-large);
}

.content-area {
    flex: 1 1 65%; /* More explicit flex sizing */
    min-width: 0; /* Prevents overflow in flex containers */
}

/* --- Post Listings --- */
.post-entry {
    border: 1px solid #e0e0e0;
    margin-bottom: 25px;
    padding: var(--spacing-large);
    display: flex;
    align-items: flex-start;
    border-radius: 5px;
    gap: var(--spacing-large);
}

.post-thumbnail {
    flex: 0 0 150px;
}

.post-thumbnail img {
    border-radius: 5px;
}

.entry-content-wrap {
    flex: 1;
    min-width: 0;
}

.entry-title {
    margin: 0 0 var(--spacing-small);
    font-size: 1.5em;
    line-height: 1.3;
}

.entry-title a {
    color: var(--dark-text);
}

.entry-title a:hover {
    color: var(--primary-color);
}

.entry-meta {
    font-size: 0.8em;
    color: var(--meta-text);
    margin-bottom: var(--spacing-medium);
}

.entry-meta a.post-category {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
    color: var(--light-text);
    text-transform: uppercase;
    font-size: 0.7em;
    font-weight: bold;
}

.entry-summary {
    font-size: 0.9em;
    line-height: 1.6;
}

.read-more-link {
    display: inline-block;
    margin-top: var(--spacing-medium);
    border: 1px solid var(--border-color-dark);
    padding: 8px var(--spacing-medium);
    color: var(--dark-text);
    font-weight: bold;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
}

.read-more-link:hover {
    background: #f0f0f0;
}

/* --- Single Post --- */
.single .post-entry {
    border: none;
    padding: 0;
    display: block;
}

.single .entry-title {
    font-size: 2em;
}

.single .entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-medium);
    font-size: 0.9em;
    color: #666;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-small) 0;
    margin-bottom: var(--spacing-large);
}

.updated-date, .published-date {
    font-weight: normal;
}

.meta-separator {
    color: var(--border-color-dark);
}

.single .entry-content p {
    font-size: 1.05em;
}

/* featured image handled by .post-featured-image */


/* --- Sidebar --- */
.widget-area {
    flex: 1 1 300px;
    min-width: 250px;
    max-width: 400px;
}

.widget {
    margin-bottom: 25px;
}

.widget-title {
    font-size: 1.2em;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: var(--spacing-small);
    margin-bottom: var(--spacing-medium);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    margin-bottom: var(--spacing-medium);
    display: flex;
    align-items: flex-start;
}

.widget ul li img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    margin-right: var(--spacing-small);
    border-radius: 3px;
}

.widget ul li a {
    color: var(--dark-text);
    font-weight: bold;
}

.widget ul li .post-meta {
    font-size: 0.8em;
    color: var(--meta-text);
}

/* --- Related Posts --- */
.related-posts-container {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border-color);
}

.related-posts-title {
    font-size: 1.5em;
    margin: 0 0 var(--spacing-large) 0;
}

/* Grid layout */
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-large);
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-post-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Thumbnail */
.related-post-thumbnail img {
    width: 100%;
    aspect-ratio: 1 / 1; /* keeps images square */
    object-fit: cover;
    border-radius: 5px;
    margin: 0 0 var(--spacing-small) 0;
    transition: transform 0.3s ease-in-out;
}

.related-post-thumbnail img:hover {
    transform: scale(1.03);
}

/* Title */
.related-post-title {
    font-size: 0.9em;
    line-height: 1.4;
    font-weight: bold;
    color: #000; /* always black */
    text-decoration: none;
    margin: 0;
    padding: 0;
    display: inline-block;
}

.related-post-title h4 {
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit; /* inherit black */
}


/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
    padding-top: var(--spacing-large);
    color: var(--light-text);
}

.footer-widgets-wrapper {
    padding: var(--spacing-large) 0;
    border-bottom: 1px solid var(--border-color);
}

.footer-widgets-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

.footer-widget-area, .footer-navigation {
    flex: 1;
    min-width: 250px;
}

.footer-navigation .widget-title {
    font-size: 1.2em;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: var(--spacing-small);
    margin-bottom: var(--spacing-medium);
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-medium);
}

.footer-menu li {
    margin-bottom: 0;
}

.footer-menu a {
    color: var(--light-text);
}

.site-info {
    text-align: center;
    padding: var(--spacing-large) 0;
    font-size: 0.9em;
}

/* #to-top-button styles → see bottom of stylesheet */


/* --- Responsive --- */

/* Mobile Navigation Toggle */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color-dark);
    border-radius: 4px;
    padding: 8px var(--spacing-small);
    cursor: pointer;
}

.menu-toggle .hamburger-icon {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--dark-text);
    position: relative;
}

.menu-toggle .hamburger-icon::before,
.menu-toggle .hamburger-icon::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: var(--dark-text);
    position: absolute;
    left: 0;
    transition: all 0.2s ease-in-out;
}

.menu-toggle .hamburger-icon::before { top: -6px; }
.menu-toggle .hamburger-icon::after { bottom: -6px; }

.main-navigation-mobile-container {
    display: none; 
}

/* Styles for very large screens */
/* Styles for very large screens */
@media (min-width: 1280px) {
  #content {
      font-size: 1.1em; /* Increase base font size slightly for readability */
  }
}

@media (max-width: 900px) {
    .menu-toggle {
        display: block;
    }

    .header-right {
        display: none;
    }

    .main-navigation-mobile-container {
        width: 100%;
        order: 3;
        margin-top: var(--spacing-medium);
        border-top: 1px solid var(--border-color);
        padding-top: var(--spacing-medium);
    }

    .main-navigation-mobile-container.toggled {
        display: block;
    }

    .site-header {
        flex-wrap: wrap;
    }

    .main-navigation-mobile-container .main-navigation ul {
        flex-direction: column;
    }

    .main-navigation-mobile-container .main-navigation ul li {
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
    }

     .main-navigation-mobile-container .main-navigation ul li a {
        display: block;
        padding: var(--spacing-small) 5px;
     }

     .main-navigation-mobile-container .search-form {
         margin-top: var(--spacing-medium);
     }

     .main-navigation-mobile-container .search-field {
         width: 100%;
         box-sizing: border-box;
     }
}

@media (max-width: 768px) {
    .site-content {
        flex-direction: column;
    }
    
    .content-area {
        margin-right: 0; /* No longer needed with gap */
    }

    .widget-area {
        margin-top: var(--spacing-large);
    }

    .post-thumbnail {
        flex: 0 0 100px;
    }

    .entry-summary {
        display: none; /* Hide excerpt on tablet and smaller */
    }

    table, th, td {
        border-collapse: collapse;
	    font-size: 14px;
        width: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--spacing-small);
    }

    .entry-title {
        font-size: 1.3em;
    }

    .single .entry-title {
        font-size: 1.7em;
    }

    .post-thumbnail {
        flex: 0 0 80px;
    }

    .post-entry {
        padding: var(--spacing-medium);
    }

    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-medium);
    }
}

/* --- Pagination Styles --- */
.navigation li {
    display: inline;
}
  
.navigation li a,
.navigation li a:hover,
.navigation li.active a,
.navigation li.disabled {
    color: var(--background-white);
    text-decoration:none;
    background-color: #6FB7E9;
    border-radius: 3px;
    cursor: pointer;
    padding: 0.75rem;
}
  
.navigation li a:hover,
.navigation li.active a {
    background-color: #3C8DC5;
}


/* ============================================================
   FEATURED IMAGE (v1.5.0)
   — Displays at natural size, never upscaled
   — On mobile: fills column width but capped at 70vw height
   ============================================================ */

.post-featured-image {
    display: block;
    margin: 0 0 1.75rem;
    line-height: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.13);
}

.post-featured-image img {
    display: block;
    /* Never stretch beyond natural pixel size */
    width: auto;
    max-width: 100%;
    height: auto;
}

/* Mobile: fill the column, cap height so it doesn't overwhelm screen */
@media (max-width: 640px) {
    .post-featured-image img {
        width: 100%;
        max-height: 68vw;
        object-fit: cover;
        object-position: top center;
    }
}

/* When injected after paragraph */
.entry-content .post-featured-image {
    margin: 1.5rem 0 1.75rem;
}

/* ============================================================
   SEO / UX — CONTENT READABILITY
   ============================================================ */

/* Wider readable line length + better leading */
.single .entry-content {
    max-width: 740px;
}

.single .entry-content p,
.single .entry-content li {
    font-size: 1.06em;
    line-height: 1.82;
    color: #2d2d2d;
}

.single .entry-content h2,
.single .entry-content h3,
.single .entry-content h4 {
    margin-top: 2rem;
    margin-bottom: 0.6rem;
    line-height: 1.3;
    color: #111;
}

.single .entry-content h2 { font-size: 1.55em; }
.single .entry-content h3 { font-size: 1.3em; }
.single .entry-content h4 { font-size: 1.1em; }

/* Blockquotes */
.single .entry-content blockquote {
    border-left: 4px solid var(--primary-color);
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: #f0f7ff;
    border-radius: 0 4px 4px 0;
    font-style: italic;
    color: var(--light-text);
}

/* Inline code */
.single .entry-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* ============================================================
   BREADCRUMBS — Refined
   ============================================================ */

.breadcrumb {
    padding: 10px 0;
    font-size: 0.82em;
    color: #888;
    border-bottom: 1px solid var(--border-color);
    word-break: break-word;
    /* Truncate very long breadcrumbs gracefully */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .breadcrumb {
        white-space: normal;
    }
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #999;
    font-weight: 500;
}

/* Rank Math override — let RM style its own inner markup */
.breadcrumb.rank-math-breadcrumb {
    overflow: visible;
    white-space: normal;
}

/* ============================================================
   SHARE BUTTONS — Refined
   ============================================================ */

.share-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.sbtn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #fff !important;
    text-decoration: none !important;
    transition: opacity 0.18s ease, transform 0.15s ease;
    border: none;
    cursor: pointer;
    line-height: 1.4;
}
.sbtn:hover {
    opacity: 0.82;
    transform: translateY(-1px);
    text-decoration: none !important;
}

.sbtn.fb  { background: #1877f2; }
.sbtn.x   { background: #000;    }
.sbtn.pin { background: #e60023; }

.native-btn {
    background: #555;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1em;
    display: none; /* shown by JS only when Web Share API is available */
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
}
.native-btn:hover { background: #333; }

/* ============================================================
   AUTHOR BOX — Polished
   ============================================================ */

.author-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, #f9fafb 0%, #f0f4ff 100%);
    border: 1px solid #dce3f0;
    padding: 20px;
    margin-top: 2.5rem;
    border-radius: 10px;
}

.author-avatar img {
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    flex-shrink: 0;
}

.author-info { flex: 1; min-width: 0; }

.author-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.author-name {
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
}
.author-name a { color: #111; text-decoration: none; }
.author-name a:hover { color: var(--primary-color); }

.author-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.author-links a {
    font-size: 0.78em;
    font-weight: 600;
    color: #fff;
    background: var(--primary-color);
    padding: 3px 9px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.15s;
}
.author-links a:hover { background: #0056b3; text-decoration: none; }

.author-bio {
    margin: 0;
    font-size: 0.9em;
    color: #555;
    line-height: 1.6;
}

/* ============================================================
   ENTRY META — Tighter + cleaner
   ============================================================ */

.single .entry-meta {
    font-size: 0.85em;
    color: #777;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.updated-date  { color: #e07b00; font-weight: 600; }
.published-date { color: #555; }
.meta-separator { color: #ddd; }

/* ============================================================
   SINGLE POST TITLE
   ============================================================ */

.single .entry-title {
    font-size: 2em;
    line-height: 1.25;
    margin-bottom: 0.4rem;
    letter-spacing: -0.3px;
}

@media (max-width: 600px) {
    .single .entry-title { font-size: 1.5em; }
}

/* ============================================================
   RELATED POSTS — Tighter grid on mobile
   ============================================================ */

.related-posts-container {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.related-posts-title {
    font-size: 1.35em;
    margin: 0 0 1rem;
    color: #111;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 480px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.related-post-item {
    display: flex;
    flex-direction: column;
}

.related-post-thumbnail img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 7px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: block;
}
.related-post-thumbnail:hover img {
    transform: scale(1.04);
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.related-post-title {
    font-size: 0.85em;
    line-height: 1.35;
    font-weight: 700;
    color: #111;
    text-decoration: none;
}
.related-post-title:hover { color: var(--primary-color); text-decoration: none; }
.related-post-title h4 {
    margin: 0; padding: 0;
    font-size: inherit; font-weight: inherit;
    line-height: inherit; color: inherit;
}

/* ============================================================
   SCROLL TO TOP — More visible
   ============================================================ */

#to-top-button {
    position: fixed;
    bottom: 20px;
    right: 20px;   /* right side is more conventional */
    left: auto;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    font-size: 1.5em;
    line-height: 1;
    z-index: 200;
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
    transition: background 0.18s, transform 0.15s;
}
#to-top-button:hover {
    background: #0056b3;
    transform: translateY(-2px);
}


/* ============================================================
   TABLE OF CONTENTS (v1.5.0)
   ============================================================ */

.cw-toc {
    background: #f8f9ff;
    border: 1px solid #dce3f5;
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
    padding: 16px 20px;
    margin: 1.5rem 0 1.75rem;
    font-size: 0.92em;
}

.cw-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.cw-toc-title {
    font-weight: 700;
    font-size: 1em;
    color: #111;
    letter-spacing: 0.2px;
}

.cw-toc-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8em;
    color: #888;
    padding: 2px 6px;
    border-radius: 3px;
    transition: color 0.15s, transform 0.2s;
}
.cw-toc-toggle:hover { color: var(--primary-color); }
.cw-toc-toggle.collapsed { transform: rotate(180deg); }

.cw-toc-list {
    margin: 0;
    padding-left: 1.2em;
    line-height: 1.7;
}
.cw-toc-list.hidden { display: none; }

.cw-toc-list li a {
    color: var(--primary-color);
    text-decoration: none;
    display: inline-block;
}
.cw-toc-list li a:hover {
    text-decoration: underline;
}
.cw-toc-list li.cw-toc-sub {
    margin-left: 1.2em;
    list-style-type: disc;
    font-size: 0.93em;
    color: #555;
}

/* ============================================================
   DATE <time> element
   ============================================================ */

time.updated-date  { color: #e07b00; font-weight: 600; font-size: 0.85em; }
time.published-date { color: #555; font-size: 0.85em; }
time.post-date { color: var(--meta-text); font-size: 0.85em; }


/* ============================================================
   PAGE TEMPLATE (content-page.php)
   ============================================================ */

.single-page-thumb {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
}
.single-page-thumb-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* ============================================================
   404 PAGE
   ============================================================ */

.error-404 {
    padding: 3rem 0;
    text-align: center;
}
.error-404 .page-title {
    font-size: 2em;
    margin-bottom: 1rem;
}
.error-404 .search-form {
    max-width: 480px;
    margin: 1.5rem auto 0;
    display: flex;
    gap: 8px;
}
.error-404 .search-field {
    flex: 1;
    min-width: 0;
}

/* ============================================================
   ARCHIVE / SEARCH PAGE HEADERS
   ============================================================ */

.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}
.page-title {
    font-size: 1.6em;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}
.archive-description {
    color: var(--light-text);
    font-size: 0.95em;
    margin: 0;
}
.search-no-results .page-title {
    font-size: 1.4em;
}

/* ============================================================
   ACCESSIBILITY — focus styles
   ============================================================ */

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

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

@media print {
    .site-header, .widget-area, .related-posts-container,
    .author-box .author-links, .share-links, #to-top-button,
    .main-navigation-mobile-container { display: none !important; }
    body { font-size: 12pt; color: #000; background: #fff; }
    a { color: #000; text-decoration: underline; }
    .post-featured-image img { max-height: 300px; }
}


/* ============================================================
   COMMENTS (v1.6.0) — Toggle-button pattern, no Website field
   ============================================================ */

.comments-area {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.comments-title {
    font-size: 1.25em;
    font-weight: 700;
    margin: 0 0 1.25rem;
    color: #111;
}

.comments-count {
    color: var(--primary-color);
}

/* Comment list */
.comment-list {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
}

.comment-list li {
    margin-bottom: 16px;
}

.comment-list .comment-body {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fafbff;
}

.comment-list .comment-author {
    font-weight: 700;
    font-size: 0.92em;
    color: #111;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-list .comment-author img {
    border-radius: 50%;
}

.comment-list .comment-metadata {
    font-size: 0.78em;
    color: var(--meta-text);
    margin-bottom: 8px;
}

.comment-list .comment-content p {
    margin: 0 0 8px;
    font-size: 0.93em;
    line-height: 1.7;
    color: #333;
}

.comment-list .reply {
    margin-top: 6px;
}

.comment-reply-link {
    font-size: 0.78em;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    transition: background 0.15s, color 0.15s;
}

.comment-reply-link:hover {
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

/* Children / nested comments */
.comment-list .children {
    list-style: none;
    padding-left: 20px;
    margin-top: 12px;
    border-left: 3px solid var(--border-color);
}

/* Comments navigation */
.comments-navigation {
    margin: 1rem 0;
    font-size: 0.9em;
}

/* ── Toggle button ── */
.comment-respond-wrapper {
    margin-top: 1.5rem;
}

.cw-comment-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 11px 22px;
    font-size: 0.95em;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.18s, transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0,123,255,0.25);
    letter-spacing: 0.2px;
}

.cw-comment-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,123,255,0.3);
}

.cw-comment-btn.active {
    background: #0056b3;
}

.cw-comment-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.cw-comment-btn.active svg {
    transform: scale(-1, -1);
}

/* ── Revealed comment form ── */
.cw-comment-form-wrap {
    margin-top: 1.25rem;
    padding: 22px 24px;
    background: #f8f9ff;
    border: 1px solid #dce3f5;
    border-radius: 10px;
    animation: cw-slide-in 0.22s ease;
}

@keyframes cw-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cw-comment-form-wrap .comment-reply-title {
    font-size: 1.1em;
    font-weight: 700;
    margin: 0 0 1rem;
    color: #111;
}

/* Field layout */
.cw-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 540px) {
    .cw-field-row { grid-template-columns: 1fr; }
}

.comment-form-author,
.comment-form-email,
.comment-form-comment {
    margin: 0 0 12px;
}

.comment-form label {
    display: block;
    font-size: 0.82em;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #cdd5e0;
    border-radius: 6px;
    font-size: 0.93em;
    font-family: inherit;
    color: #111;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.12);
    outline: none;
}

.comment-form textarea {
    resize: vertical;
    min-height: 110px;
}

.cw-submit-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 28px;
    font-size: 0.95em;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.18s, transform 0.15s;
    letter-spacing: 0.3px;
    margin-top: 4px;
}

.cw-submit-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.comment-form .required {
    color: #e53935;
}

.no-comments {
    color: var(--meta-text);
    font-size: 0.9em;
    margin-top: 1rem;
}

/* ============================================================
   SHARE BUTTONS — full refresh
   ============================================================ */

.share-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: 0;
}

.sbtn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #fff !important;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.5;
    transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.sbtn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    text-decoration: none !important;
}

.sbtn.fb  { background: #1877f2; }
.sbtn.x   { background: #000;    }
.sbtn.pin { background: #e60023; }

.native-btn {
    background: #555;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 0.9em;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
    line-height: 1;
}

.native-btn:hover { background: #333; }



/* ============================================================
   CATEGORY BADGE — Post listing cards
   ============================================================ */

.entry-category-badge {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 9px;
    border-radius: 3px;
    margin-bottom: 6px;
    text-decoration: none;
    transition: background 0.15s;
}
.entry-category-badge:hover {
    background: #0056b3;
    text-decoration: none;
    color: #fff;
}

/* ============================================================
   FRESHNESS BADGE — "Updated 2 days ago"
   ============================================================ */

.freshness-badge {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    font-size: 0.72em;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
}

/* ============================================================
   POST TAGS — Single post footer
   ============================================================ */

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 1.5rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.post-tag {
    display: inline-block;
    background: var(--background-light);
    color: var(--light-text);
    border: 1px solid var(--border-color-dark);
    font-size: 0.78em;
    font-weight: 600;
    padding: 3px 11px;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.post-tag:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    text-decoration: none;
}

/* ============================================================
   PREV / NEXT POST NAVIGATION
   ============================================================ */

.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 2rem 0 0;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

@media (max-width: 540px) {
    .post-navigation { grid-template-columns: 1fr; }
}

.post-nav-prev,
.post-nav-next {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    gap: 4px;
    overflow: hidden;
}
.post-nav-prev:hover,
.post-nav-next:hover {
    background: #e8f0fe;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    text-decoration: none;
}

.post-nav-next {
    text-align: right;
    grid-column: 2;
}
@media (max-width: 540px) {
    .post-nav-next { grid-column: 1; text-align: left; }
}

.post-nav-label {
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-color);
}

.post-nav-title {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--dark-text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   SEARCH RESULTS COUNT
   ============================================================ */

.search-count {
    font-size: 0.9em;
    color: var(--light-text);
    margin: 0 0 1.5rem;
}

/* ============================================================
   CATEGORY ARCHIVE PAGE
   ============================================================ */

.category-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.category-count {
    font-size: 0.85em;
    color: var(--meta-text);
    margin: 0.4rem 0 0;
}

/* ============================================================
   EXCERPT — Better "Read More" link in listings
   ============================================================ */

.entry-summary p {
    margin: 0;
}

/* The read-more from excerpt_more filter blends with summary */
.entry-summary .read-more-link {
    display: inline;
    font-size: 0.85em;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
}
.entry-summary .read-more-link:hover {
    text-decoration: underline;
}

/* ============================================================
   WIDE BLOCKS (Gutenberg align-wide support)
   ============================================================ */

.alignwide {
    margin-left:  calc(-1 * var(--spacing-large));
    margin-right: calc(-1 * var(--spacing-large));
    max-width: calc(100% + 2 * var(--spacing-large));
}

.alignfull {
    margin-left:  -24px;
    margin-right: -24px;
    max-width: calc(100% + 48px);
}

@media (max-width: 600px) {
    .alignwide, .alignfull {
        margin-left:  calc(-1 * var(--spacing-small));
        margin-right: calc(-1 * var(--spacing-small));
    }
}

/* Responsive embeds (videos, iframes) */
.wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}
.wp-block-embed__wrapper iframe,
.wp-block-embed__wrapper embed,
.wp-block-embed__wrapper object {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* ============================================================
   HONEYPOT — hidden spam trap (must be invisible)
   ============================================================ */

.cw-hp-wrap {
    display: none !important;
    visibility: hidden;
    position: absolute;
    left: -9999px;
}
