/* ==========================================================================
   Shin Hiyorin Theme - 9to5Mac Style Modern Tech Blog Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Variables & Reset
   -------------------------------------------------------------------------- */
:root {
    --bg-black: #000000;
    --bg-dark: #090b10;
    --bg-body: #0d1117;
    --bg-card: #161b22;
    --bg-card-hover: #1c2128;
    --bg-nav: #0e2038;
    --bg-nav-hover: #173254;
    --bg-input: #0d1117;

    --border-color: #21262d;
    --border-light: #30363d;
    --border-cyan: #00d2ff;

    --text-primary: #f0f6fc;
    --text-secondary: #c9d1d9;
    --text-muted: #8b949e;
    --text-link: #58a6ff;
    --text-link-hover: #79c0ff;

    --accent-blue: #0071e3;
    --accent-cyan: #00d2ff;
    --accent-cyan-glow: rgba(0, 210, 255, 0.35);
    --accent-badge: #1f6feb;

    --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
    --font-mono: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

    --container-width: 1280px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-black);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
    color: var(--text-link);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --------------------------------------------------------------------------
   2. Header & Navigation (9to5Mac 2-Tier Style)
   -------------------------------------------------------------------------- */
.site-header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

/* Tier 1: Main Brand Bar */
.header-main-bar {
    background-color: var(--bg-black);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-branding {
    flex: 1;
    min-width: 0;
}

/* Brand Logo */
.custom-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    line-height: 1.25;
}

.brand-badge {
    background: linear-gradient(135deg, #0071e3, #00d2ff);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.brand-title {
    font-weight: 800;
    color: #ffffff;
    word-break: break-word;
}

.brand-title-wrap {
    display: inline-block;
}

.brand-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-cyan);
    flex-shrink: 0;
}

/* Header Utilities & Flat 9to5Mac Action Icons */
.header-utilities {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Force flat, clean transparent action buttons (overriding core/plugin CSS) */
.header-utilities .header-action-btn,
.header-utilities button,
.header-action-btn {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    color: #f0f6fc !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.header-utilities .header-action-btn:hover,
.header-utilities button:hover,
.header-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: var(--accent-cyan) !important;
    transform: translateY(-1px);
}

.header-utilities .header-action-btn:active,
.header-utilities button:active,
.header-action-btn:active {
    background-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(0);
}

.header-utilities svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    stroke: currentColor !important;
    fill: none !important;
}

.mobile-sidebar-trigger {
    display: none; /* Shown on tablet / mobile */
}

.menu-toggle {
    display: none;
}

/* Tier 2: Slate Blue Sub Navigation */
.header-nav-bar {
    background-color: var(--bg-nav);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px 0;
    scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-menu li a {
    display: block;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item > a {
    background-color: var(--bg-nav-hover);
    color: var(--accent-cyan);
}

/* --------------------------------------------------------------------------
   3. 9to5Mac Featured Hero Section
   -------------------------------------------------------------------------- */
.shin-featured-hero {
    background-color: var(--bg-black);
    padding: 24px 0 36px;
    border-bottom: 1px solid var(--border-color);
}

.featured-container {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 36px;
    align-items: start;
}

/* Main Featured Card (Left) */
.featured-main-card {
    display: flex;
    flex-direction: column;
}

.featured-image-wrap {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: #000;
    display: block;
    aspect-ratio: 16 / 9;
    border: 2px solid var(--border-cyan);
    box-shadow: 0 0 20px var(--accent-cyan-glow);
    transition: var(--transition);
}

.featured-image-wrap:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.55);
}

.featured-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.featured-image-wrap:hover .featured-hero-img {
    transform: scale(1.03);
}

.featured-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #111827, #1f2937);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: 700;
}

.featured-main-body {
    padding-top: 16px;
}

.featured-main-title {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin: 8px 0 12px;
}

.featured-main-title a {
    color: #ffffff;
}

.featured-main-title a:hover {
    color: var(--accent-cyan);
}

/* Sub Featured Column (Right) */
.featured-sub-col {
    display: flex;
    flex-direction: column;
}

.featured-header-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.featured-section-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin: 0;
}

.featured-accent-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, #0071e3, transparent);
}

.featured-sub-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.featured-sub-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
}

.featured-sub-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sub-item-thumb-link {
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sub-item-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sub-item-thumb-link:hover .sub-item-thumb {
    transform: scale(1.05);
}

.sub-item-placeholder {
    width: 100%;
    height: 100%;
    background: #1e293b;
}

.sub-item-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 6px;
}

.sub-item-title a {
    color: #ffffff;
}

.sub-item-title a:hover {
    color: var(--accent-cyan);
}

/* Category Badges */
.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.cat-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-cyan);
    transition: var(--transition);
}

.cat-pill:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Post Meta Line */
.post-meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.meta-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-weight: 600;
}

.author-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.meta-sep {
    opacity: 0.4;
}

.meta-date {
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   4. Main Content Layout & Timeline Feed
   -------------------------------------------------------------------------- */
.main-layout-container {
    padding-top: 36px;
    padding-bottom: 60px;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
}

.section-header-block {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.section-main-heading {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
}

.section-heading-line {
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

/* Timeline Posts Grid */
.posts-timeline-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.timeline-post-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
}

.timeline-post-card:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card-thumb-link {
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: var(--bg-dark);
}

.card-thumb-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card-thumb-link:hover .card-thumb-image {
    transform: scale(1.04);
}

.card-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.card-content-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 6px 0 10px;
}

.card-title a {
    color: #ffffff;
}

.card-title a:hover {
    color: var(--accent-cyan);
}

.card-excerpt {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   5. Single Article Page Styles
   -------------------------------------------------------------------------- */
.single-article-entry {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px;
    margin-bottom: 40px;
}

.single-article-header {
    margin-bottom: 24px;
}

.single-article-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.28;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin: 12px 0 16px;
}

.single-featured-image-wrap {
    margin: 24px 0 30px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.single-hero-img {
    width: 100%;
    height: auto;
}

/* Article Body Typography */
.entry-content {
    font-size: 1.06rem;
    line-height: 1.85;
    color: var(--text-secondary);
}

.entry-content p {
    margin-bottom: 1.6em;
}

.entry-content h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: #ffffff;
    margin: 2em 0 0.8em;
    padding-bottom: 0.4em;
    border-bottom: 2px solid var(--border-color);
}

.entry-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 1.8em 0 0.6em;
}

.entry-content blockquote {
    margin: 1.8em 0;
    padding: 16px 24px;
    background-color: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--accent-cyan);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: #e2e8f0;
}

.entry-content pre, .entry-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.entry-content pre {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    overflow-x: auto;
    margin: 1.8em 0;
}

.entry-content p code {
    background-color: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-cyan);
}

/* Share Box */
.shin-share-box {
    margin: 28px 0;
    padding: 18px 24px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.share-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-x { background-color: #000000; border: 1px solid #333; }
.btn-facebook { background-color: #1877f2; }
.btn-hatena { background-color: #00a4de; }
.btn-pocket { background-color: #ee4056; }
.btn-copy { background-color: #24292f; border: 1px solid var(--border-color); }

.btn-share:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Author Profile Box */
.author-bio-card {
    display: flex;
    gap: 20px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin: 36px 0;
    align-items: center;
}

.author-bio-avatar img {
    border-radius: 50%;
}

.author-bio-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.author-bio-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Post Navigation (Prev / Next) */
.single-post-navigation {
    margin: 36px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
}

.single-post-navigation .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.nav-subtitle {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.nav-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-title:hover {
    color: var(--accent-cyan);
}

.nav-next {
    text-align: right;
}

/* Related Posts */
.related-posts-section {
    margin: 40px 0;
}

.related-heading {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: #ffffff;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.related-card {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.related-thumb-link {
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.related-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 6px;
}

.related-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   6. Comments & Forms
   -------------------------------------------------------------------------- */
.comments-area {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.comments-title, .comment-reply-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: #ffffff;
}

.comment-list {
    margin-bottom: 30px;
}

.comment-list .comment {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.comment-body .comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-author .fn {
    font-weight: 700;
    color: #ffffff;
}

.comment-metadata a {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan-glow);
}

.btn-comment-submit {
    background: linear-gradient(135deg, #0071e3, #00d2ff);
    color: #ffffff;
    font-weight: 700;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-comment-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   7. Sidebar & Widgets
   -------------------------------------------------------------------------- */
.main-sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.widget-title span {
    position: relative;
}

.widget-title span::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-cyan);
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.9rem;
}

.widget ul li:last-child {
    border-bottom: none;
}

.sidebar-post-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar-post-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
    align-items: center;
    border: none !important;
    padding: 0 !important;
}

.sidebar-post-thumb-link {
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--bg-dark);
}

.sidebar-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-post-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
}

.sidebar-post-title a {
    color: var(--text-primary);
}

.sidebar-post-title a:hover {
    color: var(--accent-cyan);
}

.sidebar-post-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   8. Mobile Slide-In Sidebar & Drawers
   -------------------------------------------------------------------------- */
.mobile-sidebar-drawer {
    position: fixed;
    top: 0;
    right: -360px;
    width: 340px;
    max-width: 85vw;
    height: 100vh;
    background-color: var(--bg-card);
    border-left: 1px solid var(--border-color);
    z-index: 2000;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.8);
    overflow-y: auto;
}

.mobile-sidebar-drawer.is-active {
    right: 0;
}

.drawer-inner {
    padding: 24px;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.drawer-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
}

.drawer-close {
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    font-size: 2rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 !important;
}

.drawer-close:hover {
    color: #ffffff !important;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 3000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.search-modal.is-active {
    opacity: 1;
    visibility: visible;
}

.search-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.search-modal-dialog {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

.search-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    font-size: 1.8rem !important;
    cursor: pointer !important;
}

.search-modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: #ffffff;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 16px;
}

.search-input-wrap:focus-within {
    border-color: var(--accent-cyan);
}

.search-input-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
}

.search-submit-btn {
    background-color: var(--accent-blue) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 8px 18px !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 700 !important;
    cursor: pointer !important;
}

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background-color: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.footer-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.footer-social-links {
    display: flex;
    gap: 12px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-icon:hover {
    background-color: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.footer-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--accent-cyan);
    color: #000;
    border-color: var(--accent-cyan);
    transform: translateY(-3px);
}

/* --------------------------------------------------------------------------
   10. Responsive Media Queries (Mobile Optimization)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .featured-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .main-sidebar {
        display: none; /* Accessible via mobile sidebar drawer */
    }

    .mobile-sidebar-trigger {
        display: inline-flex !important;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 14px;
    }

    .header-main-bar {
        padding: 8px 0;
    }

    .custom-brand-logo {
        font-size: 0.96rem;
        gap: 6px;
        line-height: 1.25;
    }

    .brand-badge {
        font-size: 0.65rem;
        padding: 2px 4px;
    }

    .brand-dot {
        display: none; /* Clean look on mobile */
    }

    .header-utilities {
        gap: 2px;
    }

    .header-utilities .header-action-btn,
    .header-utilities button,
    .header-action-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
    }

    .header-utilities svg {
        width: 19px !important;
        height: 19px !important;
    }

    .menu-toggle {
        display: inline-flex !important;
    }

    .header-nav-bar {
        display: none; /* Toggled by menu button */
    }

    .header-nav-bar.is-active {
        display: block;
    }

    .featured-main-title {
        font-size: 1.5rem;
    }

    .featured-section-title {
        font-size: 1.4rem;
    }

    .featured-sub-item {
        grid-template-columns: 110px 1fr;
        gap: 12px;
        padding-bottom: 14px;
    }

    .sub-item-title {
        font-size: 0.92rem;
        line-height: 1.35;
        margin-bottom: 4px;
    }

    .timeline-post-card {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 14px;
    }

    .single-article-entry {
        padding: 18px;
    }

    .single-article-title {
        font-size: 1.55rem;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 420px) {
    .custom-brand-logo {
        font-size: 0.88rem;
    }

    .featured-main-title {
        font-size: 1.3rem;
    }

    .featured-sub-item {
        grid-template-columns: 95px 1fr;
        gap: 10px;
    }

    .sub-item-title {
        font-size: 0.85rem;
    }
}
