/* ============================================
   PUBLIC DOG PAGE - CORE CSS
   ============================================ */

*, *::before, *::after { box-sizing: border-box; }
html { 
  font-size: 16px; 
  -webkit-text-size-adjust: 100%; 
  scroll-behavior: smooth;
  scroll-padding-top: 135px;
}
body { margin: 0; padding: 0; min-height: 100vh; }

.public-dog-page { 
  display: flex; 
  flex-direction: column; 
  min-height: 100vh; 
  max-width: 960px; 
  margin: 0 auto; 
  background: #ffffff;
  box-shadow: 0 0 30px rgba(0,0,0,0.15);
}

/* ============================================
   HEADER - Base styles
   ============================================ */
.public-dog-header { 
  position: sticky; 
  top: 0; 
  z-index: 1000; 
  width: 100%; 
}

/* Hide mobile header on desktop, show desktop header */
.public-dog-header-mobile { display: none; }
.public-dog-nav-mobile { display: none; }
.public-dog-header-desktop { 
  display: flex;
  flex-direction: column;
  position: relative;
  height: 135px;
}

.public-dog-header-top { 
  display: flex; 
  align-items: center; 
  justify-content: flex-start; 
  padding: 0.75rem 1.5rem;
  padding-right: 180px; /* Make room for logo */
  flex: 1;
}
.public-dog-header-title h1 { margin: 0; font-size: 1.5rem; font-weight: 600; }

/* Logo positioned absolutely to span full header height with padding */
.public-dog-header-logo { 
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: flex-start;
}
.public-dog-header-logo img { 
  height: 100%; 
  width: auto; 
}

.public-dog-nav { flex-shrink: 0; }
.public-dog-tabs { 
  display: flex; 
  list-style: none; 
  margin: 0; 
  padding: 0 1rem; 
  padding-right: 180px; /* Make room for logo */
  overflow-x: auto; 
  -webkit-overflow-scrolling: touch; 
}
.public-dog-tabs li { flex: 0 0 auto; }
.public-dog-tab { 
  display: block; 
  padding: 0.5rem 1rem; 
  border: none; 
  background: transparent; 
  font-size: 0.85rem; 
  font-weight: 500; 
  cursor: pointer; 
  white-space: nowrap; 
  transition: background-color 0.2s, color 0.2s; 
  text-decoration: none; 
}

/* ============================================
   CONTENT
   ============================================ */
.public-dog-content { flex: 1; width: 100%; }
.public-dog-section { width: 100%; }
.public-dog-section-wrapper { width: 100%; padding: 1.5rem; }
.public-dog-section-wrapper:nth-child(odd) { background: #ffffff; }
.public-dog-section-wrapper:nth-child(even) { background: #f5f7f9; }
.public-dog-section-title { margin: 0 0 1.25rem 0; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* Details Layout */

/* Mobile hero: hidden on desktop */
.public-dog-mobile-hero { display: none; }

/* Desktop: grid with content left, photo right */
.public-dog-details-grid { 
  display: grid; 
  grid-template-columns: 1fr auto; 
  gap: 1.5rem; 
  align-items: start;
}
.public-dog-details-content { display: flex; flex-direction: column; gap: 0.5rem; }

/* Desktop description (above fields) */
.public-dog-desktop-description {
  margin-bottom: 1rem;
}
.public-dog-desktop-description p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #444;
}

/* Desktop image (on right) */
.public-dog-desktop-image { 
  width: 180px; 
  flex-shrink: 0; 
}
.public-dog-desktop-image img { 
  width: 100%; 
  height: auto; 
  display: block; 
  border-radius: 4px; 
}

.public-dog-info-card { }
.public-dog-info-list { margin: 0; }
.public-dog-info-item { display: flex; padding: 0.2rem 0; font-size: 0.9rem; }
.public-dog-info-item dt { flex: 0 0 160px; font-weight: 600; text-transform: uppercase; font-size: 0.75rem; color: #333; }
.public-dog-info-item dd { flex: 1; margin: 0; }
.public-dog-description { margin: 0; font-size: 0.9rem; line-height: 1.5; }

/* Gallery */
.public-dog-gallery { }
.public-dog-gallery .react-photo-album--rows { cursor: pointer; width: 100%; }

/* Health table */
.public-dog-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.public-dog-table { width: 100%; border-collapse: collapse; }
.public-dog-table th, .public-dog-table td { padding: 0.75rem 1rem; text-align: left; font-size: 0.9rem; }
.public-dog-table th { font-weight: 700; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }

/* Pedigree */
.public-dog-pedigree-image { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.public-dog-pedigree-image img { max-width: 100%; height: auto; }

/* Footer */
.public-dog-footer { width: 100%; padding: 1rem; text-align: center; }
.public-dog-footer p { margin: 0; font-size: 0.8rem; }

/* Empty/Loading states */
.public-dog-empty { padding: 2rem; text-align: center; font-style: italic; color: #666; }
.public-dog-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem; text-align: center; }
.public-dog-loading p { margin-top: 1rem; color: #666; }
.public-dog-spinner { width: 40px; height: 40px; border: 4px solid #e0e0e0; border-top-color: var(--public-dog-accent, #5eb3d5); border-radius: 50%; animation: public-dog-spin 1s linear infinite; }
@keyframes public-dog-spin { to { transform: rotate(360deg); } }

/* ============================================
   TABLET (769px - 1024px) - Compact menu
   ============================================ */
@media (max-width: 1024px) {
  html { scroll-padding-top: 110px; }
  .public-dog-header-desktop { height: 110px; }
  .public-dog-header-top { padding: 0.5rem 1rem; padding-right: 130px; }
  .public-dog-header-title h1 { font-size: 1.25rem; }
  .public-dog-header-logo { top: 0.4rem; right: 0.4rem; bottom: 0.4rem; }
  .public-dog-header-logo img { height: 100%; }
  .public-dog-tabs { padding-right: 130px; }
  .public-dog-tab { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
}

/* ============================================
   MOBILE (≤768px) - Hamburger menu
   ============================================ */
@media (max-width: 768px) {
  html { scroll-padding-top: 70px; }
  
  /* Hide desktop header, show mobile header */
  .public-dog-header-desktop { display: none; }
  .public-dog-header-mobile { display: flex; }
  
  /* Mobile header layout: hamburger | title | logo */
  .public-dog-header-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.3rem;
    gap: 0.75rem;
  }
  
  /* Hamburger button with FA icon */
  .public-dog-hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .public-dog-hamburger:hover {
    opacity: 0.8;
  }
  
  /* Mobile title - centered, can wrap to 2 lines */
  .public-dog-header-title-mobile {
    flex: 1;
    text-align: center;
    min-width: 0;
  }
  .public-dog-header-title-mobile h1 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.2;
    color: white;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  /* Mobile logo */
  .public-dog-header-logo-mobile {
    flex-shrink: 0;
    width: 40px;
    display: flex;
    justify-content: flex-end;
  }
  .public-dog-header-logo-mobile img {
    height: 40px;
    width: auto;
  }
  .public-dog-header-logo-placeholder {
    width: 40px;
    flex-shrink: 0;
  }
  
  /* Mobile dropdown menu */
  .public-dog-nav-mobile {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }
  .public-dog-nav-mobile.open {
    max-height: 300px;
  }
  .public-dog-tabs-mobile {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .public-dog-tab-mobile {
    display: block;
    padding: 0.75rem 1rem;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .public-dog-tab-mobile:hover {
    background: rgba(255,255,255,0.1);
  }
  
  /* Mobile: Show mobile hero - description left, photo right */
  .public-dog-mobile-hero {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: center; /* Center when single child */
    margin-bottom: 1rem;
  }
  .public-dog-mobile-description {
    flex: 1;
    min-width: 0;
    order: -1; /* Description on left */
  }
  .public-dog-mobile-description p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #444;
  }
  .public-dog-mobile-image {
    flex-shrink: 0;
    width: 250px;
  }
  .public-dog-mobile-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
  }
  
  /* Hide desktop-only elements on mobile */
  .public-dog-desktop-description { display: none; }
  .public-dog-desktop-image { display: none; }
  
  /* Mobile: single column grid */
  .public-dog-details-grid { 
    display: block; 
  }
  
  /* Two-column grid for info items */
  .public-dog-info-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.5rem;
  }
  .public-dog-info-item { flex-direction: column; padding: 0; }
  .public-dog-info-item dt { flex: none; margin-bottom: 2px; }
}

/* ============================================
   VERY NARROW (≤480px) - Single column
   ============================================ */
@media (max-width: 480px) {
  /* Stack: photo on top, description below */
  .public-dog-mobile-hero {
    flex-direction: column;
    align-items: center;
  }
  .public-dog-mobile-image {
    width: 250px;
    order: -1; /* Photo first (on top) */
  }
  .public-dog-mobile-description {
    order: 0; /* Description second */
    width: 100%;
  }
  .public-dog-mobile-description p {
    font-size: 0.8rem;
  }
  
  .public-dog-info-list {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .public-dog-info-item { padding: 0.3rem 0; }
  .public-dog-info-item dt { margin-bottom: 3px; }
  
  .public-dog-header-title-mobile h1 { font-size: 1rem; }
  .public-dog-header-logo-mobile img { height: 35px; }
}
