/*
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
*/
:root {
	/*
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #4cc9f0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    */
    --css-primary-color: DodgerBlue;
	--css-secondary-color: #246a99;
    --css-light-color: #f8f9fa;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    
    --css-background-color: #D1E9F6; /* Light, airy background */
    --css-dark-color: #0F2C3D;      /* Deep navy for text/footers */
}
/*
body {
    background-color: #f5f7ff;
    color: var(--dark-color);
    line-height: 1.6;
}
*/
.css-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
/*
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
*/
.logo {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo span {
    color: var(--accent-color);
}
/*
nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--accent-color);
}
*/
main {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    /*margin: 2rem 0;*/
}

.post-content-section {
    flex: 3;
    min-width: 300px;
}

.sidebar {
    flex: 1;
    min-width: 280px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--css-primary-color);
    color: var(--css-secondary-color);
}

.post-full {
    background: white;
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.post-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--css-secondary-color);
    line-height: 1.3;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: var(--gray-color);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.post-content p {
    margin-bottom: 1.2rem;
}

.post-content p.no-margin {
    margin-bottom: 0;
}

.post-content ul {
	padding-left: 40px;
	list-style: disc; 
}
.post-content ol {
	padding-left: 40px;
}
.post-content ol li::marker {
	font-weight: bold;
}
  

.post-content h2 {
    /*color: var(--css-primary-color);*/
    
    background-color: var(--css-background-color);
    color: var(--css-dark-color);
}

.post-content span{
	font-size: 0.8rem;
	font-family: monospace;
	font-style: italic;
}
/* Override Prism */
code[class*="language-"],
pre[class*="language-"] {
	font-size: 0.8rem !important;
	font-family: monospace !important;
	font-style: italic !important;
}


.post-content table {
    border: 1px solid black;
    border-collapse: collapse;
}

.post-content td {
	border: 1px solid black;
	padding: 5px;
}

.post-content caption {
	font-weight: bold;
	margin-bottom: 5px;
	text-align: left;
}


.post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 0;
    margin-top: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
	display: block;      /* Removes default inline behavior */
	margin-left: auto;   /* Automatic left margin */
	margin-right: auto;  /* Automatic right margin */
}

/* Styling for the figure and caption */
.math-figure {
	text-align: center; /* Center the formula */
	margin: 20px;
	font-family: 'Times New Roman', Times, serif;
}
.math-figure figdef {
	font-size: 0.7em;
	color: #000;
	margin-top: 5px;
	/*font-weight: normal;*/
	/*font-family: 'Times New Roman', Times, serif;*/
	
	font-family: 'Inter', sans-serif;
	font-style: italic;
	line-height: 1.0;
}
.math-figure figcaption {
	font-size: 0.9em;
	/*color: #555;*/
	color: #666;
	margin-top: 5px;
	/*font-weight: normal;*/
	/*font-family: 'Times New Roman', Times, serif;*/
	
	font-family: 'Inter', sans-serif;
	font-style: italic;
	line-height: 1.6;
}

mjx-container[jax="CHTML"][display="true"] {
	margin-top: 1em !important;
	margin-bottom: 0 !important;
}

.image-caption {
  /* Centers the text under the image */
  text-align: center;
  
  /* Makes the text slightly smaller than body text */
  font-size: 0.9em;
  
  /* Makes the text a lighter gray to separate it from main content */
  color: #666;
  
  /* Adds space between the image and the text */
  margin-top: 8px; 
  
  /* Optional: Italicizes the text to distinguish it further */
  font-style: italic;
}


/*
.protocol-diagram {
	display: flex;
	justify-content: center;
	margin: 1.5rem 0;
	font-family: var(--font-code);
}

.packet-part {
	padding: 0.8rem;
	margin: 0 0.25rem;
	border: 1px solid #2196f3;
	border-radius: 4px;
	text-align: center;
	min-width: 120px;
}

.length-field {
	background-color: #bbdefb;
	font-weight: bold;
}

.data-field {
	background-color: #e3f2fd;
}
*/
.protocol-diagram {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
    font-family: var(--font-code);
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.packet-part {
    padding: 0.8rem;
    margin: 0 0.25rem 0.5rem 0.25rem; /* Added bottom margin for vertical spacing */
    border: 1px solid #2196f3;
    border-radius: 4px;
    text-align: center;
    min-width: 120px;
    position: relative;
    flex: 0 0 auto; /* Prevent stretching */
}

/* Nested diagram container */
.packet-part .protocol-diagram {
    margin: 0.75rem -0.5rem -0.5rem -0.5rem; /* Negative margins to counter padding */
    justify-content: center;
    flex-wrap: wrap;
    border-top: 1px dashed #90caf9;
    padding-top: 0.75rem;
    background: rgba(227, 242, 253, 0.4); /* Subtle background for nested area */
}

/* Nested packet parts */
.packet-part .protocol-diagram .packet-part {
    min-width: 90px; /* Smaller min-width for nested items */
    padding: 0.5rem;
    margin: 0.25rem;
    font-size: 0.9em;
    border-color: #90caf9; /* Lighter border for nested items */
}

/* Field type indicators */
.length-field {
    background-color: #bbdefb;
    font-weight: bold;
}

.data-field {
    background-color: #e3f2fd;
}

/* Nested field styles */
.packet-part .length-field {
    background-color: #e3f2fd; /* Lighter background for nested length fields */
}

.packet-part .data-field {
    background-color: #f5f9ff; /* Extra light for nested data fields */
}

/* Hierarchy indicators */
.packet-part::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 1px;
    height: 8px;
    background: #2196f3;
    display: none;
}

.packet-part.has-children::after {
    display: block;
}

/* Description text styling */
.packet-part > div:last-child:not(:first-child) {
    font-size: 0.85em;
    color: #546e7a;
    margin-top: 0.25rem;
    line-height: 1.3;
}

/* Nested description text */
.packet-part .packet-part > div:last-child:not(:first-child) {
    font-size: 0.8em;
}


.post-tags-container {
    margin: 2rem 0;
}

.post-tags-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--css-secondary-color);
}

/*
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tag {
    background-color: var(--css-light-color);
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--css-primary-color);
    transition: all 0.3s;
}

.post-tag:hover {
    background-color: var(--css-primary-color);
    color: white;
    transform: translateY(-2px);
}
*/

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tag {
    background-color: var(--css-light-color);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--css-primary-color);
}


.back-link {
    display: inline-block;
    margin: 1.5rem 0;
    color: var(--css-primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--css-secondary-color);
    text-decoration: underline;
}

.back-link i {
    margin-right: 8px;
}

.tag-container, .about-card, .search-box {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}

.tag {
    background-color: #ecf0f1;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.tag:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

.tag.active {
    background-color: var(--css-primary-color);
    color: white;
    font-weight: 600;
}

/*
.search-box {
    position: relative;
    margin-bottom: 2rem;
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-color);
}
*/
.about-card h3 {
    color: var(--css-secondary-color);
    margin-bottom: 1rem;
}

footer {
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

@media (max-width: 768px) {
	/*
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        margin-top: 1rem;
    }
    
    nav ul li {
        margin: 0 0.75rem;
    }
    */
    main {
        flex-direction: column;
    }
    
    .post-full {
        padding: 1.8rem;
    }
    
    .post-title {
        font-size: 1.8rem;
    }
}
