/* =============================================================================
   CS THEME — style.css
   Subtheme of Barrio (bootstrap_barrio) for Charity Sustainability / Annette McGill

   Structure:
   1.  Design tokens (CSS variables)
   4.  Layout — structural rules for regions
   5.  Header & navigation
   6.  Footer
   7.  Card grid system
   8.  Card component
   9.  Badges
   10. Content fields — standfirst, image captions, dates
   11. Utilities & helpers
   ============================================================================= */


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

:root {
  /* Colours */
  --cs-blue:        #2C4A6E;
  --cs-amber:       #A07028;
  --cs-off-white:   #F8F7F4;
  --cs-rule:        #D4D0C8;
  --cs-text:        #222222;
  --cs-text-mid:    #444444;
  --cs-text-light:  #888888;
  --cs-white:       #ffffff;

  /* Typography */
  --cs-font-serif:  Palatino, 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --cs-font-sans:   'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;

  /* Spacing & shape */
  --cs-radius:      4px;
  --cs-gap:         1.5rem;
}

/* =============================================================================
   HEADINGS
   ============================================================================= */

h1, h2, h3 {
  font-family: var(--cs-font-serif);
  color: var(--cs-blue);
  font-weight: 500;
}

h4, h5, h6 {
  font-family: var(--cs-font-sans);
  color: var(--cs-blue);
  font-weight: 600;
}

h1 {
  padding-top: .5rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.6rem;
  line-height: 1.3;
  font-weight: 600;
  padding-top: .5rem;
}

h3 {
  font-size: 1.3rem;
  line-height: 1.4;
  font-weight: 600;
  padding-top: .5rem;
}

h4 {
  font-size: 1.1rem;
  font-weight: 600;
  padding-top: .3rem;
}

h5, h6 {
  font-size: 1rem;
}

/* Body text */
body, p, li, td {
  font-family: var(--cs-font-sans);
  color: var(--cs-text);
  font-size: 18px;
  line-height: 1.6;
}

.attribution {
  font-style: italic;
  color: var(--cs-text-mid);
  font-size: 0.95rem;
}



.field--name-body field {
  padding-bottom: 2rem;
}

/* =============================================================================
   4. LAYOUT — CONTENT WIDTH & MARGINS
   ============================================================================= */

/* Region-level defaults — centring and padding on desktop */
.node--type-article .region-content,
.node--type-page .region-content {
  padding-left: 2rem;
  padding-right: 2rem;
}

.node--type-home-page .region-content {
  padding-left: 0;
  padding-right: 0;
}


/* Layout region constraints — desktop only */
@media (min-width: 640px) {

  /* Standard content — constrain to readable line length, centred */
  .layout--onecol .layout__region {
    max-width: 75ch;
    margin-left: auto;
    margin-right: auto;
  }

/* Basic page — no layout region wrapper, target blocks directly */
/* Excluded on home page — text bands manage their own width */
body:not(.node--type-home-page) #block-two-barrio-pagetitle,
body:not(.node--type-home-page) #block-two-barrio-content {
  max-width: 75ch;
  margin-left: auto;
  margin-right: auto;
}

/* Services page — wider column, centred */
body.page-node-84 #block-two-barrio-pagetitle,
body.page-node-84 #block-two-barrio-content {
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
}



  /* Home page — full width; text bands manage their own internal padding */
  .node--type-home-page .layout--onecol .layout__region {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }



  /* Home page — full width; text bands manage their own internal padding */
  .node--type-home-page .layout--onecol .layout__region {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

/* Home page — svc-rows centred, text bands full width */
.node--type-home-page .svc-row {
  margin-left: auto;
  margin-right: auto;
}

.node--type-home-page .text-band {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

}




/* Mobile — full width, reduced padding */
@media (max-width: 639px) {
  .layout--onecol .layout__region {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* =============================================================================
   5. HEADER & NAVIGATION
   ============================================================================= */

#header {
  background: var(--cs-white);
  border-bottom: 1px solid var(--cs-rule);
}

/* ── Header / nav padding ── */
#header .navbar-nav .nav-link {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Generic nav link fallback */
.nav-link {
  font-family: var(--cs-font-sans);
  color: var(--cs-blue);
  font-weight: 600;
}

/* ── Nav link colours ── */
#header .navbar .nav-link {
  color: var(--cs-blue);
  opacity: 1;
}

#header .navbar .nav-link:hover {
  color: var(--cs-amber);
}

#header .navbar .nav-link.active,
#header .navbar .nav-link.is-active {
  color: var(--cs-blue);
  border-bottom: 2px solid var(--cs-amber);
}

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

.site-footer {
  background: var(--cs-blue);
  color: var(--cs-white);
  padding: 2rem 0 0;
}

.site-footer a {
  color: var(--cs-white);
}

.site-footer p {
  color: var(--cs-white);
}

.site-footer a:hover {
  color: var(--cs-amber);
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1rem;
}

.site-footer__bottom {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* Remove extra space from Layout Builder wrappers inside copyright block */
.site-footer__bottom .layout--onecol,
.site-footer__bottom .layout__region,
.site-footer__bottom .block__content {
  padding: 0 !important;
  margin: 0 !important;
}

/* Prevent double padding from nested .site-footer__bottom */
.site-footer__bottom .site-footer__bottom {
  padding: 0 !important;
}

.site-footer__inner.container {
  padding-bottom: 0.75rem;
}

/* =============================================================================
   7. CARD GRID SYSTEM
   NOTE ON VIEWS FORMAT
   Use Views > Format: Unformatted List (not Bootstrap Grid).
   In Format settings set:
     Wrapper class:  cards-grid cards-grid--featured   (or --taxonomy)
     Row class:      card
   ============================================================================= */

/* Gap between body section and first card section */
.node--type-landing-no-image .field--name-body {
  margin-bottom: 2.5rem;
}   

.cards-grid {
  display: grid;
  gap: var(--cs-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Featured: 2-column grid */
.cards-grid--featured .view-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--cs-gap);
  width: 100%;
}

.cards-grid--featured .view-content .card {
  width: 100%;
  min-width: 0;
}

@media (max-width: 639px) {
  .cards-grid--featured .view-content {
    grid-template-columns: 1fr;
  }
}

/* Taxonomy landing: 3 columns */
.cards-grid--taxonomy .view-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--cs-gap);
  width: 100%;
}

/* Taxonomy landing: 4 columns */
.cards-grid--taxonomy-4 .view-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: var(--cs-gap);
  width: 100%;
}


.cards-grid--taxonomy .view-content .card {
  width: 100%;
  min-width: 0;
}

@media (max-width: 639px) {
  .cards-grid--taxonomy .view-content {
    grid-template-columns: 1fr;
  }
}


/* =============================================================================
   8. CARD COMPONENT
   ============================================================================= */

.card {
  background: var(--cs-white);
  border: 1px solid var(--cs-rule);
  border-radius: var(--cs-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card a {
  text-decoration: none;
  color: inherit;
}

/* Featured image — 4-card taxonomy grid (compact) */
.cards-grid--taxonomy .card .views-field-field-featured-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* Featured image — 2-card featured grid (taller, wider cards) */
.cards-grid--featured .card .views-field-field-featured-image img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

/* Featured image padding */
.card .views-field-field-featured-image {
  padding: 0;
  margin: 0;
}

/* Card body padding wrapper */
.card__body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Badges row */
.card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 0.6rem;
}

/* Internal field padding */
.card .views-field {
  padding: 0 1.25rem;
}

.card .views-field:first-child {
  padding: 0;
}

.card .views-field:last-child {
  padding-bottom: 1.25rem;
}

/* Title */
.card .views-field-title {
  font-family: var(--cs-font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.5rem;
  color: var(--cs-blue);
}

/* Standfirst (card context — compact size) */
.card .views-field-field-standfirst {
  font-size: 0.9rem;
  color: var(--cs-text-mid);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* Trimmed body */
.card .views-field-body {
  font-size: 0.875rem;
  color: #555;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  flex: 1;
}

/* Date */
.card .views-field-field-date,
.card .views-field-field-date-published {
  font-size: 0.78rem;
  color: var(--cs-text-light);
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--cs-rule);
}

/* Helper class for 4-card grid title alignment */
.grid-4-card-title {
  min-height: 100px;
}

.grid-4-card {
  padding-left: 20px;
  padding-right: 20px;
}

/* =============================================================================
   HOME PAGE — TEXT BANDS
   ============================================================================= */

.text-band {
  width: 100%;
  padding: 3rem 1.5rem;
}

.text-band__inner {
  max-width: 740px;
  margin: 0 auto;
}

/* Default band — white background, hero use */
.text-band--default {
  background: var(--cs-white);
}

.text-band--default h1 {
  font-family: var(--cs-font-serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--cs-blue);
  line-height: 1.25;
  margin-bottom: 1rem;
}

.text-band--default .text-band__inner > div > p:first-child {
  font-size: 1.15rem;
  color: var(--cs-text-mid);
  line-height: 1.6;
}

/* Off-white band — credibility line */
.text-band--off_white {
  background: var(--cs-off-white);
  border-top: 1px solid var(--cs-rule);
  border-bottom: 1px solid var(--cs-rule);
}

.text-band--off_white p {
  font-size: 1.05rem;
  color: var(--cs-text-mid);
  line-height: 1.7;
}

/* Dark band — CS panel */
.text-band--dark {
  background: var(--cs-blue);
}

.text-band--dark h2,
.text-band--dark p {
  color: var(--cs-white);
}

.text-band--dark h2 {
  font-family: var(--cs-font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}


.text-band--dark a,
.text-band--dark a:link,
.text-band--dark a:visited {
  color: var(--cs-white) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-band--dark a:hover {
  color: var(--cs-amber) !important;
}

.text-band--dark a:hover {
  color: var(--cs-amber);
}

.text-band a[href] {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cs-blue);
  display: inline-block;
  margin-top: 0.5rem;
}

.text-band--default h2 {
  font-size: 2.2rem;
  line-height: 1.3;
  font-weight: 400;
  max-width: 60ch;
}


/* =============================================================================
   HOME PAGE — WHAT I DO GRID
   ============================================================================= */

/* Wrapper around the service_item paragraphs on the home page */
.home-services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--cs-gap);
  padding: 2rem 1.5rem;
  max-width: 740px;
  margin: 0 auto;
}

@media (max-width: 639px) {
  .home-services-grid {
    grid-template-columns: 1fr;
  }
}


/* Hide front page title */
.path-frontpage h1.page-title,
.path-frontpage .page-title {
  display: none;
}
/* =============================================================================
   9. BADGES
   ============================================================================= */

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  display: inline-block;
  line-height: 1.6;
}

.badge--type {
  background-color: var(--cs-blue);
  color: var(--cs-white);
}

.badge--topic {
  background-color: var(--cs-amber);
  color: var(--cs-white);
}


/* =============================================================================
   10. CONTENT FIELDS — STANDFIRST, IMAGE CAPTIONS, DATES
   ============================================================================= */

/* ── Standfirst (full article / node context) ──
   Note: card context standfirst is in Section 8 above.
   field-standfirst and field-standfirst1 are treated identically. */

div.field--name-field-standfirst,
div.field--name-field-standfirst1 {
  font-family: var(--cs-font-serif);
  font-size: 1.4rem;
  line-height: 2rem;
  color: #505050;
  padding-bottom: 40px;
  max-width: 90%;
}

div.field--name-field-standfirst p,
div.field--name-field-standfirst1 p {
  font-family: var(--cs-font-serif);
  font-size: 1.4rem;
  line-height: 2rem;
  color: #505050;
}

/* ── Image captions ── */

div.field--name-field-imagecaption {
  max-width: 560px;
  width: 100%;
}

div.field--name-field-featured-imagecaption p {
  font-family: var(--cs-font-sans);
  color: #999999;
  font-weight: 400;
  font-size: 1rem;
  margin-top: 10px;
  margin-bottom: 40px;
  line-height: 1.3;
}

/* ── Dates ── */

div.field.field--name-field-date.field--type-datetime.field--label-inline {
  font-family: var(--cs-font-sans);
  margin-top: 30px;
  margin-bottom: 20px;
}

div.field.field--name-field-date.field--type-datetime.field--label-hidden.field__item {
  font-family: var(--cs-font-sans);
  font-size: 1.1rem;
  font-weight: 400;
  color: #999;
  margin-top: 30px;
  margin-bottom: 20px;
}

.date-published {
  font-family: var(--cs-font-sans);
  font-size: 1rem;
  font-weight: 400;
  color: #999;
  margin-top: 30px;
  margin-bottom: 20px;
}

.date-published-view {
  font-family: var(--cs-font-sans);
  font-size: 1rem;
  font-weight: 400;
  color: #767e84;
  margin-top: 20px;
  margin-bottom: 10px;
}

div.field.field--name-field-date-updated {
  font-family: var(--cs-font-sans);
  font-size: 0.9rem;
  color: #999;
  margin-bottom: 20px;
}

/* =============================================================================
   Services page — responsive row layout
   ============================================================================= */

.svc-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  padding: 36px 0;
  border-bottom: 0.5px solid var(--cs-rule);
  max-width: 780px;
}

.svc-label {
  font-family: var(--cs-font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cs-amber);
  padding-top: 4px;
}

.svc-heading {
  font-family: var(--cs-font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--cs-blue);
  margin: 0 0 0.5rem 0;
  border-left: 3px solid var(--cs-amber);
  padding-left: 12px;
}

.svc-body {
  font-family: var(--cs-font-sans);
  font-size: 1rem;
  color: var(--cs-text-mid);
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 640px) {
  .svc-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 28px 0;
  }
  .svc-label {
    padding-top: 0;
  }
}

/* =============================================================================
   11. UTILITIES & HELPERS
   ============================================================================= */

.text-serif {
  font-family: var(--cs-font-serif);
}

.standfirst {
  font-size: 1.1rem;
  color: var(--cs-text-mid);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

.padding-l-r-10 {
  padding-left: 10px;
  padding-right: 10px;
}
.padding-l-r-5 {
  padding-left: 10px;
  padding-right: 10px;
}
.padding-l-r-2 {
  padding-left: 10px;
  padding-right: 10px;
}

.padding-b-20 {
  padding-bottom: 20px
}


.field--name-field-featured-image {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.field--name-field-featured-image img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-width: 100%;
  height: auto;
}
/* =============================================================================
   DRUPAL ADMIN TOOLBAR — reduce size for logged-in editors
   These rules only affect the toolbar overlay, not the public site.
   ============================================================================= */

/* Shrink the main toolbar height */
#toolbar-bar {
  font-size: 0.8rem;
}

#toolbar-bar .toolbar-icon {
  font-size: 0.85rem;
}

/* Reduce the system status alert (maintenance mode etc.) */
.alert {
  padding: 0;
}

.messages--warning,
.messages--error,
.messages--status {
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.messages__wrapper {
  padding: 0.1rem 0;
}

.alert-wrapper {
  padding: 0.1rem 0;
  max-width: 40%;
}

@media print {
  .node--type-home-page .text-band {
    width: 100%;
    margin-left: 0;
  }

  .node--type-home-page .svc-row {
    margin-left: 0;
    margin-right: 0;
  }

  #block-two-barrio-content {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}