/**
 * GRiNS Theme — Custom Styles
 */

/* ── Skip Link (Barrierefreiheit) ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 999;
  padding: 0.75rem 1.5rem;
  background: #007194;
  color: #fff;
  border-radius: 0 0 6px 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 0;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.grins-header-logo {
  flex-shrink: 0;
}
.grins-header-logo img {
  height: 48px;
  width: auto;
}

/* Ensure navigation takes available space */
.site-header .wp-block-navigation {
  flex: 1;
  min-width: 0;
}
.site-header .wp-block-navigation .wp-block-navigation__container {
  justify-content: flex-end;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* Navigation */
.wp-block-navigation .wp-block-navigation-item a {
  color: #1a1a1a;
  transition: color 0.15s;
}
.wp-block-navigation .wp-block-navigation-item a:hover,
.wp-block-navigation .wp-block-navigation-item a:focus {
  color: #007194;
}
.wp-block-navigation .wp-block-navigation-item.current-menu-item > a {
  color: #007194;
  font-weight: 600;
}

/* Submenu */
.wp-block-navigation .has-child .wp-block-navigation__submenu-container {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 0.5rem 0;
  min-width: 200px;
}
.wp-block-navigation .has-child .wp-block-navigation__submenu-container a {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
}

/* ── Hero Section ── */
.hero-section {
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(193, 202, 49, 0.06);
  pointer-events: none;
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(128, 205, 236, 0.05);
  pointer-events: none;
}
.hero-logo img {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

/* ── Blog Cards ── */
.blog-card {
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.blog-card .wp-block-post-featured-image img {
  transition: transform 0.3s;
}
.blog-card:hover .wp-block-post-featured-image img {
  transform: scale(1.03);
}
.blog-card .wp-block-post-featured-image {
  overflow: hidden;
  margin: 0;
}
.blog-card .wp-block-post-title a {
  color: #1a1a1a;
  text-decoration: none;
}
.blog-card .wp-block-post-title a:hover {
  color: #007194;
}

/* Blog Grid — responsive */
.blog-grid .wp-block-post-template.is-layout-grid {
  gap: 1.5rem;
}
@media (max-width: 781px) {
  .blog-grid .wp-block-post-template.is-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Partner Cards ── */
.partner-card {
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 100%;
}
.partner-card:hover {
  border-color: #80cdec;
  box-shadow: 0 4px 16px rgba(0, 113, 148, 0.08);
}

/* ── Social Share ── */
.grins-share-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.grins-share-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #555;
}
.grins-share-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border: 1px solid #e5e7eb;
  color: #555;
  background: #fff;
}
.grins-share-btn:hover {
  background: #007194;
  color: #fff;
  border-color: #007194;
}
.grins-share-linkedin:hover {
  background: #0077B5;
  border-color: #0077B5;
}

/* ── Förderhinweis Footer ── */
.foerderhinweis {
  position: relative;
}
.foerder-logos {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

/* ── Global ── */
.wp-block-post-navigation-link {
  font-weight: 500;
}

/* Focus styles for accessibility */
*:focus-visible {
  outline: 3px solid #007194;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Smooth scrolling */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ── Section Labels ── */
.wp-block-group p[style*="text-transform: uppercase"],
.wp-block-group p[style*="text-transform:uppercase"] {
  margin-bottom: 0.25rem;
}

/* ── Page hero banner ── */
.wp-block-group.has-primary-background-color .wp-block-post-title {
  margin: 0;
}

/* ── Blog card — no featured image fallback ── */
.blog-card .wp-block-post-featured-image:empty {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #007194 0%, #80cdec 100%);
  border-radius: 12px 12px 0 0;
}

/* ── Footer responsive ── */
@media (max-width: 781px) {
  .site-footer .wp-block-columns {
    flex-direction: column;
    gap: 1rem;
  }
  .site-footer .has-text-align-right {
    text-align: left !important;
  }
  .foerderhinweis .wp-block-columns {
    gap: 2rem;
  }
}

/* ── Responsive adjustments ── */
@media (max-width: 600px) {
  .hero-section {
    min-height: auto !important;
  }
  .hero-section h1 {
    font-size: 1.75rem !important;
  }
  .grins-lang-switch {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

/* Language Switcher */
.grins-lang-switch {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-left: 2rem;
}
.grins-lang-switch a {
  color: #555;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.15s;
}
.grins-lang-switch a.lang-active {
  color: #007194;
  background: rgba(0, 113, 148, 0.08);
}
.grins-lang-switch a:hover {
  color: #007194;
}
.grins-lang-switch .lang-sep {
  color: #ccc;
}

/* Newsletter form in footer */
.site-footer .newsletter-form input[type="email"] {
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1rem;
  width: 100%;
  max-width: 400px;
}
.site-footer .newsletter-form input[type="email"]::placeholder {
  color: rgba(255,255,255,0.6);
}
.site-footer .newsletter-form input[type="submit"] {
  padding: 0.75rem 2rem;
  background: #c1ca31;
  color: #1a1a1a;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.site-footer .newsletter-form input[type="submit"]:hover {
  background: #a8b11a;
}

/* ── Contact Form 7 ── */
.wpcf7 label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 1.25rem;
}
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  margin-top: 0.25rem;
  transition: border-color 0.15s;
}
.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 textarea:focus {
  border-color: #007194;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 113, 148, 0.1);
}
.wpcf7 textarea {
  min-height: 150px;
  resize: vertical;
}
.wpcf7 input[type="submit"] {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: #007194;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.wpcf7 input[type="submit"]:hover {
  background: #005a76;
}
.wpcf7-response-output {
  border-radius: 6px !important;
  padding: 1rem !important;
  font-size: 0.9375rem;
}

/* ══════════════════════════════════════════
   RESPONSIVE DESIGN
   ══════════════════════════════════════════ */

/* ── Tablet / iPad (768px – 1023px) ── */
@media (max-width: 1023px) {
  /* Header: smaller logo, tighter spacing */
  .grins-header-logo img {
    height: 40px;
  }
  .site-header .wp-block-navigation .wp-block-navigation__container {
    gap: 1rem;
  }
  .site-header .wp-block-navigation {
    font-size: 0.875rem;
  }

  /* Hero: reduce padding and font sizes */
  .hero-section .wp-block-cover {
    min-height: 400px !important;
  }
  .hero-section .hero-logo img {
    width: 220px !important;
  }
  .hero-section h1 {
    font-size: 1.875rem !important;
  }

  /* Columns: reduce gap */
  .wp-block-columns {
    gap: 2rem !important;
  }

  /* Stats: wrap on tablet */
  .wp-block-group[class*="has-light-background"] > .wp-block-group > .wp-block-group[style*="flex"] {
    gap: 1.5rem;
  }

  /* Partner cards: full width on tablet */
  .partner-card {
    flex-basis: 100% !important;
    max-width: 100%;
  }

  /* Blog grid: 2 columns on tablet */
  .blog-grid .wp-block-post-template.is-layout-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Footer: stack content */
  .foerderhinweis .wp-block-group[style*="flex"] {
    flex-direction: column;
    gap: 2rem;
    align-items: flex-start;
  }

  /* General padding reduction */
  .wp-block-group[style*="padding-top:5rem"] {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }
}

/* ── Mobile / iPhone (max 767px) ── */
@media (max-width: 767px) {
  /* Header: mobile layout */
  .grins-header-logo img {
    height: 36px;
  }
  .grins-lang-switch {
    margin-left: 0.5rem;
    font-size: 0.75rem;
  }
  .grins-lang-switch a {
    padding: 0.2rem 0.4rem;
  }

  /* Hero: compact mobile */
  .wp-block-cover.hero-section {
    min-height: 360px !important;
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  .hero-section .hero-logo img {
    width: 180px !important;
  }
  .hero-section h1 {
    font-size: 1.5rem !important;
  }
  .hero-section .has-accent-blue-color {
    font-size: 0.9375rem !important;
  }
  .hero-section .wp-block-buttons {
    flex-direction: column;
    width: 100%;
  }
  .hero-section .wp-block-button {
    width: 100%;
  }
  .hero-section .wp-block-button__link {
    width: 100%;
    text-align: center;
  }

  /* "Über das Projekt" columns stack on mobile */
  .wp-block-columns {
    flex-direction: column !important;
  }
  .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
  }

  /* Stats: 2x2 grid on mobile */
  .is-layout-flex > .wp-block-group[style*="padding-top:2rem"] {
    flex-basis: 45%;
    text-align: center;
  }

  /* Blog grid: single column */
  .blog-grid .wp-block-post-template.is-layout-grid {
    grid-template-columns: 1fr !important;
  }

  /* General: reduce section padding */
  .wp-block-group[style*="padding-top:5rem"] {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }
  .wp-block-group[style*="padding-top:4rem"] {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  .wp-block-group[style*="padding-left:2rem"] {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Headings: scale down */
  h1.wp-block-heading { font-size: 1.75rem !important; }
  h2.wp-block-heading { font-size: 1.5rem !important; }
  h3.wp-block-heading { font-size: 1.25rem !important; }

  /* Page hero banner */
  .wp-block-group.has-primary-background-color h1 {
    font-size: 1.5rem !important;
  }

  /* Footer links: stack */
  .site-footer .is-layout-flex[style*="space-between"] {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    align-items: center;
  }

  /* Newsletter form */
  .newsletter-form div[style*="flex"] {
    flex-direction: column;
    align-items: stretch;
  }
  .newsletter-form input[type="email"] {
    max-width: 100% !important;
  }
  .newsletter-form input[type="submit"] {
    width: 100%;
  }

  /* Förderhinweis */
  .foerderhinweis .foerder-logos img {
    max-height: 70px !important;
  }
  .foerderhinweis .wp-block-group[style*="flex"] {
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
  }
}

/* ── Small phones (max 375px) ── */
@media (max-width: 375px) {
  .hero-section h1 {
    font-size: 1.25rem !important;
  }
  .hero-section .hero-logo img {
    width: 150px !important;
  }
  h2.wp-block-heading {
    font-size: 1.25rem !important;
  }
}

/* ── Print styles ── */
@media print {
  .site-header,
  .skip-link,
  .grins-lang-switch,
  .wp-block-navigation,
  .newsletter-form,
  .grins-share-links,
  .wp-block-button {
    display: none !important;
  }
  .site-footer {
    margin-top: 2rem;
  }
  body {
    font-size: 12pt;
    color: #000;
  }
}
