/* ==========================================================================
   Account, login, hamburger, verified badge — The Sri COM
   --------------------------------------------------------------------------
   Login uses Ghost Portal (the same system as Subscribe). Desktop shows a
   "Log in" link or an account chip in the header; mobile moves those into the
   hamburger menu, which also restores the navigation that is hidden < 900px.

   Loaded after header-blue.css / header-mobile.css so header rules win.
   ========================================================================== */

/* --- Header: login link + account chip (line art, like Subscribe) --------- */

html[data-theme] body .site-header .login,
html[data-theme] body .site-header .account {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1.5px solid rgba(255, 255, 255, .85);
  border-radius: 9px;
  background: transparent;
  color: #fff;
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
}

html[data-theme] body .site-header .login:hover,
html[data-theme] body .site-header .account:hover {
  border-color: #fff;
  background: #fff;
  color: #1a5fc4;
}

.account-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* White scalloped seal + blue tick, so it reads on the blue masthead. */
.account-badge {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: none;
  background:
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20d%3D%27M12.0%203.0A2.33%202.33%200%200%201%2016.5%204.21A2.33%202.33%200%200%201%2019.79%207.5A2.33%202.33%200%200%201%2021.0%2012.0A2.33%202.33%200%200%201%2019.79%2016.5A2.33%202.33%200%200%201%2016.5%2019.79A2.33%202.33%200%200%201%2012.0%2021.0A2.33%202.33%200%200%201%207.5%2019.79A2.33%202.33%200%200%201%204.21%2016.5A2.33%202.33%200%200%201%203.0%2012.0A2.33%202.33%200%200%201%204.21%207.5A2.33%202.33%200%200%201%207.5%204.21A2.33%202.33%200%200%201%2012.0%203.0Z%27%20fill%3D%27%23ffffff%27/%3E%3Cpath%20d%3D%27M8%2012.3l2.8%202.8L16.4%209.4%27%20fill%3D%27none%27%20stroke%3D%27%232475e8%27%20stroke-width%3D%272.4%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
}

/* --- Hamburger ------------------------------------------------------------ */

.menu-toggle {
  display: none;               /* shown < 900px */
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.menu-toggle-bars {
  display: block;
  width: 17px;
  height: 12px;
  position: relative;
}

.menu-toggle-bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform .2s ease, opacity .2s ease, top .2s ease;
}

.menu-toggle-bars span:nth-child(1) { top: 0; }
.menu-toggle-bars span:nth-child(2) { top: 5px; }
.menu-toggle-bars span:nth-child(3) { top: 10px; }

/* Bars morph into an X while the menu is open. */
html.menu-open .menu-toggle-bars span:nth-child(1) { top: 5px; transform: rotate(45deg); }
html.menu-open .menu-toggle-bars span:nth-child(2) { opacity: 0; }
html.menu-open .menu-toggle-bars span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

/* --- Mobile menu panel ---------------------------------------------------- */

.mobile-menu {
  position: fixed;
  z-index: 49;
  top: 60px;                   /* just under the sticky header */
  left: 0;
  right: 0;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: var(--mm-bg, #0c0c0e);
  border-bottom: 1px solid var(--mm-line, rgba(255, 255, 255, .1));
  box-shadow: 0 18px 40px rgba(0, 0, 0, .4);
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  transition: transform .2s ease, opacity .2s ease, visibility .2s ease;
}

html[data-theme="light"] .mobile-menu {
  --mm-bg: #ffffff;
  --mm-line: #dbe3ef;
  box-shadow: 0 18px 40px rgba(20, 40, 75, .16);
}

html.menu-open .mobile-menu {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-menu-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 20px 22px;
}

/* Navigation links from Ghost. */
.mobile-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-nav a {
  display: block;
  padding: 13px 4px;
  border-bottom: 1px solid var(--mm-line, rgba(255, 255, 255, .1));
  color: var(--mm-text, #e7eef9);
  font-size: 1rem;
  font-weight: 600;
}

html[data-theme="light"] .mobile-nav a { --mm-text: #16233a; }

.mobile-nav a:hover { color: #2475e8; }

/* Login / account block below the links. */
.mobile-menu-account {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.mobile-menu-login,
.mobile-menu-subscribe,
.mobile-account {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 600;
}

.mobile-menu-login,
.mobile-account {
  border: 1.5px solid #2475e8;
  color: #2475e8;
}

.mobile-menu-subscribe {
  background: #2475e8;
  color: #fff;
}

.mobile-account-badge {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20d%3D%27M12.0%203.0A2.33%202.33%200%200%201%2016.5%204.21A2.33%202.33%200%200%201%2019.79%207.5A2.33%202.33%200%200%201%2021.0%2012.0A2.33%202.33%200%200%201%2019.79%2016.5A2.33%202.33%200%200%201%2016.5%2019.79A2.33%202.33%200%200%201%2012.0%2021.0A2.33%202.33%200%200%201%207.5%2019.79A2.33%202.33%200%200%201%204.21%2016.5A2.33%202.33%200%200%201%203.0%2012.0A2.33%202.33%200%200%201%204.21%207.5A2.33%202.33%200%200%201%207.5%204.21A2.33%202.33%200%200%201%2012.0%203.0Z%27%20fill%3D%27%232475e8%27/%3E%3Cpath%20d%3D%27M8%2012.3l2.8%202.8L16.4%209.4%27%20fill%3D%27none%27%20stroke%3D%27%23fdfbf3%27%20stroke-width%3D%272.4%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
}

/* --- Verified badge inside comments --------------------------------------- */

.comment-verified {
  display: inline-flex;
  width: 15px;
  height: 15px;
  margin-left: 5px;
  vertical-align: -2px;
  color: #2475e8;
}

.comment-verified svg { width: 100%; height: 100%; display: block; }

/* "Commenting as X" strip above the form for signed-in members. */
.comment-as {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(36, 117, 232, .12);
  color: var(--c-brand, #2475e8);
  font-size: .84rem;
  font-weight: 600;
}

.comment-as .comment-verified { margin-left: 0; }

/* --- Breakpoint: desktop vs mobile ---------------------------------------- */

@media (min-width: 901px) {
  .menu-toggle { display: none; }
  .mobile-menu { display: none; }
}

@media (max-width: 900px) {
  .menu-toggle { display: grid; }

  /* Login / account live in the hamburger on mobile, not the header. */
  html[data-theme] body .site-header .login,
  html[data-theme] body .site-header .account { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-toggle-bars span,
  .mobile-menu { transition: none; }
}
