/* base.css — Design tokens, reset, typography, layout
 * Part of Ortorodzina theme CSS architecture.
 * DO NOT add page-specific styles here.
 */

/*
Theme Name: Ortorodzina
Description: Main application styles - base, layout, typography, and design tokens
Version: 1.0.0
*/

/* ============================================================================
   Design Tokens / CSS Variables
   ========================================================================= */

:root {
  /* Base Colors */
  --color-bg: #ffffff;
  --color-surface: #f7f8fa;
  --color-text: #0e1116;
  --color-text-soft: #4b5563;
  --color-border: #e5e7eb;

  /* Dark Premium Palette */
  --color-dark: #0b1220;
  --color-dark-2: #111827;
  --color-navy: #122033;

  /* Accent */
  --color-accent: #ff3a2d;

  /* State Colors */
  --color-success: #14804a;
  --color-warning: #b7791f;
  --color-error: #c53030;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Spacing Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 80px;
  --space-10: 96px;
  --space-11: 112px;
  --space-12: 128px;

  /* Typography */
  --font-body: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --line-height-body: 1.7;
  --line-height-heading: 1.2;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);

  /* Container Widths */
  --container-max: 1320px;
  --container-wide: 1600px;
}

/* ============================================================================
   CSS Reset & Base Styles
   ========================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-bg);
}

body.menu-open {
  overflow: hidden;
}

/* ============================================================================
   Typography
   ========================================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--space-4);
  font-weight: 700;
  line-height: var(--line-height-heading);
  color: var(--color-dark);
}

h1 {
  font-size: 48px;
}

h2 {
  font-size: 36px;
}

h3 {
  font-size: 28px;
}

h4 {
  font-size: 22px;
}

h5 {
  font-size: 18px;
}

h6 {
  font-size: 16px;
}

p {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--color-dark);
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Suppress click-focus outline globally; keep keyboard outline via :focus-visible */
*:focus:not(:focus-visible) {
  outline: none;
}

strong,
b {
  font-weight: 700;
}

em,
i {
  font-style: italic;
}

small {
  font-size: 14px;
}

/* ============================================================================
   Layout
   ========================================================================= */

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
  /* padding: var(--space-8) 0; */
}

.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.container-wide {
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.content-area {
  display: grid;
  gap: var(--space-7);
}

.content-area.has-sidebar {
  grid-template-columns: 1fr 300px;
}

.content-area.no-sidebar {
  grid-template-columns: 1fr;
}

@media (max-width: 768px) {
  .content-area.has-sidebar {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   Section Header — shared across all reusable sections
   ========================================================================= */

.sec-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-10);
}

.sec-header__title {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 700;
  color: var(--color-dark);
  line-height: 1.25;
  margin: 0 0 var(--space-4);
}

.sec-header__intro {
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text-soft);
  margin: 0;
}

/* ============================================================================
   Header
   ========================================================================= */

.site-header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow var(--transition-fast);
}

@media (max-width: 768px) {
  /* position: sticky fails inside a flex container on real mobile browsers.
     Switching to block layout restores correct sticky scroll behaviour. */
  .site {
    display: block;
  }
}

.header-topbar {
  background-color: var(--color-dark-2);
  color: var(--color-surface);
  padding: var(--space-2) 0;
  font-size: 14px;
}

.header-topbar .container {
  max-width: var(--container-wide);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.topbar-left {
  flex: 1;
}

.topbar-company-name {
  color: var(--color-surface);
  font-weight: 500;
  font-size: 14px;
}

.topbar-contact {
  display: flex;
  gap: var(--space-5);
  justify-content: center;
}

.topbar-contact a {
  color: var(--color-surface);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.topbar-contact a:hover {
  color: var(--color-accent);
}

.topbar-icon,
.icon.topbar-icon {
  width: 20px;
  height: 20px;
  margin-right: var(--space-2);
  vertical-align: middle;
}

.topbar-social {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.topbar-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-surface);
  transition: color var(--transition-fast);
}

.topbar-social a:hover {
  color: var(--color-accent);
}

.topbar-social svg {
  width: 16px;
  height: 16px;
}

/* Topbar Responsive */
@media (max-width: 1024px) {
  .topbar-inner {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }

  .topbar-left,
  .topbar-contact,
  .topbar-social {
    flex: none;
    justify-content: center;
  }

  .topbar-contact {
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .topbar-company-name {
    font-size: 13px;
  }

  .header-topbar {
    font-size: 13px;
  }
}

@media (max-width: 1024px) {
  .topbar-left {
    display: none;
  }

  .topbar-company-name {
    display: none;
  }

  .topbar-inner {
    flex-direction: row;
    justify-content: space-between;
  }

  .topbar-contact {
    gap: var(--space-2);
    font-size: 12px;
  }

  .topbar-phone,
  .topbar-email {
    display: flex;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .header-topbar {
    padding: var(--space-1) 0;
  }

  .topbar-contact {
    flex-direction: column;
    gap: var(--space-1);
  }

  .topbar-social {
    gap: var(--space-2);
  }
}

.header-main {
  padding: var(--space-2) 0;
}

.header-main .container {
  max-width: var(--container-wide);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
  min-height: 70px;
}

.site-branding {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.site-title a {
  color: var(--color-dark);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.site-title a:hover {
  color: var(--color-accent);
}

.site-description {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-soft);
  font-weight: 400;
}

.custom-logo-link {
  display: block;
  max-width: 180px;
  line-height: 0;
}

.custom-logo {
  display: block;
  width: auto;
  height: auto;
  max-height: 50px;
}
