/* ==========================================================
   GG Database Search Pages — CLEAN (Birth / Marriage / Death / Surname / All Records)
   File: assets/css/gg-databases.css
   Scope: only your GG search forms + results UI
   ========================================================== */

/* ---------------------------------
   0) Search panel card (restores “missing card”)
---------------------------------- */
.gg-ui .gg-search-panel{
  background: #fff;
  border: 1px solid var(--gg-border);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 14px 0 22px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.05);
}

/* If your shortcode outputs a title above the panel */
.gg-ui > h2{
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--gg-primary-dark);
}

/* Softer separation between panel and results */
.gg-ui .gg-search-panel + hr{
  margin: 18px 0 22px;
  border: 0;
  border-top: 1px solid var(--gg-border);
}

/* ---------------------------------
   1) Form grids — consistent layout
---------------------------------- */
.gg-ui .birth-search-form .birth-grid,
.gg-ui .marriage-search-form .marriage-grid,
.gg-ui .death-search-form .death-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 30px;
  max-width: 900px;
}

@media (min-width: 1200px){
  .gg-ui .birth-search-form .birth-grid,
  .gg-ui .marriage-search-form .marriage-grid,
  .gg-ui .death-search-form .death-grid{
    max-width: 1150px;
    grid-template-columns: 1fr 1.15fr;
  }

  .gg-ui .gg-search-panel{
    max-width: 1150px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 700px){
  .gg-ui .birth-search-form .birth-grid,
  .gg-ui .marriage-search-form .marriage-grid,
  .gg-ui .death-search-form .death-grid{
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------
   2) Inputs — normalize OceanWP weirdness
---------------------------------- */
.gg-ui .birth-search-form input,
.gg-ui .birth-search-form select,
.gg-ui .marriage-search-form input,
.gg-ui .marriage-search-form select,
.gg-ui .death-search-form input,
.gg-ui .death-search-form select{
  font-family: 'Inter', sans-serif !important;
  font-size: 14px;
  line-height: 1.2;
  height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--gg-border);
  border-radius: 6px;
  background: #fff;
}

.gg-ui .birth-search-form select,
.gg-ui .marriage-search-form select,
.gg-ui .death-search-form select{
  -webkit-appearance: none;
  appearance: none;
  background-image: none;
}

/* ---------------------------------
   3) Year row — consistent + tidy
---------------------------------- */
.gg-ui .birth-search-form .year-row,
.gg-ui .marriage-search-form .year-row,
.gg-ui .death-search-form .year-row{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  align-self: start;
}

.gg-ui .birth-search-form .year-row label,
.gg-ui .marriage-search-form .year-row label,
.gg-ui .death-search-form .year-row label{
  min-width: 42px;
  position: relative;
  top: 1px;
}

.gg-ui .birth-search-form .year-row input,
.gg-ui .marriage-search-form .year-row input,
.gg-ui .death-search-form .year-row input{
  width: 130px !important;
  min-width: 130px;
  text-align: center;
}

@media (max-width: 700px){
  .gg-ui .birth-search-form .year-row input,
  .gg-ui .marriage-search-form .year-row input,
  .gg-ui .death-search-form .year-row input{
    width: 90px !important;
    min-width: 90px;
  }
}

/* Inline Available Years label */
.gg-ui .year-available{
  font-size: 13px;
  color: var(--gg-text-secondary);
  margin-left: 10px;
  white-space: nowrap;
  display: inline-block;
}

/* ---------------------------------
   4) Actions row — buttons + checkbox alignment
---------------------------------- */
.gg-ui .birth-search-form .actions,
.gg-ui .marriage-search-form .actions,
.gg-ui .death-search-form .actions{
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.gg-ui .birth-search-form .actions .gg-button,
.gg-ui .birth-search-form .actions .gg-button-secondary,
.gg-ui .marriage-search-form .actions .gg-button,
.gg-ui .marriage-search-form .actions .gg-button-secondary,
.gg-ui .death-search-form .actions .gg-button,
.gg-ui .death-search-form .actions .gg-button-secondary{
  height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  text-transform: none !important;
}

/* Checkbox fix */
.gg-ui .birth-search-form .actions input[type="checkbox"],
.gg-ui .marriage-search-form .actions input[type="checkbox"],
.gg-ui .death-search-form .actions input[type="checkbox"]{
  height: 18px !important;
  width: 18px !important;
  margin: 0 8px 0 0;
  vertical-align: middle;
  transform: none !important;
}

.gg-ui .birth-search-form .actions label,
.gg-ui .marriage-search-form .actions label,
.gg-ui .death-search-form .actions label{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

/* ---------------------------------
   5) Results footer / responsiveness
---------------------------------- */
@media (max-width: 700px){
  .gg-ui .results-footer.gg-results-footer,
  .gg-ui .results-footer{
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

.gg-ui .entries-info{
  font-size: 13px;
  color: var(--gg-text-secondary);
}

/* ---------------------------------
   6) View Details — CSS safety:
      hide unless .is-open exists (JS will handle toggling)
---------------------------------- */
.gg-ui .details-row,
.gg-ui .gg-details-row{
  display: none !important;
  background: var(--gg-bg-soft);
}

/* If details row is a <tr> */
.gg-ui tr.details-row.is-open,
.gg-ui tr.gg-details-row.is-open{
  display: table-row !important;
}

/* If details row is a <div> */
.gg-ui div.details-row.is-open,
.gg-ui div.gg-details-row.is-open{
  display: block !important;
}

/* View Details link style (bigger brown/gold, not button) */
.gg-ui .view-details-link,
.gg-ui .gg-view-details,
.gg-ui a.view-details-link{
  font-size: 14px;
  font-weight: 400;
  color: var(--gg-primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gg-ui .view-details-link:hover,
.gg-ui .gg-view-details:hover{
  color: var(--gg-accent);
  text-decoration: none;
}

/* Sort arrows */
.gg-ui .sort-arrow{ font-size: 11px; margin-left: 4px; color: #999; }
.gg-ui .sort-active{ color: #000; }

/* =====================================================================
   GG Search All Records
   ===================================================================== */

/* Page title spacing */
.gg-allrecords .gg-allrecords-title{ margin-bottom: 12px; }

/* Search panel */
.gg-allrecords .gg-allrecords-panel{
  background: var(--gg-bg-soft);
  border: 1px solid var(--gg-border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.04);
}

/* Top row */
.gg-allrecords .gg-allrecords-top{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.gg-allrecords .gg-allrecords-q{
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--gg-border);
  padding: 0 14px;
  background: #fff;
}

.gg-allrecords .gg-allrecords-top .gg-button{
  height: 52px;
  padding: 0 22px;
  border-radius: 12px;
}

/* Filters row */
.gg-allrecords .gg-allrecords-filters{
  margin-top: 12px;
  display: grid;
  grid-template-columns: 220px 1fr 1fr 180px 180px auto;
  gap: 10px;
  align-items: center;
}

/* OceanWP override — Year fields width */
.gg-allrecords .gg-allrecords-filters input[name="year_from"],
.gg-allrecords .gg-allrecords-filters input[name="year_to"]{
  width: 100% !important;
  max-width: none !important;
  min-width: 160px;
}

.gg-allrecords select,
.gg-allrecords input{
  width: 100%;
  height: 44px;
  border: 1px solid var(--gg-border);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
}

/* Reset button basic sizing */
.gg-allrecords .gg-reset{
  white-space: nowrap;
  height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 16px !important;
}

/* Select dropdown arrow */
.gg-allrecords select{
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(59,42,34,0.55) 50%),
    linear-gradient(135deg, rgba(59,42,34,0.55) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 12px) 18px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

/* Meta */
.gg-allrecords .gg-results-meta{
  margin: 14px 0 10px;
  color: var(--gg-text-secondary);
}
.gg-allrecords .gg-meta-split{ margin: 0 8px; opacity: 0.6; }

/* Sections */
.gg-allrecords .gg-allrecords-section{ margin-top: 22px; }
.gg-allrecords .gg-allrecords-section-head{
  display:flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.gg-allrecords .gg-allrecords-section-meta{
  color: var(--gg-text-secondary);
  font-size: 14px;
}

/* Table */
.gg-allrecords .gg-results-table{
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--gg-border);
  border-radius: 14px;
  overflow: hidden;
}

.gg-allrecords .gg-results-table thead th{
  text-align: left;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: rgba(59,42,34,0.75);
  background: rgba(243,241,236,0.65);
  border-bottom: 1px solid var(--gg-border);
  padding: 12px 14px;
}

.gg-allrecords .gg-results-table td{
  padding: 12px 14px;
  border-bottom: 1px solid var(--gg-border);
  vertical-align: top;
}

.gg-allrecords .gg-th-actions{ width: 170px; }
.gg-allrecords .gg-year{ width: 90px; white-space: nowrap; }

.gg-allrecords .gg-name{ font-weight: 650; color: var(--gg-text-main); }
.gg-allrecords .gg-muted{ color: var(--gg-text-secondary); font-size: 13px; margin-top: 4px; }

/* Actions column */
.gg-allrecords .gg-actions-cell{ text-align: right; vertical-align: top; }
.gg-allrecords .gg-action-links{
  display: inline-flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

/* Links (OceanWP-safe) */
.gg-allrecords .gg-link{
  text-decoration: none !important;
  border-bottom: 1px solid rgba(95,111,90,0.35);
  color: var(--gg-primary-dark);
}
.gg-allrecords .gg-link:hover{ border-bottom-color: rgba(95,111,90,0.65); }

/* Details (All Records) — ALSO force hidden unless .is-open */
.gg-allrecords .gg-details-row{
  display: none !important;
}
.gg-allrecords .gg-details-row.is-open{
  display: table-row !important;
}
.gg-allrecords .gg-details-row td{
  background: rgba(243,241,236,0.45);
}
.gg-allrecords .gg-details{
  padding: 12px 6px;
  display: grid;
  gap: 8px;
}
.gg-allrecords .gg-notes{ line-height: 1.55; }

/* Pagination */
.gg-allrecords .gg-pagination{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}
.gg-allrecords .gg-pagination a,
.gg-allrecords .gg-pagination span{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--gg-border);
  text-decoration: none !important;
  color: var(--gg-primary-dark);
  background: #fff;
}
.gg-allrecords .gg-pagination .current{
  border-color: rgba(95,111,90,0.45);
  background: rgba(95,111,90,0.10);
  font-weight: 650;
}

/* Responsive */
@media (max-width: 980px){
  .gg-allrecords .gg-allrecords-top{ grid-template-columns: 1fr; }
  .gg-allrecords .gg-allrecords-top .gg-button{ width: 100%; }

  .gg-allrecords .gg-allrecords-filters{
    grid-template-columns: 1fr;
  }
  .gg-allrecords .gg-reset{ width: 100%; }
  .gg-allrecords .gg-th-actions{ width: auto; }
  .gg-allrecords .gg-actions-cell{ text-align: left; }
  .gg-allrecords .gg-action-links{ justify-content: flex-start; }
}

/* OceanWP override — Reset button styling */
.gg-allrecords .gg-reset,
.gg-allrecords .gg-reset:visited{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  height: 44px !important;
  padding: 0 16px !important;
  border-radius: 10px !important;

  background: transparent !important;
  border: 2px solid var(--gg-primary) !important;
  color: var(--gg-primary-dark) !important;

  text-decoration: none !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

.gg-allrecords .gg-reset:hover,
.gg-allrecords .gg-reset:focus{
  background: rgba(95,111,90,0.10) !important;
  color: var(--gg-primary-dark) !important;
  text-decoration: none !important;
  outline: none !important;
}

.gg-allrecords .gg-reset::before,
.gg-allrecords .gg-reset::after{
  content: none !important;
}
