/*
 * plannedway-case-studies.css
 *
 * Drop this file into your WordPress theme's /css/ folder and enqueue it
 * in functions.php like this:
 *
 *   wp_enqueue_style(
 *       'plannedway-case-studies',
 *       get_template_directory_uri() . '/css/plannedway-case-studies.css',
 *       array(),
 *       '1.0.0'
 *   );
 *
 * ─────────────────────────────────────────────────────────────────────────────
 * ALSO add these two lines to your theme's <head> (via wp_head hook or
 * header.php) to load the Google Fonts the design depends on:
 *
 *   <link rel="preconnect" href="https://fonts.googleapis.com">
 *   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 *   <link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,400&family=Great+Vibes&family=Lato:wght@300;400;700;900&display=swap" rel="stylesheet">
 *
 * AND add the Tailwind CDN for all the utility classes used in the templates:
 *
 *   <script src="https://cdn.tailwindcss.com"></script>
 *   <script>
 *     tailwind.config = {
 *       theme: {
 *         extend: {
 *           fontFamily: {
 *             display: ['"Cormorant Garamond"', 'Georgia', 'serif'],
 *             sans:    ['Lato', 'system-ui', 'sans-serif'],
 *             script:  ['"Great Vibes"', 'cursive'],
 *           },
 *           colors: {
 *             primary:    '#B85427',
 *             accent:     '#CC6030',
 *             forest:     '#4A5530',
 *             cream:      '#F5E6CC',
 *             sand:       '#EDE0CC',
 *             sage:       '#9AB87A',
 *             'deep-brown': '#3A2510',
 *             muted:        '#E6D4B8',
 *             card:         '#F5E6CC',
 *             background:   '#EDE0CC',
 *             foreground:   '#3A2510',
 *             border:       'rgba(58,37,16,0.14)',
 *           },
 *           borderRadius: { '2xl': '1rem' }
 *         }
 *       }
 *     }
 *   </script>
 *
 * ─────────────────────────────────────────────────────────────────────────────
 * The rules below handle everything that Tailwind CDN cannot: the custom
 * brand CSS variables, the .eyebrow class, the .script class, base resets,
 * and any Tailwind colour/semantic tokens that appear as CSS custom properties
 * inside inline styles (e.g. bg-primary, text-primary-foreground, etc.).
 * ─────────────────────────────────────────────────────────────────────────────
 */


/* ═══════════════════════════════════════════════════════════════════════════
   1. BRAND CSS CUSTOM PROPERTIES
   These map exactly to the :root block in the React project's styles.css.
   They are referenced by Tailwind utilities like bg-primary, text-deep-brown,
   border-border, etc. after the Tailwind config above wires them in.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Radius scale */
  --radius: 0.75rem;

  /* ── Raw brand colours ──────────────────────────────────────────── */
  --sand:         #EDE0CC;
  --cream:        #F5E6CC;
  --burnt-orange: #B85427;
  --terracotta:   #CC6030;
  --forest:       #4A5530;
  --sage:         #9AB87A;
  --deep-brown:   #3A2510;
  --charcoal:     #3A3A3A;

  /* ── Semantic tokens (mirrors the React theme) ───────────────────── */
  --background:              var(--sand);
  --foreground:              var(--deep-brown);

  --card:                    var(--cream);
  --card-foreground:         var(--deep-brown);

  --primary:                 var(--burnt-orange);
  --primary-foreground:      #FBF3E6;

  --secondary:               var(--forest);
  --secondary-foreground:    var(--cream);

  --muted:                   #E6D4B8;
  --muted-foreground:        #6B4A28;

  --accent:                  var(--terracotta);
  --accent-foreground:       #FBF3E6;

  --destructive:             #8C3A18;
  --destructive-foreground:  #FBF3E6;

  --border:                  rgba(58, 37, 16, 0.14);
  --input:                   rgba(58, 37, 16, 0.18);
  --ring:                    var(--burnt-orange);

  /* ── Font stacks ───────────────────────────────────────────────── */
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-sans:    "Lato", system-ui, sans-serif;
  --font-script:  "Great Vibes", cursive;
}


/* ═══════════════════════════════════════════════════════════════════════════
   2. BASE RESETS
   Mirrors the @layer base block in the React project's styles.css.
   Scoped to the case-study post type with .case-study-page to avoid
   fighting existing WordPress theme styles. If your theme has no conflicting
   globals you can remove this scope and apply them to html/body directly.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Scope: add class="case-study-page" to <body> via body_class() filter */
.case-study-page,
.post-type-archive-case-study {
  background-color: var(--background);
  color:            var(--foreground);
  font-family:      var(--font-sans);
  font-weight:      300;
  -webkit-font-smoothing: antialiased;
}

.case-study-page h1,
.case-study-page h2,
.case-study-page h3,
.case-study-page h4,
.post-type-archive-case-study h1,
.post-type-archive-case-study h2,
.post-type-archive-case-study h3,
.post-type-archive-case-study h4 {
  font-family:     var(--font-display);
  font-weight:     600;
  color:           var(--deep-brown);
  letter-spacing:  -0.01em;
}


/* ═══════════════════════════════════════════════════════════════════════════
   3. CUSTOM UTILITY CLASSES
   These are the three classes that are NOT Tailwind utilities and therefore
   NOT provided by the Tailwind CDN. They come from the React project's own
   styles.css @layer base block and must exist in WordPress separately.
   ═══════════════════════════════════════════════════════════════════════════ */

/*
 * .eyebrow
 * Used on: every section label ("The Work", "The Challenge", "About the Client", etc.)
 * Source: styles.css lines 104–111
 */
.eyebrow {
  font-family:     var(--font-sans);    /* Lato */
  font-weight:     900;
  font-size:       0.72rem;
  letter-spacing:  0.2em;
  text-transform:  uppercase;
  color:           var(--burnt-orange);
}

/*
 * .script
 * Used on: the pull-quote section ("“...”")
 * Source: styles.css lines 112–115
 */
.script {
  font-family:  var(--font-script);   /* Great Vibes */
  font-weight:  400;
}

/*
 * .font-display
 * In the React project this is a Tailwind utility auto-generated from the
 * `fontFamily.display` config. In WordPress / without Tailwind it must be
 * an explicit CSS class. Used on: metric values, timeline numbers, logo text,
 * funnel stage numbers, quote pull-text, revenue figure.
 */
.font-display {
  font-family: var(--font-display);   /* Cormorant Garamond */
}


/* ═══════════════════════════════════════════════════════════════════════════
   4. TAILWIND SEMANTIC COLOUR TOKENS AS REAL CSS PROPERTIES
   When Tailwind CDN is configured (see the <script> block at the top of this
   file), utilities like bg-primary / text-primary-foreground automatically
   resolve to your brand colours. The :root variables above ensure any usage
   of CSS var(--primary) inside inline styles also works.

   If for any reason you cannot use the Tailwind CDN (e.g. strict CSP policy),
   uncomment and use the fallback block below instead.
   ═══════════════════════════════════════════════════════════════════════════ */

/*
 * ── FALLBACK (only needed WITHOUT Tailwind CDN) ───────────────────────────
 * Uncomment this entire block if you are NOT loading tailwindcss from CDN.
 * It provides the minimum CSS to make the layout and colours work.

.bg-primary         { background-color: var(--primary) !important; }
.bg-forest          { background-color: var(--forest) !important; }
.bg-card            { background-color: var(--card) !important; }
.bg-muted           { background-color: var(--muted) !important; }
.bg-cream\/60       { background-color: rgba(245,230,204,0.6) !important; }
.bg-cream\/50       { background-color: rgba(245,230,204,0.5) !important; }
.bg-cream\/70       { background-color: rgba(245,230,204,0.7) !important; }
.bg-deep-brown      { background-color: var(--deep-brown) !important; }

.text-primary            { color: var(--primary) !important; }
.text-primary\/70        { color: rgba(184,84,39,0.7) !important; }
.text-accent             { color: var(--accent) !important; }
.text-foreground         { color: var(--foreground) !important; }
.text-muted-foreground   { color: var(--muted-foreground) !important; }
.text-primary-foreground { color: var(--primary-foreground) !important; }
.text-deep-brown         { color: var(--deep-brown) !important; }
.text-deep-brown\/85     { color: rgba(58,37,16,0.85) !important; }
.text-deep-brown\/75     { color: rgba(58,37,16,0.75) !important; }
.text-deep-brown\/70     { color: rgba(58,37,16,0.7) !important; }
.text-deep-brown\/80     { color: rgba(58,37,16,0.8) !important; }
.text-cream              { color: var(--cream) !important; }
.text-cream\/80          { color: rgba(245,230,204,0.8) !important; }
.text-cream\/50          { color: rgba(245,230,204,0.5) !important; }
.text-cream\/90          { color: rgba(245,230,204,0.9) !important; }
.text-primary-foreground\/75 { color: rgba(251,243,230,0.75) !important; }
.text-primary-foreground\/60 { color: rgba(251,243,230,0.60) !important; }

.border-border        { border-color: var(--border) !important; }
.border-border\/60    { border-color: rgba(58,37,16,0.085) !important; }
.border-primary\/60   { border-color: rgba(184,84,39,0.6) !important; }
.border-primary\/20   { border-color: rgba(184,84,39,0.2) !important; }
.border-primary\/30   { border-color: rgba(184,84,39,0.3) !important; }

.hover\:text-accent:hover  { color: var(--accent) !important; }
.hover\:text-primary:hover { color: var(--primary) !important; }
.hover\:border-primary\/60:hover { border-color: rgba(184,84,39,0.6) !important; }

 * ── END FALLBACK ──────────────────────────────────────────────────────────
 */


/* ── Astra conflict fix for case study pages ────────────────────────── */

/* Force Astra's main content area to not use flex/grid on case study pages */
.case-study-page #content,
.case-study-page #primary,
.case-study-page #main,
.case-study-page .ast-container,
.case-study-page .site-content,
.case-study-page .content-area,
.case-study-page .ast-row {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
}

/* Remove Astra sidebar */
.case-study-page #secondary,
.case-study-page .widget-area {
    display: none !important;
}

/* Remove Astra's default entry padding/margins */
.case-study-page .entry-content,
.case-study-page .entry-header,
.case-study-page article.post,
.case-study-page .ast-article-single {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
}

/* Tailwind box-sizing fix */
.case-study-page *,
.case-study-page *::before,
.case-study-page *::after {
    box-sizing: border-box;
}

/* Fix Astra overriding grid */
.case-study-page .grid {
    display: grid !important;
}

.case-study-page .flex {
    display: flex !important;
}

/* Fix Astra heading margins interfering */
.case-study-page h1,
.case-study-page h2,
.case-study-page h3 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Fix Astra paragraph margins */
.case-study-page p {
    margin-bottom: 0 !important;
}
