/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

/* =========================================================================
   mentoring.ro — component rules (P1 step 7)
   Colours resolve from Blocksy's palette, so Customizer edits still flow
   through. Only the two utility greys are literals: they are deliberately
   kept out of the editor picker.
   ========================================================================= */

:root {
  --m-accent:       var(--theme-palette-color-1);  /* #FF7B00 */
  --m-accent-hover: var(--theme-palette-color-2);  /* #FF8C00 */
  --m-body:         var(--theme-palette-color-3);  /* #262626 */
  --m-black:        var(--theme-palette-color-4);  /* #000000 */
  --m-rule:         var(--theme-palette-color-5);  /* #DDDDDD */
  --m-surface:      var(--theme-palette-color-6);  /* #F5F4F1 */
  --m-wash:         var(--theme-palette-color-7);  /* #FFF3E6 */
  --m-white:        var(--theme-palette-color-8);  /* #FFFFFF */

  --m-muted:        #6B6660;  /* captions, 5.68:1 on white */
  --m-rule-strong:  #949089;  /* input borders, 3.18:1 — #DDDDDD fails at 1.36:1 */

  --m-radius: 2px;
}

/* --- Focus -------------------------------------------------------------
   Orange alone is 2.60:1 and fails the 3:1 minimum for UI components.
   The black ring does the work; the orange halo makes it ours.          */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--m-black);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--m-accent);
  border-radius: var(--m-radius);
}
/* On black grounds the ring inverts so it stays visible. */
.m-on-dark :where(a, button, input, textarea, summary, [tabindex]):focus-visible {
  outline-color: var(--m-white);
}

/* --- Links -------------------------------------------------------------
   Never orange text on a light ground. Black text, orange underline.     */
.entry-content a:not(.wp-block-button__link):not(.wp-element-button):not(.wp-block-navigation-item__content) {
  color: var(--m-body);
  text-decoration: underline;
  text-decoration-color: var(--m-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.entry-content a:not(.wp-block-button__link):not(.wp-element-button):hover {
  text-decoration-color: var(--m-black);
}
/* On black, orange IS legible as text — 9.00:1. */
.m-on-dark a { color: var(--m-accent-hover); text-decoration: none; }
.m-on-dark a:hover { text-decoration: underline; }

/* --- Buttons -----------------------------------------------------------
   Primary is an orange fill with BLACK text (8.09:1). White on orange is
   2.33:1 and must never appear.                                          */
.wp-block-button__link,
.wp-element-button {
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: .9rem;
  line-height: 1.2;
  padding: 13px 24px;
  border-radius: var(--m-radius);
  border: 2px solid var(--m-accent);
  background-color: var(--m-accent);
  color: var(--m-black);
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.wp-block-button__link:hover,
.wp-element-button:hover {
  background-color: var(--m-accent-hover);
  border-color: var(--m-accent-hover);
  color: var(--m-black);
}

.wp-block-button.is-style-outline .wp-block-button__link {
  background-color: transparent;
  border-color: var(--m-black);
  color: var(--m-black);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background-color: var(--m-black);
  border-color: var(--m-black);
  color: var(--m-white);
}

/* Tertiary: text with an orange underline. Add class "m-btn-text". */
.wp-block-button.m-btn-text .wp-block-button__link {
  background: none;
  border: 0;
  padding: 13px 4px;
  color: var(--m-body);
  text-decoration: underline;
  text-decoration-color: var(--m-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.wp-block-button.m-btn-text .wp-block-button__link:hover {
  text-decoration-thickness: 3px;
  background: none;
  color: var(--m-body);
}

/* --- Form fields -------------------------------------------------------
   #DDDDDD is 1.36:1 and fails the 3:1 rule for UI components.            */
input[type="text"], input[type="email"], input[type="url"], input[type="tel"],
input[type="number"], input[type="search"], input[type="password"],
textarea, select {
  border: 1px solid var(--m-rule-strong);
  border-radius: var(--m-radius);
  padding: 12px 14px;
  background-color: var(--m-white);
  color: var(--m-body);
}
input:focus, textarea:focus, select:focus { border-color: var(--m-black); }
/* 16px minimum stops iOS zooming the page on focus. */
@media (max-width: 782px) {
  input[type="text"], input[type="email"], input[type="url"], input[type="tel"],
  input[type="number"], input[type="search"], input[type="password"],
  textarea, select { font-size: 16px; }
}

/* --- HubSpot embedded forms -------------------------------------------
   Applies only to the raw HTML embed. Inside an iframe none of this
   reaches the form.                                                      */
.hs-form .hs-input {
  border: 1px solid var(--m-rule-strong);
  border-radius: var(--m-radius);
  padding: 12px 14px;
  width: 100%;
  box-sizing: border-box;
  font-family: "Source Sans 3", sans-serif;
  color: var(--m-body);
}
.hs-form .hs-form-field > label { font-weight: 600; font-size: .94rem; }
.hs-form .hs-button {
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  padding: 13px 24px;
  border-radius: var(--m-radius);
  border: 2px solid var(--m-accent);
  background-color: var(--m-accent);
  color: var(--m-black);   /* HubSpot ships white-on-colour; overridden */
  cursor: pointer;
}
.hs-form .hs-button:hover {
  background-color: var(--m-accent-hover);
  border-color: var(--m-accent-hover);
}
.hs-form .hs-error-msg, .hs-form .hs-main-font-element { color: #9B2C1E; font-size: .9rem; }

/* --- Cards -------------------------------------------------------------- */
.m-card {
  border: 1px solid var(--m-rule);
  border-radius: var(--m-radius);
  background: var(--m-white);
  padding: 24px;
}
.m-card:hover { border-color: var(--m-black); }

/* --- Source rail -------------------------------------------------------
   The citation mechanism the evidence-institute direction depends on.    */
.m-source-rail {
  background: var(--m-surface);
  border-left: 2px solid var(--m-accent);
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--m-body);
}
.m-source-rail cite,
.m-source-rail .m-source-ref {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-style: normal;
  color: var(--m-muted);
  margin-top: 6px;
}

/* --- Callout ------------------------------------------------------------ */
.m-callout {
  background: var(--m-wash);
  border: 1px solid var(--m-accent);
  border-radius: var(--m-radius);
  padding: 20px 24px;
}

/* --- Utility ------------------------------------------------------------ */
.m-muted   { color: var(--m-muted); }
.m-eyebrow {
  font-family: Montserrat, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--m-muted);
}
.m-on-dark { background: var(--m-black); color: var(--m-white); }
.m-on-dark .m-eyebrow { color: var(--m-accent-hover); }

hr.wp-block-separator { border-color: var(--m-rule); opacity: 1; }
hr.wp-block-separator.m-rule-strong { border-color: var(--m-black); }

/* --- Long-form measure -------------------------------------------------
   Blocksy's Narrow container already caps this; the ch cap keeps the
   measure honest if a wider container is ever used for an article.       */
.m-prose > p, .m-prose > ul, .m-prose > ol { max-width: 68ch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* =========================================================================
   Page templates (P3)
   Each template adds one body class; layout is driven from here so the PHP
   files stay thin and survive Blocksy updates.
   ========================================================================= */

/* Long-form reads at the narrow measure. Reuses Blocksy's own custom
   properties rather than hard-coding a width, so Customizer edits still flow. */
body.m-tpl-articol-lung [data-content] > article,
body.m-tpl-pillar [data-content] > article {
  --theme-block-max-width: var(--has-wide, var(--theme-narrow-container-max-width));
  --theme-block-wide-max-width: var(--has-wide, calc(var(--theme-narrow-container-max-width) + var(--theme-wide-offset) * 2));
}

/* Commercial templates: tighten the display headline's optical spacing. */
body.m-tpl-home h1,
body.m-tpl-hub-servicii h1,
body.m-tpl-serviciu h1 { letter-spacing: -.025em; line-height: 1.02; }

/* Listing templates: cards sit on a consistent grid gutter. */
body.m-tpl-listare-resurse .wp-block-post-template,
body.m-tpl-listare-cazuri .wp-block-post-template { gap: var(--wp--preset--spacing--40); }

/* Contact: the form column never exceeds a comfortable filling width. */
body.m-tpl-contact .hs-form { max-width: 520px; }

/* =========================================================================
   Header & footer (P1 step 6)
   Kept in CSS rather than Customizer options so it is versioned with the
   theme and reviewable in a diff. Safe to move into Blocksy's panels later.
   ========================================================================= */

/* Footer sits on black — the one place white and orange are both correct. */
[data-footer] .ct-footer {
  background-color: var(--m-black);
  color: var(--m-white);
}
[data-footer] .ct-footer a { color: var(--m-white); text-decoration: none; }
[data-footer] .ct-footer a:hover { color: var(--m-accent-hover); }
[data-footer] .ct-footer .widget-title,
[data-footer] .ct-footer h3 { color: var(--m-white); }
[data-footer] .ct-footer :where(p, li, span) { color: var(--m-rule); }
/* Focus ring inverts on the dark ground so it stays visible. */
[data-footer] .ct-footer :where(a, button):focus-visible { outline-color: var(--m-white); }
