/*
Theme Name:       Hello KIway
Theme URI:        https://flavormedia.ch/kiway
Author:           Flavor Media GmbH
Author URI:       https://flavormedia.ch
Description:      A minimal blank theme designed to work with KIway Editor. Provides clean, unstyled foundations for blog, search, archive, and 404 pages while KIway handles landing page styling.
Version:          1.0.0
Requires at least: 6.0
Tested up to:     6.8
Requires PHP:     8.0
License:          GPL v2 or later
License URI:      https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:      hello-kiway
Tags:             blank, starter, page-builder, kiway
*/

/* === Reset & Base === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #1f2937;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    margin-bottom: 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    margin-bottom: 1em;
}

/* === Layout === */
.hk-site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.hk-content {
    flex: 1;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.hk-content-wide {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* === Header === */
.hk-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

.hk-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hk-site-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
}

.hk-site-title:hover {
    text-decoration: none;
    color: #2563eb;
}

.hk-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
}

.hk-nav a {
    color: #4b5563;
    font-size: 0.9rem;
}

.hk-nav a:hover {
    color: #111827;
}

/* === Footer === */
.hk-footer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
}

/* === Blog Posts === */
.hk-post {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.hk-post:last-child {
    border-bottom: none;
}

.hk-post-title {
    font-size: 1.5rem;
    margin-bottom: 0.25em;
}

.hk-post-title a {
    color: #111827;
}

.hk-post-title a:hover {
    color: #2563eb;
    text-decoration: none;
}

.hk-post-meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.hk-post-meta a {
    color: #6b7280;
}

.hk-post-meta a:hover {
    color: #2563eb;
}

.hk-post-thumbnail {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.hk-post-excerpt {
    color: #374151;
}

.hk-read-more {
    display: inline-block;
    margin-top: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
}

/* === Single Post === */
.hk-single-header {
    margin-bottom: 2rem;
}

.hk-single-title {
    font-size: 2rem;
    margin-bottom: 0.25em;
}

.hk-single-content {
    line-height: 1.8;
}

.hk-single-content p {
    margin-bottom: 1.25em;
}

.hk-single-content ul,
.hk-single-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.hk-single-content li {
    margin-bottom: 0.5em;
}

.hk-single-content blockquote {
    border-left: 3px solid #d1d5db;
    padding: 0.5em 1em;
    margin: 1.5em 0;
    color: #4b5563;
    font-style: italic;
}

.hk-single-content pre {
    background: #f3f4f6;
    padding: 1em;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-size: 0.875rem;
    margin: 1.5em 0;
}

.hk-single-content code {
    background: #f3f4f6;
    padding: 0.125em 0.25em;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.hk-single-content pre code {
    background: none;
    padding: 0;
}

.hk-single-content img {
    border-radius: 0.5rem;
    margin: 1.5em 0;
}

.hk-single-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.hk-single-content th,
.hk-single-content td {
    border: 1px solid #e5e7eb;
    padding: 0.5em 0.75em;
    text-align: left;
}

.hk-single-content th {
    background: #f9fafb;
    font-weight: 600;
}

/* === Post Navigation === */
.hk-post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.hk-post-nav a {
    color: #4b5563;
}

.hk-post-nav a:hover {
    color: #2563eb;
}

/* === Pagination === */
.hk-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
}

.hk-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #4b5563;
    text-decoration: none;
}

.hk-pagination .page-numbers.current {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.hk-pagination .page-numbers:hover:not(.current) {
    background: #f3f4f6;
}

/* === Search === */
.hk-search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.hk-search-form input[type="search"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    outline: none;
}

.hk-search-form input[type="search"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.hk-search-form button {
    padding: 0.5rem 1rem;
    background: #111827;
    color: #ffffff;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.hk-search-form button:hover {
    background: #1f2937;
}

/* === 404 === */
.hk-404 {
    text-align: center;
    padding: 4rem 1.5rem;
}

.hk-404 h1 {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 0.25em;
}

.hk-404 p {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* === Comments === */
.hk-comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.hk-comments h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.hk-comment-list {
    list-style: none;
    padding: 0;
}

.hk-comment-list .comment {
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.hk-comment-list .comment-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.hk-comment-list .comment-meta {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.hk-comment-list .comment-content p {
    margin-bottom: 0.5em;
}

/* === WordPress Alignment === */
.alignleft {
    float: left;
    margin: 0 1.5em 1em 0;
}

.alignright {
    float: right;
    margin: 0 0 1em 1.5em;
}

.aligncenter {
    display: block;
    margin: 1.5em auto;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.5em;
}

/* === Screen Reader === */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
   WooCommerce Basic Styles
   ========================================================================== */

/* Product Grid */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce ul.products li.product {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: box-shadow 0.2s;
}

.woocommerce ul.products li.product:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.woocommerce ul.products li.product a img {
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.woocommerce ul.products li.product .price {
    color: #111827;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.woocommerce ul.products li.product .price del {
    color: #9ca3af;
    font-weight: 400;
    font-size: 0.875rem;
}

.woocommerce ul.products li.product .price ins {
    text-decoration: none;
}

/* Buttons */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce .button {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #111827;
    color: #ffffff;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce .button:hover {
    background: #1f2937;
    color: #ffffff;
    text-decoration: none;
}

.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
    background: #2563eb;
}

.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
    background: #1d4ed8;
}

/* Sale Badge */
.woocommerce span.onsale {
    background: #dc2626;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1;
}

/* Star Rating */
.woocommerce .star-rating {
    color: #f59e0b;
    font-size: 0.875rem;
}

/* Single Product */
.woocommerce div.product {
    max-width: 1200px;
    margin: 0 auto;
}

.woocommerce div.product div.images {
    margin-bottom: 2rem;
}

.woocommerce div.product div.images img {
    border-radius: 0.5rem;
}

.woocommerce div.product .product_title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.woocommerce div.product p.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.woocommerce div.product .woocommerce-product-details__short-description {
    margin-bottom: 1.5rem;
    color: #374151;
    line-height: 1.7;
}

/* Quantity Input */
.woocommerce .quantity .qty {
    width: 4rem;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    text-align: center;
    font-size: 1rem;
}

/* Cart Table */
.woocommerce table.shop_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.woocommerce table.shop_table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.875rem;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.woocommerce table.shop_table img {
    width: 60px;
    height: auto;
    border-radius: 0.25rem;
}

/* Cart Totals / Checkout */
.woocommerce .cart_totals,
.woocommerce-checkout #order_review {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.woocommerce .cart_totals h2,
.woocommerce-checkout h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

/* Checkout Form */
.woocommerce form .form-row {
    margin-bottom: 1rem;
}

.woocommerce form .form-row label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Notices */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.woocommerce .woocommerce-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.woocommerce .woocommerce-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.woocommerce .woocommerce-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    list-style: none;
    padding-left: 1rem;
}

/* Breadcrumb */
.woocommerce .woocommerce-breadcrumb {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.woocommerce .woocommerce-breadcrumb a {
    color: #6b7280;
}

.woocommerce .woocommerce-breadcrumb a:hover {
    color: #2563eb;
}

/* Tabs (Single Product) */
.woocommerce div.product .woocommerce-tabs ul.tabs {
    list-style: none;
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    padding: 0;
    margin: 2rem 0 1rem;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    margin: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    text-decoration: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: #111827;
    border-bottom-color: #111827;
}

/* Result Count & Ordering */
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.woocommerce .woocommerce-ordering select {
    padding: 0.375rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

/* My Account */
.woocommerce-account .woocommerce-MyAccount-navigation {
    margin-bottom: 2rem;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #4b5563;
    border-bottom: 2px solid transparent;
    text-decoration: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
    color: #111827;
    border-bottom-color: #111827;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .woocommerce table.shop_table {
        font-size: 0.875rem;
    }

    .woocommerce table.shop_table th,
    .woocommerce table.shop_table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products {
        grid-template-columns: 1fr;
    }
}
