/*
Theme Name: TinkerTailz
Theme URI: https://tinkertailz.de
Author: TinkerTailz Team
Author URI: https://tinkertailz.de
Description: Ein modernes WordPress Block-Theme für TinkerTailz – Innovative 3D-Drucke, Cosplay Props & individuelle Anfertigungen.
Version: 2.28.0
Requires at least: 6.3
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tinkertailz
Tags: block-theme, full-site-editing, woocommerce, dark-mode, custom-colors
*/

/* ============================================================
   DESIGN TOKENS – LIGHT MODE (DEFAULT)
   ============================================================ */
:root {
  /* Brand */
  --tt-primary:        #7C4DFF;
  --tt-secondary:      #A784FF;
  --tt-glow:           #C9B4FF;

  /* Surfaces */
  --tt-bg:             #F8F3EE;
  --tt-surface:        #FFFDFC;
  --tt-card:           #FFFFFF;
  --tt-border:         #E7D8CC;
  --tt-warm:           #D9B48A;

  /* Text */
  --tt-text:           #2C1F1A;
  --tt-text2:          #6A5951;

  /* Semantic aliases */
  --tt-link:           var(--tt-primary);
  --tt-link-hover:     var(--tt-secondary);
  --tt-focus-ring:     var(--tt-glow);

  /* Typography */
  --tt-font-heading:   'Orbitron', 'Segoe UI', Arial, sans-serif;
  --tt-font-body:      'Inter', 'Segoe UI', Arial, sans-serif;

  --tt-fs-sm:          0.875rem;   /* 14px */
  --tt-fs-base:        1rem;       /* 16px */
  --tt-fs-lg:          1.125rem;   /* 18px */
  --tt-fs-xl:          1.25rem;    /* 20px */
  --tt-fs-2xl:         1.5rem;     /* 24px */
  --tt-fs-3xl:         1.875rem;   /* 30px */
  --tt-fs-4xl:         2.25rem;    /* 36px */

  --tt-fw-normal:      400;
  --tt-fw-medium:      500;
  --tt-fw-semibold:    600;
  --tt-fw-bold:        700;
  --tt-fw-black:       900;

  --tt-lh-tight:       1.2;
  --tt-lh-normal:      1.5;
  --tt-lh-relaxed:     1.7;

  /* Spacing */
  --tt-space-0:        0;
  --tt-space-1:        0.25rem;
  --tt-space-2:        0.5rem;
  --tt-space-3:        0.75rem;
  --tt-space-4:        1rem;
  --tt-space-5:        1.5rem;
  --tt-space-6:        2rem;
  --tt-space-7:        3rem;
  --tt-space-8:        4rem;
  --tt-space-9:        6rem;
  --tt-space-10:       8rem;

  /* Border radius */
  --tt-radius-sm:      0.25rem;
  --tt-radius-md:      0.5rem;
  --tt-radius-lg:      0.75rem;
  --tt-radius-xl:      1rem;
  --tt-radius-full:    9999px;

  /* Shadows */
  --tt-shadow-sm:      0 1px 3px rgba(44,31,26,0.08), 0 1px 2px rgba(44,31,26,0.05);
  --tt-shadow-md:      0 4px 12px rgba(44,31,26,0.10), 0 2px 6px rgba(44,31,26,0.06);
  --tt-shadow-lg:      0 10px 32px rgba(44,31,26,0.12), 0 4px 12px rgba(44,31,26,0.08);
  --tt-shadow-glow:    0 0 24px rgba(124,77,255,0.35), 0 0 8px rgba(124,77,255,0.2);

  /* Transitions */
  --tt-transition:     150ms ease;
  --tt-transition-md:  300ms ease;

  /* Layout */
  --tt-max-width:      1280px;
  --tt-header-h:       72px;

  /* Glass panels */
  --tt-glass-section:  rgba(248, 243, 238, 0.38);
  --tt-glass-card:     rgba(255, 255, 255, 0.45);
  --tt-glass-border:   rgba(255, 255, 255, 0.35);
  --tt-glass-blur:     blur(18px);
}

/* ============================================================
   DARK MODE OVERRIDES
   ============================================================ */
[data-theme="dark"] {
  /* Surfaces */
  --tt-bg:             #140F0D;
  --tt-surface:        #221815;
  --tt-card:           #2B1F1B;
  --tt-border:         #4B342C;
  --tt-warm:           #E8C7A1;

  /* Glass — dark mode: darker, more opaque glass for visibility */
  --tt-glass-section:  rgba(20, 15, 13, 0.65);
  --tt-glass-card:     rgba(30, 22, 18, 0.75);
  --tt-glass-border:   rgba(75, 52, 44, 0.6);

  /* Text */
  --tt-text:           #FFFFFF;
  --tt-text2:          #D8CFC9;

  /* Shadows in dark mode */
  --tt-shadow-sm:      0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --tt-shadow-md:      0 4px 12px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
  --tt-shadow-lg:      0 10px 32px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.4);
  --tt-shadow-glow:    0 0 32px rgba(124,77,255,0.5), 0 0 12px rgba(124,77,255,0.3);
}

/* ============================================================
   BASE RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  overflow-x: hidden;           /* prevent horizontal scroll globally */
}

body {
  font-family: var(--tt-font-body);
  font-size: var(--tt-fs-base);
  font-weight: var(--tt-fw-normal);
  line-height: var(--tt-lh-normal);
  color: var(--tt-text);
  background-color: var(--tt-bg);
  background-image: url('/wp-content/themes/tinkertailz/assets/images/hero-bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;           /* prevent horizontal scroll globally */
  transition: background-color var(--tt-transition-md), color var(--tt-transition-md);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* iOS/mobile: background-attachment:fixed causes rendering issues and
   can create invisible overflow. Switch to scroll on touch devices. */
@supports (-webkit-touch-callout: none) {
  body { background-attachment: scroll; }
}
@media (max-width: 768px) {
  body { background-attachment: scroll; }
}

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

a {
  color: var(--tt-link);
  text-decoration: none;
  transition: color var(--tt-transition);
}

a:hover {
  color: var(--tt-link-hover);
}

a:focus-visible {
  outline: 2px solid var(--tt-focus-ring);
  outline-offset: 3px;
  border-radius: var(--tt-radius-sm);
}

button {
  font-family: var(--tt-font-body);
  cursor: pointer;
  border: none;
  background: none;
}

button:focus-visible {
  outline: 2px solid var(--tt-focus-ring);
  outline-offset: 3px;
  border-radius: var(--tt-radius-sm);
}

ul, ol {
  list-style: none;
}

input, textarea, select {
  font-family: var(--tt-font-body);
  font-size: var(--tt-fs-base);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--tt-font-heading);
  font-weight: var(--tt-fw-bold);
  line-height: var(--tt-lh-tight);
  color: var(--tt-text);
}

::selection {
  background-color: var(--tt-primary);
  color: #ffffff;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tt-space-2);
  padding: var(--tt-space-3) var(--tt-space-6);
  background: var(--tt-primary);
  color: #ffffff !important;
  font-family: var(--tt-font-body);
  font-size: var(--tt-fs-base);
  font-weight: var(--tt-fw-semibold);
  line-height: 1;
  border-radius: var(--tt-radius-full);
  border: 2px solid var(--tt-primary);
  cursor: pointer;
  transition: background var(--tt-transition), border-color var(--tt-transition), box-shadow var(--tt-transition), transform var(--tt-transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--tt-secondary);
  border-color: var(--tt-secondary);
  box-shadow: var(--tt-shadow-glow);
  transform: translateY(-1px);
  color: #ffffff !important;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--tt-focus-ring);
  outline-offset: 3px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tt-space-2);
  padding: var(--tt-space-3) var(--tt-space-6);
  background: transparent;
  color: var(--tt-primary) !important;
  font-family: var(--tt-font-body);
  font-size: var(--tt-fs-base);
  font-weight: var(--tt-fw-semibold);
  line-height: 1;
  border-radius: var(--tt-radius-full);
  border: 2px solid var(--tt-primary);
  cursor: pointer;
  transition: background var(--tt-transition), color var(--tt-transition), box-shadow var(--tt-transition), transform var(--tt-transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-outline:hover {
  background: var(--tt-primary);
  color: #ffffff !important;
  box-shadow: var(--tt-shadow-glow);
  transform: translateY(-1px);
}

.btn-outline:active {
  transform: translateY(0);
}

.btn-outline:focus-visible {
  outline: 2px solid var(--tt-focus-ring);
  outline-offset: 3px;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--tt-max-width);
  margin-inline: auto;
  padding-inline: var(--tt-space-5);
}

@media (min-width: 640px) {
  .container {
    padding-inline: var(--tt-space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-inline: var(--tt-space-8);
  }
}

.section-padding {
  padding-block: var(--tt-space-8);
}

@media (min-width: 768px) {
  .section-padding {
    padding-block: var(--tt-space-9);
  }
}

@media (min-width: 1024px) {
  .section-padding {
    padding-block: var(--tt-space-10);
  }
}

/* --- Text helpers --- */
.text-brand {
  color: var(--tt-primary);
}

.text-center {
  text-align: center;
}

.text-2 {
  color: var(--tt-text2);
}

/* --- Grid helpers --- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--tt-space-5);
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--tt-space-5);
}

@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--tt-space-5);
}

@media (min-width: 640px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- Card base --- */
.tt-card {
  background: var(--tt-card);
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius-xl);
  padding: var(--tt-space-6);
  box-shadow: var(--tt-shadow-sm);
  transition: box-shadow var(--tt-transition-md), transform var(--tt-transition-md), border-color var(--tt-transition-md);
}

.tt-card:hover {
  box-shadow: var(--tt-shadow-md);
  transform: translateY(-2px);
  border-color: var(--tt-primary);
}

/* ============================================================
   GLASS PANELS – Sektionen als Glasplatten über dem BG-Bild
   ============================================================ */
.tt-featured-services,
.tt-services-grid,
.tt-pricing,
.tt-lumina,
.tt-feedback-section,
.tt-cta-banner,
.tt-site-footer {
  background: var(--tt-glass-section) !important;
  backdrop-filter: var(--tt-glass-blur);
  -webkit-backdrop-filter: var(--tt-glass-blur);
}

/* Header auch Glas im Light Mode */
.tt-site-header {
  background: rgba(255, 253, 252, 0.50) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* CTA Banner – Light Mode braucht soliden Gradient damit weißer Text lesbar bleibt */
:root:not([data-theme="dark"]) .tt-cta-banner {
  background: linear-gradient(135deg, #7C4DFF 0%, #A784FF 50%, #7C4DFF 100%) !important;
}

/* Karten innerhalb der Sektionen */
.tt-fc-card,
.tt-service-card,
.tt-pricing-card,
.tt-feedback-card,
.tt-card {
  background: var(--tt-glass-card) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: var(--tt-glass-border) !important;
}

/* --- Screen reader only --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* --- Section headings ---
   These classes form the canonical design system for all pages.
   The front page patterns define identical styles inline — these
   are the base definitions that all sub-pages should use.        */

.tt-section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.tt-section-tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  font-family: var(--tt-font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-primary);
  background: rgba(124,77,255,0.08);
  border: 1px solid rgba(124,77,255,0.2);
  padding: .3rem .875rem;
  border-radius: var(--tt-radius-full);
  margin-bottom: .75rem;
}

.tt-section-title {
  font-family: var(--tt-font-heading);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 900;
  color: var(--tt-text);
  line-height: 1.15;
  margin: 0 0 .875rem;
}

.tt-section-desc {
  color: var(--tt-text2);
  font-size: 1.0625rem;
  line-height: 1.75;
  max-width: 56ch;
  margin-inline: auto;
}

/* Page hero variant — larger title for h1 elements */
.tt-page-hero-title {
  font-family: var(--tt-font-heading);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 900;
  line-height: var(--tt-lh-tight);
  color: var(--tt-text);
  margin: .5rem 0 1rem;
}

/* Glass section background — alternating sections with frosted glass effect */
.tt-glass-section {
  background: var(--tt-glass-section);
  backdrop-filter: var(--tt-glass-blur);
  -webkit-backdrop-filter: var(--tt-glass-blur);
}

/* --- Divider --- */
.tt-divider {
  width: 48px;
  height: 4px;
  background: var(--tt-primary);
  border-radius: var(--tt-radius-full);
  margin-block: var(--tt-space-4);
}

/* --- WordPress editor styles --- */
.wp-site-blocks {
  padding-top: 0;
  padding-bottom: 0;
}

/* Sticky header fix: WordPress wraps <!-- wp:template-part --> in its own
   <header class="wp-block-template-part"> element. position:sticky must be
   on THIS outer wrapper, not on the inner .tt-site-header element, because
   sticky only works relative to the nearest scrolling ancestor (wp-site-blocks).
   The inner .tt-site-header still has sticky as a fallback for non-block contexts. */
.wp-site-blocks > header:first-child,
.wp-site-blocks > .wp-block-template-part:first-child {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.is-layout-constrained > * {
  max-width: var(--tt-max-width);
  margin-inline: auto;
}

/* --- Accessibility --- */
:focus-visible {
  outline: 2px solid var(--tt-focus-ring);
  outline-offset: 3px;
}

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--tt-space-4);
  z-index: 9999;
  padding: var(--tt-space-3) var(--tt-space-5);
  background: var(--tt-primary);
  color: #fff;
  font-weight: var(--tt-fw-semibold);
  border-radius: 0 0 var(--tt-radius-md) var(--tt-radius-md);
  transition: top var(--tt-transition);
}

.skip-link:focus {
  top: 0;
}

/* ============================================================
   FEEDBACK / TESTIMONIAL SECTION
   ============================================================ */

.tt-feedback-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--tt-space-5);
}
@media (min-width: 640px) {
  .tt-feedback-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .tt-feedback-grid { grid-template-columns: repeat(3, 1fr); }
}

.tt-feedback-card {
  position: relative;
  border: 1px solid var(--tt-glass-border);
  border-radius: var(--tt-radius-xl);
  padding: var(--tt-space-6);
  display: flex;
  flex-direction: column;
  gap: var(--tt-space-3);
  transition: box-shadow var(--tt-transition-md),
              transform var(--tt-transition-md),
              border-color var(--tt-transition-md);
}
.tt-feedback-card:hover {
  box-shadow: var(--tt-shadow-md);
  transform: translateY(-3px);
  border-color: var(--tt-primary);
}

/* Featured card accent */
.tt-feedback-card--featured {
  border-color: rgba(124, 77, 255, 0.35);
  box-shadow: var(--tt-shadow-sm), 0 0 0 1px rgba(124, 77, 255, 0.1);
}
.tt-feedback-card--featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--tt-space-5);
  right: var(--tt-space-5);
  height: 3px;
  background: linear-gradient(90deg, var(--tt-primary), var(--tt-secondary));
  border-radius: 0 0 var(--tt-radius-sm) var(--tt-radius-sm);
}

.tt-feedback-quote {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 3rem;
  line-height: 1;
  color: var(--tt-primary);
  opacity: 0.3;
  user-select: none;
  margin-bottom: calc(var(--tt-space-1) * -1);
}

.tt-feedback-text {
  margin: 0;
  padding: 0;
  font-size: var(--tt-fs-base);
  line-height: var(--tt-lh-relaxed);
  color: var(--tt-text);
  flex: 1;
}

.tt-feedback-stars {
  color: #f0b429;
  font-size: var(--tt-fs-lg);
  letter-spacing: 1px;
}

.tt-feedback-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: var(--tt-space-3);
  border-top: 1px solid var(--tt-border);
  margin-top: auto;
}
.tt-feedback-name {
  font-family: var(--tt-font-heading);
  font-size: var(--tt-fs-sm);
  font-weight: var(--tt-fw-bold);
  color: var(--tt-text);
  letter-spacing: 0.02em;
}
.tt-feedback-project {
  font-size: 0.75rem;
  color: var(--tt-text2);
}

.tt-feedback-badge {
  position: absolute;
  top: var(--tt-space-3);
  right: var(--tt-space-3);
  font-size: 0.65rem;
  font-weight: var(--tt-fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tt-primary);
  background: rgba(124, 77, 255, 0.08);
  border: 1px solid rgba(124, 77, 255, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: var(--tt-radius-full);
}

/* ============================================================
   LUMINA IDLE TOAST — subtle help prompt near the chat FAB
   ============================================================ */

.tt-idle-toast {
  position: fixed;
  bottom: 100px;
  right: 24px;
  z-index: 9001;
  max-width: 280px;
  display: flex;
  align-items: flex-start;
  gap: 0;
  background: var(--tt-glass-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--tt-glass-border);
  border-radius: var(--tt-radius-lg);
  box-shadow: var(--tt-shadow-lg), 0 0 0 1px rgba(124, 77, 255, 0.1);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  overflow: hidden;
}
.tt-idle-toast--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.tt-idle-toast--leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
}

.tt-idle-toast-body {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem 0.75rem 0.875rem;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.tt-idle-toast-body:hover {
  background: rgba(124, 77, 255, 0.04);
}

.tt-idle-toast-paw {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.3;
}
.tt-idle-toast-text {
  font-size: var(--tt-fs-sm);
  line-height: 1.5;
  color: var(--tt-text);
}

.tt-idle-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--tt-text2);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.5rem 0.625rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--tt-transition);
  align-self: flex-start;
}
.tt-idle-toast-close:hover {
  opacity: 1;
}

@media (max-width: 480px) {
  .tt-idle-toast {
    right: 12px;
    bottom: 90px;
    max-width: calc(100vw - 24px);
  }
}
