/*
Theme Name: Comtechzone
Theme URI: https://comtechzone.com/
Author: Comtechzone
Author URI: https://comtechzone.com/
Description: Custom responsive corporate and technology blogging theme.
Version: 1.0.10
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: comtechzone
*/

/* ========================================
   01. GLOBAL VARIABLES
======================================== */

:root {
    --ctz-primary: #2563eb;
    --ctz-secondary: #0f172a;
    --ctz-background: #ffffff;
    --ctz-surface: #f8fafc;
    --ctz-text: #334155;
    --ctz-heading: #0f172a;
    --ctz-border: #e2e8f0;

    --ctz-font-family: system-ui, sans-serif;
    --ctz-font-size: 16px;
    --ctz-heading-size: 30px;

    --ctz-container: 1200px;
    --ctz-radius: 12px;

    --ctz-header-bg: #ffffff;
    --ctz-nav-bg: #0f172a;
    --ctz-nav-text: #ffffff;
    --ctz-nav-hover-bg: #2563eb;
    --ctz-nav-hover-text: #ffffff;

    --ctz-header-padding: 22px;
    --ctz-logo-width: 180px;
    --ctz-nav-height: 54px;
    --ctz-title-size: 28px;
    --ctz-menu-size: 14px;

    --ctz-sticky-top: 0px;

    /* Premium design tokens */

    --ctz-premium-shadow:
        0 10px 30px rgb(15 23 42 / 6%);

    --ctz-premium-shadow-hover:
        0 18px 42px rgb(15 23 42 / 11%);

    --ctz-premium-transition:
        0.25s ease;
}

/* ========================================
   02. RESET
======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--ctz-background);
    color: var(--ctz-text);
    font-family: var(--ctz-font-family);
    font-size: var(--ctz-font-size);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ctz-primary);
    text-decoration: none;
    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--ctz-primary);
    outline-offset: 3px;
}

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

button,
input,
textarea,
select {
    font: inherit;
}

.ctz-container {
    width: calc(100% - 32px);
    max-width: var(--ctz-container);
    margin-inline: auto;
}

/* ========================================
   03. ACCESSIBILITY
======================================== */

.ctz-skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 99999;

    padding: 10px 16px;

    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;

    box-shadow: 0 5px 20px rgb(0 0 0 / 12%);
}

.ctz-skip-link:focus {
    top: 12px;
}

/* ========================================
   04. PREMIUM HEADER
======================================== */

.ctz-site-header {
    position: relative;

    padding-block: var(--ctz-header-padding);

    background: var(--ctz-header-bg);
    border-bottom: 1px solid var(--ctz-border);

    box-shadow: 0 3px 18px rgb(15 23 42 / 4%);
}

.ctz-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.ctz-branding {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.ctz-logo {
    flex-shrink: 0;
}

.ctz-logo img {
    display: block;

    width: auto;
    height: auto;

    max-width: var(--ctz-logo-width);
    max-height: 110px;
}

.ctz-brand-text {
    min-width: 0;
}

.ctz-site-title {
    margin: 0;

    color: var(--ctz-heading);

    font-size: var(--ctz-title-size);
    font-weight: 800;
    line-height: 1.3;

    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.ctz-site-title a {
    color: inherit;
}

.ctz-site-title a:hover {
    color: var(--ctz-primary);
    text-decoration: none;
}

.ctz-site-description {
    margin: 4px 0 0;

    color: var(--ctz-text);

    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

/* ========================================
   05. NAVIGATION BAR
======================================== */

.ctz-navigation-bar {
    position: relative;

    width: 100%;

    background: var(--ctz-nav-bg);

    box-shadow:
        0 5px 18px rgb(15 23 42 / 12%);

    z-index: 1000;
}

/* Native sticky behavior */

.ctz-navigation-bar.ctz-sticky-enabled {
    position: sticky;
    top: var(--ctz-sticky-top);
}

/* Fixed mode compatibility */

.ctz-navigation-bar.ctz-is-fixed {
    position: fixed;

    top: var(--ctz-sticky-top);
    left: 0;
    right: 0;

    width: 100%;
}

/* Existing spacer compatibility */

.ctz-nav-spacer {
    display: block;

    width: 100%;
    height: 0;

    pointer-events: none;
}

/* WordPress Admin Bar */

.admin-bar .ctz-navigation-bar.ctz-sticky-enabled {
    --ctz-sticky-top: 32px;
}

@media (max-width: 782px) {

    .admin-bar .ctz-navigation-bar.ctz-sticky-enabled {
        --ctz-sticky-top: 46px;
    }
}

@media (max-width: 600px) {

    .admin-bar .ctz-navigation-bar.ctz-sticky-enabled {
        --ctz-sticky-top: 0px;
    }
}

/* ========================================
   06. NAVIGATION LAYOUT
======================================== */

.ctz-navigation-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    min-height: var(--ctz-nav-height);
}

.ctz-desktop-nav {
    flex: 1;
    min-width: 0;
}

.ctz-desktop-nav ul,
.ctz-mobile-menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ctz-desktop-nav > ul,
.ctz-desktop-nav > .menu > ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

.ctz-desktop-nav li {
    position: relative;
}

.ctz-desktop-nav a {
    display: flex;
    align-items: center;

    padding: 10px 13px;

    color: var(--ctz-nav-text);

    font-size: var(--ctz-menu-size);
    font-weight: 500;
    line-height: 1.5;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.ctz-desktop-nav > ul > li > a,
.ctz-desktop-nav > .menu > ul > li > a {
    min-height: var(--ctz-nav-height);
    border-radius: 8px;
}

.ctz-desktop-nav a:hover,
.ctz-desktop-nav a:focus-visible,
.ctz-desktop-nav .current-menu-item > a,
.ctz-desktop-nav .current-menu-ancestor > a {
    background: var(--ctz-nav-hover-bg);
    color: var(--ctz-nav-hover-text);
    text-decoration: none;
}

/* ========================================
   07. PREMIUM DROPDOWN
======================================== */

.ctz-desktop-nav .sub-menu,
.ctz-desktop-nav .children {
    display: none;

    position: absolute;
    top: 100%;
    left: 0;

    min-width: 210px;

    padding: 7px;

    background: var(--ctz-nav-bg);

    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 12px;

    box-shadow:
        0 16px 35px rgb(0 0 0 / 20%);

    z-index: 1100;
}

.ctz-desktop-nav li:hover > .sub-menu,
.ctz-desktop-nav li:focus-within > .sub-menu,
.ctz-desktop-nav li:hover > .children,
.ctz-desktop-nav li:focus-within > .children {
    display: block;
}

.ctz-desktop-nav .sub-menu a,
.ctz-desktop-nav .children a {
    border-radius: 7px;
}

.ctz-desktop-nav .sub-menu a:hover,
.ctz-desktop-nav .children a:hover {
    text-decoration: none;
}

/* ========================================
   08. NAVIGATION ACTIONS
======================================== */

.ctz-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;

    flex-shrink: 0;
}

/* ========================================
   09. SOCIAL ICONS
======================================== */

.ctz-social-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.ctz-social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    color: var(--ctz-nav-text);

    border-radius: 9px;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.ctz-social-links a:hover,
.ctz-social-links a:focus-visible {
    background: var(--ctz-nav-hover-bg);
    color: var(--ctz-nav-hover-text);

    text-decoration: none;
    transform: translateY(-2px);
}

.ctz-social-links svg {
    display: block;
}

.ctz-social-links--mobile {
    display: none;
}

/* ========================================
   10. SEARCH
======================================== */

.ctz-search-toggle {
    position: relative;
    flex-shrink: 0;
}

.ctz-search-toggle summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-height: 42px;
    padding: 8px 11px;

    color: var(--ctz-nav-text);

    cursor: pointer;
    border-radius: 9px;

    font-size: var(--ctz-menu-size);
    font-weight: 600;

    list-style: none;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.ctz-search-toggle summary::-webkit-details-marker {
    display: none;
}

.ctz-search-toggle summary:hover,
.ctz-search-toggle[open] > summary {
    background: var(--ctz-nav-hover-bg);
    color: var(--ctz-nav-hover-text);
}

/* Premium Search Dropdown */

.ctz-search-panel {
    position: absolute;

    top: calc(100% + 8px);
    right: 0;

    width: min(360px, calc(100vw - 32px));

    padding: 22px;

    background: #ffffff;

    border: 1px solid var(--ctz-border);
    border-radius: 16px;

    box-shadow:
        0 20px 50px rgb(15 23 42 / 17%);

    z-index: 1200;
}

.ctz-search-panel form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ctz-search-panel label {
    flex: 1 1 180px;
}

.ctz-search-panel input[type="search"] {
    width: 100%;
    min-height: 42px;

    padding: 8px 12px;

    border: 1px solid var(--ctz-border);
    border-radius: 9px;

    background: #ffffff;
    color: #0f172a;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.ctz-search-panel input[type="search"]:focus {
    border-color: var(--ctz-primary);

    box-shadow:
        0 0 0 3px rgb(37 99 235 / 10%);
}

.ctz-search-panel input[type="submit"],
.ctz-search-panel button[type="submit"] {
    min-height: 42px;

    padding: 8px 14px;

    background: var(--ctz-primary);

    border: 0;
    border-radius: 9px;

    color: #ffffff;
    font-weight: 700;

    cursor: pointer;

    transition:
        filter 0.2s ease,
        transform 0.2s ease;
}

.ctz-search-panel input[type="submit"]:hover,
.ctz-search-panel button[type="submit"]:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

/* ========================================
   11. MOBILE NAVIGATION
======================================== */

.ctz-mobile-menu {
    display: none;
    position: relative;
}

.ctz-mobile-menu summary {
    display: flex;
    align-items: center;
    gap: 9px;

    min-height: var(--ctz-nav-height);

    padding: 10px 12px;

    color: var(--ctz-nav-text);

    cursor: pointer;
    font-weight: 600;

    list-style: none;
}

.ctz-mobile-menu summary::-webkit-details-marker {
    display: none;
}

.ctz-mobile-menu summary:hover,
.ctz-mobile-menu[open] > summary {
    background: var(--ctz-nav-hover-bg);
    color: var(--ctz-nav-hover-text);
}

.ctz-menu-icon {
    font-size: 21px;
    line-height: 1;
}

.ctz-mobile-menu nav {
    position: absolute;

    top: 100%;
    left: 0;

    width: min(320px, calc(100vw - 32px));
    max-height: 70vh;

    overflow-y: auto;

    padding: 10px;

    background: var(--ctz-nav-bg);

    border-radius: 0 0 12px 12px;

    box-shadow:
        0 15px 35px rgb(0 0 0 / 18%);

    z-index: 1100;
}

.ctz-mobile-menu a {
    display: block;

    padding: 10px 12px;

    color: var(--ctz-nav-text);
    font-size: var(--ctz-menu-size);

    border-radius: 7px;
}

.ctz-mobile-menu a:hover,
.ctz-mobile-menu a:focus-visible,
.ctz-mobile-menu .current-menu-item > a {
    background: var(--ctz-nav-hover-bg);
    color: var(--ctz-nav-hover-text);
    text-decoration: none;
}

.ctz-mobile-menu .sub-menu,
.ctz-mobile-menu .children {
    padding-left: 16px;
}

/* ========================================
   12. MAIN CONTENT
======================================== */

.ctz-main {
    padding-block: 40px;
}

/* Default post styling */

.ctz-post {
    margin-bottom: 24px;

    padding: 24px;

    background: var(--ctz-surface);

    border: 1px solid var(--ctz-border);
    border-radius: var(--ctz-radius);
}

.ctz-post-title {
    margin: 0 0 12px;

    color: var(--ctz-heading);

    font-size: var(--ctz-heading-size);
    font-weight: 800;
    line-height: 1.3;

    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

.ctz-post-title a {
    color: var(--ctz-heading);
}

.ctz-post-title a:hover {
    color: var(--ctz-primary);
    text-decoration: none;
}

.ctz-post-meta {
    margin-bottom: 16px;

    color: var(--ctz-text);
    font-size: 14px;
}

.ctz-post-thumbnail {
    margin: 18px 0;
}

.ctz-featured-image {
    display: block;

    max-width: 100%;
    height: auto;

    border-radius: var(--ctz-radius);
}

.ctz-post-content {
    overflow-wrap: anywhere;
}

.ctz-post-content > * {
    max-width: 100%;
}

.ctz-post-content img {
    height: auto;
}

/* ========================================
   13. PREMIUM BLOG / ARCHIVE CARDS
======================================== */

body.blog .ctz-post,
body.archive .ctz-post,
body.search .ctz-post {
    padding: 30px;

    border: 1px solid var(--ctz-border);
    border-radius: 18px;

    background: linear-gradient(
        135deg,
        #ffffff,
        var(--ctz-surface)
    );

    box-shadow: var(--ctz-premium-shadow);

    transition:
        transform var(--ctz-premium-transition),
        border-color var(--ctz-premium-transition),
        box-shadow var(--ctz-premium-transition);
}

body.blog .ctz-post:hover,
body.archive .ctz-post:hover,
body.search .ctz-post:hover {
    transform: translateY(-4px);

    border-color: var(--ctz-primary);

    box-shadow: var(--ctz-premium-shadow-hover);
}

body.blog .ctz-post-title,
body.archive .ctz-post-title,
body.search .ctz-post-title {
    margin-bottom: 14px;
}

body.blog .ctz-post-meta,
body.archive .ctz-post-meta,
body.search .ctz-post-meta {
    color: var(--ctz-text);
    font-size: 13px;
}

body.blog .ctz-featured-image,
body.archive .ctz-featured-image,
body.search .ctz-featured-image {
    border-radius: 12px;
}

/* ========================================
   14. PREMIUM PAGINATION
======================================== */

.ctz-pagination {
    margin-top: 32px;
}

.ctz-pagination a,
.ctz-pagination .current {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 40px;
    min-height: 40px;

    margin: 3px;
    padding: 8px 13px;

    border: 1px solid var(--ctz-border);
    border-radius: 10px;

    background: #ffffff;
    color: var(--ctz-heading);

    font-size: 14px;
    font-weight: 700;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.ctz-pagination a:hover {
    transform: translateY(-2px);

    border-color: var(--ctz-primary);

    background: var(--ctz-primary);
    color: #ffffff;

    text-decoration: none;
}

.ctz-pagination .current {
    border-color: var(--ctz-primary);

    background: var(--ctz-primary);
    color: #ffffff;
}

/* ========================================
   15. PREMIUM FOOTER
======================================== */

.ctz-site-footer {
    padding: 46px 0;

    background-color: var(--ctz-secondary);

    background-image: linear-gradient(
        125deg,
        transparent,
        rgb(37 99 235 / 17%)
    );

    color: #ffffff;
    text-align: center;
}

.ctz-footer-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 14px 28px;

    margin: 0 0 25px;
    padding: 0;

    list-style: none;
}

.ctz-footer-menu a {
    color: #e2e8f0;

    font-size: 14px;
    font-weight: 600;

    transition:
        color 0.2s ease;
}

.ctz-footer-menu a:hover {
    color: #93c5fd;
    text-decoration: none;
}

.ctz-copyright {
    color: #cbd5e1;
}

.ctz-copyright p {
    margin: 0;
    font-size: 14px;
}

/* ========================================
   16. TABLET RESPONSIVE
======================================== */

@media (max-width: 959px) {

    .ctz-desktop-nav {
        display: none;
    }

    .ctz-mobile-menu {
        display: block;
    }

    .ctz-social-links--desktop {
        display: none;
    }

    .ctz-social-links--mobile {
        display: flex;

        margin-top: 12px;
        padding-top: 12px;

        border-top: 1px solid rgb(255 255 255 / 15%);
    }

    .ctz-social-links--mobile a {
        display: inline-flex;
        padding: 0;
    }
}

/* ========================================
   17. MOBILE RESPONSIVE
======================================== */

@media (max-width: 767px) {

    .ctz-header-inner {
        gap: 12px;
    }

    .ctz-branding {
        gap: 10px;
    }

    .ctz-logo img {
        max-width: min(
            var(--ctz-logo-width),
            120px
        );

        max-height: 70px;
    }

    .ctz-site-title {
        font-size: clamp(
            18px,
            4.5vw,
            var(--ctz-title-size)
        );
    }

    .ctz-site-description {
        font-size: 12px;
    }

    /* Search label remains accessible */

    .ctz-search-label {
        position: absolute;

        width: 1px;
        height: 1px;

        padding: 0;
        margin: -1px;

        overflow: hidden;

        clip: rect(0, 0, 0, 0);

        white-space: nowrap;
        border: 0;
    }

    .ctz-search-panel {
        padding: 16px;
        border-radius: 12px;
    }

    .ctz-main {
        padding-block: 24px;
    }

    .ctz-post {
        padding: 18px;
    }

    .ctz-post-title {
        font-size: clamp(
            22px,
            5vw,
            var(--ctz-heading-size)
        );
    }

    /* Premium mobile blog cards */

    body.blog .ctz-post,
    body.archive .ctz-post,
    body.search .ctz-post {
        padding: 21px;
        border-radius: 14px;
    }

    /* Footer */

    .ctz-site-footer {
        padding: 35px 0;
    }

    .ctz-footer-menu {
        gap: 12px 18px;
    }
}

/* ========================================
   18. SMALL MOBILE
======================================== */

@media (max-width: 380px) {

    .ctz-container {
        width: calc(100% - 24px);
    }

    .ctz-header-inner {
        gap: 8px;
    }

    .ctz-branding {
        gap: 8px;
    }

    .ctz-navigation-inner {
        gap: 6px;
    }

    .ctz-mobile-menu summary {
        padding-inline: 8px;
    }

    .ctz-search-toggle summary {
        padding-inline: 8px;
    }

    body.blog .ctz-post,
    body.archive .ctz-post,
    body.search .ctz-post {
        padding: 17px;
    }

    .ctz-footer-menu {
        gap: 10px 15px;
    }
}

/* ========================================
   19. REDUCED MOTION
======================================== */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    .ctz-social-links a,
    .ctz-search-panel input[type="submit"],
    .ctz-search-panel button[type="submit"],
    .ctz-pagination a,
    body.blog .ctz-post,
    body.archive .ctz-post,
    body.search .ctz-post {
        transition: none;
    }

    .ctz-social-links a:hover,
    .ctz-search-panel input[type="submit"]:hover,
    .ctz-search-panel button[type="submit"]:hover,
    .ctz-pagination a:hover,
    body.blog .ctz-post:hover,
    body.archive .ctz-post:hover,
    body.search .ctz-post:hover {
        transform: none;
    }
}


