/*
Theme Name: Kyokushin Kan
Theme URI:
Author: Amir Abolhasani
Author URI: https://namirasoft.com
Description: A light, custom-built WordPress theme for the Kyokushin Kan Karate Dojo. Left sidebar layout matching the original kyokushinkan.ca site.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kyokushin-kan
Tags: custom, dojo, karate, sidebar, responsive
*/

:root {
    --kk-color-bg: #ffffff;
    --kk-color-surface: #f7f7f7;
    --kk-color-text: #1a1a1a;
    --kk-color-muted: #555555;
    --kk-color-accent: #6fb5d8;
    --kk-color-accent-dark: #4a93b8;
    --kk-color-border: #e5e5e5;
    --kk-color-sidebar: #0f3b5e;
    --kk-color-sidebar-dark: #0a2a44;
    --kk-color-sidebar-text: #ffffff;
    --kk-color-sidebar-muted: #c8d7e3;

    --kk-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Helvetica Neue", Arial, sans-serif;
    --kk-font-heading: "Helvetica Neue", Arial, sans-serif;

    --kk-sidebar-width: 280px;
    --kk-radius: 4px;
    --kk-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--kk-font-body);
    color: var(--kk-color-text);
    background: var(--kk-color-bg);
    line-height: 1.6;
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--kk-font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.6em;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a {
    color: var(--kk-color-accent-dark);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover,
a:focus {
    color: var(--kk-color-sidebar-dark);
    text-decoration: underline;
}

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

/* Skip link */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

.skip-link:focus {
    position: fixed;
    top: 8px;
    left: 8px;
    width: auto;
    height: auto;
    clip: auto;
    background: var(--kk-color-sidebar);
    color: #fff;
    padding: 8px 12px;
    z-index: 1000;
}

/* Layout shell */
.kk-layout {
    display: grid;
    grid-template-columns: var(--kk-sidebar-width) 1fr;
    min-height: 100vh;
}

/* Sidebar */
.kk-sidebar {
    background: var(--kk-color-sidebar);
    color: var(--kk-color-sidebar-text);
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
}

.kk-sidebar__inner {
    padding: 32px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kk-site-branding {
    text-align: center;
    padding: 0 20px;
}

.kk-site-branding__logo {
    margin: 0 auto 16px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.kk-site-branding__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.kk-site-branding__logo--default .kk-kanji {
    color: var(--kk-color-sidebar-dark);
    font-size: 1.6rem;
    font-weight: 700;
    writing-mode: vertical-rl;
    letter-spacing: 0.1em;
}

.kk-site-branding__flag {
    margin: 0 0 12px;
    color: var(--kk-color-sidebar-text);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    display: flex;
    justify-content: center;
    gap: 6px;
    align-items: center;
}

.kk-site-title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.02em;
    color: var(--kk-color-sidebar-text);
}

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

.kk-site-title a:hover,
.kk-site-title a:focus {
    color: var(--kk-color-accent);
    text-decoration: none;
}

.kk-site-description {
    margin: 6px 0 0;
    font-size: 0.78rem;
    color: var(--kk-color-sidebar-muted);
    line-height: 1.45;
}

/* Mobile nav toggle (hidden on desktop) */
.kk-nav-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    background: var(--kk-color-sidebar);
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: var(--kk-radius);
    cursor: pointer;
    font-size: 1rem;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Navigation */
.kk-main-navigation {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.kk-main-navigation ul.kk-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kk-main-navigation li {
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.kk-main-navigation a {
    display: block;
    padding: 14px 28px;
    color: var(--kk-color-sidebar-text);
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.02em;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.kk-main-navigation a:hover,
.kk-main-navigation a:focus,
.kk-main-navigation .current-menu-item > a,
.kk-main-navigation .current_page_item > a {
    background: var(--kk-color-sidebar-dark);
    color: var(--kk-color-accent);
    text-decoration: none;
}

/* Main column */
.kk-site-main {
    background: var(--kk-color-bg);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Reusable container for page content */
.kk-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Buttons */
.kk-button {
    display: inline-block;
    background: var(--kk-color-sidebar);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--kk-radius);
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 2px solid var(--kk-color-sidebar);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.kk-button:hover,
.kk-button:focus {
    background: var(--kk-color-sidebar-dark);
    border-color: var(--kk-color-sidebar-dark);
    color: #ffffff;
    text-decoration: none;
}

.kk-button--outline {
    background: transparent;
    color: var(--kk-color-sidebar);
}

.kk-button--outline:hover,
.kk-button--outline:focus {
    background: var(--kk-color-sidebar);
    color: #ffffff;
}

/* Generic inner page wrapper */
.kk-page {
    flex: 1;
    padding: clamp(32px, 5vw, 64px) 0;
}

.kk-page__header {
    margin-bottom: 32px;
}

.kk-post {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--kk-color-border);
}

.kk-post__title {
    margin-bottom: 8px;
}

/* Footer */
.kk-site-footer {
    background: var(--kk-color-sidebar);
    color: #d4d4d4;
    margin-top: auto;
}

.kk-site-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
}

.kk-site-footer__copy {
    margin: 0;
    color: #d4d4d4;
}

.kk-site-footer__links {
    margin: 0;
}

.kk-site-footer__top {
    color: #ffffff;
}

.kk-site-footer__top:hover,
.kk-site-footer__top:focus {
    color: var(--kk-color-accent);
}

/* Responsive: collapse sidebar on small screens */
@media (max-width: 900px) {
    .kk-nav-toggle {
        display: inline-flex;
    }

    .kk-layout {
        grid-template-columns: 1fr;
    }

    .kk-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        height: 100vh;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
    }

    .kk-sidebar.is-open {
        transform: translateX(0);
    }

    .kk-site-main {
        padding-top: 60px;
    }
}
