/*
Theme Name: Nisius
Theme URI: https://nisius.de
Author: Nisius.de
Author URI: https://nisius.de
Description: Child Theme für Twenty Twenty-Four mit zweisprachiger Navigation (DE/EN), Polylang-Integration und angepasstem Footer für das Nisius Genealogie-Projekt.
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Template: twentytwentyfour
Text Domain: nisius

Nisius Genealogie - Familiengeschichte seit 1600
*/

/* =================================
   LANGUAGE-SPECIFIC VISIBILITY
   Based on Polylang body class (pll-de / pll-en)
   ================================= */

/* -------- DEFAULT: Hide all language-specific items -------- */

/* Header menu items */
.menu-item-de,
.menu-item-en {
  display: none !important;
}

/* Footer intro text */
.footer-intro-de,
.footer-intro-en {
  display: none !important;
}

/* Footer column titles */
.footer-col-title-de,
.footer-col-title-en {
  display: none !important;
}

/* Footer navigation */
.footer-nav-de,
.footer-nav-en {
  display: none !important;
}

/* Copyright */
.copyright-de,
.copyright-en {
  display: none !important;
}

/* -------- GERMAN PAGES: Show DE elements -------- */

body.pll-de .menu-item-de,
body[class*="lang-de"] .menu-item-de,
html[lang="de"] .menu-item-de,
html[lang="de-DE"] .menu-item-de {
  display: flex !important;
}

body.pll-de .footer-intro-de,
body[class*="lang-de"] .footer-intro-de,
html[lang="de"] .footer-intro-de,
html[lang="de-DE"] .footer-intro-de {
  display: block !important;
}

body.pll-de .footer-col-title-de,
body[class*="lang-de"] .footer-col-title-de,
html[lang="de"] .footer-col-title-de,
html[lang="de-DE"] .footer-col-title-de {
  display: block !important;
}

body.pll-de .footer-nav-de,
body[class*="lang-de"] .footer-nav-de,
html[lang="de"] .footer-nav-de,
html[lang="de-DE"] .footer-nav-de {
  display: flex !important;
}

body.pll-de .copyright-de,
body[class*="lang-de"] .copyright-de,
html[lang="de"] .copyright-de,
html[lang="de-DE"] .copyright-de {
  display: block !important;
}

/* -------- ENGLISH PAGES: Show EN elements -------- */

body.pll-en .menu-item-en,
body[class*="lang-en"] .menu-item-en,
html[lang="en"] .menu-item-en,
html[lang="en-US"] .menu-item-en,
html[lang="en-GB"] .menu-item-en {
  display: flex !important;
}

body.pll-en .footer-intro-en,
body[class*="lang-en"] .footer-intro-en,
html[lang="en"] .footer-intro-en,
html[lang="en-US"] .footer-intro-en,
html[lang="en-GB"] .footer-intro-en {
  display: block !important;
}

body.pll-en .footer-col-title-en,
body[class*="lang-en"] .footer-col-title-en,
html[lang="en"] .footer-col-title-en,
html[lang="en-US"] .footer-col-title-en,
html[lang="en-GB"] .footer-col-title-en {
  display: block !important;
}

body.pll-en .footer-nav-en,
body[class*="lang-en"] .footer-nav-en,
html[lang="en"] .footer-nav-en,
html[lang="en-US"] .footer-nav-en,
html[lang="en-GB"] .footer-nav-en {
  display: flex !important;
}

body.pll-en .copyright-en,
body[class*="lang-en"] .copyright-en,
html[lang="en"] .copyright-en,
html[lang="en-US"] .copyright-en,
html[lang="en-GB"] .copyright-en {
  display: block !important;
}

/* =================================
   LANGUAGE SWITCHER (PHP-generated)
   ================================= */

.language-switcher {
  margin-left: 1.5rem;
  padding-left: 1.5rem;
  border-left: 1px solid var(--wp--preset--color--contrast-3, rgba(0,0,0,0.1));
}

.nisius-language-switcher {
  display: flex;
  align-items: center;
  gap: 0;
}

.nisius-language-switcher .lang-sep {
  color: var(--wp--preset--color--contrast, #111111);
  opacity: 0.3;
  margin: 0 0.25rem;
  font-size: 0.8rem;
}

.nisius-language-switcher .lang-switch {
  display: inline-block;
}

.nisius-language-switcher .lang-switch a {
  color: var(--wp--preset--color--contrast, #111111);
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.15s ease;
  font-size: 0.85rem;
  white-space: nowrap;
  display: inline-block;
}

.nisius-language-switcher .lang-switch a:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Highlight current language */
.nisius-language-switcher .lang-switch.current-lang a {
  background-color: rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

/* =================================
   HEADER STYLING
   ================================= */

.site-header {
  position: relative;
  z-index: 100;
}

.site-header .wp-block-site-logo img {
  height: 40px;
  width: auto;
}

/* Navigation spacing */
.main-navigation {
  gap: 0.25rem;
}

/* Navigation links */
.main-navigation .wp-block-navigation-item__content {
  color: var(--wp--preset--color--contrast, #111111);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  transition: opacity 0.15s ease;
  font-size: 0.95rem;
}

.main-navigation .wp-block-navigation-item__content:hover {
  opacity: 0.7;
}

/* Dropdown arrow */
.main-navigation .wp-block-navigation-submenu > .wp-block-navigation-item__content::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.5;
}

/* Submenu container */
.main-navigation .wp-block-navigation__submenu-container {
  background-color: var(--wp--preset--color--base, #ffffff);
  border: 1px solid var(--wp--preset--color--contrast-3, rgba(0,0,0,0.1));
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  min-width: 220px;
  padding: 0.5rem 0;
}

.main-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
  display: block;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  color: var(--wp--preset--color--contrast, #111111);
}

.main-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
  background-color: rgba(0, 0, 0, 0.04);
  opacity: 1;
}

/* =================================
   FOOTER STYLING
   ================================= */

.footer-intro-section {
  border-bottom: 1px solid var(--wp--preset--color--contrast-3, rgba(0,0,0,0.1));
}

.site-footer .wp-block-site-logo img {
  opacity: 0.8;
}

.site-footer h4 {
  margin-bottom: 0.75rem;
  color: var(--wp--preset--color--contrast, #111111);
}

/* Footer navigation links */
.footer-nav .wp-block-navigation-item__content {
  color: var(--wp--preset--color--contrast-2, #636363);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s ease;
}

.footer-nav .wp-block-navigation-item__content:hover {
  color: var(--wp--preset--color--contrast, #111111);
}

/* Footer copyright link */
.site-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a:hover {
  text-decoration: none;
}

/* =================================
   MOBILE RESPONSIVE
   ================================= */

@media (max-width: 781px) {
  /* Language switcher adjustments */
  .language-switcher {
    margin-left: 1rem;
    padding-left: 1rem;
  }
  
  /* Footer columns stack */
  .site-footer .wp-block-columns {
    flex-direction: column;
    gap: 2rem;
  }
  
  .site-footer .wp-block-column {
    flex-basis: 100% !important;
  }
}

/* =================================
   BREADCRUMBS (Rank Math)
   ================================= */

.rank-math-breadcrumb {
  font-size: 0.85rem;
  color: var(--wp--preset--color--contrast-2, #636363);
}

.rank-math-breadcrumb a {
  color: var(--wp--preset--color--contrast-2, #636363);
  text-decoration: none;
}

.rank-math-breadcrumb a:hover {
  color: var(--wp--preset--color--contrast, #111111);
  text-decoration: underline;
}

.rank-math-breadcrumb .separator {
  margin: 0 0.5rem;
  opacity: 0.5;
}

/* =================================
   PRINT STYLES
   ================================= */

@media print {
  .language-switcher,
  .main-navigation {
    display: none !important;
  }
  
  .site-footer {
    border-top: 1px solid #ccc;
    padding-top: 1rem;
  }
}
