/*
Theme Name: Chemag Agrar
Theme URI: https://www.chemag.de
Author: Chemag Agrarchemikalien GmbH
Author URI: https://www.chemag.de
Description: Modernes WordPress FSE Theme für die Chemag Agrarchemikalien GmbH – internationaler Handel mit Düngemitteln.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
License: Proprietary
Text Domain: chemag-agrar
Tags: full-site-editing, block-theme, business, b2b
*/

/* =========================================================
   Custom Properties
   ========================================================= */
:root {
  --chemag-primary: #1D9E75;
  --chemag-primary-dark: #0F6E56;
  --chemag-primary-light: #E8F7F2;
  --chemag-secondary: #2C2C2A;
  --chemag-accent: #F1EFE8;
  --chemag-white: #FFFFFF;
  --chemag-light-gray: #F5F5F3;
  --chemag-mid-gray: #9E9E9A;
  --chemag-dark-gray: #4A4A47;
  --chemag-black: #1A1A18;

  --chemag-radius-sm: 4px;
  --chemag-radius-md: 8px;
  --chemag-radius-lg: 12px;
  --chemag-radius-xl: 20px;

  --chemag-shadow-sm: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .06);
  --chemag-shadow-md: 0 4px 12px rgba(0, 0, 0, .10), 0 2px 4px rgba(0, 0, 0, .06);
  --chemag-shadow-card: 0 2px 8px rgba(0, 0, 0, .08), 0 0 1px rgba(0, 0, 0, .06);

  --chemag-transition: 0.2s ease;
  --chemag-header-height: 72px;
}

/* =========================================================
   Global Reset & Base
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: 'Source Sans 3', sans-serif;
  color: var(--chemag-secondary);
  background-color: var(--chemag-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.entry-content {
  margin-top: 0;
}

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

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

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

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--chemag-primary);
  outline-offset: 3px;
  border-radius: var(--chemag-radius-sm);
}

/* =========================================================
   Utility Classes
   ========================================================= */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--chemag-primary);
  color: var(--chemag-white) !important;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 32px;
  border-radius: var(--chemag-radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color var(--chemag-transition),
    transform var(--chemag-transition),
    box-shadow var(--chemag-transition);
  text-decoration: none;
}

.btn-primary:hover {
  background-color: var(--chemag-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--chemag-shadow-md);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  color: var(--chemag-primary) !important;
  font-weight: 600;
  font-size: 16px;
  padding: 12px 28px;
  border-radius: var(--chemag-radius-md);
  border: 2px solid var(--chemag-primary);
  cursor: pointer;
  transition: background-color var(--chemag-transition),
    color var(--chemag-transition),
    transform var(--chemag-transition);
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: var(--chemag-primary);
  color: var(--chemag-white) !important;
  transform: translateY(-1px);
}

/* =========================================================
   Header
   ========================================================= */
.wp-block-template-part[data-slug="header"],
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--chemag-shadow-sm);
}

.chemag-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--chemag-header-height);
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* Navigation */
.wp-block-navigation__responsive-container {
  gap: 8px;
}

.wp-block-navigation-item__content {
  padding: 8px 12px !important;
  border-radius: var(--chemag-radius-sm);
  transition: background-color var(--chemag-transition), color var(--chemag-transition);
}

.wp-block-navigation-item__content:hover {
  background-color: var(--chemag-primary-light);
  color: var(--chemag-primary-dark) !important;
}

.wp-block-navigation .current-menu-item>.wp-block-navigation-item__content {
  color: var(--chemag-primary);
  font-weight: 600;
}

/* =========================================================
   Hero / Cover Block
   ========================================================= */
.chemag-hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
}

.chemag-hero-home {
  min-height: 680px;
}

.wp-block-cover {
  min-height: 520px;
}

/* =========================================================
   Cards
   ========================================================= */
.chemag-card {
  background: var(--chemag-white);
  border: 1px solid #E8E8E5;
  border-radius: var(--chemag-radius-lg);
  padding: 32px 28px;
  height: 100%;
  position: relative;
}

.chemag-card-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: transparent;
  border-radius: 50%;
  font-size: 0;
  text-decoration: none;
  position: absolute;
  bottom: 32px;
  right: 28px;
  transition: background-color var(--chemag-transition);
}

.chemag-card-arrow::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  background-color: var(--chemag-primary);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 45.6'%3E%3Cpolygon points='0 45.6 46 27.9 46 17.7 0 0 0 12.1 17.6 17.9 31.1 22.6 31.1 23 17.6 27.7 0 33.5 0 45.6 0 45.6'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  -webkit-mask-position: center;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 45.6'%3E%3Cpolygon points='0 45.6 46 27.9 46 17.7 0 0 0 12.1 17.6 17.9 31.1 22.6 31.1 23 17.6 27.7 0 33.5 0 45.6 0 45.6'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-size: contain;
  mask-position: center;
  transition: background-color var(--chemag-transition);
}

.chemag-card:hover .chemag-card-arrow {
  background-color: var(--chemag-primary);
}

.chemag-card:hover .chemag-card-arrow::before {
  background-color: var(--chemag-white);
}

/* =========================================================
   Team Cards
   ========================================================= */
.chemag-team-card {
  background: var(--chemag-white);
  border: 1px solid #E8E8E5;
  border-radius: var(--chemag-radius-lg);
  padding: 32px 24px;
  text-align: left;
}


.chemag-team-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 20px;
  background-color: var(--chemag-light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chemag-team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chemag-team-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--chemag-secondary);
  margin: 0 0 4px;
}

.chemag-team-role {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
}

.chemag-team-company {
  font-size: 13px;
  color: var(--chemag-mid-gray);
  font-weight: 600;
  margin: 0 0 20px;
}

.chemag-team-contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  font-size: 14px;
  color: var(--chemag-dark-gray);
}

.chemag-team-contacts li {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid var(--chemag-light-gray);
}

.chemag-team-contacts li:first-child {
  border-top: none;
}

.chemag-team-contacts span.label {
  font-weight: 600;
  color: var(--chemag-mid-gray);
  min-width: 20px;
}

.chemag-team-contacts a {
  color: var(--chemag-dark-gray);
  word-break: break-all;
}

.chemag-team-contacts a:hover {
  color: var(--chemag-primary);
}

/* =========================================================
   Download Cards
   ========================================================= */
.chemag-download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--chemag-white);
  border: 1px solid #E8E8E5;
  border-radius: var(--chemag-radius-lg);
  padding: 28px 32px;
  box-shadow: var(--chemag-shadow-card);
  transition: transform var(--chemag-transition), box-shadow var(--chemag-transition);
}

.chemag-download-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--chemag-shadow-md);
}

.chemag-download-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--chemag-secondary);
}

/* =========================================================
   USP / Bullet List
   ========================================================= */
.chemag-usp-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chemag-usp-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font-size: 16px;
  color: var(--chemag-dark-gray);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.chemag-usp-list li:last-child {
  border-bottom: none;
}

.chemag-usp-list li::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  background-color: var(--chemag-primary);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 45.6'%3E%3Cpolygon points='0 45.6 46 27.9 46 17.7 0 0 0 12.1 17.6 17.9 31.1 22.6 31.1 23 17.6 27.7 0 33.5 0 45.6 0 45.6'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  -webkit-mask-position: center;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 45.6'%3E%3Cpolygon points='0 45.6 46 27.9 46 17.7 0 0 0 12.1 17.6 17.9 31.1 22.6 31.1 23 17.6 27.7 0 33.5 0 45.6 0 45.6'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-size: contain;
  mask-position: center;
  margin-top: 3px;
}

/* =========================================================
   Page Hero Banner
   ========================================================= */
.chemag-page-hero {
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 48px;
}

.chemag-page-hero-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  color: var(--chemag-white);
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* =========================================================
   Section Spacing
   ========================================================= */
.chemag-section {
  padding-block: 80px;
}

.chemag-section-sm {
  padding-block: 48px;
}

.chemag-section-lg {
  padding-block: 112px;
}

.chemag-section-bg-accent {
  background-color: var(--chemag-accent);
}

.chemag-section-bg-primary-light {
  background-color: var(--chemag-primary-light);
}

.chemag-section-bg-dark {
  background-color: var(--chemag-secondary);
  color: var(--chemag-white);
}

/* =========================================================
   Footer
   ========================================================= */
.chemag-footer {
  background-color: var(--chemag-secondary);
  color: rgba(255, 255, 255, 0.75);
  padding-top: 64px;
  padding-bottom: 32px;
}

.chemag-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  margin-top: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.chemag-footer a {
  color: rgba(255, 255, 255, 0.75);
  transition: color var(--chemag-transition);
}

.chemag-footer a:hover {
  color: var(--chemag-primary);
}

.chemag-footer h4 {
  color: var(--chemag-white);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.chemag-footer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =========================================================
   Language Switcher (PolyLang select)
   ========================================================= */
.chemag-lang-switcher {
  display: flex;
  align-items: center;
}

.wp-block-polylang-language-switcher {
  position: relative;
  display: flex;
  align-items: center;
}

.wp-block-polylang-language-switcher::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  translate: 0 -50%;
  width: 10px;
  height: 6px;
  pointer-events: none;
  background-color: var(--chemag-primary);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.pll-switcher-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--chemag-dark-gray);
  background-color: transparent;
  border: 1px solid var(--chemag-primary-light);
  border-radius: var(--chemag-radius-sm);
  padding: 4px 28px 4px 8px;
  cursor: pointer;
  transition: background-color var(--chemag-transition),
    color var(--chemag-transition),
    border-color var(--chemag-transition);
}

.pll-switcher-select:hover,
.pll-switcher-select:focus {
  background-color: var(--chemag-primary-light);
  color: var(--chemag-primary-dark);
  border-color: var(--chemag-primary-light);
  outline: none;
}

.pll-switcher-select:focus-visible {
  outline: 2px solid var(--chemag-primary);
  outline-offset: 2px;
}

/* =========================================================
   Responsive
   ========================================================= */

/* Shift navigation block mobile breakpoint from 600px to 1024px */
@media (min-width: 600px) and (max-width: 1024px) {
  .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
    display: none;
  }

  .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: flex;
  }
}

@media (max-width: 1200px) {
  .chemag-header-inner {
    padding-inline: var(--wp--preset--spacing--5) !important;
  }
}

@media (max-width: 1024px) {
  .chemag-section {
    padding-block: 64px;
  }
}

@media (max-width: 768px) {
  :root {
    --chemag-header-height: 64px;
  }

  .chemag-section {
    padding-block: 48px;
  }

  .chemag-section-sm {
    padding-block: 32px;
  }

  .chemag-section-lg {
    padding-block: 64px;
  }

  .chemag-page-hero {
    min-height: 240px;
    padding-bottom: 32px;
  }

  .chemag-download-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .chemag-footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {

  .btn-primary,
  .btn-secondary {
    padding: 12px 24px;
    font-size: 15px;
  }

  .chemag-card {
    padding: 24px 20px;
  }
}

/* =========================================================
   Block Editor Overrides
   ========================================================= */
.wp-block-buttons .wp-block-button__link {
  transition: background-color var(--chemag-transition),
    transform var(--chemag-transition),
    box-shadow var(--chemag-transition);
}

.wp-block-buttons .wp-block-button__link:hover {
  transform: translateY(-1px);
  box-shadow: var(--chemag-shadow-md);
}

.wp-block-cover__background {
  border-radius: 0 !important;
}

/* Ensure full-width covers break out of content width */
.wp-block-cover.alignfull,
.wp-block-group.alignfull {
  width: 100vw;
  margin-inline: calc(-1 * var(--wp--style--root--padding-left));
}