/**
 * Armchair Journal Header Styles
 * Components: Utility Bar, Masthead, Tools Strip
 */

#masthead.aj-site-header {
  width: 100%;
  background-color: #ffffff;
  font-family: var(--aj-font-sans, sans-serif);
}

/* ==========================================================================
   1. UTILITY BAR
   ========================================================================== */

.aj-util {
  background: var(--aj-color-bg-card, #ffffff);
  border-bottom: 1px solid var(--aj-color-rule-light, #dfe3ea);
  padding: 7px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--aj-fs-12-5, 12.5px);
  flex-wrap: wrap;
  gap: 8px 20px;
}

.aj-util-nav {
  display: flex;
  align-items: center;
}

.aj-util-links {
  display: flex;
  gap: 8px 24px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aj-util-links a,
.aj-util-links .menu-item a {
  color: var(--aj-color-ink-body, #474f5c);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: color var(--aj-transition-color, 0.3s ease);
}

.aj-util-links a:hover,
.aj-util-links .menu-item a:hover {
  color: var(--aj-color-navy-primary, #1a3d74);
}

.aj-util-actions {
  display: flex;
  gap: 8px 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* User Profile Avatar (Inside Utility Bar) */
.aj-profile-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--aj-radius-full, 50%);
  background-color: var(--aj-color-navy-primary, #1a3d74);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--aj-font-serif, serif);
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  overflow: hidden;
}

.aj-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ==========================================================================
   2. MASTHEAD
   ========================================================================== */

.aj-masthead {
  background: var(--aj-color-bg-card, #ffffff);
  padding: 26px 40px 0;
}

.aj-masthead-inner {
  max-width: var(--aj-width-editorial, 1180px);
  margin: 0 auto;
}

.aj-masthead-brand {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.aj-masthead-logo {
  width: clamp(100px, 14vw, 148px);
  height: auto;
  aspect-ratio: 148 / 116;
  object-fit: contain;
  display: block;
}

.aj-masthead-wordmark {
  font-family: var(--aj-font-serif, serif);
  font-size: clamp(26px, 5.2vw, 50px);
  color: var(--aj-color-navy-primary, #1a3d74);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  font-weight: 500;
  margin-top: 16px;
  text-align: center;
}

.aj-masthead-wordmark .aj-arm-highlight {
  color: var(--aj-color-red-primary, #c33d29);
}

.aj-masthead-tagline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  width: 100%;
  max-width: 680px;
}

.aj-tag-line {
  flex: 1;
  height: 1px;
  background-color: var(--aj-color-rule-light, #dfe3ea);
}

.aj-tag-diamond {
  color: var(--aj-color-gold-accent, #dcb352);
  font-size: 9px;
  line-height: 1;
  flex-shrink: 0;
}

.aj-tag-eng {
  font-family: var(--aj-font-serif, serif);
  font-style: italic;
  font-size: var(--aj-fs-16, 16px);
  color: var(--aj-color-navy-primary, #1a3d74);
  letter-spacing: 0.1em;
  font-weight: 500;
  white-space: nowrap;
}

.aj-tag-sep {
  width: 1px;
  height: 14px;
  background-color: var(--aj-color-rule-light, #dfe3ea);
  flex-shrink: 0;
}

.aj-tag-skt {
  font-family: var(--aj-font-serif, serif);
  font-size: var(--aj-fs-14-5, 14.5px);
  color: var(--aj-color-gold-text, #87651f);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.aj-masthead-rule-thick {
  margin-top: 22px;
  border-top: 3px solid var(--aj-color-navy-primary, #1a3d74);
}

.aj-masthead-rule-thin {
  margin-top: 2px;
  border-top: 1px solid var(--aj-color-navy-primary, #1a3d74);
}


/* ==========================================================================
   3. TOOLS STRIP
   ========================================================================== */

.aj-tools-strip-wrapper {
  background: var(--aj-color-bg-card, #ffffff);
  border-bottom: 1px solid var(--aj-color-rule-light, #dfe3ea);
}

.aj-tools {
  max-width: var(--aj-width-editorial, 1180px);
  margin: 0 auto;
  padding: 0 clamp(12px, 4vw, 40px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.aj-tools-item {
  min-width: 0;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  min-height: 76px;
  border-bottom: 3px solid transparent;
  border-right: 1px solid var(--aj-color-rule-subtle, #e7eaf0);
  transition: background-color 0.2s ease, border-bottom-color 0.2s ease;
}

.aj-tools-item:last-child {
  border-right: none;
}

.aj-tools-item:hover {
  background-color: var(--aj-color-bg-hover, #f2f5f9);
}

.aj-tool-num {
  width: 34px;
  text-align: center;
  flex-shrink: 0;
  font-family: 'IBM Plex Sans', var(--aj-font-sans, sans-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .02em;
  opacity: 0.4;
}

.aj-tool-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.aj-tool-title {
  margin: 0;
  line-height: 1.3;
  font-family: 'IBM Plex Sans', var(--aj-font-sans, sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.aj-tool-sub {
  line-height: 1.3;
  font-family: 'IBM Plex Sans', var(--aj-font-sans, sans-serif);
  font-style: normal;
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: .005em;
  color: #67707d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aj-tool-arrow {
  margin-left: auto;
  color: #626e81;
  font-size: 14px;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}
.aj-util-pair-mark { height: 16px; width: auto; display: block; flex-shrink: 0; }
.aj-util-actions .aj-btn-donate { background: transparent; border-color: #c3cad4; color: #616a78; gap: 5px; }
.aj-util-actions .aj-btn-donate:hover { border-color: #1a3d74; color: #1a3d74; background: #fff; }
.aj-util-actions .aj-btn-donate img { border-radius: 50%; flex-shrink: 0; }

.aj-tools-item:hover .aj-tool-arrow {
  transform: translateX(2px);
}

/* Card 01 — Slide Your Article */
.aj-tool-01 .aj-tool-num,
.aj-tool-01 .aj-tool-title {
  color: var(--aj-color-navy-primary, #1a3d74);
}
.aj-tool-01:hover {
  border-bottom-color: var(--aj-color-navy-primary, #1a3d74);
}

/* Card 02 — Bias Meter */
.aj-tool-02 .aj-tool-num,
.aj-tool-02 .aj-tool-title {
  color: var(--aj-color-red-primary, #c33d29);
}
.aj-tool-02:hover {
  border-bottom-color: var(--aj-color-red-primary, #c33d29);
}

/* Card 03 — Discourse */
.aj-tool-03 .aj-tool-num,
.aj-tool-03 .aj-tool-title {
  color: var(--aj-color-navy-primary, #1a3d74);
}
.aj-tool-03:hover {
  border-bottom-color: var(--aj-color-navy-primary, #1a3d74);
}

/* Card 04 — Bias Games */
.aj-tool-04 .aj-tool-num,
.aj-tool-04 .aj-tool-title {
  color: var(--aj-color-gold-text, #87651f);
}
.aj-tool-04:hover {
  border-bottom-color: var(--aj-color-gold-text, #87651f);
}


/* ==========================================================================
   4. RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 860px) {
  .aj-tools {
    grid-template-columns: 1fr 1fr;
  }
  .aj-tools .aj-tools-item:nth-child(odd) {
    border-right: 1px solid var(--aj-color-rule-subtle, #e7eaf0);
  }
  .aj-tools .aj-tools-item:nth-child(even) {
    border-right: none;
  }
  .aj-tools .aj-tools-item:nth-child(1),
  .aj-tools .aj-tools-item:nth-child(2) {
    border-bottom: 1px solid var(--aj-color-rule-subtle, #e7eaf0);
  }
}

@media (max-width: 720px) {
  .aj-util {
    padding-left: 16px;
    padding-right: 16px;
  }
  .aj-util-links {
    gap: 12px 16px;
  }
  .aj-masthead {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 600px) {
  .aj-tag-skt,
  .aj-tag-sep {
    display: none !important;
  }
  .aj-util-hide-sm {
    display: none !important;
  }
}

@media (max-width: 560px) {
  .aj-tools {
    grid-template-columns: 1fr;
  }
  .aj-tools .aj-tools-item {
    border-right: none;
    border-bottom: 1px solid var(--aj-color-rule-subtle, #e7eaf0);
  }
  .aj-tools .aj-tools-item:last-child {
    border-bottom: 3px solid transparent;
  }
}
