/*
Theme Name: CoTheme
Theme URI: https://reklamco.se
Author: Reklam & Co
Author URI: https://reklamco.se
Description: Ett minimalt WordPress-tema byggt för Beaver Builder. Ren grund utan bloat – bara global typografi, färgvariabler och BB-stöd.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cotheme
*/

/* ==========================================================================
   Reset / Normalize
   ========================================================================== */

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

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

body {
  font-family: var(--cotheme-font-body, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  font-size: var(--cotheme-body-size, 16px);
  line-height: var(--cotheme-body-line-height, 1.6);
  color: var(--cotheme-text, #333);
  background-color: var(--cotheme-bg, #fff);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--cotheme-font-heading, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  font-weight: var(--cotheme-font-heading-weight, 700);
  line-height: 1.2;
  color: var(--cotheme-heading, var(--cotheme-text, #333));
}

h1 { font-size: var(--cotheme-h1-size, 44px); }
h2 { font-size: var(--cotheme-h2-size, 36px); }
h3 { font-size: var(--cotheme-h3-size, 28px); }
h4 { font-size: var(--cotheme-h4-size, 22px); }
h5 { font-size: var(--cotheme-h5-size, 18px); }
h6 { font-size: var(--cotheme-h6-size, 16px); }

p {
  margin-bottom: 1em;
}

a {
  color: var(--cotheme-primary, #0066cc);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--cotheme-primary-hover, var(--cotheme-secondary, #004999));
}

a:focus-visible {
  color: var(--cotheme-primary-hover, var(--cotheme-secondary, #004999));
  outline: 2px solid var(--cotheme-primary, #0066cc);
  outline-offset: 2px;
  border-radius: 2px;
}

ul, ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

blockquote {
  border-left: 4px solid var(--cotheme-primary, #0066cc);
  padding: 0.5em 1em;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--cotheme-text-light, #666);
}

/* ==========================================================================
   Buttons (base)
   ========================================================================== */

.cotheme-btn,
button,
input[type="submit"] {
  display: inline-block;
  padding: 0.75em 1.5em;
  font-family: var(--cotheme-font-body, inherit);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background-color: var(--cotheme-primary, #0066cc);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.cotheme-btn:hover,
button:hover,
input[type="submit"]:hover {
  background-color: var(--cotheme-primary-hover, var(--cotheme-secondary, #004999));
}

.cotheme-btn:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible {
  background-color: var(--cotheme-primary-hover, var(--cotheme-secondary, #004999));
  outline: 2px solid var(--cotheme-primary, #0066cc);
  outline-offset: 2px;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.cotheme-site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.cotheme-content {
  flex: 1;
}

.cotheme-container {
  width: 100%;
  max-width: var(--cotheme-container-width, 1200px);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   WordPress Core
   ========================================================================== */

.alignwide {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

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

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

.wp-caption-text {
  font-size: 0.875rem;
  color: var(--cotheme-text-light, #666);
  margin-top: 0.5em;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* ==========================================================================
   Forms (base)
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.625em 0.875em;
  border: 1px solid var(--cotheme-border, #ddd);
  border-radius: 4px;
  background: #fff;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--cotheme-primary, #0066cc);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--cotheme-primary, #0066cc);
  outline-offset: 1px;
  box-shadow: none;
}

/* ==========================================================================
   Utility classes
   ========================================================================== */

.cotheme-text-center { text-align: center; }
.cotheme-text-right { text-align: right; }
.cotheme-mt-1 { margin-top: 1rem; }
.cotheme-mt-2 { margin-top: 2rem; }
.cotheme-mb-1 { margin-bottom: 1rem; }
.cotheme-mb-2 { margin-bottom: 2rem; }

/* ==========================================================================
   Default header & footer
   ========================================================================== */

.cotheme-header {
  border-bottom: 1px solid var(--cotheme-border, #ddd);
}

.cotheme-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.cotheme-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--cotheme-border, #ddd);
}

.cotheme-footer-inner {
  text-align: center;
}

.cotheme-footer-widgets {
  margin-bottom: 1.5rem;
}

.cotheme-footer-copy {
  margin-top: 1rem;
  color: var(--cotheme-text-light, #666);
  font-size: 0.875rem;
}

/* ==========================================================================
   Skip-to-content (WCAG 2.4.1)
   ========================================================================== */

.cotheme-skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100000;
  padding: 0.75em 1.5em;
  background: var(--cotheme-primary, #0066cc);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
  transition: top 0.15s ease;
}

.cotheme-skip-link:focus {
  top: 0;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ==========================================================================
   Reduced motion (WCAG 2.3.3)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
