/* Compact site header on phones (partials/site_header.html).
   Loaded last, after mobile-nav.css. Desktop and tablets are unchanged.

   - Round author photo beside "KlingsKitchen / Katarina Kling"
   - Small cookbook cover on the right (still links to the shop)
   - The search button sits at the right end of the menu bar (nav-bar.css);
     here it is made a bit smaller and the search field opens over the
     menu row. */

@media screen and (max-width: 768px) {
  /* --- Header: one row --- */
  .site-header {
    padding: 1.25rem 0;
  }

  /* Seasonal string of lights along the bottom edge: leave room for it so
     the bulbs don't hang over the photo and the cookbook */
  .site-header:has(.holiday-lights) {
    padding-bottom: calc(1.25rem + 22px);
  }

  .header-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
  }

  .left-section {
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
    width: auto;
    min-width: 0;
  }

  /* Round photo; the decorations around the big frame are dropped */
  .author-image-container {
    width: 62px;
    height: 62px;
    flex-shrink: 0;
    border-width: 2px;
    border-radius: 50%;
    box-shadow:
      0 0 0 2px var(--accent-warm),
      0 4px 10px rgba(0, 0, 0, 0.3);
  }

  .author-image-container::before,
  .author-image-container::after,
  .author-frame::before,
  .author-frame::after {
    display: none;
  }

  .site-branding {
    text-align: left;
    min-width: 0;
  }

  .blog-name {
    font-size: 1.65rem;
    line-height: 1.1;
    margin: 0;
  }

  .blog-name::after,
  .tagline {
    display: none;
  }

  .author-name {
    font-size: 0.95rem;
    margin: 0.2rem 0 0;
  }

  /* Small cookbook cover, still clickable */
  .header-book-section {
    width: auto;
    margin: 0;
    flex-shrink: 0;
  }

  .header-book {
    width: 52px;
    height: 70px;
    transform: rotateY(-14deg);
    animation: none;
  }

  .header-book-cover {
    animation: none;
  }

  .header-book-info {
    display: none;
  }

  /* --- Search button (positioned by nav-bar.css) --- */
  #searchToggle {
    padding: 9px 12px;
    font-size: 15px;
    border-radius: 20px;
  }

  /* Open search: the field slides over the menu row, left of the button
     (the button stays put and closes it again). Replaces the older
     full-screen/static mobile search rules in style.css. */
  .nav-search .inline-search.active {
    width: auto;
  }

  .nav-search .inline-search.active .search-wrapper {
    display: flex;
    position: absolute;
    top: 50%;
    right: calc(100% + 6px);
    left: auto;
    bottom: auto;
    width: calc(100vw - 72px);
    height: auto;
    margin: 0;
    transform: translateY(-50%);
    backdrop-filter: none;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
  }

  .nav-search .inline-search.active .search-form {
    max-width: none;
  }

  .nav-search .inline-search.active .search-form input[type="text"] {
    padding: 9px 14px;
    font-size: 16px;   /* 16px stops iPhone from zooming in on focus */
  }

  .nav-search .live-search-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    margin-top: 0;
  }
}

/* Very narrow phones (iPhone SE / small Android) */
@media screen and (max-width: 360px) {
  .site-header {
    padding: 1rem 0;
  }

  .site-header:has(.holiday-lights) {
    padding-bottom: calc(1rem + 22px);
  }

  .header-container {
    padding: 0 0.75rem;
  }

  .left-section {
    gap: 0.6rem;
  }

  .author-image-container {
    width: 50px;
    height: 50px;
  }

  .blog-name {
    font-size: 1.35rem;
  }

  .author-name {
    font-size: 0.85rem;
  }

  .header-book {
    width: 44px;
    height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-book,
  .header-book-cover {
    animation: none;
  }
}
