/*
Theme Name:   Carbon Market India
Theme URI:    https://carbonmarketindia.com/
Description:  Child theme for Fairy. Owns the design tokens, fixes the float-based layout that Fairy inherits from an older CSS era, and tightens the header. Deliberately contains no template overrides — deactivating it returns the site to stock Fairy with nothing left behind.
Author:       Richard N. Bright
Author URI:   https://carbonmarketindia.com/richardbright/
Template:     fairy
Version:      1.0.2
License:      GPL-2.0-or-later
Text Domain:  cmi-child
*/

/* ==========================================================================
   1. TOKENS

   Every value here was read off the live site on 27 Aug 2026, not chosen. The
   plugin ships the same block so that track pages still render correctly if
   this theme is ever deactivated; when both are present these win, because the
   theme loads later and a site's own theme should be the authority on its own
   colours.

   The point of writing them down at all: an audit found twenty font sizes in
   the plugin against twelve in the theme, eight corner radii, and the brand red
   hardcoded twenty-two times. That is not a styling problem, it is a vocabulary
   problem, and it is why every design change so far has needed a rescue.
   ========================================================================== */

:root{
  --cmi-red:#D10014;
  --cmi-red-dark:#A50010;
  --cmi-ink:#141413;
  --cmi-ink-2:#404040;
  --cmi-muted:#79818E;
  --cmi-faint:#9B9FA0;
  --cmi-surface:#FFFFFF;
  --cmi-surface-2:#FBFBFB;
  --cmi-charcoal:#37373F;
  --cmi-rule:#E3E3E3;
  --cmi-rule-strong:#C9CAD1;
  --cmi-on-red:#E5ECE9;

  --cmi-state-settled:#1F6F4A;
  --cmi-state-settled-soft:#E4F0E9;
  --cmi-state-motion:#A8481A;
  --cmi-state-motion-soft:#FAEBE1;
  --cmi-state-absent:#79818E;
  --cmi-state-absent-soft:#F1F2F4;

  --cmi-display:Poppins,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --cmi-body:Mulish,Muli,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --cmi-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;

  --cmi-fs-xs:11px;
  --cmi-fs-sm:13px;
  --cmi-fs-md:14px;
  --cmi-fs-base:16px;
  --cmi-fs-lg:20px;
  --cmi-fs-xl:26px;
  --cmi-fs-2xl:34px;

  --cmi-lh-body:1.7;
  --cmi-lh-tight:1.25;

  --cmi-radius:5px;
  --cmi-radius-pill:20px;
  --cmi-col:802px;
  --cmi-gutter:15px;
}

/* ==========================================================================
   2. FLOATS

   This is the fix that matters most, and it is why a child theme is worth
   having at all.

   Fairy floats block-level children inside its content areas — a pattern from
   before flexbox and grid were usable. The consequence is that any component
   dropped into the content area leaves normal flow and wraps around its
   siblings: on the /tracks/ hub the title sat beside the eyebrow and the slot
   strip beside the footer, and the homepage poster computed 100vw against a
   narrow masonry cell and pushed itself half off screen.

   Both were previously worked around inside the plugin — `float:none !important`
   scattered through component CSS, and an output-buffer that re-injects the
   poster outside the masonry grid. Those workarounds treat the symptom in every
   component, forever. This treats the cause once.

   Scoped to our own components rather than applied globally: Fairy uses floats
   deliberately elsewhere, for image alignment and the masonry grid, and turning
   those off would break the article listing that currently works.
   ========================================================================== */

.cmi-hub > *,
.cmi-hub-in > *,
.cmi-track > *,
.cmi-explain > *,
.cmi-foot > *,
.cmi-poster > *{
  float:none;
}

/* Alignment classes are Fairy's, and they are legitimate. Left alone. */

/* ==========================================================================
   3. HEADER

   The tagline is doing three jobs — a slogan, a topic list and a credential —
   and the credential is the only one that differentiates anything. Until the
   wording changes, the least that can be done is stop the three competing:
   give the line room, hold it to a readable measure, and quieten it relative
   to the wordmark so the eye reaches the navigation.
   ========================================================================== */

.site-branding .site-title,
.site-header h1.site-title{
  font-family:var(--cmi-display);
  letter-spacing:-0.015em;      /* Poppins 700 at 37px sets slightly loose */
  line-height:1.05;             /* was 1.0 — descenders were clipping */
  margin-bottom:6px;
}

.site-description{
  max-width:66ch;
  margin:0 auto;
  font-size:var(--cmi-fs-md);
  line-height:1.55;             /* was 1.0, which is unreadable if it ever wraps */
  color:var(--cmi-muted);
}

/* Navigation: Tracks is the differentiated asset and currently has exactly the
   same weight as Contact Us. A quiet marker, not a shout. */
.main-navigation a{
  font-family:var(--cmi-body);
  font-size:var(--cmi-fs-base);
}
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a{
  color:var(--cmi-red);
}

/* ==========================================================================
   4. TYPOGRAPHY

   Aligning the theme to the same scale the plugin now uses, so a track page and
   an article are visibly the same publication. Body copy is untouched: 16/1.7
   Mulish #404040 was already consistent and already correct.
   ========================================================================== */

.entry-content h2{ font-size:var(--cmi-fs-xl); line-height:1.25; }
.entry-content h3{ font-size:var(--cmi-fs-lg); line-height:1.3; }
.entry-content h4{ font-size:var(--cmi-fs-base); }
.entry-content{ max-width:var(--cmi-col); }

/* Fairy underlines every link in content. Kept — an underlined link is the
   accessible default and this site is a reference, where knowing what is a
   citation matters more than tidiness. Only the colour is tokenised. */
.entry-content a{ color:var(--cmi-red); }
.entry-content a:hover{ color:var(--cmi-red-dark); }

/* ==========================================================================
   5. SHAPE

   One radius. Fairy uses 5px dominantly and then 2, 3, 6, 8 and 15 in odd
   corners; the mixture reads as sloppiness rather than variety at these sizes.
   ========================================================================== */

.fairy-post-list .post-thumbnail img,
.widget,
.btn,
button,
input[type=submit],
.wp-block-button__link{
  border-radius:var(--cmi-radius);
}

/* ==========================================================================
   6. FOOTER

   Nothing here. The plugin renders the footer and strips Fairy's broken credit
   line with an output buffer.

   That buffer is the one workaround this child theme should eventually delete,
   by overriding footer.php properly — but doing that requires reading Fairy's
   own footer.php to reproduce the wrappers its header.php opens, and guessing
   at those would produce an unclosed div on every page of the site. Left as a
   known, deliberate gap rather than a risk taken blind.
   ========================================================================== */
