/* ==========================================================================
   TYRESÖ TAK AB — style.css
   Architecture: SMACSS (Base → Layout → Module → State)
   Naming: Bulma-inspired (no prefixes, no abbreviations)
   Approach: Mobile-first
   Primary brand: #0a3b80
   ========================================================================== */


/* ==========================================================================
   1. BASE — Resets, custom properties, typography
   ========================================================================== */

:root {
  --primary:        #0a3b80;
  --primary-dark:   #062a5c;
  --primary-light:  #1a5bb8;
  --accent:         #e8a020;
  --accent-hover:   #d08e10;

  --white:      #ffffff;
  --off-white:  #e9eef6;
  --gray-100:   #e8ecf1;
  --gray-200:   #cdd4de;
  --gray-500:   #6b7a8d;
  --gray-700:   #3a4555;
  --gray-900:   #1a2130;

  --font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius: 8px;
  --shadow-md: 0 4px 16px rgba(10, 59, 128, 0.1);
  --shadow-lg: 0 8px 32px rgba(10, 59, 128, 0.14);
  --speed: 0.25s ease;
}

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

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

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-900);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  margin: 0 0 1rem;
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }

p {
  margin: 0 0 1rem;
  color: var(--gray-700);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--speed);
}

a:hover { color: var(--primary-light); }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--primary);
  color: var(--white);
}


/* ==========================================================================
   2. LAYOUT — Structural containers
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Sections --- */

.section {
  padding: 3rem 0;
}

.section.is-alt { background: var(--off-white); }

.section.is-dark {
  background: var(--primary);
  color: var(--white);
}

.section.is-dark h2,
.section.is-dark h3,
.section.is-dark p { color: var(--white); }
.section.is-dark p { opacity: 0.88; }

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.5rem;
}

.section-header p { color: var(--gray-500); font-size: 1rem; }
.section.is-dark .section-header p { color: rgba(255, 255, 255, 0.75); }

/* --- Hero --- */

.hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1rem;
  background:
    linear-gradient(160deg, rgba(233, 238, 246, 0.86), rgba(255, 255, 255, 0.92)),
    url('images/hero.jpg') center / cover no-repeat;
  position: relative;
  overflow: hidden;
}

.hero-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo-image {
  max-width: 480px;
  width: calc(100% - 5rem);
  height: auto;
}

.hero-body {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

/* --- Grids --- */

.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}


/* ==========================================================================
   3. MODULE — Reusable components
   ========================================================================== */

/* --- Buttons --- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--speed), transform var(--speed), box-shadow var(--speed);
  text-decoration: none;
  line-height: 1;
}

.button:active { transform: scale(0.97); }

.button.is-fullwidth {
  width: 100%;
  background: var(--primary);
  color: var(--white);
  padding: 1rem;
  font-size: 1.05rem;
}

.button.is-fullwidth:hover { background: var(--primary-light); }

/* --- Section title with accent bar --- */

.section-title { position: relative; }

.section-title::after {
  content: '';
  display: block;
  width: 56px; height: 3px;
  background: var(--primary);
  margin-top: 0.5rem;
  border-radius: 2px;
}

.section-title.is-accent::after {
  background: var(--accent);
}

.section-header .section-title::after {
  margin-left: auto;
  margin-right: auto;
}

/* --- Service card --- */

.service-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 1.5rem;
  text-align: left;
  transition: background-color var(--speed), border-color var(--speed);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.service-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(232, 160, 32, 0.25);
}

.service-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--white);
  letter-spacing: -0.01em;
}

.service-card p {
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
  flex-grow: 1;
  margin-bottom: 0;
}

/* --- Form --- */

.field { display: flex; flex-direction: column; gap: 0.25rem; }

.field + .field { margin-top: 1rem; }

.label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
}

.input,
.select,
.textarea {
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-900);
  transition: border-color var(--speed), box-shadow var(--speed);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 59, 128, 0.1);
}

.textarea { resize: vertical; min-height: 120px; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a8d' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* --- Contact info --- */

.contact-items {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-icon {
  width: 3rem;
  height: 3rem;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info p {
  color: var(--gray-500);
  font-size: 1rem;
}

.contact-icon svg { width: 20px; height: 20px; color: var(--white); }

.contact-item strong {
  display: block;
  margin-bottom: 0;
  color: var(--gray-900);
  font-size: 1rem;
}

.contact-item span,
.contact-item a {
  font-size: 1rem;
  color: var(--gray-500);
}

.contact-item a:hover { color: var(--primary); }


/* ==========================================================================
   4. STATE — Interactive / toggled states
   ========================================================================== */

/* Scroll-reveal */
.is-hidden {
  opacity: 0;
  transform: translateY(24px);
}

.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Form submitted */
.is-submitted .button.is-fullwidth {
  background: #27ae60;
  pointer-events: none;
}


/* ==========================================================================
   5. RESPONSIVE — Mobile-first, min-width breakpoints
   ========================================================================== */

@media (min-width: 720px) {
  .hero { min-height: 60vh; }

  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-card:last-child {
    grid-column: span 2;
    max-width: 600px;
    margin: 0 auto;
  }
}

@media (min-width: 1200px) {
  .container { padding: 0 2.5rem; }

  .section { padding: 6rem 0; }

  .section-header {
    margin-bottom: 3rem;
  }

  .hero-logo-image {
    max-width: 480px;
    width: 100%;
    height: auto;
  }

  .contact-grid {
    grid-template-columns: 3fr 2fr;
    max-width: 1080px;
    margin: 0 auto;
    gap: 6rem;
  }

  .contact-items {
    margin-top: 2.5rem;
  }

  .service-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .service-card {
    padding: 2.5rem;
  }

  .service-card:last-child {
    grid-column: auto;
    max-width: none;
    margin: 0;
  }
}
