/*
 * Krona Mag - Base Stylesheet
 * Version: 0.1.0
 * Description: Layout base, container, reset, typography.
 *
 * Sections:
 *   1. Layout Base
 *   2. Container
 *   3. Main
 *   4. Admin Bar
 *   5. Layout with Sidebar
 *   6. Section Headers
 *   7. Buttons
 */

/* =============================================
   1. LAYOUT BASE
   Global box-sizing and base resets
   ============================================= */

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

body {
  margin: 0;
  padding: 0;
  background: var(--km-bg);
  color: var(--km-text);
}

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

a {
  text-decoration: none;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* =============================================
   2. CONTAINER
   Centered max-width wrapper with lateral padding
   ============================================= */

.km-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================================
   3. MAIN
   No padding - sections manage their own spacing
   ============================================= */

.km-main {
  padding: 0;
  margin-top: 0;
}

/* =============================================
   4. ADMIN BAR
   WordPress admin bar compensation
   ============================================= */

.admin-bar .km-header {
  top: 32px;
}

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

/* =============================================
   5. LAYOUT WITH SIDEBAR
   2-column layout: content + sidebar
   Used on single, archive pages
   ============================================= */

.km-layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  padding: 48px 0;
  align-items: start;
}

/* Main content column - min-width:0 prevents overflow */
.km-content-area {
  min-width: 0;
}

/* Sticky sidebar below header */
.km-sidebar {
  position: sticky;
  top: 100px;
}

/* =============================================
   6. SECTION HEADERS
   Flex row: title + decorative line + see all link
   Used in all homepage sections
   ============================================= */

.km-section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

/* Section title - uppercase small, accent color */
.km-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--km-accent);
  white-space: nowrap;
}

.km-section-title a {
  color: var(--km-accent);
}

.km-section-title a:hover {
  color: var(--km-accent-dark);
}

/* Decorative line - extends to fill space */
.km-section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--km-border);
}

/* See all link - right side */
.km-see-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--km-accent);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.2s;
  white-space: nowrap;
}

.km-see-all:hover {
  color: var(--km-accent-dark);
}

/* =============================================
   7. BUTTONS
   Base button styles used across the theme
   ============================================= */

/* Primary button - accent color */
.km-btn-primary {
  display: inline-block;
  background: var(--km-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 32px;
  border-radius: var(--km-radius);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.2s;
  border: none;
  cursor: pointer;
}

.km-btn-primary:hover {
  background: var(--km-accent-dark);
  color: #fff;
  transform: translateY( -2px );
}

/* Load more button */
.km-btn-more {
  display: inline-block;
  background: var(--km-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 40px;
  border-radius: var(--km-radius);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.2s;
}

.km-btn-more:hover {
  background: var(--km-accent-dark);
  color: #fff;
  transform: translateY( -2px );
}

/* =============================================
   HEADER BASE
   Dark background for header
   ============================================= */

.km-header {
  background: var(--km-header-bg);
  z-index: 100;
}

.km-header--sticky {
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

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

.km-logo a {
  display: flex;
  align-items: center;
  height: 100%;
}

.km-logo-text {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.km-logo .custom-logo {
  height: 40px;
  width: auto;
}

/* Nav menu base links */
.km-nav .km-menu li a {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--km-radius);
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}

.km-nav .km-menu li a:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Exception for dropdown links */
.km-nav .km-menu li .km-dropdown a:hover {
  background: color-mix(in srgb, var(--km-item-color) 25%, white) !important;
  color: #1e293b !important;
}