/* Elementa Theme global overrides */

/* Material Symbols Rounded - local font */
@font-face {
  font-family: 'Material Symbols Rounded';
  font-style: normal;
  font-weight: 100 700;
  src: url('../vendor/material-symbols/MaterialSymbolsRounded.woff2') format('woff2-variations');
  font-display: swap;
}

:root {
  /* Elementa basic rounded corners */
  --radius: 10px;
  
  /* iOS/Vision OS blue */
  --primary: #0a84ff;
  --on-primary: #ffffff;
  
  /* Glassmorphism surfaces with transparency */
  --surface: rgba(255, 255, 255, 0.7);
  --surface-variant: rgba(255, 255, 255, 0.6);
  
  /* Elevated shadow for depth */
  --shadow-medium: 0 12px 40px rgba(0, 0, 0, 0.14);
  --shadow-light: 0 4px 16px rgba(0, 0, 0, 0.08);
  
  /* Card design tokens */
  --card-bg-color: rgba(255, 255, 255, 0.75);
  --card-border-color: rgba(0, 0, 0, 0.06);
  --card-backdrop-filter: blur(12px) saturate(140%);
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.08);
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "lnum", "ss01", "cv02";
}

/* Material Symbols - iOS/Instagram-like styling */
i {
  font-family: 'Material Symbols Rounded';
  font-weight: 300;
  font-style: normal;
  font-size: 28px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color: currentColor;
  vertical-align: middle;
}

/* Slightly larger icons in buttons */
button i {
  font-size: 20px;
  font-weight: 400;
}

/* Brand wordmark (Happen) with animated accent dot */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-logo .brand-word {
  font-family: "Sen", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.8rem;
  color: #1c203b;
}

body.dark .brand-logo .brand-word {
  color: #f6f7fb;
}

/* City selector chip - clean look */
#main-header .chip[data-ui="#city-modal"] {
  border: none;
  background: transparent;
}

.brand-logo .brand-dot {
  inline-size: 0.65rem;
  block-size: 0.65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #d53369 0%, #daae51 100%);
  animation: brand-bounce 2s cubic-bezier(0.28, 0.84, 0.42, 1) 2;
}

@media (prefers-reduced-motion: reduce) {
  .brand-logo .brand-dot {
    animation: none;
  }
}

@keyframes brand-bounce {
  0% { transform: scale(1) translateY(0); }
  10% { transform: scale(1.1, 0.9) translateY(0); }
  30% { transform: scale(0.9, 1.1) translateY(-10px); }
  50% { transform: scale(1.05, 0.95) translateY(0); }
  57% { transform: scale(1) translateY(-2px); }
  64% { transform: scale(1) translateY(0); }
  100% { transform: scale(1) translateY(0); }
}

body.light {
  --background: #f6f7fb;
}

body.dark {
  --background: #0d1117;
  --card-bg-color: rgba(22, 27, 34, 0.85);
  --card-border-color: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.4);
}

/* Sidebar dialog (Beer CSS) */
dialog#sidebar-menu {
  position: fixed;
  inset: 0 auto 0 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: var(--surface, rgba(255, 255, 255, 0.92));
  box-shadow: var(--shadow-medium);
  overflow: hidden;
  z-index: 9999;
}

body.dark dialog#sidebar-menu {
  background: rgba(16, 16, 20, 0.9);
}

dialog#sidebar-menu::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

dialog#sidebar-menu header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark dialog#sidebar-menu header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

dialog#sidebar-menu .list {
  margin: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

dialog#sidebar-menu .list li a {
  width: 100%;
}

dialog#sidebar-menu .list i {
  font-size: 22px;
}
/* Navigation rails with subtle glass effect */
nav.left,
nav.right {
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

/* Keep WordPress content wrapper from adopting BeerCSS grid layout */
.site-content {
  display: block;
  max-width: 1170px;
  margin: 0 auto;
  padding-inline: 1.25rem;
  background: transparent;
}

/* Content max-width constraint (1170px desktop, full fluid on mobile/tablet) */

.grid {
  gap: 1rem;
}

@media (min-width: 768px) {
  .grid {
    gap: 1.25rem;
  }
}

/* City Hero Section */
.medium-height {
  position: relative;
  min-height: 400px;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.medium-height::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.7) 100%
  );
  z-index: 1;
}

.medium-height > * {
  position: relative;
  z-index: 2;
}

.medium-height .center-align.middle-align {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.medium-height h1 {
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: block;
  width: 100%;
}

.medium-height p {
  font-size: 1.125rem;
  max-width: 65ch;
  margin: 0 auto;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  display: block;
  width: 100%;
}

@media (min-width: 768px) {
  .medium-height {
    min-height:380px;
  }
  
  .medium-height h1 {
    font-size: 3rem;
  }
  
  .medium-height p {
    font-size: 1.25rem;
  }
}

/* City Modal Dialog */
#city-modal {
  max-width: 800px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  padding: 1.5rem;
  color: var(--on-surface, inherit);
}

body.dark #city-modal {
  background: rgba(16, 16, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

#city-modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#city-modal h5,
#city-modal p {
  text-align: center;
}

#city-modal .grid {
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.25rem;
}

/* City item cards */
#city-modal .city-item {
  display: block;
}

#city-modal .city-item article {
  padding: 0.75rem;
  border-radius: var(--radius, 0.5rem);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
  background: var(--surface, rgba(255, 255, 255, 0.75));
  border: 1px solid var(--border, rgba(0, 0, 0, 0.05));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

#city-modal .city-item:hover article {
  background-color: var(--surface-variant, rgba(0, 0, 0, 0.05));
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
  #city-modal {
    max-width: 95vw;
    margin: 1rem;
  }
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
  display: none;
}

.skip-link:focus {
  top: 0;
}

/* Header scroll behavior */
#main-header {
  transition: transform 0.3s ease;
}

#main-header.header-hidden {
  transform: translateY(-100%);
}

/* Back to top button visibility */
#back-to-top {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}

/* Organizer Page Tabs (Beer CSS Native) */
#organizer-tabs {
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.1));
  padding-bottom: 0;
  justify-content: center;
  display: flex;
  gap: 1rem;
}

#organizer-tabs a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  color: var(--on-surface, inherit);
  text-decoration: none;
  cursor: pointer;
}

#organizer-tabs a:hover {
  background-color: var(--surface-variant, rgba(0, 0, 0, 0.05));
  border-radius: var(--radius, 0.5rem) var(--radius, 0.5rem) 0 0;
}

#organizer-tabs a.active {
  border-bottom-color: var(--primary, #0066cc);
  color: var(--primary, #0066cc);
  font-weight: 600;
}

#organizer-tabs a i {
  width: 20px;
  height: 20px;
}

/* Tab panels (organizer past/upcoming) */
.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive tabs */
@media (max-width: 768px) {
  #organizer-tabs {
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  #organizer-tabs a {
    padding: 0.75rem 1rem;
    flex-shrink: 0;
  }
  
  #organizer-tabs a span {
    font-size: 0.875rem;
  }
}

/* Event Card Enhancements (Beer CSS Native) */
article.no-padding {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--card-bg-color);
  border: 1px solid var(--card-border-color);
  -webkit-backdrop-filter: var(--card-backdrop-filter);
  backdrop-filter: var(--card-backdrop-filter);
  box-shadow: var(--card-shadow);
  border-radius: 14px;
}

article.no-padding:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

article.no-padding img.responsive {
  transition: transform 0.3s ease;
}

/* Ensure media fills full card width */
article.no-padding img.responsive.medium {
  width: 100%;
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

article.no-padding:hover img.responsive {
  transform: scale(1.05);
}

article.no-padding h6 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

article.no-padding h6 a:hover {
  color: var(--primary, #0066cc);
}

article.no-padding h6 {
  margin: 0;
}

/* Event date badge styling */
.event-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3rem;
  padding: 0.5rem;
  background: var(--primary, #0066cc) !important;
  color: var(--on-primary, white) !important;
}

.event-date-day {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.event-date-month {
  font-size: 0.7rem;
  opacity: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


/* Placeholder image styling */
article.no-padding .responsive.medium {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* Card media wrapper for consistent aspect */
article.no-padding .card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  width: 100%;
  border-radius: 14px 14px 0 0;
}

/* Card body should stretch */
article.no-padding .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 0.35rem;
}

/* Sticky header with scroll behavior */
#main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, backdrop-filter 0.3s ease;
  will-change: transform;
  background-color: transparent;
}

/* Front page: absolute header over hero */
body.home #main-header {
  position: absolute;
  width: 100%;
  background: transparent !important;
  box-shadow: none !important;
}

/* Front page scrolled: make sticky with background */
body.home #main-header.scrolled {
  position: sticky;
  background-color: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

body.dark.home #main-header.scrolled {
  background-color: rgba(28, 32, 59, 0.8) !important;
}

/* Hide search field on front page until scrolled */
body.home #header-search {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.home #main-header.scrolled #header-search {
  opacity: 1;
  pointer-events: auto;
}

#main-header > nav {
  width: 100%;
  max-width: 1170px;
  margin: 0 auto;
}

/* Unify search field colors (desktop + mobile header) */
#main-header .field.round.fill {
  background-color: var(--surface, #ffffff) !important;
  color: inherit;
}

body.dark #main-header .field.round.fill {
  background-color: rgba(28, 32, 59, 0.9) !important;
}

#main-header .field.round.fill input {
  color: inherit;
}

/* Add background when scrolled */
#main-header.scrolled {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.dark #main-header.scrolled {
  background-color: rgba(28, 32, 59, 0.8);
}

/* Bottom navigation - hide on scroll up */
nav.bottom.s {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Category nav width alignment with body */
#category-nav-list {
  width: 100%;
  max-width: 1170px;
  margin: 0 auto;
  padding-inline: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

#category-nav-list::-webkit-scrollbar {
  display: none; /* WebKit */
}

/* ===================================================================
   Favorites Button (Heart Icon)
   =================================================================== */

/* Position favorite button on top right of card */
article {
    position: relative;
    box-shadow: none;
}

/* Remove background for single blog post articles */
article.post,
article.type-post {
    background-color: transparent !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Related posts responsive layout */
@media (min-width: 601px) {
    .scroll.s {
        display: none !important;
    }
    .grid.m.l {
        display: grid !important;
    }
}

@media (max-width: 600px) {
    .grid.m.l {
        display: none !important;
    }
}

/* Hide scrollbar but keep scroll functionality */
.scroll-container {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.scroll-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Scroll navigation arrows - AllEvents style (outside container) */
.scroll-nav-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-variant);
    border: 1px solid var(--outline-variant);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--on-surface-variant);
}

.scroll-nav-btn:hover:not(.scroll-disabled) {
    background: var(--primary-container);
    color: var(--on-primary-container);
    border-color: var(--primary);
    transform: scale(1.05);
}

.scroll-nav-btn.scroll-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.scroll-nav-btn i {
    font-size: 20px;
}

/* Dark mode adjustments */
body.dark .scroll-nav-btn {
    background: var(--surface-variant);
    border-color: var(--outline-variant);
}

body.dark .scroll-nav-btn:hover:not(.scroll-disabled) {
    background: var(--primary-container);
    color: var(--on-primary-container);
}

/* Hide scroll arrows on tablet/desktop where grid is used */
@media (min-width: 768px) {
    .scroll-nav-buttons {
        display: none !important;
    }
    
    .scroll-container {
        display: none !important;
    }
}

/* Favorite Button Styling - Force override BeerCSS defaults */
/* Favorite Button - simple */
.favorite-btn {
  position: absolute;
  top:0;
  right: 10px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.favorite-btn:hover {
  transform: scale(1.05);
}

.favorite-btn:active {
  transform: scale(0.95);
}

.favorite-btn i {
  font-size: 28px;
  color: #06232cb2;
  transition: all 0.2s ease;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Favorited state - filled heart with red color */
.favorite-btn.is-favorited i {
  color: #eb0052;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  animation: heartPop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Heart pop animation when favoriting */
@keyframes heartPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* Dark mode adjustments */
body.dark .favorite-btn i {
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

body.dark .favorite-btn.is-favorited i {
  color: #eb0052;
}

/* Fix main visibility when not using Beer CSS grid layout */
body:not(:has(>main)) main {
  display: block;
  grid-area: unset;
  padding: 1rem;
  overflow: visible;
}

/* Beer CSS .page class is for SPA transitions only - we filter it out in PHP templates */


/* Mobile touch optimization */
@media (hover: none) and (pointer: coarse) {
  .favorite-btn {
    width: 44px;
    height: 44px;
  }
}

/* Favorites count badge in navigation */
.js-favorites-count {
  display: inline-block;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background-color: var(--primary);
  color: var(--on-primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  margin-left: 4px;
}

/* ===================================================================
   Event/Place Sidebar Info Box
   =================================================================== */

/* Sidebar sticky positioning on desktop */
@media (min-width: 768px) {
  aside.s12.m4 {
    position: sticky;
    top: calc(56px + 1rem);
    align-self: start;
  }
}

/* Apply glassmorphic style to sidebar article */
aside article {
  background: var(--card-bg-color);
  border: 1px solid var(--card-border-color);
  box-shadow: var(--card-shadow);
  backdrop-filter: var(--card-backdrop-filter);
  -webkit-backdrop-filter: var(--card-backdrop-filter);
}

/* Add spacing between rows in sidebar */
aside article .row {
  margin-bottom: 1.25rem;
}

aside article .row:last-child {
  margin-bottom: 0;
}

/* Icon color in sidebar */
aside article .row > i {
  color: var(--primary);
}
