/*--------------------------------------------------------------
# ColorMag Hugo Theme - Main Stylesheet
# Based on ColorMag WordPress Theme
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# CSS Variables
--------------------------------------------------------------*/
:root {
    --color-primary: #207daf;
    --color-primary-light: #9bc8da;
    --color-secondary: #27272a;
    --color-text: #3f3f46;
    --color-text-light: #71717a;
    --color-gray: #888888;
    --color-border: #e4e4e7;
    --color-background: #e4e4e7;
    --color-white: #ffffff;
    --font-primary: 'Open Sans', sans-serif;
    --max-width: 1140px;
}

/*--------------------------------------------------------------
# Reset & Base
--------------------------------------------------------------*/
*, *::before, *::after {
    box-sizing: inherit;
}

html {
    font-size: 62.5%;
    box-sizing: border-box;
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    width: 100%;
}

body {
    margin: 0;
    padding: 10px;
    background-color: var(--color-background);
    color: var(--color-text);
    font-size: 16px;
    font-family: var(--font-primary);
    line-height: 1.8;
    word-wrap: break-word;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

article, aside, details, figcaption, figure,
footer, header, main, nav, section {
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover, a:focus, a:active {
    text-decoration: none;
    color: var(--color-secondary);
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: top;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 20px;
    color: var(--color-secondary);
    font-weight: 500;
    font-family: var(--font-primary);
    line-height: 1.3;
}

h1 { font-size: 4rem; }
h2 { font-size: 3.2rem; }
h3 { font-size: 2.4rem; }
h4 { font-size: 2rem; }
h5 { font-size: 1.8rem; }
h6 { font-size: 1.6rem; }

p {
    margin: 0 0 16px;
    line-height: 1.8;
}

ul, ol {
    margin: 0 0 16px 20px;
    padding: 0;
}

ul { list-style: disc; }
ol { list-style: decimal; }

/*--------------------------------------------------------------
# Layout
--------------------------------------------------------------*/
.hfeed.site {
    background-color: var(--color-white);
    max-width: 1200px;
    margin: 0 auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

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

.cm-content {
    padding: 30px 0;
}

.cm-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.cm-primary {
    flex: 0 0 70%;
    max-width: 70%;
    padding: 0 15px;
}

.cm-secondary {
    flex: 0 0 30%;
    max-width: 30%;
    padding: 0 15px;
}

@media screen and (max-width: 991px) {
    .cm-primary,
    .cm-secondary {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .cm-secondary {
        margin-top: 30px;
    }
}

/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
.cm-header-builder {
    background-color: #e4e4e7;
    margin-left: -9999px;
    margin-right: -9999px;
    padding-left: 9999px;
    padding-right: 9999px;
}

.cm-header-top-row {
    background-color: #333;
    color: var(--color-white);
    font-size: 1.2rem;
}

/*--------------------------------------------------------------
# Top Bar (Standalone above header)
--------------------------------------------------------------*/
.cm-topbar {
    background-color: #f4f4f5;
}

.cm-topbar-row {
    padding: 0;
}

.cm-topbar .cm-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.cm-topbar .date-in-header {
    color: var(--color-text);
    font-size: 1.2rem;
}

.cm-topbar .social-icons a {
    color: var(--color-text);
}

.cm-topbar .social-icons a:hover {
    color: var(--color-primary);
}

@media screen and (max-width: 991px) {
    .cm-topbar {
        display: none;
    }
}

/*--------------------------------------------------------------
# Top Row (legacy styles)
--------------------------------------------------------------*/
.cm-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.date-in-header {
    color: var(--color-white);
}

.social-icons a {
    display: inline-block;
    margin-left: 10px;
    color: var(--color-white);
    font-size: 1.4rem;
    transition: opacity 0.3s ease;
}

.social-icons a:hover {
    opacity: 0.8;
}

.header-social-icons a {
    color: var(--color-white);
}

.footer-social-icons a {
    color: var(--color-text);
    font-size: 1.6rem;
    margin-left: 15px;
}

.footer-social-icons a:hover {
    color: var(--color-primary);
}

/* Logo / Branding */
.cm-header-main-row {
    padding: 20px 0;
}

.cm-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cm-site-branding .custom-logo {
    max-height: 90px;
}

.cm-site-branding .site-title {
    font-size: 3.6rem;
    font-weight: 700;
    color: var(--color-secondary);
}

/* Navigation */
.cm-header-bottom-row {
    background-color: #27272a;
    border-top: 4px solid #27272a;
}

/* Standalone Navigation - Full Width (like footer) */
.cm-navigation {
    background-color: #27272a;
}

.cm-navigation-row {
    border-top: 4px solid #27272a;
}

.cm-nav-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.cm-nav-col {
    width: 100%;
}

@media screen and (max-width: 991px) {
    .cm-navigation {
        display: none;
    }
}

.cm-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cm-primary-nav {
    width: 100%;
}

.cm-primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cm-primary-menu .menu-item {
    position: relative;
}

.cm-primary-menu .menu-item a {
    display: block;
    padding: 14px 20px;
    color: var(--color-white);
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.cm-primary-menu .menu-item a:hover {
    background-color: rgba(255,255,255,0.1);
}

.cm-primary-menu .menu-item.current-menu-item a {
    background-color: var(--color-primary);
}

/* Mobile Navigation */
.cm-mobile-row {
    display: none;
}

.cm-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.cm-menu-toggle .cm-icon {
    width: 24px;
    height: 24px;
    fill: var(--color-white);
}

.cm-menu-toggle .cm-icon--x-mark {
    display: none;
}

.cm-menu-toggle[aria-expanded="true"] .cm-icon--bars {
    display: none;
}

.cm-menu-toggle[aria-expanded="true"] .cm-icon--x-mark {
    display: block;
}

.cm-mobile-nav {
    display: none;
    background-color: #27272a;
}

.cm-mobile-nav.active {
    display: block;
}

.cm-mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cm-mobile-menu .menu-item a {
    display: block;
    padding: 12px 20px;
    color: var(--color-white);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.cm-mobile-menu .menu-item.current-menu-item a {
    background-color: var(--color-primary);
}

@media screen and (max-width: 991px) {
    .cm-desktop-row {
        display: none;
    }
    
    .cm-mobile-row {
        display: block;
    }
    
    .cm-mobile-row .cm-header-main-row {
        text-align: center;
    }
    
    .cm-mobile-row .cm-header-bottom-row .cm-container {
        max-width: 100%;
        padding: 0;
    }
    
    .cm-mobile-row .cm-header-bottom-row .cm-bottom-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cm-mobile-row .cm-header-bottom-row .cm-header-left-col {
        width: 100%;
    }
    
    .cm-mobile-nav-container {
        width: 100%;
    }
    
    .cm-menu-toggle {
        padding: 10px 15px;
        margin-left: 10px;
    }
}

/* Sticky Header */
.sticky-wrapper {
    position: relative;
}

.sticky-wrapper.is-sticky .cm-header-bottom-row,
.sticky-wrapper.is-sticky .cm-navigation-row {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background-color: #27272a;
}

/*--------------------------------------------------------------
# Page Header
--------------------------------------------------------------*/
.cm-page-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.cm-page-title {
    margin: 0;
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--color-secondary);
    position: relative;
}

.cm-page-title span {
    position: relative;
    display: inline-block;
    padding-right: 15px;
}

.cm-page-title span::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--color-primary);
}

/*--------------------------------------------------------------
# Posts Grid
--------------------------------------------------------------*/
.cm-posts {
    display: grid;
    gap: 30px;
}

.cm-posts.col-2 {
    grid-template-columns: 1fr;
}

@media screen and (min-width: 768px) {
    .cm-posts.col-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cm-posts article {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}

.cm-featured-image {
    position: relative;
    overflow: hidden;
}

.cm-featured-image img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.cm-featured-image:hover img {
    transform: scale(1.05);
}

.cm-post-content {
    padding: 20px;
}

.cm-below-entry-meta {
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: var(--color-text-light);
}

.cm-below-entry-meta .cm-icon {
    width: 14px;
    height: 14px;
    fill: var(--color-primary);
    vertical-align: middle;
    margin-right: 5px;
}

.cm-post-date a {
    color: var(--color-text-light);
}

.cm-post-date a:hover {
    color: var(--color-primary);
}

.cm-entry-header {
    margin-bottom: 15px;
}

.cm-entry-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.4;
}

.cm-entry-title a {
    color: var(--color-secondary);
}

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

.cm-entry-summary {
    color: var(--color-text);
    font-size: 1.4rem;
    line-height: 1.7;
}

.cm-entry-summary p:last-child {
    margin-bottom: 0;
}

.cm-read-more {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 20px;
    background-color: var(--color-primary);
    color: var(--color-white);
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.cm-read-more:hover {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

/*--------------------------------------------------------------
# Single Post
--------------------------------------------------------------*/
.single-post {
    background: none;
    border: none;
}

.single-post .cm-featured-image {
    margin-bottom: 20px;
    border-radius: 4px;
}

.single-post .cm-entry-title {
    font-size: 3rem;
}

.single-post .cm-entry-content {
    font-size: 1.6rem;
    line-height: 1.8;
}

.single-post .cm-entry-content p {
    margin-bottom: 20px;
}

.single-post .cm-entry-content img {
    border-radius: 4px;
    margin: 20px 0;
}

.cm-post-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.cm-post-tags a {
    display: inline-block;
    margin: 5px 5px 5px 0;
    padding: 5px 12px;
    background-color: #f4f4f5;
    color: var(--color-text);
    font-size: 1.2rem;
    border-radius: 3px;
}

.cm-post-tags a:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* Post Navigation */
.cm-post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
}

.cm-post-navigation .nav-previous,
.cm-post-navigation .nav-next {
    flex: 0 0 48%;
}

.cm-post-navigation .nav-next {
    text-align: right;
}

.cm-post-navigation .nav-label {
    display: block;
    font-size: 1.2rem;
    color: var(--color-text-light);
    margin-bottom: 5px;
}

.cm-post-navigation .nav-title {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-secondary);
}

.cm-post-navigation a:hover .nav-title {
    color: var(--color-primary);
}

/*--------------------------------------------------------------
# Sidebar / Widgets
--------------------------------------------------------------*/
.cm-secondary .widget {
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.cm-widget-title {
    margin: 0 0 20px;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--color-secondary);
    position: relative;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.cm-widget-title span {
    position: relative;
}

.cm-widget-title span::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--color-primary);
}

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

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

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

.widget ul li a {
    color: var(--color-text);
    font-size: 1.4rem;
}

.widget ul li a:hover {
    color: var(--color-primary);
}

/* Tag Cloud */
.tagcloud a {
    display: inline-block;
    margin: 3px;
    padding: 5px 12px;
    background-color: #f4f4f5;
    color: var(--color-text);
    font-size: 1.2rem !important;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.tagcloud a:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
.cm-footer {
    background-color: #27272a;
    color: var(--color-white);
}

.cm-footer-bottom-row {
    padding: 20px 0;
}

.cm-footer .cm-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.cm-footer-col {
    padding: 10px 0;
}

.cm-copyright {
    font-size: 1.4rem;
    color: rgba(255,255,255,0.8);
    padding-left: 20px;
}

.cm-copyright a {
    color: var(--color-primary-light);
}

.cm-copyright a:hover {
    color: var(--color-white);
}

.cm-footer .footer-social-icons a {
    color: rgba(255,255,255,0.8);
}

.cm-footer .footer-social-icons a:hover {
    color: var(--color-white);
}

@media screen and (max-width: 767px) {
    .cm-footer .cm-bottom-row {
        flex-direction: column;
        text-align: center;
    }
    
    .cm-footer .footer-social-icons {
        margin-top: 15px;
    }
    
    .cm-footer .footer-social-icons a {
        margin: 0 8px;
    }
}

/*--------------------------------------------------------------
# Scroll Up Button
--------------------------------------------------------------*/
#scroll-up {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    width: 40px;
    height: 40px;
    background-color: var(--color-primary);
    color: var(--color-white);
    text-align: center;
    line-height: 40px;
    border-radius: 4px;
    z-index: 999;
    transition: background-color 0.3s ease;
}

#scroll-up:hover {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

/*--------------------------------------------------------------
# Pagination
--------------------------------------------------------------*/
.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.pagination li {
    display: inline-block;
}

.pagination a,
.pagination span {
    display: inline-block;
    min-width: 40px;
    padding: 8px 15px;
    background-color: #f4f4f5;
    color: var(--color-text);
    font-size: 1.4rem;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.pagination a:hover,
.pagination .active span {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/*--------------------------------------------------------------
# Utilities
--------------------------------------------------------------*/
.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-width: 0;
}

.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/*--------------------------------------------------------------
# Responsive
--------------------------------------------------------------*/
@media screen and (max-width: 1199px) {
    .cm-container {
        max-width: 960px;
    }
}

@media screen and (max-width: 991px) {
    .cm-container {
        max-width: 100%;
        width: 100%;
    }
    
    .hfeed.site {
        max-width: 100%;
        margin: 0;
    }
    
    body {
        padding: 0;
    }
}

@media screen and (max-width: 767px) {
    .cm-container {
        max-width: 100%;
        width: 100%;
        padding: 0 15px;
    }
    
    .cm-posts.col-2 {
        grid-template-columns: 1fr;
    }
    
    .cm-page-title {
        font-size: 2rem;
    }
    
    .single-post .cm-entry-title {
        font-size: 2.2rem;
    }
}

@media screen and (max-width: 575px) {
    /* Inherits 100% width from 767px breakpoint */
}
