/**
 * @file sinduri.css
 * Sinduri theme — Solar design system.
 *
 * Palette:
 *   Solar        #f9c000   Primary accent, CTA bands, tags
 *   On-surface   #1c1b1b   All text, borders, frames
 *   Bone         #fcf9f8   Page base, nav background
 *   White        #ffffff   Cards, form fields
 *   Surface low  #f6f3f2   Subtle section backgrounds
 *   Surface high #e6e3e2   Layout structure only — NOT for visible borders (fails 3:1)
 *   Border       #8e8a87   All visible borders and dividers (3.27:1 on bone, 3.42:1 on white)
 *
 * Font: Lexend (self-hosted woff2, weights 400–800)
 * Wide logo: /circle-logo.svg  (1920×1080, use in banners and Canvas components)
 * Icon logo: /favicon-circle.svg  (circular mark, use in nav and favicon)
 *
 * WCAG 2.2 contrast audit (all pairs verified):
 *   #1c1b1b on #fcf9f8  16.4:1  AAA ✓
 *   #1c1b1b on #ffffff  17.2:1  AAA ✓
 *   #1c1b1b on #f9c000  10.3:1  AAA ✓
 *   #ffffff on #1c1b1b  17.2:1  AAA ✓
 *   #f9c000 on #1c1b1b  10.3:1  AAA ✓
 *   rgba(28,27,27,.70) on #fcf9f8  6.2:1  AA ✓  (muted text on light)
 *   #a0a0a0 on #1c1b1b   6.6:1  AA ✓  (muted text on dark, e.g. footer links)
 *   #8e8a87 border on #fcf9f8  3.27:1  AA ✓  (non-text, WCAG 1.4.11)
 *   #8e8a87 border on #ffffff  3.42:1  AA ✓  (non-text, WCAG 1.4.11)
 *   #8c8885 border on #fcf9f8  3.35:1  AA ✓  (outline-color, non-text)
 *   #ffffff on #f9c000   1.3:1  FAIL ✗  — never use white text on solar
 */

@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lexend-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/lexend-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/lexend-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/lexend-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/lexend-latin-800-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Custom properties
   ========================================================================== */

:root {
  /* Solar design system palette */
  --solar:        #f9c000;
  --on-surface:   #1c1b1b;
  --bone:         #fcf9f8;
  --surface-low:  #f6f3f2;
  --surface-high: #e6e3e2; /* layout structure only — do not use for visible borders */

  /* FIX: visible borders — #8e8a87 passes 3:1 on both bone and white (WCAG 1.4.11) */
  --border-visible: #8e8a87;

  /* FIX: --outline-color updated from #d5c4ac (1.63:1 fail) to #8c8885 (3.35:1 pass) */
  --outline-color: #8c8885;

  /* Status */
  --success:  #1a5e38;
  /* FIX: renamed from --warning-color to --warning for consistency */
  --warning:  #b45309;
  --error:    #93000a;

  /* Font */
  --font-sans: 'Lexend', 'Helvetica Neue', Arial, Helvetica, sans-serif;
  /* FIX: define --font-mono so var(--font-mono) doesn't silently resolve to nothing */
  --font-mono: 'Fira Mono', 'Menlo', 'Consolas', monospace;

  /* Semantic roles */
  --background:         var(--bone);
  --foreground:         var(--on-surface);
  --card:               #ffffff;
  --card-foreground:    var(--on-surface);

  /* Solar is the primary action color — text on solar must always be --on-surface */
  --primary:            var(--solar);
  --primary-foreground: var(--on-surface);

  --secondary:             var(--surface-low);
  --secondary-foreground:  var(--on-surface);
  --muted:                 var(--surface-low);
  --muted-foreground:      rgba(28, 27, 27, 0.70); /* 6.2:1 on bone ✓, 6.0:1 on surface-low ✓ */

  --accent:             var(--solar);
  --accent-foreground:  var(--on-surface);
  --destructive:        var(--error);

  /* FIX: --border now uses --border-visible for correct non-text contrast */
  --border: var(--border-visible);
  --input:  var(--bone);

  /* Shape — near-zero rounding */
  --radius:    2px;
  --radius-lg: 4px;
  --radius-xl: 8px;

}

/* ==========================================================================
   Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ==========================================================================
   Base
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Typography
   ========================================================================== */

/* Scoped to non-Canvas pages — Canvas components control their own heading styles
   via Tailwind utilities. Non-layered heading rules here would override text-white,
   text-accent, text-xl, text-2xl etc. on every Canvas heading element. */
body:not(.canvas-page) h1,
body:not(.canvas-page) h2,
body:not(.canvas-page) h3,
body:not(.canvas-page) h4,
body:not(.canvas-page) h5,
body:not(.canvas-page) h6 {
  color: var(--foreground);
  font-family: var(--font-sans);
  margin-top: 0;
  margin-bottom: 0.75rem;
}

/* Display XL — hero headline */
body:not(.canvas-page) h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

/* Headline LG — section headings */
body:not(.canvas-page) h2 {
  font-size: clamp(1.875rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.10;
  letter-spacing: -0.02em;
}

/* Headline SM — card titles, sub-headings */
body:not(.canvas-page) h3 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* Secondary — supporting details, meta */
body:not(.canvas-page) h4,
body:not(.canvas-page) h5,
body:not(.canvas-page) h6 {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.50;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

ul,
ol {
  padding-left: 1.5rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

code,
pre {
  /* FIX: use defined --font-mono token */
  font-family: var(--font-mono);
  background-color: var(--surface-low);
  border-radius: var(--radius);
}

code {
  padding: 0.1em 0.4em;
  font-size: 0.875em;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
}

/* ==========================================================================
   Links
   ========================================================================== */

/* Scoped to non-Canvas pages — Canvas components style their own links via Tailwind
   utilities. Global link rules here are non-layered CSS and would beat Tailwind's
   @layer utilities on Canvas pages, overriding button text colors. */
body:not(.canvas-page) a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease;
}

body:not(.canvas-page) a:hover,
body:not(.canvas-page) a:focus {
  color: var(--on-surface);
  text-decoration-color: var(--solar);
}

body:not(.canvas-page) a.no-underline {
  text-decoration: none;
}

/* ==========================================================================
   Focus
   ========================================================================== */

/* currentColor mirrors the element's text color — white on dark backgrounds,
   dark on light — ensuring contrast in every context without a fixed value. */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ==========================================================================
   Images
   ========================================================================== */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Skip link
   ========================================================================== */

.skip-link,
.visually-hidden.focusable.skip-link {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 700;
  padding: 0.5rem 1.25rem;
  position: absolute;
  top: -100%;
  left: 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  z-index: 9999;
  transition: top 0.1s;
}

.skip-link:focus,
.visually-hidden.focusable.skip-link:focus {
  top: 1rem;
}

/* ==========================================================================
   Visually hidden (accessibility)
   ========================================================================== */

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

/* ==========================================================================
   Layout
   ========================================================================== */

.layout-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main[role='main'] {
  flex: 1;
}

.layout-content {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  width: 100%;
}

/* ==========================================================================
   Header
   ========================================================================== */

header[role='banner'] {
  background-color: var(--bone);
  border-bottom: 2px solid var(--on-surface);
  position: sticky;
  top: 0;
  z-index: 500;
}

/* ==========================================================================
   Canvas page layout overrides
   ========================================================================== */

.canvas-page .layout-content {
  max-width: none;
  margin: 0;
  padding: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  height: 4rem;
  margin: 0 auto;
  max-width: 80rem;
  padding: 0 1.25rem;
}

/* Drupal region wrapper — rendered as a bare <div> with no class */
.header-inner > div {
  align-items: center;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.header-inner > div > div,
.header-inner > div > nav {
  align-items: center;
  display: flex;
}

/* ==========================================================================
   Site branding / logo
   ========================================================================== */

.site-branding {
  align-items: center;
  display: inline-flex;
  gap: 0.75rem;
  text-decoration: none;
}

.site-logo-icon {
  flex-shrink: 0;
  height: 2rem;
  object-fit: contain;
  width: 2rem;
}

.site-name {
  color: var(--foreground);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
}

.site-name-tld {
  color: var(--muted-foreground);
  font-weight: 400;
}

/* ==========================================================================
   Main navigation
   ========================================================================== */

.nav-wrapper {
  align-items: center;
  display: flex;
  gap: 1.5rem;
  position: relative;
}

nav.main-menu {
  display: none;
}

@media (min-width: 768px) {
  nav.main-menu {
    display: flex;
    justify-content: flex-end;
  }
}

nav.main-menu ul {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav.main-menu a {
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted-foreground);
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  min-height: 2.5rem;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

nav.main-menu a:hover,
nav.main-menu a:focus {
  border-bottom-color: var(--on-surface);
  color: var(--foreground);
}

nav.main-menu li.active-trail > a {
  border-bottom-color: var(--on-surface);
  color: var(--foreground);
}

/* Let's talk CTA — desktop only */
.nav-cta {
  align-items: center;
  background-color: var(--on-surface);
  border: 2px solid var(--on-surface);
  color: #fff;
  display: none;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  min-height: 2.5rem;
  padding: 0 1.25rem;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.nav-cta:hover,
.nav-cta:focus {
  background-color: #3a3838;
  border-color: #3a3838;
  color: #fff;
}

.nav-cta:focus-visible {
  border-width: 3px;
  outline: none;
}

@media (min-width: 768px) {
  .nav-cta {
    display: inline-flex;
  }
}

/* Mobile hamburger */
.nav-hamburger {
  align-items: center;
  background-color: var(--on-surface);
  border: 2px solid var(--on-surface);
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: center;
  padding: 0.5rem;
}

.nav-hamburger:focus-visible {
  border-width: 3px;
  outline: none;
}

@media (min-width: 768px) {
  .nav-hamburger {
    display: none;
  }
}

/* Mobile dropdown */
.mobile-menu {
  background-color: var(--bone);
  border: 2px solid var(--on-surface);
  box-shadow: 0 4px 16px rgba(28, 27, 27, 0.12);
  margin-top: 0.5rem;
  position: absolute;
  right: 0;
  top: 100%;
  width: 13rem;
  z-index: 50;
}

.mobile-menu ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.mobile-menu a {
  color: var(--muted-foreground);
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  padding: 0.625rem 1rem;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.15s, color 0.15s;
}

.mobile-menu a:hover,
.mobile-menu a:focus {
  background-color: var(--on-surface);
  color: #fff;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer[role='contentinfo'] {
  background-color: var(--bone);
  border-top: 4px solid var(--solar);
}

.footer-inner {
  margin: 0 auto;
  max-width: 72rem;
  padding: 0 1.25rem;
}

.footer-body {
  padding-bottom: 4rem;
  padding-top: 4rem;
}

.footer-body .footer-inner {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .footer-body .footer-inner {
    gap: 4rem;
    grid-template-columns: 1fr 1fr;
  }
}

.footer-logo-link {
  display: inline-flex;
  margin-bottom: 1rem;
}

.footer-logo-link:focus-visible {
  outline: 2px solid var(--on-surface);
  outline-offset: 4px;
}

.footer-logo {
  height: 6rem;
  width: auto;
}

.footer-tagline {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
  max-width: 20rem;
}

@media (min-width: 768px) {
  .footer-pages {
    display: flex;
    justify-content: flex-end;
  }
}

.footer-pages ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-pages a {
  align-items: center;
  color: var(--muted-foreground);
  display: flex;
  font-size: 0.875rem;
  min-height: 3rem;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-pages a:hover,
.footer-pages a:focus {
  color: var(--foreground);
}

.footer-bar {
  border-top: 1px solid var(--surface-high);
}

.footer-bar .footer-inner {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
  padding-bottom: 1rem;
  padding-top: 1rem;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-bar .footer-inner {
    gap: 0;
    grid-template-columns: repeat(3, 1fr);
    text-align: left;
  }
}

.footer-copyright {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.footer-motto {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-style: italic;
  margin: 0;
  text-align: center;
}

.footer-socials {
  align-items: center;
  display: flex;
  gap: 0.25rem;
  justify-content: center;
}

@media (min-width: 640px) {
  .footer-socials {
    justify-content: flex-end;
  }
}

.footer-social-link {
  align-items: center;
  color: var(--muted-foreground);
  display: flex;
  height: 2.75rem;
  justify-content: center;
  text-decoration: none;
  transition: color 0.15s;
  width: 2.75rem;
}

.footer-social-link:hover,
.footer-social-link:focus {
  color: var(--foreground);
}

.footer-social-link svg {
  height: 1.25rem;
  width: 1.25rem;
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */

.breadcrumb-nav {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.375rem 1.25rem;
}

.breadcrumb-nav ol {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.875rem;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb-nav li {
  display: flex;
  align-items: center;
  color: var(--muted-foreground);
}

.breadcrumb-nav a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb-nav a:hover {
  color: var(--foreground);
}

.breadcrumb-nav .breadcrumb-separator {
  /* FIX: use --border-visible so separator meets non-text contrast */
  color: var(--border-visible);
  margin: 0 0.125rem;
  user-select: none;
}

.breadcrumb-nav li:last-child {
  color: var(--foreground);
}

/* ==========================================================================
   Page title
   ========================================================================== */

.page-title {
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Content (blog posts, nodes)
   ========================================================================== */

.node__content {
  max-width: 65ch;
}

.node__content p {
  color: var(--foreground);
}

.node__content a {
  color: var(--foreground);
  text-decoration-color: var(--solar);
}

.node__meta {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Views
   ========================================================================== */

.views-row + .views-row {
  margin-top: 2rem;
  padding-top: 2rem;
  /* FIX: use --border-visible for visible dividers */
  border-top: 1px solid var(--border-visible);
}

/* ==========================================================================
   Pager
   ========================================================================== */

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  justify-content: center;
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
}

.pager__item a {
  align-items: center;
  background-color: var(--card);
  /* FIX: use --border-visible so pager borders meet 3:1 non-text contrast */
  border: 2px solid var(--border-visible);
  border-radius: var(--radius);
  color: var(--foreground);
  display: flex;
  font-size: 0.9375rem;
  font-weight: 500;
  height: 2.5rem;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0 0.75rem;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}

.pager__item a:hover {
  background-color: var(--secondary);
  border-color: var(--on-surface);
}

.pager__item--current span {
  align-items: center;
  background-color: var(--primary);
  border: 2px solid var(--on-surface);
  border-radius: var(--radius);
  color: var(--primary-foreground);
  display: flex;
  font-weight: 700;
  height: 2.5rem;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0 0.75rem;
}

/* ==========================================================================
   Status messages
   ========================================================================== */

.messages-container {
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 32rem;
  position: fixed;
  right: 1rem;
  width: calc(100vw - 2rem);
  z-index: 9999;
}

.message-item {
  align-items: flex-start;
  background-color: var(--card);
  /* FIX: use --border-visible for the card border */
  border: 1px solid var(--border-visible);
  border-left-width: 3px;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(28, 27, 27, 0.12);
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.message-item[data-type='status'] {
  border-left-color: var(--success);
}

.message-item[data-type='warning'] {
  /* FIX: updated from --warning-color to --warning */
  border-left-color: var(--warning);
}

.message-item[data-type='error'] {
  border-left-color: var(--destructive);
}

.message-item[data-type='info'] {
  border-left-color: var(--on-surface);
}

.message-icon {
  flex-shrink: 0;
  font-size: 1.125rem;
  line-height: 1;
  margin-top: 0.125rem;
}

.message-body {
  color: var(--foreground);
  flex: 1;
  font-size: 0.9375rem;
  min-width: 0;
}

.message-body ul {
  margin: 0;
  padding-left: 1.25rem;
}

.message-body a {
  text-decoration: underline;
}

.message-close {
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.875rem;
  line-height: 1;
  padding: 0.25rem 0.375rem;
  transition: background-color 0.15s, color 0.15s;
}

.message-close:hover {
  background-color: var(--secondary);
  color: var(--foreground);
}
