/* ============================================================
   TDCOS — Shared Stylesheet
   The Dale Collaborative | Collaborative Operating System
   ============================================================ */


/* ── 1. CSS Custom Properties ───────────────────────────── */

:root {
  /* Brand colors */
  --blue:   #0060AC;
  --red:    #D21437;
  --gold:   #FAA621;
  --green:  #00AB63;
  --black:  #1a1a1a;
  --white:  #ffffff;

  /* UI colors */
  --bg:         #f5f6f7;
  --surface:    #ffffff;
  --border:     #e2e4e8;
  --text:       #1a1a1a;
  --text-muted: #6b7280;
  --overlay:    rgba(0, 0, 0, 0.55);

  /* Section accent colors (1–6) */
  --s1: var(--blue);
  --s2: var(--green);
  --s3: var(--gold);
  --s4: var(--red);
  --s5: var(--blue);
  --s6: var(--blue);

  /* Spacing */
  --gap:    24px;
  --radius: 6px;

  /* Nav */
  --nav-height: 56px;
  --drawer-width: 340px;

  /* Typography */
  --font: 'Segoe UI', Calibri, 'Carlito', system-ui, sans-serif;
}


/* ── 2. Reset & Base ─────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  padding-top: var(--nav-height);
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
}


/* ── 3. Typography ───────────────────────────────────────── */

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 600;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-number {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}


/* ── 4. Page Layout ──────────────────────────────────────── */

.page-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--gap) 60px;
}

.page-content--wide {
  max-width: 100%;
  padding: 0;
}


/* ── 5. Navigation Bar ───────────────────────────────────── */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.nav-brand-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}

.nav-rainbow {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--blue)  0%   25%,
    var(--red)   25%  50%,
    var(--gold)  50%  75%,
    var(--green) 75%  100%
  );
}

.nav-menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.4rem;
  transition: background 0.15s;
}

.nav-menu-btn:hover {
  background: var(--bg);
}


/* ── 6. Nav Drawer ───────────────────────────────────────── */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 201;
  width: var(--drawer-width);
  max-width: 90vw;
  height: 100vh;
  background: var(--white);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding-bottom: 32px;
}

.nav-drawer.open {
  transform: translateX(0);
}

.drawer-close {
  align-self: flex-end;
  width: 44px;
  height: 44px;
  margin: 8px 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

.drawer-close:hover {
  background: var(--bg);
  color: var(--text);
}

.drawer-section {
  padding: 16px 20px 4px;
}

.drawer-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0 8px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: var(--radius);
  transition: background 0.15s;
  cursor: pointer;
}

.drawer-link:hover {
  background: var(--bg);
}

.drawer-link.active {
  background: #f0f5fb;
}

.drawer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.drawer-dot--s1 { background: var(--s1); }
.drawer-dot--s2 { background: var(--s2); }
.drawer-dot--s3 { background: var(--s3); }
.drawer-dot--s4 { background: var(--s4); }
.drawer-dot--s5 { background: var(--s5); }
.drawer-dot--s6 {
  background: conic-gradient(
    var(--blue)  0deg   90deg,
    var(--red)   90deg  180deg,
    var(--gold)  180deg 270deg,
    var(--green) 270deg 360deg
  );
}
.drawer-dot--home {
  background: var(--blue);
}
.drawer-dot--companion {
  background: var(--black);
}

.drawer-link-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.drawer-link-text {
  flex: 1;
}

.drawer-link-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.drawer-link-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.drawer-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 20px;
}

.drawer-refresh {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 28px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s;
  cursor: pointer;
}

.drawer-refresh:hover {
  color: var(--text);
}

.drawer-refresh-icon {
  font-size: 1rem;
  transition: transform 0.5s ease;
}

.drawer-refresh.spinning .drawer-refresh-icon {
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ── 7. Hero ─────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px 24px 40px;
  overflow: hidden;
  background-color: var(--blue);
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.2) 0%,
    rgba(0,0,0,0.55) 100%
  );
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-logo {
  width: 180px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-rainbow {
  height: 4px;
  width: 360px;
  max-width: 100%;
  background: linear-gradient(
    to right,
    var(--blue)  0%   25%,
    var(--red)   25%  50%,
    var(--gold)  50%  75%,
    var(--green) 75%  100%
  );
  margin-bottom: 20px;
  border-radius: 2px;
}

.hero-tagline {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: rgba(255,255,255,0.88);
  font-weight: 300;
  max-width: 520px;
}

/* Section hero (used on section pages) */
.section-hero {
  min-height: 280px;
  padding: 40px 24px 36px;
  background-size: cover;
  background-position: center;
}

.section-hero .hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}


/* ── 8. Section Content ──────────────────────────────────── */

.content-section {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--border);
}

.content-section:last-child {
  border-bottom: none;
}

.content-section__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.content-section__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.content-section__body {
  font-size: 0.975rem;
  color: var(--text);
  line-height: 1.75;
}

.content-section__body p + p {
  margin-top: 14px;
}

.content-section__body strong {
  font-weight: 600;
}

.content-section__body em {
  font-style: italic;
}


/* ── 9. Section Cards (home page entry points) ───────────── */

.entry-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px 0;
}

.entry-card {
  background: var(--surface);
  border-radius: var(--radius);
  border-top: 4px solid var(--border);
  padding: 20px 18px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  transition: box-shadow 0.15s, transform 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.entry-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.entry-card--s1 { border-top-color: var(--s1); }
.entry-card--s2 { border-top-color: var(--s2); }
.entry-card--s3 { border-top-color: var(--s3); }
.entry-card--s4 { border-top-color: var(--s4); }
.entry-card--s5 { border-top-color: var(--s5); }
.entry-card--s6 { border-top-color: var(--s6); }

.entry-card__desc {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 20px;
}

.entry-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.entry-card__num {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.entry-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.entry-card__arrow {
  font-size: 1.1rem;
  color: var(--text-muted);
  flex-shrink: 0;
}


/* ── 10. Accordion / Expandable ──────────────────────────── */

.accordion {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  margin-bottom: 12px;
  overflow: hidden;
}

.accordion summary,
.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--blue);
  list-style: none;
  user-select: none;
  gap: 12px;
}

.accordion summary::-webkit-details-marker { display: none; }

.accordion summary::after,
.accordion-trigger::after {
  content: '▾';
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.accordion[open] summary::after,
.accordion-trigger.open::after {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 0 20px 20px;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* "Start Here" style large accordion */
.start-here {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  margin: 24px 0 0;
  overflow: hidden;
}

.start-here summary {
  padding: 20px 24px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blue);
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.start-here summary::-webkit-details-marker { display: none; }

.start-here summary::after {
  content: '▸';
  font-size: 1rem;
  color: var(--text-muted);
}

.start-here[open] summary::after {
  content: '▾';
}

.start-here-body {
  padding: 0 24px 24px;
}


/* ── 11. Callout / Info Boxes ────────────────────────────── */

.callout {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 24px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.callout--gold {
  border-left: 4px solid var(--gold);
}

.callout--blue {
  border-left: 4px solid var(--blue);
}

.callout--red {
  border-left: 4px solid var(--red);
}

.callout--green {
  border-left: 4px solid var(--green);
}

.callout__eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.callout--blue .callout__eyebrow  { color: var(--blue); }
.callout--red .callout__eyebrow   { color: var(--red); }
.callout--green .callout__eyebrow { color: var(--green); }

.callout__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.callout__body {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Principle box */
.principle-box {
  background: #f0f5fb;
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 20px 0;
  border-left: 4px solid var(--blue);
}

.principle-box__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 6px;
}

.principle-box__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  font-style: italic;
}

.principle-box__body {
  font-size: 0.9rem;
  line-height: 1.65;
}

/* Easy Rule box */
.easy-rule {
  background: #fff8e6;
  border: 1px solid #fce5b0;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.easy-rule strong {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}


/* ── 12. Companion / CTA Banner ──────────────────────────── */

.companion-banner {
  background: #111827;
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 32px 0 0;
  flex-wrap: wrap;
}

.companion-banner__icon {
  font-size: 1rem;
  margin-right: 6px;
}

.companion-banner__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 4px;
}

.companion-banner__title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--white);
}

.companion-banner__btn {
  flex-shrink: 0;
  padding: 10px 20px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--radius);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.companion-banner__btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.7);
}


/* ── 13. Photo Gallery ───────────────────────────────────── */

.gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 16/7;
  overflow: hidden;
  border-radius: var(--radius);
  margin: 24px 0;
  background: #ccc;
}

.gallery-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.gallery-photo.active {
  opacity: 1;
}


/* ── 14. Footer ──────────────────────────────────────────── */

.site-footer {
  background: #111827;
  padding: 40px 24px 32px;
  text-align: center;
  margin-top: 48px;
}

.site-footer img {
  width: 160px;
  margin: 0 auto 16px;
}

.site-footer__copy {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
}

.site-footer__version {
  margin-top: 8px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.3);
}


/* ── 15. Utilities ───────────────────────────────────────── */

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

.text-blue   { color: var(--blue); }
.text-red    { color: var(--red); }
.text-gold   { color: var(--gold); }
.text-green  { color: var(--green); }
.text-muted  { color: var(--text-muted); }

.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  cursor: pointer;
  z-index: 50;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: all;
}


/* ── 16. Responsive ──────────────────────────────────────── */

@media (max-width: 768px) {
  .entry-cards {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 340px;
    padding: 40px 20px 32px;
  }

  .hero-logo {
    width: 140px;
  }

  .companion-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-content {
    padding: 0 16px 48px;
  }
}

@media (min-width: 600px) and (max-width: 768px) {
  .entry-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  :root {
    --drawer-width: 85vw;
  }
}


/* ── Lightbox ────────────────────────────────────────────── */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lightbox.open {
  display: flex;
}
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}
.lightbox-caption {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  margin-top: 10px;
  text-align: center;
  font-style: italic;
}
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  opacity: 0.8;
  line-height: 1;
  padding: 4px 8px;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-prev,
.lightbox-next {
  background: none;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  cursor: pointer;
  opacity: 0.7;
  padding: 0 16px;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }

/* Make gallery clickable */
.gallery-photo {
  cursor: pointer;
}
