/*
Theme Name: ITプランナー コーポレートサイト
Theme URI: https://example.com
Author: ITプランナー
Author URI: https://example.com
Description: DX専門の顧問・コンサルティングサポート企業のWordPressテーマ
Version: 1.0.0
License: GPL v2 or later
Text Domain: itplanner
*/

/* WordPress Compatibility Fixes */

/* 1. Admin Bar Compensation */
body.admin-bar #header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar #header {
        top: 46px;
    }
}

@media screen and (max-width: 600px) {
    body.admin-bar #header {
        top: 0;
    }
}

/* 2. WordPress Default Resets */
.nav-menu {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nav-menu li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nav-menu a {
    text-decoration: none !important;
}

/* 3. WordPress Menu Structure Fix */
.nav-menu > li.menu-item,
.nav-menu > li {
    display: inline-block;
    margin: 0;
    padding: 0;
}

.nav-menu > li.menu-item > a,
.nav-menu > li > a {
    color: #ffffff;
    text-decoration: none;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
    position: relative;
    display: inline-block;
    padding: 10px 0;
}

.nav-menu > li.menu-item > a:hover,
.nav-menu > li > a:hover {
    color: #c9a961;
}

.nav-menu > li.menu-item > a::after,
.nav-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #c9a961;
    transition: width 0.3s ease;
}

.nav-menu > li.menu-item > a:hover::after,
.nav-menu > li > a:hover::after {
    width: 100%;
}

/* 4. Fix WordPress nav-cta structure */
.nav-menu .nav-cta {
    display: inline-flex !important;
    gap: 16px;
    margin-left: 32px;
    align-items: center;
}

/* 5. Ensure header navigation displays correctly */
#header nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* 6. WordPress Custom Logo Fix */
.custom-logo-link {
    display: inline-block;
    line-height: 1;
}

.custom-logo {
    height: auto;
    max-height: 50px;
    width: auto;
}

/* 7. Typography Inheritance Fix */
body,
body * {
    font-family: var(--font-body), 'Noto Sans JP', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading), 'Noto Serif JP', serif !important;
}

/* 8. Container Width Fix */
.container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 var(--container-padding) !important;
    width: 100% !important;
}

/* 9. WordPress Content Width Fix */
.page-content,
.entry-content {
    max-width: 100% !important;
}

/* 10. Remove WordPress Default Margins */
.entry-content > *,
.page-content > * {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 11. Mobile Menu Compatibility */
@media (max-width: 768px) {
    .nav-menu.active {
        display: flex !important;
    }

    .nav-menu > li.menu-item {
        display: block !important;
        width: 100%;
        text-align: center;
    }

    .nav-menu .nav-cta {
        flex-direction: column !important;
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/* 12. WordPress Block Editor Compatibility */
.wp-block {
    max-width: 100%;
}

/* 13. Ensure proper z-index hierarchy */
body.admin-bar .nav-menu.active {
    top: 0 !important;
}

/* 14. Fix WordPress default link styles */
a {
    color: inherit;
    text-decoration: none;
}

a:hover,
a:focus,
a:active {
    outline: none;
}

/* 15. WordPress alignment classes */
.alignleft {
    float: left;
    margin-right: 1.5em;
}

.alignright {
    float: right;
    margin-left: 1.5em;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* 16. Clearfix for WordPress floats */
.clearfix::after,
.entry-content::after,
.page-content::after {
    content: "";
    display: table;
    clear: both;
}

/* 17. WordPress Submenu Fixes */
.nav-menu .sub-menu {
    display: none;
}

/* 18. Ensure nav menu displays as flex */
.nav-menu {
    display: flex !important;
    gap: 32px;
    align-items: center;
}

/* 19. WordPress admin bar body margin fix */
body.admin-bar {
    margin-top: 0 !important;
}

/* 20. Ensure proper display of menu items */
.nav-menu li.menu-item-has-children > a::before {
    display: none;
}

/* 21. Fix button display in navigation */
.nav-menu .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 22. Ensure hamburger is visible on mobile */
.hamburger {
    cursor: pointer;
    background: none;
    border: none;
}

/* 23. Fix WordPress default paragraph margins */
p {
    margin-bottom: 0;
}

/* 24. Ensure proper color inheritance */
.nav-menu li.menu-item.current-menu-item > a {
    color: #c9a961;
}

/* 25. Fix footer menu structure */
.footer-links.menu {
    display: flex;
    gap: 32px;
    justify-content: center;
}

.footer-links.menu li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 26. WordPress gallery fixes */
.gallery {
    margin: 0 !important;
}

/* 27. Ensure sections display correctly */
section {
    display: block;
    width: 100%;
}

/* 28. Fix WordPress image alignments */
img {
    max-width: 100%;
    height: auto;
}