/* =============================================
   blockchainme.io — styles.css  (unified)
   Combines: original styles.css + stylesn.css + email_chain.css layout
   Mobile-first. Desktop: min-width 980px.
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Oxygen:wght@300;400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,400&family=Source+Sans+3:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

/* ── CSS Variables ── */
:root {
  --brand-navy:    rgb(0, 0, 100);
  --brand-orange:  rgb(233, 105, 61);

  /* Sidebar dimensions — auto-sized to widest item */
  --sidebar-width: 260px;
  --sidebar-bg:    #f1f1f1;
  --nav-bar-h:     56px;
  --transition:    0.3s ease;

  /* Content area */
  --content-gap:   2rem;       /* gap between sidebar right edge and content */
  --sidebar-left:  0px;        /* sidebar starts at page left edge */

  /* ptl content colours */
  --ptl-bg:        #ffffff;
  --ptl-text:      #111111;
  --ptl-link:      #0000cc;

  /* email_chain colours */
  --clr-page-bg:      #f5f4f0;
  --clr-white:        #ffffff;
  --clr-primary-dark: #1a1a2e;
  --clr-primary:      #1c3a5e;
  --clr-accent:       #2b6cb0;
  --clr-accent-light: #ebf4ff;
  --clr-border:       #c8d3df;
  --clr-border-light: #dde5ed;
  --clr-forwarded-bg: #f9f9f7;
  --clr-header-bg:    #1c3a5e;
  --clr-header-text:  #ffffff;
  --clr-footer-bg:    #1c3a5e;
  --clr-footer-text:  #d4e6f5;
  --clr-sig-bg:       #f0f4f8;
  --clr-sig-border:   #c8d3df;
  --clr-quote-border: #2b6cb0;
  --clr-quote-bg:     #f0f6ff;
  --clr-blue-reply:   #1a5276;
  --clr-table-head:   #2c4a6e;
  --clr-table-stripe: #f2f7fc;
  --clr-asic-head:    #2c4a6e;
  --clr-bar:          #2b6cb0;
  --clr-bar-peak:     #1c3a5e;
  --clr-text:         #222222;
  --clr-text-muted:   #555555;
  --clr-link:         #1a5276;

  --font-body:  'Source Sans 3', 'Trebuchet MS', 'Trebuchet', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;

  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --radius-sm: 3px;
  --radius-md: 6px;
  --shadow-card:   0 1px 4px rgba(28,58,94,0.10), 0 0 0 1px rgba(28,58,94,0.06);
  --shadow-header: 0 2px 8px rgba(0,0,0,0.18);
}

/* ── Base Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Trebuchet MS', 'Trebuchet', sans-serif;
  background-color: var(--brand-navy);
  color: snow;
  font-size: 1rem;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   MOBILE NAV (hamburger bar — visible < 980px)
   ============================================= */

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-bar-h);
  background-color: var(--brand-navy);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  z-index: 1000;
  border-bottom: 2px solid var(--brand-orange);
}

/* ── Mobile nav logo (sits to the right of the hamburger) ── */
.mobile-nav-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.mobile-nav-logo {
  display: block;
  height: 32px;   /* fits inside 56px nav bar; burger is 22px tall */
  width: auto;
}

/* ── Hamburger button ── */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 1100;
}

.bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--brand-orange);
  border-radius: 3px;
  transform-origin: center;
  transition:
    transform var(--transition),
    opacity   var(--transition),
    top       var(--transition);
}

.hamburger.open .bar1 { transform: translateY(9.5px) rotate(45deg); }
.hamburger.open .bar2 { opacity: 0; transform: scaleX(0); }
.hamburger.open .bar3 { transform: translateY(-9.5px) rotate(-45deg); }

@keyframes hamburgerPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.hamburger { animation: hamburgerPulse 1.2s ease 0.5s 2; }

/* ── Mobile drawer ── */
.mobile-drawer {
  position: fixed;
  top: var(--nav-bar-h);
  left: 0;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  background-color: var(--sidebar-bg);
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  overflow-y: auto;
}

.mobile-drawer.open { max-height: 80vh; }

.mobile-menu {
  list-style: none;
  padding: 0.5rem 0 0;
}

.mobile-menu li a,
.mobile-menu .nav-section-label {
  display: block;
  color: #222;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}

.mobile-menu .nav-section-label {
  font-weight: 700;
  cursor: default;
  color: #444;
  background: #e4e4e4;
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
}

.mobile-menu li a.active,
.mobile-menu li a:hover {
  background-color: var(--brand-orange);
  color: #fff;
}

.mobile-menu .submenu {
  list-style: none;
  padding: 0;
  background-color: #e8e8e8;
}

.mobile-menu .submenu li a {
  padding-left: 2.5rem;
  font-size: 0.9rem;
  color: #444;
}

.mobile-menu .submenu li a:hover {
  background-color: var(--brand-orange);
  color: #fff;
}

/* Mobile footer in drawer */
.mobile-footer-divider {
  list-style: none;
  height: 1px;
  background: #ccc;
  margin: 0.5rem 1rem;
}

.mobile-footer-menu {
  list-style: none;
  padding: 0;
}

.mobile-footer-menu li a.footer-nav-link {
  display: block;
  color: #888;
  padding: 0.6rem 1.5rem;
  text-decoration: none;
  font-size: 0.82rem;
  transition: background var(--transition), color var(--transition);
}

.mobile-footer-menu li a.footer-nav-link.active,
.mobile-footer-menu li a.footer-nav-link:hover {
  background-color: var(--brand-orange);
  color: #fff;
}

.mobile-copyright {
  list-style: none;
  color: #999;
  font-size: 0.72rem;
  padding: 0.4rem 1.5rem 0.75rem;
}

/* Desktop sidebar: hidden on mobile */
.sidebar { display: none; }

/* =============================================
   MAIN CONTENT — mobile
   ============================================= */

.main-content {
  padding-top: calc(var(--nav-bar-h) + 1rem);
  display: block;
  min-height: 100vh;
}

/* ── ptl content block ── */
.ptl-content {
  background-color: var(--ptl-bg);
  color: var(--ptl-text);
  font-family: 'Trebuchet MS', 'Trebuchet', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.6;
  padding: 1rem 1.25rem 2rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.ptl-content a        { color: var(--ptl-link); }
.ptl-content a:hover  { color: var(--brand-orange); }

.ptl-content hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 0.75rem 0;
}

.ptl-h1 { font-size: 2rem; display: inline; }
.ptl-h2 { font-size: 1.5rem; display: inline; }

.ptl-table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.ptl-table th,
.ptl-table td {
  border: 1px solid #ccc;
  padding: 0.4rem 0.6rem;
  vertical-align: top;
}

.ptl-table thead th {
  background-color: #e8e8e8;
  font-weight: 700;
}

.ptl-table .num {
  text-align: right;
  white-space: nowrap;
}

/* ── Generic content pages (fin, pending, contact, legal, privacy) ── */
.page-content {
  background-color: var(--ptl-bg);
  color: var(--ptl-text);
  font-family: 'Trebuchet MS', 'Trebuchet', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.6;
  padding: 1.5rem 1.25rem 2rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.page-content a        { color: var(--ptl-link); }
.page-content a:hover  { color: var(--brand-orange); }
.page-content hr       { border: none; border-top: 1px solid #ccc; margin: 0.75rem 0; }
.page-content h1       { font-size: 2rem; margin-bottom: 0.25rem; }
.page-content h2       { font-size: 1.5rem; margin: 1.25rem 0 0.5rem; }
.page-content h3       { font-size: 1.1rem; margin: 1rem 0 0.3rem; }
.page-content p        { margin-bottom: 0.75rem; }
.page-content ul, .page-content ol { margin: 0.5rem 0 0.75rem 1.5rem; }
.page-content li       { margin-bottom: 0.3rem; }

/* ── Contact form ── */
.contact-form {
  max-width: 480px;
  margin: 1.5rem 0;
}

.contact-form label {
  display: block;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.3rem;
}

.contact-form input[type="email"] {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  color: #222;
  background: #fafafa;
  outline: none;
  transition: border-color 0.2s;
}

.contact-form input[type="email"]:focus {
  border-color: var(--brand-navy);
}

.contact-form button {
  margin-top: 0.9rem;
  padding: 0.7rem 2rem;
  background: var(--brand-navy);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.contact-form button:hover {
  background: var(--brand-orange);
}

.form-message {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  display: none;
}

.form-message.success {
  background: #e6f4ea;
  color: #2a7a3b;
  display: block;
}

.form-message.error {
  background: #fdecea;
  color: #b00020;
  display: block;
}

/* ── email_chain specific styles (for page5 partnership communication) ── */
.email-page-body {
  font-family: var(--font-body);
  background-color: var(--clr-page-bg);
  color: var(--clr-text);
  padding: 0;
}

.email-content {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-sm) var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.email {
  background: var(--clr-white);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.email--primary  { border-top: 4px solid var(--clr-primary); }
.email--forwarded {
  background: var(--clr-forwarded-bg);
  border-color: var(--clr-border-light);
}

.email__forward-marker {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--clr-text-muted);
  padding: var(--space-sm) var(--space-md);
  background: var(--clr-table-stripe);
  border-bottom: 1px solid var(--clr-border-light);
  letter-spacing: 0.02em;
}

.email__header {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--clr-border-light);
  background: var(--clr-table-stripe);
}

.email__meta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.email__meta-table th,
.email__meta-table td {
  padding: 2px 6px 2px 0;
  vertical-align: top;
  border: none;
  background: transparent;
}

.email__meta-table th {
  font-weight: 700;
  color: var(--clr-primary);
  white-space: nowrap;
  width: 4.5rem;
  padding-right: var(--space-sm);
}

.email__meta-table td {
  color: var(--clr-text);
  word-break: break-word;
}

.email__body {
  padding: var(--space-md);
  font-size: 0.9rem;
}

.email__blue-reply {
  color: var(--clr-blue-reply);
  font-style: italic;
}

.email__blockquote {
  border-left: 4px solid var(--clr-quote-border);
  background: var(--clr-quote-bg);
  margin: var(--space-md) 0;
  padding: var(--space-sm) var(--space-md);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem;
  color: var(--clr-text-muted);
}

.email__signature {
  background: var(--clr-sig-bg);
  border-top: 1px solid var(--clr-sig-border);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.82rem;
  color: var(--clr-text-muted);
}

/* dropdown toggle (email_chain) */
.toggle-input { display: none; }

.notice {
  max-width: 760px;
  margin-bottom: 1rem;
}

.notice-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #e8e8e8;
  border-radius: 8px;
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.95rem;
  line-height: 1.4;
}

.notice-header a            { color: #2a2aad; text-decoration: none; }
.notice-header a:first-of-type { color: #c47a00; }
.notice-header a:hover      { text-decoration: underline; }

.triangle {
  color: #e8a000;
  font-size: 0.85rem;
  display: inline-block;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  transform-origin: center;
}

.toggle-input:checked + .notice-header .triangle { transform: rotate(90deg); }

.notice-body {
  background: #e8e8e8;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 1.1rem;
}

.notice-body p { font-size: 0.95rem; padding-bottom: 0.85rem; }

.toggle-input:checked + .notice-header + .notice-body {
  max-height: 400px;
  padding: 0.75rem 1.1rem;
}

.toggle-input:checked + .notice-header { border-radius: 8px 8px 0 0; }

/* =============================================
   FOOTER (page bottom)
   ============================================= */

.site-footer {
  background-color: var(--brand-navy);
  border-top: 2px solid var(--brand-orange);
  padding: 1.25rem 1rem 1rem;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.footer-links a {
  color: snow;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--brand-orange); }

.footer-copy {
  color: #aaaacc;
  font-size: 0.8rem;
  margin: 0;
}

/* =============================================
   DESKTOP STYLES  (min-width: 980px)
   ============================================= */

@media (min-width: 980px) {

  .mobile-nav { display: none; }

  /* ── Desktop Sidebar — fixed, full height ── */
  .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    overflow: hidden;
    z-index: 500;
  }

  .sidebar-logo {
    margin-top: 2rem;
    padding: 0 1rem;
    text-align: center;
    flex-shrink: 0;
  }

  .imgLogo {
    display: block;
    width: 100%;
    max-width: 80px;
    margin: 0 auto;
  }

  /* Nav scrolls, footer stays fixed at bottom */
  .sidebar-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
  }

  .sidebar-nav {
    flex: 1;
    overflow-y: auto;
    margin-top: 1rem;
  }

  .sidebar-nav ul,
  .sidebar-nav .sidebar-menu {
    list-style: none;
  }

  .sidebar-nav > ul > li {
    position: relative;
  }

  .sidebar-nav a,
  .sidebar-nav .nav-section-label {
    display: block;
    color: #222;
    padding: 0.65rem 1rem;
    text-decoration: none;
    font-size: 0.88rem;
    line-height: 1.3;
    transition: background var(--transition), color var(--transition);
    white-space: normal;
    word-break: break-word;
  }

  .sidebar-nav .nav-section-label {
    font-weight: 700;
    cursor: default;
    color: #555;
    background: #e4e4e4;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }

  /* Equal height via consistent padding — already achieved by padding above */

  .sidebar-nav a.active,
  .sidebar-nav a:hover {
    background-color: var(--brand-orange);
    color: #fff;
  }

  /* Sub-menu (indented items — always visible for section 4) */
  .sidebar-submenu {
    list-style: none;
    background-color: #e8e8e8;
  }

  .sidebar-submenu--open {
    max-height: none !important;
  }

  .sidebar-submenu li a {
    padding-left: 1.5rem;
    font-size: 0.84rem;
    color: #555;
  }

  .sidebar-submenu li a:hover {
    background-color: var(--brand-orange);
    color: #fff;
  }

  /* ── Sidebar Footer (fixed at bottom) ── */
  .sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid #ddd;
    background: var(--sidebar-bg);
  }

  .sidebar-footer-divider {
    height: 0; /* divider already provided by border-top above */
  }

  .sidebar-footer-menu {
    list-style: none;
    padding: 0.4rem 0 0;
  }

  .sidebar-footer-menu li a.footer-nav-link {
    display: block;
    color: #999;
    padding: 0.45rem 1rem;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background var(--transition), color var(--transition);
  }

  .sidebar-footer-menu li a.footer-nav-link.active,
  .sidebar-footer-menu li a.footer-nav-link:hover {
    background-color: var(--brand-orange);
    color: #fff;
  }

  .sidebar-copyright {
    color: #bbb;
    font-size: 0.7rem;
    padding: 0.3rem 1rem 0.6rem;
    line-height: 1.3;
  }

  /* ── Main content — sidebar offset ── */
  .main-content {
    margin-left: calc(var(--sidebar-width) + var(--content-gap));
    padding-top: 0;
    min-height: 100vh;
    /* Centers the page: sidebar left + sidebar width + gap + content + gap right */
    /* The content is centered within the remaining space by max-width + auto margins on .ptl-content */
  }

  .ptl-content {
    font-size: 1rem;
    padding: 2rem 2.5rem 3rem;
    max-width: 860px;
  }

  .page-content {
    font-size: 1rem;
    padding: 2rem 2.5rem 3rem;
    max-width: 860px;
  }

  /* Footer offset */
  .site-footer {
    margin-left: calc(var(--sidebar-width) + var(--content-gap));
  }

  .site-footer .footer-links,
  .site-footer .footer-copy {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Email chain content on desktop */
  .email-content {
    padding: var(--space-xl) var(--space-xl) var(--space-2xl);
    gap: var(--space-sm);
  }

  .email--forwarded { margin-left: var(--space-xl); }

  .email__body {
    padding: var(--space-xl);
    font-size: 0.9375rem;
  }

  .email__header  { padding: var(--space-sm) var(--space-xl); }
  .email__signature { padding: var(--space-sm) var(--space-xl); }
}

@media print {
  body { background: #fff; font-size: 11pt; }
  .mobile-nav, .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .site-footer { margin-left: 0; }
  .email { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
