/* ForeBranch Pro — frontend styles for Pro-only features. */

/* from person-page.css */
#place-detail-map.leaflet-container,
#person-map.leaflet-container,
.hp-individual .leaflet-container {
    background: #ddd;
    max-width: 100%;
}

#place-detail-map .leaflet-tile-pane img,
#place-detail-map img.leaflet-tile,
#person-map .leaflet-tile-pane img,
#person-map img.leaflet-tile,
.hp-individual .leaflet-tile-pane img,
.hp-individual img.leaflet-tile {
    max-width: none !important;
    max-height: none !important;
    width: 256px !important;
    height: 256px !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

#place-detail-map .leaflet-marker-icon,
#place-detail-map .leaflet-marker-shadow,
#person-map .leaflet-marker-icon,
#person-map .leaflet-marker-shadow,
.hp-individual .leaflet-marker-icon,
.hp-individual .leaflet-marker-shadow {
    max-width: none !important;
    max-height: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
}

/* from genealogy-frontend.css */
#place-detail-map.leaflet-container,
#person-map.leaflet-container,
.hp-individual .leaflet-container,
.hp-place-map-container .leaflet-container {
    background: #ddd;
    max-width: 100%;
}

#place-detail-map .leaflet-tile-pane img,
#place-detail-map img.leaflet-tile,
#person-map .leaflet-tile-pane img,
#person-map img.leaflet-tile,
.hp-individual .leaflet-tile-pane img,
.hp-individual img.leaflet-tile,
.hp-place-map-container .leaflet-tile-pane img,
.hp-place-map-container img.leaflet-tile {
    max-width: none !important;
    max-height: none !important;
    width: 256px !important;
    height: 256px !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

#place-detail-map .leaflet-marker-icon,
#place-detail-map .leaflet-marker-shadow,
#person-map .leaflet-marker-icon,
#person-map .leaflet-marker-shadow,
.hp-individual .leaflet-marker-icon,
.hp-individual .leaflet-marker-shadow,
.hp-place-map-container .leaflet-marker-icon,
.hp-place-map-container .leaflet-marker-shadow {
    max-width: none !important;
    max-height: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
}

.lp-leap-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--lp-radius);
  padding: var(--lp-space-6);
  margin-bottom: var(--lp-space-8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.lp-leap-banner h2 {
  margin: 0 0 var(--lp-space-2);
  font-size: var(--lp-text-xl);
  font-weight: var(--lp-weight-semibold);
  color: #fff;
}

.lp-leap-banner p {
  margin: 0 0 var(--lp-space-5);
  font-size: var(--lp-text-sm);
  opacity: 0.9;
}

.lp-leap-banner__list {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: var(--lp-space-4);
}

.lp-leap-banner__item {
  padding: var(--lp-space-2) 0;
}

.lp-leap-banner__item + .lp-leap-banner__item {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.lp-leap-banner a {
  color: #fff;
  font-weight: var(--lp-weight-medium);
}

.lp-leap-banner__meta {
  opacity: 0.8;
  font-size: var(--lp-text-sm);
  margin-left: var(--lp-space-2);
}

.lp-stats-teaser {
  margin: var(--lp-space-6, 1.5rem) 0 var(--lp-space-8, 2rem);
  padding: var(--lp-space-5, 1.25rem) var(--lp-space-5, 1.25rem) var(--lp-space-4, 1rem);
  background: var(--lp-color-surface, #fff);
  border: 1px solid var(--lp-color-border, #e1e5e9);
  border-radius: var(--lp-radius-md, 8px);
}

.lp-stats-teaser__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--lp-space-3, 0.75rem);
  margin-bottom: var(--lp-space-4, 1rem);
}

.lp-stats-teaser__title {
  margin: 0 0 0.25rem;
  font-size: var(--lp-text-lg, 1.125rem);
  font-weight: var(--lp-weight-semibold, 600);
  color: var(--lp-color-text, #333);
}

.lp-stats-teaser__subtitle {
  margin: 0;
  font-size: var(--lp-text-sm, 0.875rem);
  color: var(--lp-color-muted, #666);
  max-width: 36rem;
}

.lp-stats-teaser__cta {
  flex-shrink: 0;
  white-space: nowrap;
}

.lp-stats-teaser__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--lp-space-3, 0.75rem);
}

.lp-stats-teaser__item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: var(--lp-space-3, 0.75rem) var(--lp-space-4, 1rem);
  border-radius: var(--lp-radius-sm, 6px);
  background: var(--lp-color-bg-subtle, #f8f9fa);
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.lp-stats-teaser__item:hover,
.lp-stats-teaser__item:focus-visible {
  border-color: #bcd1e0;
  box-shadow: 0 2px 8px rgba(0, 68, 102, 0.08);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.lp-stats-teaser__label {
  font-size: var(--lp-text-xs, 0.75rem);
  font-weight: var(--lp-weight-medium, 500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lp-color-muted, #666);
}

.lp-stats-teaser__value {
  font-size: var(--lp-text-lg, 1.125rem);
  font-weight: var(--lp-weight-semibold, 600);
  color: var(--lp-color-accent, #004466);
  line-height: 1.25;
  word-break: break-word;
}

.lp-stats-teaser__meta {
  font-size: var(--lp-text-xs, 0.75rem);
  color: var(--lp-color-muted, #666);
}

@media (max-width: 900px) {
  .lp-stats-teaser__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .lp-stats-teaser__grid {
    grid-template-columns: 1fr;
  }
  .lp-stats-teaser__header {
    flex-direction: column;
  }
}

/* from genealogy-frontend.css */
.lp-btn--icon {
  min-width: 2.5rem;
  padding: var(--lp-space-2);
}

.lp-facts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--lp-space-4);
}

@media (min-width: 640px) {
  .lp-facts-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

.lp-fact {
  display: flex;
  flex-direction: column;
  gap: var(--lp-space-2);
  background: var(--lp-color-surface-alt);
  border-radius: var(--lp-radius);
  border: 1px solid var(--lp-color-border);
  padding: var(--lp-space-4);
}

.lp-fact__kicker {
  font-size: var(--lp-text-xs);
  font-weight: var(--lp-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--lp-color-accent-muted);
}

.lp-fact__body {
  margin: 0;
  font-size: var(--lp-text-lg);
  font-weight: var(--lp-weight-medium);
  line-height: var(--lp-leading-tight);
  color: var(--lp-color-text);
}

.lp-fact__detail {
  margin: 0;
  font-size: var(--lp-text-sm);
  color: var(--lp-color-text-secondary);
}

.lp-fact a {
  color: var(--lp-color-accent);
  font-weight: var(--lp-weight-medium);
}

.lp-fact-loading {
  text-align: center;
  padding: var(--lp-space-10);
  color: var(--lp-color-text-secondary);
  font-size: var(--lp-text-sm);
}

.lp-stat-card__value--text {
  font-size: var(--lp-text-base);
  font-weight: var(--lp-weight-semibold);
  letter-spacing: 0;
}

.lp-facts-grid--single {
  grid-template-columns: 1fr;
}

.lp-facts-grid--single .lp-fact {
  padding: var(--lp-space-6);
  min-height: 9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--lp-space-2);
}

.lp-facts-grid--single .lp-fact__kicker {
  font-size: var(--lp-text-xs);
  letter-spacing: 0.06em;
}

.lp-facts-grid--single .lp-fact__body {
  font-size: var(--lp-text-xl);
  font-weight: var(--lp-weight-semibold);
  line-height: var(--lp-leading-tight);
  color: var(--lp-color-text);
}

.lp-facts-grid--single .lp-fact__detail {
  font-size: var(--lp-text-sm);
}

/* from source-page.css */
.hp-source-image {
    background: white;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e1e5e9;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: flex-start;
}

.hp-source-image a {
    display: inline-block;
    line-height: 0;
}

.hp-source-image img {
    max-width: 280px;
    max-height: 360px;
    width: auto;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    object-fit: contain;
}

.hp-source-image a:only-child img {
    max-width: 100%;
    max-height: 600px;
}

/* from person-page.css */
.hp-photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
}

.hp-photo-item {
    text-align: center;
    max-width: 100px;
}

.hp-photo-item img {
    width: 80px !important;
    height: 80px !important;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.hp-photo-item img:hover {
    transform: scale(1.05);
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.hp-photo-title {
    font-size: 12px !important;
    color: #666;
    margin-top: 4px;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 80px;
}

.hp-share-section {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px 0;
}

.hp-share-section a,
.hp-share-section button:not(#lp-submission-btn):not(.lp-rel-open-btn) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: 1 !important;
}

.hp-share-section .hp-person-header-actions button,
.hp-share-section #lp-submission-btn,
.hp-share-section .lp-rel-open-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    min-height: 44px !important;
    border-radius: 6px !important;
    padding: 12px 20px !important;
    margin: 0 !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    overflow: visible !important;
}

.hp-share-section a:hover,
.hp-share-section button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.hp-share-section svg {
    width: 18px;
    height: 18px;
    display: block;
}

.hp-share-section a[href*="facebook"] {
    background: #1877f2;
}

.hp-share-section a[href*="facebook"]:hover {
    background: #166fe5;
}

.hp-share-section a[href*="twitter"] {
    background: #000;
}

.hp-share-section a[href*="twitter"]:hover {
    background: #333;
}

.hp-share-section a[href^="mailto"] {
    background: #666;
}

.hp-share-section a[href^="mailto"]:hover {
    background: #555;
}

.hp-share-section button[onclick*="lpCopyLink"] {
    background: #666 !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: 1 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

.hp-share-section button[onclick*="lpCopyLink"]:hover {
    background: #555 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.hp-share-section button[onclick*="lpCopyLink"] svg {
    width: 20px !important;
    height: 20px !important;
    fill: white !important;
    display: block !important;
}

@media (max-width: 768px) {
  .hp-person-header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
  .hp-share-section .hp-person-header-actions button,
.hp-share-section #lp-submission-btn,
.hp-share-section .lp-rel-open-btn {
        width: 100% !important;
        justify-content: center !important;
        white-space: normal !important;
    }
  .hp-photos-grid {
        gap: 6px;
    }
  .hp-photo-item {
        max-width: 80px;
    }
  .hp-photo-item img {
        width: 60px !important;
        height: 60px !important;
    }
  .hp-photo-title {
        font-size: 9px !important;
        max-width: 60px;
    }
  .hp-share-section {
        justify-content: center;
        gap: 6px;
    }
  .hp-share-section a,
.hp-share-section button:not(#lp-submission-btn):not(.lp-rel-open-btn) {
        width: 32px;
        height: 32px;
    }
  .hp-share-section svg {
        width: 16px;
        height: 16px;
    }
}

.lp-place-gmaps {
  margin-left: 0.2em;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.lp-place-gmaps:hover {
  text-decoration: underline;
}

/* Person header photo + source thumbnails */
.ancestry-photo {
    flex-shrink: 0;
}

.ancestry-photo img {
    width: 120px;
    height: 150px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: none;
}

.ancestry-photo .photo-placeholder {
    width: 120px;
    height: 150px;
    background: transparent;
    border: 2px dashed rgba(255,255,255,0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
}

.hp-source-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    align-items: center;
    max-width: 150px;
}

.hp-source-thumbnails .hp-lightbox-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    padding: 4px;
    box-sizing: border-box;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.hp-source-thumbnails .hp-lightbox-trigger * {
    pointer-events: none;
}

.hp-source-thumbnails .hp-lightbox-trigger:hover {
    z-index: 5;
}

.hp-source-thumbnail {
    display: block;
    width: 35px;
    height: 35px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 3px;
    transition: border-color 0.1s linear, box-shadow 0.1s linear, opacity 0.1s linear;
    max-width: 100%;
    max-height: 100%;
}

.hp-source-thumbnails .hp-lightbox-trigger:hover .hp-source-thumbnail {
    border-color: #007cba;
    border-width: 2px;
    box-shadow: 0 1px 4px rgba(0, 124, 186, 0.25);
}

.hp-source-count {
    font-size: 10px;
    color: #666;
    align-self: center;
    font-weight: 500;
}

@media (max-width: 768px) {
    .ancestry-photo img,
    .ancestry-photo .photo-placeholder {
        width: 100px;
        height: 125px;
    }
}

/* Auto-contrast for dark theme backgrounds - only when matching WordPress themes */
.hp-individual.inherit-theme[style*="background"] .hp-ancestry-header,
.hp-individual.inherit-theme[class*="dark"] .hp-ancestry-header {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #333 !important;
}
.hp-individual.inherit-theme[style*="background"] .ancestry-name,
.hp-individual.inherit-theme[class*="dark"] .ancestry-name {
    color: #333 !important;
}
.hp-individual.inherit-theme[style*="background"] .ancestry-label,
.hp-individual.inherit-theme[class*="dark"] .ancestry-label {
    color: rgba(51, 51, 51, 0.8) !important;
}
.hp-individual.inherit-theme[style*="background"] .ancestry-details,
.hp-individual.inherit-theme[class*="dark"] .ancestry-details {
    color: #333 !important;
}

.hp-media-page {
    max-width: var(--lp-max-width) !important;
    font-size: var(--lp-font-size, 14px) !important;
    font-family: var(--lp-font-family, inherit) !important;
}

.hp-person-photo{flex:0 0 150px;margin-right:20px;}
.hp-person-photo img{width:100%;height:auto;border-radius:5px;box-shadow:0 1px 3px rgba(0,0,0,.2);}
@media (max-width:768px){.hp-person-photo{margin-right:0;margin-bottom:20px;align-self:center;}}
