/*
Theme Name: FotoBo
Description: A clean, lightweight, responsive WordPress theme with vertical sidebar navigation and accessible design.
Version: 1.2.48
Author: FotoBo
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fotobo
Requires at least: 5.0
Tested up to: 6.3
Requires PHP: 7.4
*/

/* CSS Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color, #333);
  background-color: var(--bg-color, #f5f5f5);
}

/* CSS Custom Properties */
:root {
  --primary-color: #000000;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #f5f5f5;
  --bg-dark: rgb(24 25 29);
  --white: #fff;
  --border-color: #ddd;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --sidebar-width: 280px;
  --content-padding: 2rem;
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* ===== TOP NAVIGATION STYLES ===== */
.top-nav-header {
  background: transparent;
}

/* ===== MODE TOGGLE SWITCH STYLES ===== */
.toggle-switch {
  display: flex;
  align-items: center;
  background: #e0e0e0;
  border: none;
  border-radius: 25px;
  padding: 6px;
  cursor: pointer;
  position: relative;
  min-width: 140px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  gap: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-label {
  color: #555;
  font-weight: 600;
  z-index: 2;
  position: relative;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.3s ease;
  text-align: center;
  flex: 1;
  white-space: nowrap;
}

/* Default state - Privat is active */
.toggle-switch:not(.active) .toggle-privat {
  background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 195, 247, 0.3);
  transform: scale(1.02);
}

.toggle-switch:not(.active) .toggle-erhverv {
  background: transparent;
  color: #666;
}

/* Active state - Erhverv is active */
.toggle-switch.active .toggle-erhverv {
  background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
  transform: scale(1.02);
}

.toggle-switch.active .toggle-privat {
  background: transparent;
  color: #666;
}

/* Hover effects */
.toggle-label:hover {
  color: #333;
  transform: scale(1.05);
}

.toggle-switch:not(.active) .toggle-privat:hover {
  box-shadow: 0 4px 12px rgba(79, 195, 247, 0.4);
}

.toggle-switch.active .toggle-erhverv:hover {
  box-shadow: 0 4px 12px rgba(30, 136, 229, 0.4);
}

/* ===== TOP NAVIGATION CONTAINER ===== */
.top-nav-header {
  position: absolute;
  top: 0;
  left: calc(var(--sidebar-width) + var(--content-padding));
  right: var(--content-padding);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.5rem;
}

.top-nav-container {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
}

.top-nav-container ul,
.top-nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: flex-end;
}

.top-nav-container ul li,
.top-nav-menu li {
  margin: 0;
}

.top-nav-container ul li a,
.top-nav-menu a {
  display: block;
  padding: 1rem;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
  letter-spacing: 0;
}

@media (max-width: 1024px) and (min-width: 769px) {
  .top-nav-container ul li a,
  .top-nav-menu a {
    font-size: 0.8rem;
  }
}

.top-nav-container ul li a:hover,
.top-nav-menu a:hover {
  scale: 1.05;
  transition: all 0.3s ease;
}

@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

.top-nav-menu .current-menu-item a {
  color: var(--primary-color);
  font-weight: 600;
  letter-spacing: 0.5px;
}

body {
  padding-top: 3rem;
}

/* Layout Grid */
.site-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 90vh;
}

/* Sidebar Styles */
.sidebar {
  background-color: var(--white);
  color: var(--primary-color);
  padding: 1.5rem 0;
  position: fixed;
  top: 0; /* Back to top position */
  left: 0;
  width: var(--sidebar-width);
  height: 100vh; /* Full height */
  overflow-y: auto;
  z-index: 1000;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
}

.sidebar-logo {
  padding: 0 1.5rem 2rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 2rem;
}

.sidebar-logo img {
  max-width: 200px;
  height: auto;
}

.sidebar-logo .site-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--white);
  text-decoration: none;
}

/* Admin Bar Compatibility */
.logged-in.admin-bar .sidebar {
  top: 32px; /* Admin bar height only */
  height: calc(100vh - 32px);
}

.logged-in.admin-bar .top-nav-header {
  top: 32px; /* WordPress admin bar height */
}

.logged-in.admin-bar body {
  padding-top: 0; /* No body padding needed */
}

@media screen and (max-width: 782px) {
  .logged-in.admin-bar .top-nav-header {
    top: 46px; /* Mobile admin bar height */
  }

  .logged-in.admin-bar body {
    padding-top: 0; /* No body padding needed */
  }

  .logged-in.admin-bar .sidebar {
    top: 46px; /* Mobile admin bar height */
    height: calc(100vh - 46px);
  }
}

/* Navigation Styles */
.sidebar-nav {
  padding: 0 1rem;
}

.menu,
.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav li {
  margin-bottom: 0.5rem;
}

.menu .menu-item a,.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  color: var(--primary-color);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-size: 1rem;
  font-weight: 500;
  height: auto;
}

.menu .menu-item a:hover,
.menu .menu-item a:focus,
.sidebar-nav a:hover,
.sidebar-nav a:focus {
  background-color: rgba(255, 255, 255, 0.1);
  outline: none;
}

.menu .menu-item a:hover,
.sidebar-nav .current-menu-item a {
  color: var(--secondary-color);
}

.menu .menu-item.current-menu-item a{
   color: var(--secondary-color);
}

.sidebar-nav a.current-menu-item,
.sidebar-nav a.current-menu-parent {
  background-color: var(--secondary-color);
}

/* Ensure menu items with children don't show anchor styles */
.sidebar-nav .menu-item-has-children > a {
  display: none;
}

/* Active states for menu toggle buttons */
.sidebar-nav .current-menu-item .menu-item-toggle,
.sidebar-nav .current-menu-parent .menu-item-toggle {
  color: var(--primary-color);
}

/* Menu Item Toggle (whole clickable area) */
.menu-item-toggle {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  line-height: 1;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.menu-item-toggle:hover,
.menu-item-toggle:focus {
  background-color: rgba(0, 0, 0, 0.05);
}

.menu-item-toggle .menu-item-title {
  flex: 1;
}

.menu-item-toggle .submenu-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
}

/* Legacy Submenu Toggle (for backwards compatibility) */
.submenu-toggle {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 3px;
  line-height: 1;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.submenu-toggle:hover,
.submenu-toggle:focus {
  background-color: rgba(255, 255, 255, 0.2);
  outline: none;
}

/* Feather Icons in toggles */
.submenu-toggle .toggle-icon,
.menu-item-toggle .toggle-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

/* Hide CSS fallback when Feather icons are loaded */
.submenu-toggle-icon .toggle-icon ~ ::after,
.menu-item-toggle .submenu-toggle-icon .toggle-icon ~ ::after {
  display: none;
}

.submenu-toggle .toggle-chevron-down,
.menu-item-toggle .toggle-chevron-down {
  display: inline;
}

.submenu-toggle .toggle-chevron-up,
.menu-item-toggle .toggle-chevron-up {
  display: none;
}

/* Submenus */
.sidebar-nav .sub-menu {
  margin-top: 0.5rem;
  border-left: 2px solid rgba(255, 255, 255, 0.2);
  padding-left: 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.sidebar-nav .sub-menu.open {
  max-height: 1000px;
}

.sidebar-nav .sub-menu .sub-menu {
  margin-left: 1.5rem;
}

/* Main Content Area */
.main-content {
  padding-left: calc(var(--sidebar-width) + 2rem);
  padding-right: 2rem;
  padding-top: 1em;
  padding-bottom: 2rem;
  width: 99vw;
}

/* Content Card */
.content-card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: var(--content-padding);
  margin-bottom: 2rem;
  width: 100%;
}

.content-card h1,
.content-card h2,
.content-card h3,
.content-card h4,
.content-card h5,
.content-card h6 {
  color: var(--primary-color);
  margin-top: 0;
}

.content-card img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}

/* Responsive Design */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 250px;
    --content-padding: 1.5rem;
  }

  .top-nav-menu a {
    padding: 1rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .site-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    top: 0; /* Back to top on mobile */
    height: 100vh;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 60px; /* Add padding for top nav on mobile */
  }

  /* Top nav mobile styles */
  .top-nav-header {
    left: 1rem; /* Align with mobile content padding */
    right: 1rem; /* Align with mobile content padding */
    background: rgba(
      255,
      255,
      255,
      0.95
    ); /* Slight background for readability on mobile */
    backdrop-filter: blur(10px);
  }

  .top-nav-menu {
    justify-content: center;
    flex-wrap: wrap;
  }

  .top-nav-menu a {
    padding: 0.75rem 0.75rem;
    font-size: 0.8rem;
  }
  

  .mobile-menu-toggle {
    display: block;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.2rem;
  }
}

@media (min-width: 769px) {
  .mobile-menu-toggle {
    display: none;
  }
}

/* Focus Styles for Accessibility */
*:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: var(--white);
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 10000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* WordPress Specific Classes */
.alignleft {
  float: left;
  margin: 0 1rem 1rem 0;
}

.alignright {
  float: right;
  margin: 0 0 1rem 1rem;
}

.aligncenter {
  display: block;
  margin: 0 auto 1rem;
}

.wp-caption {
  max-width: 100%;
  background: #f9f9f9;
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: var(--border-radius);
}

.wp-caption-text {
  font-size: 0.9rem;
  color: var(--text-light);
  text-align: center;
  margin: 0.5rem 0 0;
}

/* Contact Form 7 Compatibility */
.wpcf7-form {
  max-width: 100%;
}

.wpcf7-form p {
  margin-bottom: 1rem;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.wpcf7-form input:focus,
.wpcf7-form textarea:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.wpcf7-form input[type="submit"] {
  background: var(--secondary-color);
  color: var(--white);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}

.wpcf7-form input[type="submit"]:hover {
  background: var(--primary-color);
}

/* WordPress Customizer Compatibility */
.wp-customizer iframe {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
}

#customize-preview iframe {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
}

/* Ensure customizer preview works correctly */
.customize-preview-iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  overflow: hidden !important;
}

/* Title Visibility Styles */
/* When title is hidden, adjust header spacing to prevent empty space */
.entry-header:empty {
  display: none;
}

.entry-header:not(:has(.entry-title)) {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Fallback for browsers that don't support :has() */
.entry-header {
  margin-bottom: 1.5rem;
}

.entry-header .entry-title {
  margin: 0 0 1rem 0;
  color: #000;
  font-size: 4em;
  font-weight: 700;
  line-height: 1.2;
}

/* Admin meta box styling improvements */
#fotobo_title_visibility .inside {
  margin: 0;
  padding: 10px;
}

#fotobo_title_visibility label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
}

#fotobo_title_visibility input[type="checkbox"] {
  margin: 0;
  margin-top: 2px;
}

#fotobo_title_visibility .description {
  font-size: 12px;
  line-height: 1.4;
  margin-top: 6px;
  margin-left: 22px;
  color: #646970;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .entry-header .entry-title {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .entry-header .entry-title {
    font-size: 1.5rem;
  }
}

/* ===== FOOTER STYLES ===== */
.site-footer {
  background: var(--bg-color);
  color: var(--text-color);
  margin-top: 3rem;
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  max-width: 80vw;
  margin: 0 auto;
  padding: 0 4rem;
  padding-left: 10rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.footer-section h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  border-bottom: 2px solid #cdcdcd;
  padding-bottom: 0.5rem;
}

/* Contact Information Styles */
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.contact-item svg {
  width: 18px;
  height: 18px;
  stroke: var(--primary-color);
  flex-shrink: 0;
}

.contact-item a {
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
}

.contact-item a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Pricing Section Styles */
.pricing-info p {
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.price-link {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 600;
  transition: var(--transition);
}

.price-link:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* Social Media Styles */
.facebook-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  background: var(--primary-color);
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-weight: 500;
  border: 2px solid var(--primary-color);
}

.facebook-link:hover {
  background: var(--secondary-color);
  color: var(--white);
  border: 2px solid var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.facebook-link svg {
  width: 20px;
  height: 20px;
  stroke: var(--white);
}

.facebook-link:hover svg {
  stroke: var(--white);
}

/* Footer Bottom */
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-light);
}

.footer-bottom p {
  margin: 0;
  font-size: 0.9rem;
}

/* Responsive Footer Styles */
@media (max-width: 768px) {
  .site-footer {
    margin-top: 2rem;
    padding: 1.5rem 0 1rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .footer-section h3 {
    font-size: 1.1rem;
  }

  .facebook-link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .contact-item {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .contact-item svg {
    width: 16px;
    height: 16px;
    margin-top: 2px;
  }

  .facebook-link {
    width: 100%;
    justify-content: center;
  }
}

/* WordPress Block Styles */
:where(.wp-block) {
  margin-bottom: 28px;
  margin-top: 28px;
  max-width: 100%;
  padding: 2rem;
}

.top_widget {
  display: flex;
  width: fit-content;
  align-content: center;
  align-items: center;
  padding: 0 1.5rem 0 0;
}

.top_widget .wp-block-social-links .wp-block-social-link.wp-social-link {
  margin: 0;
  padding: 0;
  width: 2rem;
  height: 2rem;
  align-self: center;
  align-content: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.top_widget ul.wp-block-social-links {
  gap: 0.5rem;
}

.wp-block-social-links .wp-social-link .wp-block-social-link-anchor svg,
.wp-block-social-links
  .wp-block-social-link.wp-social-link
  .wp-block-social-link-anchor
  svg {
  height: 1.5rem;
  width: 1.5rem;
}

.wp-block-social-links.is-style-logos-only
  .wp-social-link
  .wp-block-social-link-anchor
  svg,
.wp-block-social-links.is-style-logos-only
  .wp-block-social-link.wp-social-link
  .wp-block-social-link-anchor
  svg {
  fill: #333;
}

.wp-block-social-links .wp-social-link .wp-block-social-link-anchor:hover {
  fill: var(--primary-color);
}

.main_nav_sidebar {
}


