/* =========================================================
   
   Tagg Maiwald CSS file
   taggmaiwald.com/taggm.css
   2025-11-25
   2025-11-28
   ========================================================= */

/* 1. Root variables and base reset
   --------------------------------------------------------- */

:root {
	/* 1.1. Self-hosted web fonts (must come first) */

	@font-face {
	  font-family: "InterWeb";
	  src: url("/fonts/Inter-Italic-VariableFont_opsz,wght.ttf") format("truetype");
	  font-weight: 400;
	  font-style: italic;
	  font-display: swap;
	}

	@font-face {
	  font-family: "InterWeb";
	  src: url("/fonts/Inter-VariableFont_opsz,wght.ttf") format("truetype");
	  font-weight: 400;
	  font-style: normal;
	  font-display: swap;
	}

	@font-face {
	  font-family: "InterWeb";
	  src: url("/fonts/Montserrat-Italic-VariableFont_wght.ttf") format("truetype");
	  font-weight: 400;
	  font-style: italic;
	  font-display: swap;
	}

	@font-face {
	  font-family: "MontserratWeb";
	  src: url("/fonts/Montserrat-VariableFont_wght.ttf") format("truetype");
	  font-weight: 400;
	  font-style: normal;
	  font-display: swap;
	}

  /* 1.2 Typography */
  --font-body: "Inter", "Roboto", "Open Sans", "Lato", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Montserrat", "Poppins", "Work Sans", "Nunito Sans", "Helvetica Neue", Arial, sans-serif;

--font-size-base: 1rem;        /* equals 16px by default */
--font-size-small: 0.875rem;   /* about 14px */
--font-size-large: 1.25rem;    /* about 20px */
--line-height-base: 1.5;

  /* Colors */
  --color-bg: #f7f7f9;
  --color-surface: #ffffff;
  --color-surface-muted: #f0f0f3;
  --color-text: #111111;
  --color-text-muted: #666666;
  --color-border: #dddddd;
  --color-accent: #265d88;
  --color-accent-soft: #e2edf5;
  --color-danger: #b00020;
  --color-success: #1f7a3a;

  /* Layout */
  --page-padding-x: 0.5rem;
  --page-padding-y: 0.5rem;

  /* Radii and shadows */
  --radius-small: 4px;
  --radius: 8px;
  --radius-large: 14px;

  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.08);
  --shadow-subtle: 0 1px 3px rgba(15, 23, 42, 0.08);

  /* Table specific */
  --table-header-bg: #f0f2f5;
  --table-header-text: #111111;
  --table-row-alt: #fafbfc;
}

/* Simple reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* 2. Layout, container, headings, and basic text
   --------------------------------------------------------- */

main {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: var(--page-padding-y) var(--page-padding-x);
}

section {
  margin-bottom: 2rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text);
  line-height: 1.2;
  margin-top: 1.8rem;
  margin-bottom: 0.7rem;
}

h1 {
  font-size: 2rem;
  letter-spacing: 0.02em;
}

h2 {
  font-size: 1.6rem;
}

h3 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 1rem 0;
  color: var(--color-text);
}

small,
.text-muted {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-soft);
}

/* Utility layout helpers */

.container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: var(--page-padding-y) var(--page-padding-x);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stack-lg {
  gap: 1.5rem;
}

/* Callout blocks */
/* Base callout block */
.callout {
  padding: 1em;      /* internal spacing */
  margin: 1em 0;     /* external spacing above and below */
  border-width: 2px;
  border-style: dashed;
  border-radius: 0.5em;
}

/* Manila (light yellow) */
/* Usage: Signals and Flows
  Procedural requirements
  “You must do this before continuing”
  Steps that prevent errors
  Preconditions
  Configuration notes that affect outcomes
*/
.callout-manila {
  background-color: #fff5d6;
  border-color: #d8a500;
}

/* Powder blue */
/* Usage: Details and Related Info
  Notes
  Additional context
  Clarifications
  Optional explanations
  Cross references
  “For more information” blocks
*/
.callout-powder {
  background-color: #e3f2fd;
  border-color: #1e5fa8;
}

/* Pink */
/* Usage: Hazards
  Strong warnings
  Failure conditions
  “Do not do this” statements
  Compliance or safety flags
  High-impact exceptions or break-glass information
*/
.callout-lime {
  background-color: #fde4ec;
  border-color: #b03060;
}

/* Lime */
/* Usage: Benefits and Opportunities
  Positive branches
  Recommended actions
  Value adds
*/
.callout-lime {
  background-color: #e9fbe4;
  border-color: #6ca535;
}

/* 3. Top navigation and basic components
   --------------------------------------------------------- */

/* Header and nav */

.site-header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0.75rem var(--page-padding-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  gap: 0.5rem;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  padding-bottom: 0.15rem;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
}

/* Horizontal main nav for taggmaiwald.com */

nav.main-nav {
  padding: 0.75rem var(--page-padding-x);
}

nav.main-nav ul {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav.main-nav li {
  display: flex;
  align-items: center;
}

nav.main-nav a {
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--color-text-muted);
}

nav.main-nav a:hover {
  color: var(--color-text);
}

nav.main-nav .btn {
  margin-left: 0.5rem;
}


/* Card container */

.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-large);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0;
}

.card-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  background-color: var(--color-accent);
  color: #ffffff;
}

.btn:hover {
  background-color: var(--color-accent-soft);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-outline:hover {
  background-color: var(--color-accent-soft);
}

.btn-xs {
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  border-radius: var(--radius-small);
}

/* Chips or tags */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background-color: var(--color-accent-soft);
  color: var(--color-accent);
}

/* 4. Big archetype table
   Scrollable with sticky header and first column
   --------------------------------------------------------- */

.archetype-section {
  margin-top: 1rem;
}

/* Table wrapper */

.archetype-table-wrap {
  margin-top: 1rem;
  border-radius: var(--radius-large);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  overflow: auto;
  max-height: 70vh;
  box-shadow: var(--shadow-soft);
}

/* Optional toolbar above the table for column controls */

.archetype-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem 0.25rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-surface-muted);
}

.archetype-table-toolbar label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Table core */

.archetype-table {
  border-collapse: collapse;
  min-width: 950px;
}

.archetype-table th,
.archetype-table td {
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.7rem;
  font-size: 0.92rem;
  vertical-align: top;
  background-color: var(--color-surface);
}

/* Sticky header row */

.archetype-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background-color: var(--table-header-bg);
  color: var(--table-header-text);
  text-align: left;
}

/* Sticky first column */

.archetype-table th:first-child,
.archetype-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background-color: var(--table-header-bg);
  font-weight: 600;
}

/* Top-left corner cell above all */

.archetype-table thead th:first-child {
  z-index: 4;
}

/* Alternate row background */

.archetype-table tbody tr:nth-child(even) td {
  background-color: var(--table-row-alt);
}

/* 5. Column hide/show and row expand/collapse hooks
   --------------------------------------------------------- */

/* Generic hide helper for columns */

.is-col-hidden {
  display: none;
}

/* Compact cells with gradient fade for truncated text */

.archetype-table td {
  max-height: 6.5rem;
  overflow: hidden;
  position: relative;
}

.archetype-table td::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1.2rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--color-surface));
}

/* Expanded row shows full content */

.archetype-row-expanded td {
  max-height: none;
  overflow: visible;
}

.archetype-row-expanded td::after {
  display: none;
}

/* 6. Responsive tweaks
   --------------------------------------------------------- */

/* Narrow: phones, small tablets, cramped laptops */
@media (min-width: 1040px) {
  main,
  .container {
    margin: 0.25rem 5rem;
    padding: 0.25rem 3rem;
  }

  .page-grid {
    grid-template-columns: 1fr;
  }
  .page-grid > * {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1039px) {
  main,
  .container {
    margin: 0.25rem 4rem;
    padding: 0.25rem 2rem;
  }

  .page-grid {
    grid-template-columns: 1fr;
  }
  .page-grid > * {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1024px) {
  main,
  .container {
    margin: 0.25rem 3rem;
    padding: 0.25rem 1.5rem;
  }

  .site-header-inner {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
}

/* Optional mobile default: hide certain columns on small screens */
@media (max-width: 800px) {
  main,
  .container {
    margin: 0.25 2rem;
    padding: 0.25 1rem;
  }
  .archetype-table .col-review,
  .archetype-table .col-thought {
    display: none;
  }
}

@media (max-width: 640px) {
  main,
  .container {
    margin: 0.1rem 1rem;
    padding: 0.1rem 0.5rem;
  }

  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .card {
    padding: 1rem 1.1rem;
  }

  .archetype-table-wrap {
    max-height: none;
  }

  .archetype-table th,
  .archetype-table td {
    font-size: 0.9rem;
    padding: 0.45rem 0.5rem;
  }
}

/* Search modal overlay */
#site-search-modal {
  position: fixed;
  inset: 0;                  /* top:0; right:0; bottom:0; left:0; */
  display: none;             /* hidden by default */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
}

/* When JS adds .active, show as centered popup */
#site-search-modal.active {
  display: flex;
}

/* The popup panel itself */
#site-search-bar {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 0.75rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}

/* Optional: style the close button */
#site-search-modal .close-btn {
  margin-left: 0.75rem;
}