/*
Theme Name: Dodge/Jefferson Counties Genealogical Society
Theme URI: https://dodgejeffgen.org/
Description: Understated child theme of Astra for the Dodge/Jefferson Counties Genealogical Society. Warm off-white pages, deep navy header and footer, brass rules, Playfair Display headlines over Open Sans text. Fonts are bundled (no external font service). All colors are set in the :root block below.
Author: Dodge/Jefferson Counties Genealogical Society
Template: astra
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: djcgs
*/

/* ---- Fonts (bundled) ---------------------------------------------------- */
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(assets/fonts/PlayfairDisplay-normal.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(assets/fonts/OpenSans-normal.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: italic; font-weight: 400 700; font-display: swap; src: url(assets/fonts/OpenSans-italic.woff2) format("woff2"); }

/* ---- Palette: change colors here only ------------------------------------
   All text pairs are WCAG AAA except brass-on-navy, which is used only for rules and focus rings. */
html:root {
  --dj-page:    #f8f6f1;  /* warm off-white page */
  --dj-tint:    #ebeff4;  /* pale blue-gray panels, table heads */
  --dj-line:    #c9d1db;  /* hairlines, borders */
  --dj-ink:     #1b222b;  /* body text */
  --dj-muted:   #475262;  /* captions, notes */
  --dj-link:    #1f4a78;  /* links, h2, buttons */
  --dj-link-hi: #2c5f95;  /* hover */
  --dj-visited: #4a2f6b;
  --dj-navy:    #1d3350;  /* header */
  --dj-deep:    #15253b;  /* footer, submenus */
  --dj-brass:   #c39a52;  /* accent rules */
  --dj-on-dark: #f4f1ea;

  /* Astra and WooCommerce read these, so buttons, prices and notices follow the palette too */
  --ast-global-color-0: var(--dj-link);
  --ast-global-color-1: var(--dj-link-hi);
  --ast-global-color-2: var(--dj-ink);
  --ast-global-color-3: var(--dj-ink);
  --ast-global-color-4: var(--dj-page);
  --ast-global-color-5: var(--dj-tint);
  --ast-global-color-6: var(--dj-ink);
  --ast-global-color-7: var(--dj-line);
  --ast-global-color-8: var(--dj-ink);
}

/* ---- Base type ----------------------------------------------------------- */
body, button, input, select, textarea, .ast-button, .ast-custom-button {
  font-family: "Open Sans", -apple-system, "Segoe UI", Arial, sans-serif;
}
body { background: var(--dj-page); color: var(--dj-ink); font-size: 1.125rem; line-height: 1.65; }
.ast-plain-container, .ast-separate-container, .site-content { background: var(--dj-page); }

h1, h2, h3, h4, h5, h6, .entry-title, .site-title,
.woocommerce-loop-product__title, .product_title {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif !important;
  font-weight: 700; line-height: 1.2; color: var(--dj-ink);
  /* Playfair's default digits are old-style ("111" looks like "ııı"); years and volume numbers need lining figures */
  font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1;
}
.entry-content h2, .entry-content h3 { margin-top: 1.5em; margin-bottom: .5em; }
.entry-content h2 { font-size: 1.75rem; color: var(--dj-link); }
.entry-content h3 { font-size: 1.35rem; }
.entry-content h4 { font-size: 1.15rem; }

a { color: var(--dj-link); }
a:hover, a:focus { color: var(--dj-link-hi); }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry-content a:hover { text-decoration-thickness: 2px; }
.entry-content a:visited { color: var(--dj-visited); }
.entry-content a.wp-block-button__link, .entry-content a.button { text-decoration: none; }

:focus-visible { outline: 3px solid var(--dj-brass) !important; outline-offset: 2px; }

/* ---- Header ------------------------------------------------------------- */
.site-header .ast-primary-header-bar,
.site-header .main-header-bar,
.ast-mobile-header-wrap .ast-primary-header-bar {
  background: var(--dj-navy) !important;
  border-bottom: 4px solid var(--dj-brass) !important;
}
.site-header .site-title a, .site-header .site-title a:visited { color: var(--dj-on-dark) !important; text-decoration: none; }
.site-header .site-title a:hover { color: var(--dj-brass) !important; }
.site-header .site-title { font-size: 1.9rem !important; line-height: 1.15; margin: 0; }
.site-header .site-description { color: #dfe4ea; font-style: italic; font-size: .95rem; margin: .15rem 0 0; }

/* Desktop: title on one line, the menu on its own row beneath it (12 items don't fit beside a long name) */
@media (min-width: 922px) {
  .ast-primary-header-bar .site-primary-header-wrap { padding-top: 1rem; padding-bottom: .15rem; }
  .ast-primary-header-bar .site-primary-header-wrap { min-height: 0 !important; }
  .ast-primary-header-bar .ast-builder-grid-row { display: flex !important; flex-wrap: wrap; row-gap: .35rem; height: auto !important; }
  .ast-primary-header-bar .site-header-primary-section-left,
  .ast-primary-header-bar .site-header-primary-section-right { flex: 1 0 100%; height: auto !important; justify-content: flex-start !important; }
  .ast-primary-header-bar .site-header-primary-section-right > *,
  .ast-builder-menu-1, .ast-builder-menu-1 .site-navigation, .ast-builder-menu-1 .main-navigation { flex-grow: 1; justify-content: flex-start !important; margin: 0 !important; }
  .ast-builder-menu-1 .main-header-menu { justify-content: flex-start !important; }
  .ast-primary-header-bar .site-header-primary-section-right > *, .ast-primary-header-bar .site-header-primary-section-left > * { padding-left: 0 !important; padding-right: 0 !important; }
  .ast-builder-menu-1 .ast-main-header-bar-alignment, .ast-builder-menu-1 .main-header-bar-navigation { margin: 0 !important; padding: 0 !important; flex-grow: 1; }
  .ast-builder-menu-1 .main-header-menu { margin-left: -.5rem !important; }
  .ast-desktop .ast-primary-header-bar .main-header-menu > .menu-item { line-height: 1.3 !important; }
  .ast-builder-menu-1 .main-header-menu { flex-wrap: wrap; margin-left: -.5rem; }
  .ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link { line-height: 1.3; padding: .6rem .5rem .7rem; font-size: 1.125rem !important; }
}

.ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link,
.ast-builder-menu-1 .main-header-menu > .menu-item > .ast-menu-toggle {
  color: var(--dj-on-dark) !important; font-weight: 600; font-size: 1rem;
}
.ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link { border-bottom: 2px solid transparent; }
.ast-builder-menu-1 .main-header-menu > .menu-item:hover > .menu-link,
.ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link:focus { color: #fff !important; border-bottom-color: var(--dj-brass); }
.ast-builder-menu-1 .main-header-menu > .current-menu-item > .menu-link,
.ast-builder-menu-1 .main-header-menu > .current-menu-ancestor > .menu-link { border-bottom-color: var(--dj-brass); }
.ast-builder-menu-1 .ast-icon svg, .ast-builder-menu-1 .dropdown-menu-toggle svg { fill: currentColor; }

/* Drop-downs */
.ast-builder-menu-1 .main-header-menu .sub-menu {
  background: var(--dj-deep) !important; border: 1px solid var(--dj-brass) !important; border-top-width: 2px !important;
  min-width: 16rem; padding: .3rem 0; box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.ast-builder-menu-1 .main-header-menu .sub-menu .menu-item { border-bottom: 1px solid rgba(195,154,82,.22); }
.ast-builder-menu-1 .main-header-menu .sub-menu .menu-item:last-child { border-bottom: 0; }
.ast-builder-menu-1 .main-header-menu .sub-menu .menu-link {
  color: var(--dj-on-dark) !important; font-weight: 500; padding: .45rem .9rem; line-height: 1.35; white-space: normal;
}
.ast-builder-menu-1 .main-header-menu .sub-menu .menu-item:hover > .menu-link,
.ast-builder-menu-1 .main-header-menu .sub-menu .menu-link:focus { background: #25405f !important; color: #fff !important; }

/* Mobile header and slide-down menu */
.ast-mobile-header-wrap .menu-toggle, .ast-mobile-header-wrap .menu-toggle:hover { color: var(--dj-on-dark) !important; background: transparent !important; border-color: var(--dj-on-dark) !important; }
.ast-mobile-header-wrap .menu-toggle svg { fill: var(--dj-on-dark) !important; }
.ast-mobile-header-content, .ast-mobile-header-content .main-header-menu, .ast-mobile-header-content .sub-menu { background: var(--dj-deep) !important; }
.ast-mobile-header-content .menu-link, .ast-mobile-header-content .ast-menu-toggle { color: var(--dj-on-dark) !important; }
.ast-mobile-header-content .menu-item { border-color: rgba(195,154,82,.22) !important; }
.ast-mobile-header-content .menu-link { border-color: rgba(195,154,82,.22) !important; }

/* ---- Page content -------------------------------------------------------- */
.site-content > .ast-container { max-width: 1180px; }
/* Ordinary reading pages get a centered 820px column (title and text share its left edge).
   Pages holding a search tool, form, table or the shop keep the full 1180px width. */
body.page:not(.woocommerce-page) article.page:not(:has(form, table, .woocommerce, [class*="djgs"], [id*="djgs"])) {
  max-width: 820px; margin-left: auto; margin-right: auto;
}

#primary { margin-top: 2.2rem; margin-bottom: 3rem; }
.entry-header .entry-title {
  font-size: 2.4rem; border-bottom: 3px solid var(--dj-brass); padding-bottom: .25em; margin-bottom: .6em;
}
/* On the front page the header already says the society's name: keep the page title "Home" for screen readers only */
body.home .entry-header .entry-title {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap;
}

.entry-content ul, .entry-content ol { padding-left: 1.4em; margin-left: 0; }
.entry-content li { margin: .25em 0; }
.entry-content hr { border: 0; border-top: 1px solid var(--dj-line); margin: 2em 0; }
.entry-content blockquote { border-left: 4px solid var(--dj-brass); margin-left: 0; margin-right: 0; padding: .2em 1.2em; background: var(--dj-tint); font-style: normal; }
.entry-content figcaption, .entry-content .wp-element-caption, .wp-caption-text { color: var(--dj-muted); font-size: .9rem; }
.entry-content img { height: auto; }

.entry-content table { border-collapse: collapse; max-width: 100%; }
.entry-content th, .entry-content td { border: 1px solid var(--dj-line); padding: .4em .6em; vertical-align: top; }
.entry-content th { background: var(--dj-tint); text-align: left; }

/* ---- Buttons and form controls (search pages, shop, account) ------------ */
.wp-block-button__link, .ast-button, button:not(.menu-toggle):not(.ast-menu-toggle):not([class*="dropdown"]):not(.search-submit),
input[type=submit], input[type=button], .button,
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce #respond input#submit,
.woocommerce a.button.alt, .woocommerce button.button.alt {
  background: var(--dj-link) !important; color: #fff !important; border: 0 !important; border-radius: 2px !important;
  font-weight: 600 !important; font-size: 1rem; padding: .6em 1.2em; text-decoration: none; box-shadow: none !important;
}
.wp-block-button__link:hover, .ast-button:hover, button:not(.menu-toggle):not(.ast-menu-toggle):not([class*="dropdown"]):not(.search-submit):hover,
input[type=submit]:hover, .button:hover,
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover {
  background: var(--dj-navy) !important; color: #fff !important;
}
button:disabled, .button:disabled, .button.disabled { background: #d5dbe3 !important; color: var(--dj-muted) !important; cursor: default; }

input[type=text], input[type=search], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=url],
select, textarea {
  background-color: #fff !important; color: var(--dj-ink) !important; border: 1px solid #6a7584 !important; border-radius: 2px !important; font-size: 1rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--dj-link) !important; }

/* Search pages (djgs plugins): search box and button on one line, compact result tables */
.entry-content form:has(> input[type=text]):has(> input[type=submit]) { display: flex; flex-wrap: wrap; gap: .5rem; align-items: stretch; }
.entry-content form:has(> input[type=text]):has(> input[type=submit]) > input[type=text] { flex: 1 1 12rem; width: auto; margin: 0; }
.entry-content form:has(> input[type=text]):has(> input[type=submit]) > input[type=submit] { flex: 0 0 auto; margin: 0; }
.entry-content select { width: auto !important; max-width: 100%; }
.entry-content table.wp-list-table, .entry-content table[id*="results"], .entry-content table[id*="catalog"] {
  font-size: .95rem; line-height: 1.45; background: #fff;
}
.entry-content table.wp-list-table th, .entry-content table.wp-list-table td { padding: .45em .6em; }
.entry-content table.wp-list-table th { background: var(--dj-tint); font-weight: 700; }
.entry-content table.striped > tbody > tr:nth-child(odd), .entry-content table.wp-list-table tbody tr:nth-child(odd) { background: #fbfaf7; }

/* Astra's search box (404 page, search results): input plus a navy "Search" button.
   Astra also outputs an icon button (.ast-search-submit) that it keeps hidden; leave it hidden. */
.search-form { display: flex; max-width: 28rem; margin: 0 auto; }
.search-form label { flex: 1; margin: 0; }
.search-form .search-field { width: 100%; padding-right: 15px !important; }
.search-form .ast-search-submit { display: none !important; }
.search-form input.search-submit { position: static !important; width: auto !important; max-width: none !important; height: auto !important;
  flex: 0 0 auto; border-radius: 0 2px 2px 0 !important; padding: 0 1.1rem !important; }

/* ---- WooCommerce --------------------------------------------------------- */
/* Shop / Cart / Checkout / My account bar, shown only on the shop's pages */
.djcgs-shop-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; margin: 0 0 1.4rem; padding: .55rem 0; border-bottom: 1px solid var(--dj-line); font-size: .95rem; font-weight: 600; }
.djcgs-shop-nav a { color: var(--dj-link); text-decoration: none; border-bottom: 2px solid transparent; padding-bottom: .1rem; }
.djcgs-shop-nav a:hover { border-bottom-color: var(--dj-link); }
.djcgs-shop-nav a[aria-current="page"] { color: var(--dj-ink); border-bottom-color: var(--dj-brass); }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 1.15rem; }
.woocommerce ul.products li.product .price, .woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--dj-ink) !important; font-weight: 600; }
.woocommerce-message, .woocommerce-info { border-top-color: var(--dj-link) !important; background: var(--dj-tint) !important; }
.woocommerce-message::before, .woocommerce-info::before { color: var(--dj-link) !important; }
.woocommerce table.shop_table { border-color: var(--dj-line); background: #fff; }

/* Shop categories without their own picture: plain cards instead of a gray placeholder behind a white box */
.woocommerce ul.products li.product-category a img[src*="placeholder"] { display: none; }
.woocommerce ul.products li.product-category a:has(img[src*="placeholder"]) .woocommerce-loop-category__title {
  position: static !important; transform: none !important; width: auto !important; margin: 0 !important;
  background: #fff; border: 1px solid var(--dj-line); border-top: 3px solid var(--dj-brass);
  padding: 1.1rem 1rem !important; text-align: left; text-transform: none !important; letter-spacing: 0 !important; font-size: 1.2rem !important;
}
.woocommerce ul.products li.product-category a:hover .woocommerce-loop-category__title { border-color: var(--dj-link); color: var(--dj-link); }
.woocommerce ul.products li.product-category .count {
  display: block; margin-top: .3rem; background: none; font-family: "Open Sans", sans-serif; font-weight: 400;
  font-size: .9rem; color: var(--dj-muted) !important; opacity: 1 !important; text-transform: none; letter-spacing: 0; font-variant-numeric: lining-nums;
}

/* Carried over from the site's Customizer "Additional CSS" (which stays with the Astra theme when switching) */
img.wp-post-image { max-width: 150px !important; width: 150px !important; height: auto !important; }
img[src*="woocommerce-placeholder"] { max-width: 120px !important; width: 120px !important; height: auto !important; }

/* ---- Footer ------------------------------------------------------------- */
.site-footer, .site-footer .site-below-footer-wrap, .site-footer [data-section] {
  background: var(--dj-deep) !important; color: var(--dj-on-dark) !important; border-top: 0 !important;
}
.site-footer { border-top: 4px solid var(--dj-brass) !important; }
.site-footer a, .site-footer a:visited { color: var(--dj-on-dark) !important; text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--dj-brass) !important; }
.site-footer .ast-footer-copyright { font-size: .95rem; }

/* Footer stays at the bottom of short pages */
#page { min-height: 100vh; display: flex; flex-direction: column; }
#page > .site-content { flex: 1 0 auto; }

/* ---- Small screens ------------------------------------------------------- */
@media (max-width: 921px) {
  .site-header .site-title { font-size: 1.35rem !important; }
  #primary { margin-top: 1.6rem !important; }
  /* wide result tables scroll sideways instead of running off the screen */
  .entry-content table.wp-list-table, .entry-content table[id*="results"], .entry-content table[id*="catalog"] { display: block; overflow-x: auto; }
  .entry-header .entry-title { font-size: 1.9rem; }
}

/* Front page: the hidden title leaves no gap to fill */
body.home #primary { margin-top: 1.4rem; }
body.home .entry-header { margin: 0 !important; }
