/* ============================================= */
/* ===[ bizdir.css ]=========================== */
/* Stylesheet for the BizDir WordPress plugin.   */
/* Override the variables below (or any class)   */
/* in your theme / child theme CSS.              */
/* ============================================= */

:root {
  --bizdir-accent: #ffffe0;
  --bizdir-button-bg: #e0e0ff;
  --bizdir-button-bg-hover: #b7b6cd;
  --bizdir-button-hover-text: #ffffff;
  --bizdir-button-text: #000000;
  --bizdir-error-bg: #fff0f0;
  --bizdir-error-border: #cc0000;
  --bizdir-desc-bg: #f0f0f0;
}

/* ---------- logo + directory name header ---------- */

.bizdir-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 0.5em;
  padding: 6px 0;
  border-top: 3px double #000000;
  border-bottom: 3px double #000000;
}

.bizdir-logo {
  flex: 0 0 auto;
  width: 80px;
  height: 80px;
  max-width: 25vw;
  max-height: 25vw;
}

.bizdir-title {
  flex: 1 1 auto;
  font-family: Arial, sans-serif;
  font-size: clamp(1.4rem, 5vw, 2.6rem);
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

/* ---------- masthead: wide image on wide screens, logo + name on narrow ones ---------- */

.bizdir-masthead-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 8px;
}

.bizdir-masthead.has-image .bizdir-header {
  display: none;
}

@media only screen and (max-width: 600px) {
  .bizdir-masthead.has-image .bizdir-masthead-img {
    display: none;
  }

  .bizdir-masthead.has-image .bizdir-header {
    display: flex;
  }
}

/* ---------- standalone page shell, site menu, footer ---------- */

.bizdir-shell {
  box-sizing: border-box;
  margin: 0 auto;
  padding: 8px 16px;
}

body.bizdir-standalone {
  margin: 0;
}

.bizdir-sitemenu {
  margin: 0 0 8px;
  background: var(--bizdir-menu-bg, #92d1ff);
}

.bizdir-sitemenu ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bizdir-sitemenu li {
  position: relative;
}

.bizdir-sitemenu a {
  display: block;
  padding: 6px 12px;
  color: #000000;
  font-size: 0.85rem;
  text-decoration: none;
}

.bizdir-sitemenu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  min-width: 12em;
  flex-direction: column;
  background: var(--bizdir-menu-bg, #92d1ff);
}

.bizdir-sitemenu li:hover > .sub-menu,
.bizdir-sitemenu li:focus-within > .sub-menu {
  display: flex;
}

@media only screen and (max-width: 600px) {
  .bizdir-sitemenu .sub-menu {
    display: none !important;
  }
}

.bizdir-footer {
  margin-top: 1.5em;
  padding-top: 0.5em;
  border-top: 1px solid #8899bb;
  font-family: Arial, sans-serif;
  font-size: 0.7rem;
  text-align: center;
}

.bizdir-footer p {
  margin: 0.25em 0;
}

/* ---------- the five-link bar at the top of every BizDir page ---------- */

.bizdir-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 1em;
}

.bizdir-navsearch {
  display: flex;
  flex: 0 1 28em;
  gap: 4px;
}

.bizdir-navq {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid #000000;
  font-size: 0.9rem;
}

.bizdir-nav .bizbutton {
  margin: 0;
}

button.bizbutton {
  cursor: pointer;
}

a.bizbutton,
button.bizbutton {
  display: inline-block;
  margin: 4px;
  padding: 4px 8px;
  border: 1px solid #000000;
  background-color: var(--bizdir-button-bg);
  color: var(--bizdir-button-text);
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

a.bizbutton:hover,
a.bizbutton:focus,
a.bizbutton:active,
button.bizbutton:hover,
button.bizbutton:focus {
  background: var(--bizdir-button-bg-hover);
  color: var(--bizdir-button-hover-text);
}

/* ---------- breadcrumbs, headings, lists ---------- */

p.bizBreadcrumbs {
  margin: 0;
  padding: 0;
  font-size: 0.8em;
  font-family: Arial, sans-serif;
}

p#bizcatlisthead {
  background-color: var(--bizdir-accent);
  font-weight: 900;
  font-size: 1.4em;
}

/* Category lists: alphabetical DOWN each column (3 on desktop, 2 on tablets, 1 on phones).
   Every link is its own block; restyle it with the variables below (set them in :root or your theme). */
:root {
  --bizdir-cat-height: 48px;
  --bizdir-cat-padding: 6px 12px;
  --bizdir-cat-margin: 0 0 8px 0;
  --bizdir-cat-border: 1px solid rgba(0, 0, 0, 0.25);
  --bizdir-cat-radius: 6px;
  --bizdir-cat-bg: rgba(255, 255, 255, 0.6);
  --bizdir-cat-color: inherit;
  --bizdir-cat-hover-bg: var(--bizdir-button-bg);
  --bizdir-cat-hover-color: var(--bizdir-button-text);
}

ul.bizcatglist {
  list-style: none;
  margin: 0;
  padding: 0;
  column-count: 3;
  column-gap: 16px;
}

ul.bizcatglist li {
  margin: var(--bizdir-cat-margin);
  padding: 0;
  break-inside: avoid;
  page-break-inside: avoid;
}

ul.bizcatglist li a {
  display: flex;
  align-items: center;
  gap: 0.4em;
  min-height: var(--bizdir-cat-height);
  box-sizing: border-box;
  padding: var(--bizdir-cat-padding);
  border: var(--bizdir-cat-border);
  border-radius: var(--bizdir-cat-radius);
  background: var(--bizdir-cat-bg);
  color: var(--bizdir-cat-color);
  line-height: 1.3;
  text-decoration: none;
}

ul.bizcatglist li a:hover,
ul.bizcatglist li a:focus {
  background: var(--bizdir-cat-hover-bg);
  color: var(--bizdir-cat-hover-color);
}

@media only screen and (max-width: 900px) {
  ul.bizcatglist {
    column-count: 2;
  }
}

@media only screen and (max-width: 600px) {
  ul.bizcatglist {
    column-count: 1;
  }
}

/* Phone A-Z accordion (built by bizdir-groups.js from the flat list): a letter tab sitting on a full-width line. */
:root {
  --bizdir-tab-bg: #000080;
  --bizdir-tab-color: #ffffcc;
}

.bizaz h3 {
  margin: 16px 0 8px;
  font-size: 1em;
}

button.bizaz-toggle {
  display: flex;
  width: 100%;
  align-items: flex-end;
  justify-content: space-between;
  box-sizing: border-box;
  margin: 0;
  padding: 0 8px 0 0;
  border: 0;
  border-bottom: 1px solid var(--bizdir-tab-bg);
  background: transparent;
  color: var(--bizdir-tab-bg);
  font: inherit;
  cursor: pointer;
}

.bizaz-tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  box-sizing: border-box;
  padding: 4px 18px;
  margin-bottom: -1px;
  border: 1px solid var(--bizdir-tab-bg);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: var(--bizdir-tab-bg);
  color: var(--bizdir-tab-color);
  font-weight: 700;
  font-size: 1rem;
}

button.bizaz-toggle::after {
  content: "";
  align-self: center;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -4px;
  transition: transform 0.15s;
}

button.bizaz-toggle[aria-expanded="true"]::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.bizaz-panel {
  margin: 0 0 12px;
}

.bizaz-panel[hidden] {
  display: none;
}

.bizcat-seetxt {
  font-size: 0.8em;
  opacity: 0.75;
  white-space: nowrap;
}

/* Groups / List All switch and Expand all. */
.bizdir-viewswitch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0.5em 0;
}

.bizdir-viewswitch a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  box-sizing: border-box;
  border: 1px solid currentColor;
  text-decoration: none;
}

.bizdir-viewswitch a + a {
  border-left: 0;
}

.bizdir-viewswitch a.is-current {
  background: var(--bizdir-button-bg);
  color: var(--bizdir-button-text);
  font-weight: bold;
}

button.bizdir-expandall {
  min-height: 44px;
  padding: 0 8px;
  margin: 0 0 0 auto;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Expandable groups (<details>). */
.bizgroups {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 1.5em;
}

details.bizgroup {
  border: 1px solid currentColor;
  background: var(--bizdir-accent);
}

details.bizgroup > summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  box-sizing: border-box;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

details.bizgroup > summary::-webkit-details-marker {
  display: none;
}

details.bizgroup > summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin: 6px 2px 0 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s;
}

details.bizgroup[open] > summary::after {
  transform: rotate(-135deg);
  margin-top: 10px;
}

.bizgroup-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.bizgroup-name {
  font-weight: bold;
  font-size: 1.1em;
  letter-spacing: 0.02em;
}

.bizgroup-desc {
  font-size: 0.9em;
  line-height: 1.45;
}

.bizgroup-count {
  flex: none;
  font-size: 0.9em;
  white-space: nowrap;
  margin-left: auto;
}

details.bizgroup > ul.bizcatglist {
  padding: 4px 16px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
}

@media only screen and (max-width: 600px) {
  .bizgroup-count {
    display: none;
  }
}

h2.bizCatName {
  font-weight: 900;
  font-size: 1.4em;
}

p.bizCatDesc {
  background-color: var(--bizdir-desc-bg);
}

.bizdir-pagination {
  margin: 1em 0;
}

/* ---------- single listing ---------- */

.bizdir-map iframe {
  width: 100%;
  max-width: 640px;
  height: auto;
  aspect-ratio: 4 / 3;
  border: 0;
}

/* ---------- search and Add a Listing form ---------- */

.bizdir-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  column-gap: 16px;
}

@media only screen and (max-width: 600px) {
  .bizdir-grid {
    grid-template-columns: 1fr;
  }
}

.bizdir-errors {
  margin: 1em 0;
  padding: 0.5em 1em;
  background: var(--bizdir-error-bg);
  border-left: 4px solid var(--bizdir-error-border);
}

.bizdir-submitted {
  text-align: center;
}

/* ---------- Add a Listing: rules and login buttons ---------- */

.bizdir-rules {
  margin: 0 0 1.5em;
}

.bizdir-loginbtns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1em 0;
}

.bizdir-loginbtns a.bizbutton {
  margin: 0;
  min-height: 44px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
}
