/* AInsteinWP Theme Supreme — Template Components CSS
 * Load order: main.css → templates.css → client.css
 *
 * NEW components for PHP page-templates and partials.
 * Base components (cta-banner, feature-grid, testimonials, content-block)
 * are already defined in main.css and NOT duplicated here.
 */

/* ═══════════════════════════════════════════════════════════
   LAYOUT UTILITIES
   ═══════════════════════════════════════════════════════════ */

.section-inner {
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 5vw, 3.75rem);
}
.max-w {
  max-width: 1320px;
  margin-inline: auto;
}

/* Grid helpers — mobile-first */
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 600px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}


/* ═══════════════════════════════════════════════════════════
   HERO EYEBROW — optional eyebrow inside .hero-content
   Base .hero styles live in main.css
   ═══════════════════════════════════════════════════════════ */

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 1rem;
}
.hero-eyebrow::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--gold-light);
  border-radius: 2px;
}


/* ═══════════════════════════════════════════════════════════
   CONTENT ALTERNATING — text + image, flips every other
   Used by: template-industry.php, template-payment.php
   ═══════════════════════════════════════════════════════════ */

.content-alt {
  position: relative;
}
.content-alt:nth-child(even) {
  background: var(--off-white);
}

.content-alt-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  max-width: 1320px;
  margin-inline: auto;
  padding: clamp(3rem, 8vw, 5rem) clamp(1.25rem, 5vw, 3.75rem);
}
@media (min-width: 900px) {
  .content-alt-inner {
    grid-template-columns: 1fr 1fr;
    gap: clamp(2.5rem, 5vw, 5rem);
  }
  /* Reverse: image left, text right */
  .content-alt.reverse .content-alt-inner {
    direction: rtl;
  }
  .content-alt.reverse .content-alt-inner > * {
    direction: ltr;
  }
}

.content-alt-text h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: 0.75rem;
}
.content-alt-text p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}
.content-alt-text .check-list {
  margin: 1rem 0;
}
.content-alt-text .btn {
  margin-top: 0.75rem;
}

.content-alt-image {
  border-radius: var(--radius-md);
  overflow: hidden;
}
.content-alt-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  transition: transform 0.4s ease;
}
.content-alt-image:hover img {
  transform: scale(1.02);
}


/* ═══════════════════════════════════════════════════════════
   PRODUCT CARDS — equipment with specs
   Used by: template-feature.php (kvittoskrivare, kassadator, etc.)
   ═══════════════════════════════════════════════════════════ */

.product-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--gray-200);
}

.product-card-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--gray-50);
}
.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  transition: transform 0.4s ease;
}
.product-card:hover .product-card-image img {
  transform: scale(1.05);
}

.product-card-body {
  padding: 1.5rem;
}
.product-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.product-card-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Expandable specifications */
.product-specs {
  border-top: 1px solid var(--gray-100);
  margin: 1rem 1.5rem 0;
  padding-bottom: 0.5rem;
}
.product-specs summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
}
.product-specs summary::-webkit-details-marker {
  display: none;
}
.product-specs summary::after {
  content: '+';
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 700;
  transition: transform 0.2s ease;
}
.product-specs[open] summary::after {
  content: '\2212';
}

.product-specs-list {
  padding: 0 0 0.75rem;
}
.product-specs-list dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.75rem;
}
.product-specs-list dd {
  font-size: 0.88rem;
  color: var(--text);
  margin-top: 0.15rem;
}


/* ═══════════════════════════════════════════════════════════
   OVERVIEW GRID — child page cards (bransch, integration, etc.)
   Used by: overview-grid.php partial
   ═══════════════════════════════════════════════════════════ */

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}
@media (min-width: 600px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.overview-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  position: relative;
}
.overview-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.overview-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--gray-200);
}
.overview-card:hover::before {
  transform: scaleX(1);
}

.overview-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--gray-50);
}
.overview-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.overview-card:hover .overview-card-image img {
  transform: scale(1.05);
}

.overview-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.overview-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
.overview-card-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}
.overview-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-hover);
  margin-top: 0.75rem;
}
.overview-card-link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition);
}
.overview-card:hover .overview-card-link svg {
  transform: translateX(4px);
}

/* Icon variant (no image, just icon + text) */
.overview-card--icon {
  padding: 1.75rem;
}
.overview-card--icon .overview-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(24, 64, 93, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.overview-card--icon .overview-card-icon svg {
  width: 24px;
  height: 24px;
  color: var(--navy);
}


/* ═══════════════════════════════════════════════════════════
   TEMPLATE REVEAL ANIMATIONS
   Extends the base .reveal from main.css
   ═══════════════════════════════════════════════════════════ */

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.32s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* ═══════════════════════════════════════════════════════════
   GOOGLE REVIEWS — horizontal scroller with star ratings
   Used by: template-startsida.php
   ═══════════════════════════════════════════════════════════ */

.google-reviews {
  background: var(--off-white);
}

.review-scroller {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 0 1.5rem;
  scrollbar-width: none;
}
.review-scroller::-webkit-scrollbar { display: none; }

.review-card {
  flex: 0 0 320px;
  scroll-snap-align: start;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
@media (min-width: 768px) {
  .review-card { flex: 0 0 380px; }
}
.review-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--gray-200);
}

.review-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 1rem;
}

.review-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.25rem;
}

.review-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.review-author strong {
  font-size: 0.88rem;
  color: var(--navy);
}
.review-meta {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.google-reviews-cta .btn {
  gap: 6px;
}


/* ═══════════════════════════════════════════════════════════
   GOOGLE MAP — embedded map with navy surround
   Used by: template-startsida.php
   ═══════════════════════════════════════════════════════════ */

.google-map-section {
  background: var(--navy);
  color: #fff;
}
.google-map-section .section-eyebrow {
  color: var(--gold-light);
}
.google-map-section .section-eyebrow::before {
  background: var(--gold-light);
}
.google-map-section .section-title {
  color: #fff;
}
.google-map-section .section-intro {
  color: rgba(255,255,255,0.6);
}

.map-container {
  margin-top: 2rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.map-container iframe {
  display: block;
  width: 100%;
  height: 400px;
  border: 0;
}
