/*
Theme Name: Katusetohter
Theme URI: https://katusetohter.ee
Author: Katusetohter OÜ
Author URI: https://katusetohter.ee
Description: Custom WordPress theme for Katusetohter OÜ — katuse-, fassaadi- ja üldehitustööd Võrus ja üle Eesti. A 1:1 conversion of the React/Vite source. Estonian only, light theme, VELUX official partner. No page builders, no ACF, no form plugins.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: katusetohter
*/

/* =========================================================================
   Design tokens — ported verbatim from React src/index.css (:root, light)
   Light theme only. Colors are stored as raw HSL channels and consumed by
   Tailwind utilities as hsl(var(--token)).
   ========================================================================= */
:root {
  --background: 210 20% 98%;
  --foreground: 220 20% 10%;

  --card: 0 0% 100%;
  --card-foreground: 220 20% 10%;

  --popover: 0 0% 100%;
  --popover-foreground: 220 20% 10%;

  --primary: 0 72% 45%;
  --primary-foreground: 0 0% 100%;

  --secondary: 220 14% 20%;
  --secondary-foreground: 0 0% 98%;

  --muted: 210 15% 93%;
  --muted-foreground: 220 10% 45%;

  --accent: 0 72% 45%;
  --accent-foreground: 0 0% 100%;

  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;

  --border: 220 13% 88%;
  --input: 220 13% 88%;
  --ring: 0 72% 45%;

  --radius: 0.5rem;

  --sidebar-background: 0 0% 98%;
  --sidebar-foreground: 240 5.3% 26.1%;
  --sidebar-primary: 240 5.9% 10%;
  --sidebar-primary-foreground: 0 0% 98%;
  --sidebar-accent: 240 4.8% 95.9%;
  --sidebar-accent-foreground: 240 5.9% 10%;
  --sidebar-border: 220 13% 91%;
  --sidebar-ring: 217.2 91.2% 59.8%;

  /* Custom tokens */
  --hero-overlay: 220 20% 8%;
  --section-dark: 220 20% 8%;
  --section-dark-foreground: 210 20% 92%;
  --section-alt: 210 15% 95%;
}

/* =========================================================================
   Base element styles (plain-CSS equivalent of the @layer base rules in
   src/index.css — @apply cannot run in a static stylesheet).
   ========================================================================= */
html,
body {
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

/* Hide Alpine.js-bound elements until Alpine initialises (prevents flash). */
[x-cloak] {
  display: none !important;
}

/* Offset in-page anchors (e.g. #katuseaknad) so they clear the sticky header. */
:target,
[id] {
  scroll-margin-top: 130px;
}

* {
  border-color: hsl(var(--border));
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
}

/* =========================================================================
   Utilities ported from src/index.css @layer utilities
   ========================================================================= */
.text-gradient {
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  background-image: linear-gradient(to right, hsl(var(--primary)), #dc2626); /* primary -> red-600 */
}

/* =========================================================================
   Keyframes — ported from tailwind.config.ts (fade-up). Mirrors the
   framer-motion fadeUp variant used across the React pages.
   ========================================================================= */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes accordion-down {
  from { height: 0; }
  to { height: var(--radix-accordion-content-height); }
}

@keyframes accordion-up {
  from { height: var(--radix-accordion-content-height); }
  to { height: 0; }
}

/* Respect users who prefer reduced motion (disables AOS reveals visually). */
@media (prefers-reduced-motion: reduce) {
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Progressive enhancement: if JS is disabled or AOS fails to load, never keep
   content hidden (AOS's own CSS sets [data-aos] to opacity:0 by default). */
.no-js [data-aos],
.kt-no-aos [data-aos] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* WordPress admin bar should not break the sticky header offset. */
.admin-bar .kt-header {
  top: 32px;
}
@media screen and (max-width: 782px) {
  .admin-bar .kt-header {
    top: 46px;
  }
}

/* Native gallery / project gallery grid helper (single project page). */
.kt-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (min-width: 768px) {
  .kt-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
