* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
    padding-top: 100px;
}
:root {
    --bg-color: #f9f9f9;
    --text-color: #333;
    --card-bg: #fff;
    --header-bg: linear-gradient(to bottom, #00BFA5, #341CC3);
    --footer-bg: #002424;
    --link-color: #2c5aa0;
    --border-color: #eee;
    --menu-square-bg: rgba(255, 255, 255, 0.1);
}
.dark-theme {
    --bg-color: #121212;
    --text-color: #f0f0f0;
    --card-bg: #1e1e1e;
    --link-color: #64b5f6;
    --border-color: #333;
    --menu-square-bg: rgba(255, 255, 255, 0.05);
}
a {
    text-decoration: none;
    color: var(--link-color);
    transition: color 0.3s;
}
header {
    background: var(--header-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    z-index: 100;
    width: 100%;
    transition: transform 0.3s ease-out;
}
.header-hidden {
    transform: translateY(-100%);
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
    position: relative;
}
.logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.logo span {
    color: #ffeb3b;
}
/* Optional: If you ever want to use logo-1024.png as image logo, uncomment below */
/*
.logo {
    background: url(/logos/logo-1024.png) no-repeat center center;
    background-size: contain;
    width: 120px;
    height: 40px;
    text-indent: -9999px;
    overflow: hidden;
}
*/

.hamburger {
    display: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    position: relative;
    background: var(--menu-square-bg);
    border-radius: 4px;
    justify-content: center;
    align-items: center;
}
.hamburger span {
    display: block;
    position: absolute;
    height: 4px;
    width: 24px;
    background: white;
    border-radius: 4px;
    opacity: 1;
    left: 8px;
    transform: rotate(0deg);
    transition: transform 0.25s ease-in-out, opacity 0.25s ease-in-out, left 0.25s ease-in-out;
}
.hamburger span:nth-child(1) { top: 10px; }
.hamburger span:nth-child(2) { top: 18px; }
.hamburger span:nth-child(3) { top: 26px; }
.hamburger.active span:nth-child(1) {
    top: 18px;
    transform: rotate(135deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
    left: -40px;
}
.hamburger.active span:nth-child(3) {
    top: 18px;
    transform: rotate(-135deg);
}
.menu-strip {
    background: #176281;
    height: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: fixed;
    top: 80px;
    z-index: 99;
}
.menu-strip a, .menu-strip button {
    flex: 1;
    text-align: center;
    color: white;
    padding: 0.3rem 0;
    transition: background-color 0.3s;
}
.menu-strip a:hover, .menu-strip button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
.theme-toggle-desktop-menu {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.3rem;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: -100%;
    width: fit-content;
    max-width: 90%;
    height: auto;
    background: #7F7F7F;
    flex-direction: column;
    padding: 0.5rem;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 101;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
}
.mobile-menu.active {
    display: flex;
    left: 0;
}
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
}
.mobile-menu-overlay.active {
    display: block;
}
.mobile-menu li {
    margin: 0.5rem 0;
}
.mobile-menu li a {
    display: block;
    color: white;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.theme-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    margin-top: 0.5rem;
    text-align: left;
    width: 100%;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.close-menu {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    align-self: flex-end;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    position: relative;
}
.close-menu span {
    display: block;
    position: absolute;
    height: 4px;
    width: 24px;
    background: white;
    border-radius: 4px;
    left: 8px;
}
.close-menu span:nth-child(1) {
    top: 18px;
    transform: rotate(45deg);
}
.close-menu span:nth-child(2) {
    top: 18px;
    transform: rotate(-45deg);
}
.container {
    margin: 2rem auto;
    padding: 0;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.3rem;
    flex: 1;
    width: 100%;
    max-width: 1200px;
}
main {
    padding: 0;
    margin: 0;
    width: 100%;
}
aside {
    padding: 0;
    margin: 0;
    width: 100%;
}
/* Desktop: Fixed, scrollable sidebar with gap before footer */
@media (min-width: 769px) {
    aside {
        position: sticky;
        top: 100px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        padding: 0 0.5rem;
    }
    .tab-content {
        margin: 0;
        padding: 0.5rem;
    }
    footer {
        margin-top: 2rem;
    }
}
/* Mobile: Limit sidebar to 12 links */
@media (max-width: 768px) {
    body {
        padding-top: 80px;
    }
    .menu-strip {
        display: none;
    }
    .container {
        grid-template-columns: 1fr;
        padding: 0;
        margin: 0;
        width: 100%;
        gap: 0.3rem;
    }
    main, aside {
        padding: 0;
        margin: 0;
        width: 100%;
    }
    .post-content {
        margin: 1rem 0.5rem 0;
        padding: 0.5rem;
        max-width: 100%;
    }
    .tab-content {
        margin: 0 0.5rem;
        padding: 0.5rem;
        max-width: 100%;
    }
    .tab-list li {
        padding: 0.4rem;
    }
    .tab-list li:nth-child(n+13) {
        display: none;
    }
    header {
        position: fixed;
    }
    .hamburger {
        display: flex;
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }
}
@media (max-width: 480px) {
    .logo {
        font-size: 1.4rem;
    }
    .section-title {
        font-size: 1.3rem;
    }
    .mobile-menu {
        width: fit-content;
        max-width: 90%;
        left: -100%;
    }
    .post-content {
        margin: 1rem 0.4rem 0;
        padding: 0.4rem;
        max-width: 100%;
    }
    .tab-content {
        margin: 0 0.4rem;
        padding: 0.4rem;
        max-width: 100%;
    }
    .tab-list li {
        padding: 0.3rem;
    }
    .post-title {
        font-size: 1.6rem;
    }
    .post-body h2 {
        font-size: 1.3rem;
    }
}
.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--link-color);
    color: var(--link-color);
    text-align: center;
}
.post-content {
    background: var(--card-bg);
    padding: 0.5rem;
    margin: 0 0.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1.5px solid transparent;
    border-image: var(--header-bg) 1;
    max-width: 100%;
}
.post-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}
.post-meta {
    display: flex;
    justify-content: flex-start;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1.5rem;
}
.post-body {
    font-size: 1rem;
    line-height: 1.8;
}
.post-body h2 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
}
.post-body p {
    margin-bottom: 1rem;
}
.latest-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.3rem;
    padding: 0 0.5rem;
}
.post-card {
    background: var(--card-bg);
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1.5px solid transparent;
    border-image: var(--header-bg) 1;
}
.post-image {
    height: 140px;
    background-size: cover;
    background-position: center;
}
.post-card .post-content {
    padding: 1rem;
}
.post-card .post-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.post-card .post-title a {
    color: var(--text-color);
}
.post-excerpt {
    color: #aaa;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}
.sidebar-tabs {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}
.tab {
    flex: 1;
    text-align: center;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}
.tab.active {
    background: var(--header-bg);
    color: white;
    border-radius: 4px 4px 0 0;
}
.tab:hover {
    background: rgba(0, 123, 255, 0.1);
}
.tab-content {
    display: none;
    background: var(--card-bg);
    padding: 0.5rem;
    margin: 0 0.5rem;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1.5px solid transparent;
    border-image: var(--header-bg) 1;
    max-width: 100%;
}
.tab-content.active {
    display: block;
}
.tab-list {
    list-style: none;
}
.tab-list li {
    margin-bottom: 1rem;
    padding: 0.4rem;
    border: 1.5px solid transparent;
    border-image: var(--header-bg) 1;
    border-radius: 4px;
}
.tab-list li:last-child {
    margin-bottom: 0;
}
.tab-list a {
    display: block;
    font-weight: 500;
}
footer {
    background: var(--footer-bg);
    color: white;
    padding: 2rem 0;
    margin-top: auto;
    width: 100%;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.footer-top-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
}
.footer-top-row a {
    flex: 1;
    text-align: center;
    color: white;
    transition: color 0.3s;
}
.footer-top-row a:hover {
    text-decoration: underline;
}
.footer-bottom-row {
    text-align: center;
    font-size: 0.9rem;
    width: 100%;
}
/* ===== ADVANCED POST STYLES ===== */
/* POST FEATURED IMAGE */
.post-featured-image {
    margin: 1rem 0 2rem;
    text-align: center;
}
.post-featured-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1.5px solid transparent;
    border-image: var(--header-bg) 1;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
/* CUSTOM FONT CLASSES */
.text-serif {
    font-family: 'Playfair Display', 'Georgia', serif;
}
.text-mono {
    font-family: 'Roboto Mono', 'Courier New', monospace;
    background: var(--card-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}
.text-cursive {
    font-family: 'Dancing Script', 'Brush Script MT', cursive;
    font-size: 1.2em;
}
/* TEXT ENHANCEMENTS */
.text-bold { font-weight: 700; }
.text-italic { font-style: italic; }
.text-underline { text-decoration: underline; }
.text-strike { text-decoration: line-through; }
.text-highlight { 
    background: linear-gradient(120deg, #00BFA5, #341CC3);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    color: white;
}
/* SPECIAL CONTENT BLOCKS */
.content-block {
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1.5px solid transparent;
    border-image: var(--header-bg) 1;
}
.warning-block {
    background: linear-gradient(135deg, #fff3cd, #ffecb5);
    border-left: 4px solid #ffc107;
    border-image: none;
}
.info-block {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border-left: 4px solid #0dcaf0;
    border-image: none;
}
.success-block {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-left: 4px solid #198754;
    border-image: none;
}
.danger-block {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-left: 4px solid #dc3545;
    border-image: none;
}
.explanation-block {
    background: linear-gradient(135deg, #e2e3e5, #d3d6d8);
    border-left: 4px solid #6c757d;
    border-image: none;
}
/* IMAGE GALLERY SYSTEM */
.image-gallery {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}
.gallery-2-col {
    grid-template-columns: repeat(2, 1fr);
}
.gallery-3-col {
    grid-template-columns: repeat(3, 1fr);
}
.gallery-4-col {
    grid-template-columns: repeat(4, 1fr);
}
.gallery-item {
    text-align: center;
}
.gallery-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1.5px solid transparent;
    border-image: var(--header-bg) 1;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.gallery-caption {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
}
/* FLEX LAYOUTS */
.flex-container {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    align-items: center;
}
.flex-item {
    flex: 1;
}
.flex-text { flex: 2; }
.flex-image { flex: 1; }
/* CODE BLOCKS */
.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    margin: 1.5rem 0;
}
/* QUOTE STYLES */
.pull-quote {
    font-size: 1.3rem;
    font-style: italic;
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    border-left: 4px solid #00BFA5;
}
/* RESPONSIVE IMAGES */
.responsive-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
}
.img-left { float: left; margin-right: 1rem; margin-bottom: 1rem; max-width: 50%; }
.img-right { float: right; margin-left: 1rem; margin-bottom: 1rem; max-width: 50%; }
.img-center { display: block; margin: 1rem auto; text-align: center; }
/* TABLE STYLES */
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--card-bg);
    border: 1.5px solid transparent;
    border-image: var(--header-bg) 1;
}
.post-body th,
.post-body td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.post-body th {
    background: var(--header-bg);
    color: white;
    font-weight: 600;
}
.post-body tr:hover {
    background: rgba(0, 191, 165, 0.05);
}
/* MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
    .gallery-2-col,
    .gallery-3-col,
    .gallery-4-col {
        grid-template-columns: 1fr;
    }
    .flex-container {
        flex-direction: column;
    }
    .img-left,
    .img-right {
        float: none;
        margin: 1rem auto;
        max-width: 100%;
    }
    .post-featured-image img {
        max-width: 100%;
    }
}