/* DQ Site Tweaks — site-wide custom CSS (v1.0.15).
   New fixes go here as file edits; the Customizer "Additional CSS" is legacy. */

/* Redesign Stage B fix 2026-10-06 (mobile audit H-1/H-2):
   5-column data tables (calorie/price tables) were clipped on phones —
   body{overflow-x:hidden} with no inner scroll container meant columns
   past the viewport edge were unreachable. Fix: every Gutenberg table
   figure becomes its own horizontal scroller (harmless on desktop: no
   scrollbar appears when content fits). Bare tables (Nutrition hub's 3
   tables have no wp-block-table wrapper) get the same treatment on
   small screens so no table is ever clipped. */
figure.wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  .entry-content > table,
  .entry-content > div > table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Keep table cells readable: don't let 5 columns squeeze below ~72px. */
  .entry-content table th,
  .entry-content table td {
    min-width: 72px;
  }
}

/* Redesign Stage B fix 2026-10-06 (mobile audit M-1):
   belt-and-braces aspect-ratio on card images so the 4:3 frame is
   reserved even before the image bytes arrive (pairs with the
   width/height attributes added to the PHP fallback in v1.0.15). */
#archive-container .loop-entry .post-thumbnail img.wp-post-image {
  aspect-ratio: 4 / 3;
}

/* ==========================================================================
   PHASE 4 — Mobile-first refinements (2026-10-06)
   Verified: Kadence mobile drawer toggle exists in markup
   (menu-toggle-open drawer-toggle, #mobile-drawer, aria-labels).
   ========================================================================== */
@media (max-width: 768px) {
  /* Tighter content padding on phones — more content above the fold. */
  .entry-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Scrollable tables: subtle edge fade hints there's more to see. */
  figure.wp-block-table {
    background:
      linear-gradient(to right, #fff 30%, rgba(255,255,255,0)),
      linear-gradient(to left, #fff 30%, rgba(255,255,255,0)),
      linear-gradient(to right, rgba(0,0,0,.12), rgba(0,0,0,0)),
      linear-gradient(to left, rgba(0,0,0,.12), rgba(0,0,0,0));
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-position: 0 0, 100% 0, 0 0, 100% 0;
    background-attachment: local, local, scroll, scroll;
  }

  /* Hub anchor pills: full-width tap rows on very small screens. */
  .dq-pills a {
    flex: 1 1 calc(50% - var(--dq-s2));
    justify-content: center;
    text-align: center;
  }

  /* Long headings wrap nicely instead of overflowing. */
  h1, h2, h3 {
    overflow-wrap: break-word;
    hyphens: auto;
  }

  /* Mobile drawer menu: comfortable tap targets, readable text. */
  #mobile-drawer .mobile-navigation ul li a {
    padding-top: 0.9em;
    padding-bottom: 0.9em;
    font-size: 1rem;
  }
}

/* ==========================================================================
   PHASE 5-6 — Homepage & template polish (2026-10-06)
   Premium, editorial feel via CSS only (no content changes).
   ========================================================================== */

/* Homepage hero: ensure text reads well over the background image. */
body.home .kb-row-layout-id215_5f36ec-7f .kt-row-column-wrap {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

/* Category cards ("Browse the Menu"): subtle lift on hover, smooth. */
body.home .kt-blocks-info-box-link-wrap {
  border-radius: var(--dq-radius);
  transition: transform .18s ease, box-shadow .18s ease;
}
body.home .kt-blocks-info-box-link-wrap:hover {
  transform: translateY(-3px);
  box-shadow: var(--dq-shadow);
}
@media (prefers-reduced-motion: reduce) {
  body.home .kt-blocks-info-box-link-wrap {
    transition: none;
  }
  body.home .kt-blocks-info-box-link-wrap:hover {
    transform: none;
  }
}

/* Section rhythm: generous, consistent breathing room between sections. */
body.home .entry-content > .wp-block-kadence-rowlayout {
  margin-top: var(--dq-s5);
  margin-bottom: var(--dq-s5);
}
body.home .entry-content > .wp-block-kadence-rowlayout:first-child {
  margin-top: 0;
}

/* Section headings: editorial underline accent. */
body.home .entry-content > h2.wp-block-heading,
.page .entry-content > h2.wp-block-heading {
  padding-bottom: var(--dq-s2);
  border-bottom: 3px solid var(--dq-red);
  display: inline-block;
}

/* ==========================================================================
   PREMIUM REDESIGN v2.0 — Master prompt implementation (2026-10-06)
   Compact cards, refined hero, tighter tables, premium header/footer.
   ========================================================================== */

@media (max-width: 768px) {
  /* --- Category cards: compact, 2-col where readable --- */
  body.home .kt-blocks-info-box-link-wrap {
    padding: var(--dq-s2);
  }
  body.home .kt-blocks-info-box-title {
    font-size: 1rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.25rem !important;
  }
  body.home .kt-blocks-info-box-text {
    font-size: 0.8125rem !important;
    line-height: 1.45 !important;
  }
  /* Verification/trust cards: compact, less whitespace */
  body.home .kt-blocks-info-box-link-wrap .kt-blocks-info-box-media {
    margin-bottom: 0.5rem !important;
  }

  /* --- Hero: controlled height, no awkward breaks --- */
  body.home .kb-row-layout-id215_5f36ec-7f .kt-row-column-wrap {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }
  body.home .kb-row-layout-id215_5f36ec-7f h1 {
    font-size: clamp(1.75rem, 6vw, 2.25rem) !important;
    text-wrap: balance;
    hyphens: none !important;   /* never break words like "Calo-ries" */
  }
}

/* --- Tables: compact rows, scannable numbers (all screens) --- */
.entry-content .wp-block-table table th,
.entry-content .wp-block-table table td {
  padding: 0.55rem 0.7rem !important;
  font-size: 0.9rem;
}
/* Very small screens: 5-6 column tables get tighter (audit H-1) */
@media (max-width: 480px) {
  .entry-content .wp-block-table table th,
  .entry-content .wp-block-table table td {
    padding: 0.45rem 0.5rem !important;
    font-size: 0.8rem;
  }
}
.entry-content .wp-block-table thead th {
  font-size: 0.78rem !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dq-ink-soft);
  background: var(--dq-surface) !important;
}
.entry-content .wp-block-table td {
  font-variant-numeric: tabular-nums;
}

/* --- Premium footer: organized, calm --- */
.site-footer {
  background: var(--dq-ink) !important;
  color: #D8D5D0 !important;
}

/* Trust/category cards: card treatment on desktop (mobile gets compact padding above) */
@media (min-width: 769px) {
  body.home .kt-blocks-info-box-link-wrap {
    background: var(--dq-card);
    border: 1px solid var(--dq-line);
    border-radius: var(--dq-radius);
    padding: var(--dq-s3);
  }
}
.site-footer a { color: #D8D5D0 !important; }
.site-footer a:hover { color: #fff !important; }
.site-footer .widget-title,
.site-footer h2 {
  color: #fff !important;
  font-family: var(--dq-display);
  font-size: 1.05rem !important;
}

/* ==========================================================================
   PHASE 7-8 — Search & discovery polish (2026-10-06)
   ========================================================================== */

/* Search results header: clear, editorial. */
.search-archive-title .page-title {
  font-size: var(--dq-h1);
}
.search-archive-title .page-title mark,
.search-archive-title .page-title .search-query {
  color: var(--dq-red);
  background: transparent;
}

/* Search form: large, tappable input + button. */
.search-form {
  display: flex;
  gap: var(--dq-s2);
  max-width: 560px;
}
.search-form .search-field {
  flex: 1 1 auto;
  min-height: 48px;
  padding: 0.65rem 1rem;
  font-size: var(--dq-body);
  border: 2px solid var(--dq-line);
  border-radius: var(--dq-radius);
  background: var(--dq-card);
}
.search-form .search-field:focus {
  border-color: var(--dq-red);
  outline: none;
  box-shadow: 0 0 0 3px var(--dq-red-soft);
}
.search-form .search-submit {
  min-height: 48px;
  padding: 0.65rem 1.25rem;
  font-weight: 700;
  color: #fff;
  background: var(--dq-red);
  border: 2px solid var(--dq-red);
  border-radius: var(--dq-radius);
  cursor: pointer;
}
.search-form .search-submit:hover {
  background: var(--dq-red-dark);
  border-color: var(--dq-red-dark);
}

/* Result cards: title hierarchy + meta polish. */
#archive-container .loop-entry .entry-title {
  font-size: 1.05rem;
  line-height: 1.4;
}
#archive-container .loop-entry .entry-title a {
  color: var(--dq-ink);
  text-decoration: none;
}
#archive-container .loop-entry .entry-title a:hover {
  color: var(--dq-red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* QA fix 2026-10-04: uniform 4:3 result cards on search/archive grids.
   Selectors verified from live search results markup (?s=blizzard). */

/* (a) Force every result card image area to one identical 4:3 ratio. */
#archive-container .loop-entry .post-thumbnail {
  display: block;
  flex: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
#archive-container .loop-entry .post-thumbnail .post-thumbnail-inner {
  padding: 0 !important;
  padding-bottom: 0 !important;
  height: 100%;
}
#archive-container .loop-entry .post-thumbnail img {
  position: static !important;
  display: block;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* (b) Results WITHOUT a featured image: uniform 4:3 placeholder in cream/red. */
#archive-container .loop-entry:not(.has-post-thumbnail)::before {
  content: "DQ";
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f7efe0;
  background: color-mix(in srgb, var(--global-palette1) 8%, #ffffff);
  color: color-mix(in srgb, var(--global-palette1) 26%, transparent);
  font-family: var(--global-heading-font-family);
  font-weight: 800;
  font-size: clamp(2.75rem, 6vw, 4.25rem);
  letter-spacing: -0.02em;
  line-height: 1;
}

/* (c) Equal-height cards per row with aligned text baselines. */
#archive-container {
  align-items: stretch;
}
#archive-container > .entry-list-item {
  height: 100%;
}
#archive-container .loop-entry {
  display: flex;
  flex-direction: column;
  height: 100%;
}
#archive-container .loop-entry > .entry-content-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
#archive-container .loop-entry .entry-summary {
  flex: 1 1 auto;
}

/* Owner request 2026-10-04: breathing room inside the homepage hero and
   between the hero and the paragraph below it. */
body.home .entry-content > :first-child {
  padding-top: 56px !important;
  padding-bottom: 56px !important;
}
body.home .entry-content > :first-child + * {
  margin-top: 56px !important;
}
@media (max-width: 768px) {
  body.home .entry-content > :first-child {
    padding-top: 36px !important;
    padding-bottom: 36px !important;
  }
  body.home .entry-content > :first-child + * {
    margin-top: 36px !important;
  }
}

/* Owner request 2026-10-04: uniform landscape photo ratio on all 21 Blizzard /
   cake sub-pages (children of hubs 219 and 223) — matches the Blizzard hub
   reference. No more odd portrait crops; images fill a 16:9 frame. */
body.parent-pageid-219 .entry-content figure.wp-block-image img,
body.parent-pageid-223 .entry-content figure.wp-block-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Owner request 2026-10-04: spacing around sub-page H1 titles.
   (H1 is a manual content block; the theme's global page title is off.) */
/* Gap: site header → H1 title */
body.parent-pageid-219 .entry-content > h1.wp-block-heading:first-child,
body.parent-pageid-223 .entry-content > h1.wp-block-heading:first-child {
  margin-top: 3rem;
}
/* Gap: H1 title → intro paragraph */
body.parent-pageid-219 .entry-content > h1.wp-block-heading:first-child + p,
body.parent-pageid-223 .entry-content > h1.wp-block-heading:first-child + p {
  margin-top: 1.75rem;
}
@media (max-width: 768px) {
  body.parent-pageid-219 .entry-content > h1.wp-block-heading:first-child,
  body.parent-pageid-223 .entry-content > h1.wp-block-heading:first-child {
    margin-top: 2rem;
  }
}

/* Owner request 2026-10-06: hide author byline site-wide.
   The site is branded "DQ Menu Guide" — no personal author names. */
.entry-author,
.post-author,
.author.vcard,
.byline .author,
.entry-meta .posted-by,
.kadence-post-author {
  display: none !important;
}

/* Owner request 2026-10-05: uniform 4:3 ratio on ALL Menu hub (page 217)
   category section images — same size, same height, perfectly aligned.
   Covers both old nested markup and modern figure markup. */
body.page-id-217 .entry-content .wp-block-image img,
body.page-id-217 .entry-content figure.wp-block-image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
@media (max-width: 768px) {
  body.page-id-217 .entry-content .wp-block-image img,
  body.page-id-217 .entry-content figure.wp-block-image img {
    aspect-ratio: 4 / 3;
  }
}

/* Premium header redesign 2026-10-06: white editorial header with red accents.
   Replaces the 2026-10-04 red bar. Charcoal branding/nav, red hover, subtle border. */
#masthead .site-header-row-container-inner {
  background-color: #ffffff !important;
  border-bottom: 1px solid #E5E2DE;
}
#masthead .site-branding a,
#masthead .site-title a,
#masthead .site-title,
#masthead .site-title-wrap,
#masthead .site-description {
  color: #20232B !important;
}
#masthead #site-navigation #primary-menu > li > a {
  color: #20232B !important;
}
#masthead #site-navigation #primary-menu > li > a:hover,
#masthead #site-navigation #primary-menu > li > a:focus-visible,
/* Touch devices: no hover exists, so give tap feedback instead */
#masthead #site-navigation #primary-menu > li > a:active {
  color: #C92332 !important;
  background-color: transparent !important;
}
/* Mobile header: ensure white background, charcoal hamburger */
@media (max-width: 768px) {
  #masthead .site-header-row-container-inner {
    background-color: #ffffff !important;
  }
  #masthead .menu-toggle,
  #masthead .mobile-toggle {
    color: #20232B !important;
  }
}
/* === WARM BEIGE THEME v1.0.26 (2026-10-06) === */
/* Sophisticated warm light theme replacing stark pure white.
   Palette:
   - Page bg: #F5F0E8 (warm light beige)
   - Cards: #FFFCF7 (soft cream white)
   - Alternate sections: #E9DFD0 (light sand beige)
   - Brand: #C92332 (existing)
   - Text: #292824 (main), #625D54 (secondary)
   - Borders: #E3D9CB
*/

:root {
  --dq-beige-bg: #F5F0E8;
  --dq-cream: #FFFCF7;
  --dq-sand: #E9DFD0;
  --dq-text: #292824;
  --dq-text-secondary: #625D54;
  --dq-border: #E3D9CB;
}

/* --- 1. SITE-WIDE PAGE BACKGROUND --- */
body {
  background-color: var(--dq-beige-bg) !important;
  color: var(--dq-text);
}
body .content-area,
body .site-content {
  background-color: transparent;
}

/* --- 2. HEADER: cream surface with subtle border --- */
#masthead .site-header-row-container-inner {
  background-color: var(--dq-cream) !important;
  border-bottom: 1px solid var(--dq-border) !important;
}

/* --- 3. HERO: preserve original dark image hero (user preference 2026-10-06) --- */
/* No hero overrides — original Kadence Row with bg image + white text kept. */

/* --- 4. CATEGORY CARDS: cream surfaces with subtle borders --- */
.home .kt-blocks-info-box-link-wrap {
  background-color: var(--dq-cream) !important;
  border: 1px solid var(--dq-border) !important;
  border-radius: 8px;
}
.home .kt-blocks-info-box-link-wrap h3 {
  color: var(--dq-text) !important;
}
.home .kt-blocks-info-box-link-wrap p {
  color: var(--dq-text-secondary) !important;
}

/* --- 5. TABLES: cream cells with readable borders --- */
.wp-block-table table {
  background-color: var(--dq-cream) !important;
  border: 1px solid var(--dq-border) !important;
}
.wp-block-table th {
  background-color: var(--dq-sand) !important;
  color: var(--dq-text) !important;
  border: 1px solid var(--dq-border) !important;
}
.wp-block-table td {
  border: 1px solid var(--dq-border) !important;
  color: var(--dq-text) !important;
}

/* --- 6. FAQ: cream background for questions --- */
.rank-math-faq-item,
.wp-block-rank-math-faq-block .rank-math-list-item {
  background-color: var(--dq-cream) !important;
  border: 1px solid var(--dq-border) !important;
}

/* --- 7. BODY TEXT: ensure readability --- */
.entry-content p,
.entry-content li {
  color: var(--dq-text);
}
.entry-content .has-secondary-color,
.text-secondary {
  color: var(--dq-text-secondary) !important;
}

/* --- 8. LINKS: brand red for important actions --- */
.entry-content a:not(.wp-block-button__link) {
  color: #C92332;
}
.entry-content a:not(.wp-block-button__link):hover {
  color: #951D2A;
}

/* --- 9. BUTTONS: brand red --- */
.wp-block-button__link,
.wp-block-search__button {
  background-color: #C92332 !important;
  color: #ffffff !important;
}
.wp-block-button__link:hover {
  background-color: #951D2A !important;
}

/* --- 10. FOOTER: preserve dark, ensure connection --- */
/* Dark footer already exists; add subtle top border for transition */
.site-footer {
  border-top: 3px solid #C92332;
}

/* v1.0.27 fix: Kadence .site wrapper was covering body beige bg */
body.content-style-unboxed .site,
.site {
  background-color: transparent !important;
}

