/*
 Counter Culture Co — Child CSS (clean, no JS)
 Theme: Astra Child
 Template: astra
 Description: Global layout + spacing tuned for Astra Transparent Header (desktop only).
 Version: 2025-10-02
*/

/* ============================================
   0) TOKENS / VARIABLES
   ============================================ */
:root{
  /* transparent header spacing */
  --ccc-header-fallback: 96px; /* used if --ast-header-offset isn’t present */
  --ccc-home-gap: 8px;

  /* layout */
  --ccc-maxw: 1200px;
  --ccc-gutter: 24px;
  --ccc-gutter-sm: 16px;

  /* generic gaps used in some sections */
  --ccc-gap-desktop: 80px;
  --ccc-gap-mobile: 56px;

  /* borders */
  --ccc-div-line: 1px solid rgba(0,0,0,.14);
}

/* ============================================
   1) CORE LAYOUT
   ============================================ */
.wrap-ccc{
  max-width: var(--ccc-maxw);
  margin-inline: auto;
  padding-inline: var(--ccc-gutter);
}
@media (max-width: 600px){
  .wrap-ccc{ padding-inline: var(--ccc-gutter-sm); }
}

/* Edge-to-edge utility for full-bleed bands */
.full-bleed{
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}

/* ============================================
   2) BREADCRUMBS (visual off, schema on)
   (body class 'no-breadcrumbs' is added in functions.php)
   ============================================ */
.no-breadcrumbs .ast-breadcrumbs,
.no-breadcrumbs .rank-math-breadcrumb{ display:none; }

/* ============================================
   3) HOMEPAGE SPACING (Astra Transparent Header on desktop only)
   - Desktop: add offset using Astra’s --ast-header-offset (with fallback)
   - Mobile/Tablet (≤ 921px): no offset (your header isn’t transparent there)
   - Remove rogue first-block top margins/padding/spacers
   ============================================ */

/* Hide default WP title wrapper on home (you have a hero) */
.home .entry-header,
.home .entry-title{ display:none; }

/* DESKTOP: transparent header active */
body.home.ast-theme-transparent-header .site-content{
  padding-top: calc(var(--ast-header-offset, var(--ccc-header-fallback)) + var(--ccc-home-gap));
}

/* DESKTOP + admin bar */
.admin-bar.home.ast-theme-transparent-header .site-content{
  padding-top: calc(var(--ast-header-offset, var(--ccc-header-fallback)) + var(--ccc-home-gap) + 32px);
}

/* MOBILE/TABLET: header not transparent — zero the padding */
@media (max-width: 921px){
  .home.ast-header-break-point .site-content{ padding-top: 0 !important; }

  /* logged-in mobile has a taller admin bar */
  .admin-bar.home.ast-header-break-point .site-content{
    padding-top: 46px !important;
  }
}

/* Safe-area (iOS notch) — adds only if padding is non-zero */
@supports (padding-top: env(safe-area-inset-top)){
  body.home.ast-theme-transparent-header .site-content{
    padding-top: calc(
      var(--ast-header-offset, var(--ccc-header-fallback))
      + var(--ccc-home-gap)
      + env(safe-area-inset-top)
    );
  }
}

/* Kill rogue first-block top spacing on the homepage
   (no universal selector; safest core blocks + Spectra/UAGB) */
.home .entry-content > .wp-block-group:first-child,
.home .entry-content > .wp-block-cover:first-child,
.home .entry-content > .wp-block-columns:first-child,
.home .entry-content > .wp-block-image:first-child,
.home .entry-content > .wp-block-media-text:first-child,
.home .entry-content > .wp-block-gallery:first-child,
.home .entry-content > .wp-block-heading:first-child,
.home .entry-content > .wp-block-paragraph:first-child,
.home .entry-content > .wp-block-template-part:first-child,
.home .entry-content > .wp-block-query:first-child,
.home .entry-content > .wp-block-uagb-container:first-child,
.home .entry-content > .wp-block-uagb-section:first-child,
.home .entry-content > .alignfull:first-child,
.home .entry-content > .alignwide:first-child{
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Neutralize a first Spacer block entirely */
.home .entry-content > .wp-block-spacer:first-child{
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* (Optional) cap spacer heights on home to avoid surprise bands */
.home .entry-content .wp-block-spacer{
  height: clamp(0px, 24px, 48px);
}

/* ============================================
   4) NON-HOME PAGES — zero top pad
   ============================================ */
body:not(.home) .site-content{ padding-top: 0; }

/* ============================================
   5) PAGE / HEADING BASICS
   ============================================ */
.page .entry-header{ padding-top: 24px; }

.home .entry-content h1{
  text-align: center;
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 .75rem;
}
.home .entry-content h2{
  text-align: center;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 .6rem;
}
.home .entry-content h3{
  text-align: center;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 .5rem;
}

/* Prevent awkward broken letters; let titles wrap by words */
.home .entry-content h1,
.home .entry-content h2{
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere; /* allows 'Vintage T-Shirts' to wrap at hyphen */
}

/* ============================================
   6) OPTIONAL ASTRA HEADER LINES / FOOTER DIVIDERS
   ============================================ */
.ast-above-header,
.ast-below-header{ border-bottom: var(--ccc-div-line); }

/* ============================================
   7) PRODUCT PAGE MICRO-TYPOGRAPHY
   ============================================ */
.single-product .product_title{
  font-size: 34px;
  line-height: 1.15;
  margin-bottom: .5em;
}
@media (max-width: 1200px){ .single-product .product_title{ font-size: 32px; } }
@media (max-width: 992px){  .single-product .product_title{ font-size: 30px; } }
@media (max-width: 768px){  .single-product .product_title{ font-size: 28px; } }
@media (max-width: 600px){  .single-product .product_title{ font-size: 24px; } }

/* ============================================
   8) PAGE-SPECIFIC BIG-H2 EXAMPLE (page 365)
   Add classes .ccc-big-h2 and .ccc-big-h2b on the two blocks.
   ============================================ */
.page-id-365 .ccc-big-h2 h2,
.page-id-365 .ccc-big-h2 .wp-block-heading,
.page-id-365 .ccc-big-h2 .uagb-heading-text,
.page-id-365 .ccc-big-h2 .wp-block-uagb-advanced-heading .uagb-heading-text,
.page-id-365 .ccc-big-h2b h2,
.page-id-365 .ccc-big-h2b .wp-block-heading,
.page-id-365 .ccc-big-h2b .uagb-heading-text,
.page-id-365 .ccc-big-h2b .wp-block-uagb-advanced-heading .uagb-heading-text{
  font-size: 50px;
  line-height: 1.2;
}
@media (max-width: 480px){
  .page-id-365 .ccc-big-h2 h2,
  .page-id-365 .ccc-big-h2 .wp-block-heading,
  .page-id-365 .ccc-big-h2 .uagb-heading-text,
  .page-id-365 .ccc-big-h2 .wp-block-uagb-advanced-heading .uagb-heading-text,
  .page-id-365 .ccc-big-h2b h2,
  .page-id-365 .ccc-big-h2b .wp-block-heading,
  .page-id-365 .ccc-big-h2b .uagb-heading-text,
  .page-id-365 .ccc-big-h2b .wp-block-uagb-advanced-heading .uagb-heading-text{
    font-size: 28px;
  }
}
