/* =========================================================
   Galicia Gen — TNG Overrides (Cleaned + Consolidated)
   Notes:
   - Keep this as the LAST loaded CSS so it wins.
   - Designed to work across TNG templates (esp. 21/23) while you
     transition to a rebuilt Template 1.
   ========================================================= */

/* ===============================
   0) THEME TOKENS
   =============================== */
:root{
  --gg-ink:   #4A2A1A;   /* warm brown */
  --gg-sage:  #5F6F5A;   /* sage */
  --gg-sage2: #8FA184;   /* lighter sage */
  --gg-cream: #F7F5F2;   /* soft parchment */
  --gg-paper: #FFFFFF;
  --gg-line:  #E6E0D8;
  --gg-muted: #6B6B6B;
  --gg-shadow: 0 10px 30px rgba(0,0,0,.12);
}

/* ===============================
   1) GLOBAL BASE
   =============================== */
html body{
  font-family: "Inter", sans-serif !important;
  background: var(--gg-cream) !important;
  color: #222 !important;
  line-height: 1.6;
}

h1,h2,h3,h4,h5{
  font-family: "Fraunces", serif !important;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--gg-ink) !important;
}

a{
  color: var(--gg-sage) !important;
  text-decoration: none;
}
a:hover{
  color: var(--gg-ink) !important;
  text-decoration: underline;
}

/* ===============================
   2) LAYOUT WIDTH + CONTENT PADDING
   - IMPORTANT: avoid breaking header/nav layout
   =============================== */
#bodycontainer,
.bodycontainer,
#container{
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 28px 24px !important;
}

/* If your template uses .container everywhere, keep it safe */
.container{
  max-width: 1200px !important;
  margin: 0 auto !important;
}

/* Prevent generic container padding from wrecking header/nav */
header .container,
.nav-menu .container{
  padding: 0 !important;
}

/* Content columns (Template 21/23-ish) */
.contentLeft,
.sidebarRight{
  padding-top: 20px;
}
.contentLeft p,
.sidebarRight p{
  line-height: 1.7;
  font-size: 16px;
}
p{ margin-bottom: 1rem; }

/* ===============================
   3) HEADER
   =============================== */
header{
  background: var(--gg-paper) !important;
  border-bottom: 1px solid var(--gg-line) !important;
  box-shadow: none !important;
}

header .brand a{
  color: var(--gg-ink) !important;
  text-decoration: none !important;
  font-family: "Fraunces", serif !important;
  font-weight: 600 !important;
  letter-spacing: .2px;
}

header .slogan{
  color: var(--gg-muted) !important;
  font-family: "Inter", sans-serif !important;
  font-weight: 400;
}

/* Top-right links (Template 21) */
header .list1 a,
header .list1 a:visited{
  color: var(--gg-sage) !important;
}
header .list1 a:hover{
  color: var(--gg-ink) !important;
}

/* ===============================
   4) NAV BAR — GG SAGE
   =============================== */
.nav-menu{
  background: var(--gg-sage) !important;
  box-shadow: none !important;
  border: none !important;
  background-image: none !important;
  padding: 0 !important;
}

.nav-menu ul,
.nav-menu #tngnav,
.nav-menu .tngnav,
.nav-menu .menu{
  margin: 0 !important;
  padding: 0 !important;
  background-image: none !important;
}

.nav-menu a{
  color: #fff !important;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .5px;
  text-transform: none !important;
  padding: 0 22px !important;
  line-height: 44px; /* keeps items vertically centered */
  display: block;
}

.nav-menu a:hover,
.nav-menu li:hover > a{
  background: rgba(255,255,255,.15) !important;
  color: #fff !important;
}

/* Dropdowns */
.nav-menu ul ul{
  background: #fff !important;
  border: 1px solid var(--gg-line) !important;
  box-shadow: var(--gg-shadow) !important;
}
.nav-menu ul ul a{
  color: var(--gg-ink) !important;
  background: transparent !important;
  font-weight: 500;
  line-height: 40px;
}
.nav-menu ul ul a:hover{
  background: #f3efe9 !important;
  color: var(--gg-ink) !important;
}

/* Hide “Media” links (common TNG filenames) */
.nav-menu a[href*="browsemedia.php"],
.nav-menu a[href*="media.php"],
.nav-menu a[href*="album"],
.nav-menu a[href*="cemeteries.php"]{
  display: none !important;
}

/* ===============================
   5) BUTTONS + FORM CONTROLS
   =============================== */
a.btn-small,
a.btn-detail,
a.btn,
input[type="submit"],
input[type="reset"],
button{
  background: var(--gg-ink) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 10px 16px !important;
  box-shadow: none !important;
  font-weight: 600;
}

a.btn-small:hover,
a.btn-detail:hover,
a.btn:hover,
input[type="submit"]:hover,
button:hover{
  background: #3a1f14 !important;
}

/* Make Reset a touch different so it reads as “secondary” */
input[type="reset"]{
  background: #7a2a21 !important;
}
input[type="reset"]:hover{
  background: #5f221b !important;
}

/* ===============================
   6) TABLES
   =============================== */
table{
  background: var(--gg-paper) !important;
  border-collapse: collapse;
  width: 100%;
  border: 1px solid var(--gg-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none !important;
}
table td, table th{
  padding: 10px 12px;
  border-bottom: 1px solid var(--gg-line);
}
th{
  background: #F0ECE7 !important;
  color: var(--gg-ink) !important;
  font-weight: 700;
}

/* ===============================
   7) SIDEBAR LINKS / LISTS
   =============================== */
.list4 li a{
  background: #fff !important;
  border: 1px solid var(--gg-line) !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  display: block;
  transition: all .2s ease;
  box-shadow: none !important;
}
.list4 li a:hover,
.list4 li a:focus,
.list4 li a:active{
  background: #f3efe9 !important;
  border-color: var(--gg-sage) !important;
  outline: none !important;
}

h3.center{
  font-size: 26px !important;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--gg-line) !important;
  padding-bottom: 10px;
}

/* Remove red/arrow icons inside list blocks */
.list1 img, .list2 img, .list3 img, .list4 img,
.list1 i, .list2 i, .list3 i, .list4 i,
.list1 .fa, .list2 .fa, .list3 .fa, .list4 .fa{
  display: none !important;
}

/* ===============================
   8) SEARCH PAGES — DE-RED PASS
   =============================== */

/* Left label column on search forms */
table.searchtable td.fieldname,
table.searchtable td.label,
table.searchtable td:first-child{
  background: var(--gg-ink) !important;
  color: #fff !important;
}

/* Search layout: keep form left + options right */
.searchform,
#searchform,
form[name="searchform"]{
  overflow: auto; /* contain floats */
}

.searchform .searchcol1,
.searchcol1,
#searchcol1{
  float: left !important;
  width: 68% !important;
}

.searchform .searchcol2,
.searchcol2,
#searchcol2{
  float: right !important;
  width: 28% !important;
  position: relative !important;
  top: 0 !important;
}

/* Surname letter buttons */
.surnamealpha a,
.surnamealpha a:visited,
.surnamealpha span,
a.snlink,
a.snlink:visited{
  background: var(--gg-ink) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: none !important;
}
.surnamealpha a:hover,
a.snlink:hover{
  background: #3a1f14 !important;
}

/* Remove the tiny icon next to page titles (Search People, Place List, etc.) */
h1 img, h2 img, h3 img,
.pagetitle img, .title img, .header img{
  display: none !important;
}

/* ===============================
   9) “FLOURISH” / DECORATIVE DIVIDERS
   =============================== */
img[src*="flour"],
img[src*="orn"],
img[src*="decor"],
img[src*="divider"]{
  display: none !important;
}

hr.fancy,
.gg-divider{
  border: none !important;
  height: 1px !important;
  background: var(--gg-line) !important;
  margin: 22px 0 !important;
}

/* ===============================
   10) FOOTER
   =============================== */
footer{
  background: var(--gg-paper) !important;
  border-top: 1px solid var(--gg-line) !important;
  color: var(--gg-muted) !important;
  box-shadow: none !important;
}
footer a{ color: var(--gg-sage) !important; }
footer a:hover{ color: var(--gg-ink) !important; }

/* ===============================
   11) OPTIONAL: GG “Editorial” homepage components
   (safe to keep even if unused)
   =============================== */
.gg-home{ padding: 28px 0 10px; }

.gg-hero{
  background: #fff;
  border: 1px solid var(--gg-line);
  border-radius: 18px;
  padding: 34px 34px 26px;
  margin: 0 0 26px;
  box-shadow: none;
}
.gg-hero-title{
  margin: 0 0 10px;
  font-size: 44px;
  line-height: 1.1;
  color: var(--gg-ink);
}
.gg-hero-subtitle{
  margin: 0 0 18px;
  max-width: 72ch;
  font-size: 17px;
  line-height: 1.7;
  color: #2b2b2b;
}
.gg-hero-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 12px;
}
.gg-hero-note{
  margin: 10px 0 0;
  color: var(--gg-muted);
  font-size: 14px;
}

.gg-btn{
  display: inline-block;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  text-decoration: none !important;
  border: 1px solid transparent;
}
.gg-btn-primary{
  background: var(--gg-ink);
  color: #fff !important;
}
.gg-btn-primary:hover{ background: #3a1f14; }

.gg-btn-secondary{
  background: #fff;
  color: var(--gg-ink) !important;
  border-color: var(--gg-line);
}
.gg-btn-secondary:hover{
  background: #f3efe9;
  border-color: var(--gg-sage);
}

.gg-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}
.gg-card{
  background: #fff;
  border: 1px solid var(--gg-line);
  border-radius: 16px;
  padding: 18px 18px 16px;
}
.gg-card h2{
  margin: 0 0 8px;
  font-size: 20px;
}
.gg-card p{
  margin: 0 0 10px;
  color: #2b2b2b;
  line-height: 1.7;
}
.gg-link{
  color: var(--gg-sage) !important;
  font-weight: 600;
  text-decoration: none !important;
}
.gg-link:hover{ color: var(--gg-ink) !important; }

.gg-surnames{
  background: #fff;
  border: 1px solid var(--gg-line);
  border-radius: 18px;
  padding: 18px 18px 10px;
  margin: 0 0 20px;
}
.gg-surnames h2{ margin: 0 0 6px; }
.gg-muted{ color: var(--gg-muted); }

/* ===============================
   12) OPTIONAL: Custom header block (if you add it in template files)
   =============================== */
.gg-tng-header{
  background: #fff !important;
  border-bottom: 1px solid var(--gg-line) !important;
}
.gg-tng-header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px !important;
  max-width: 1200px;
  margin: 0 auto;
}
.gg-tng-logo img{
  height: 62px;
  width: auto;
  display: block;
}
.gg-tng-right{ text-align: right; }
.gg-tng-title{
  font-family: "Fraunces", serif !important;
  font-size: 42px;
  line-height: 1.05;
  color: var(--gg-ink);
  margin: 0;
}
.gg-tng-subtitle{
  font-family: "Inter", sans-serif !important;
  font-size: 16px;
  color: var(--gg-muted);
  margin-top: 6px;
}

/* ===============================
   13) RESPONSIVE
   =============================== */
@media (max-width: 980px){
  .gg-grid{ grid-template-columns: 1fr; }
  .gg-hero-title{ font-size: 34px; }

  /* Search columns stack */
  #searchcol1, .searchcol1,
  #searchcol2, .searchcol2{
    float: none !important;
    width: auto !important;
  }
}

/* Hide the Media tab (Template 21: extra hidden/blank <li> throws off nth-child) */
/* Template 21 – hide Media tab */
#tngdd > li:nth-child(2) {
  display: none !important;
}
