/* ==================================================
   Apple Newsroom Style – main.css (Clean Version)
   ================================================== */

/* ---------- Design Tokens ---------- */
:root {
  --bg-color: #f5f5f7;
  --card-bg: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --content-width: 980px;
  --content-padding-x: 22px;
  --grid-gap: 28px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* ---------- Global Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.47;
  color: var(--text-primary);
  background-color: var(--card-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

ul, li {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

/* ==================================================
   1. NAVIGATION
   ================================================== */

.ac-ln-shell {
  position: sticky;
  top: 0;
  z-index: 999;
  height: 52px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.page-archive .ac-ln-shell {
  position: relative !important;
}

.ac-ln-wrapper {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  height: 52px;
  padding: 0 var(--content-padding-x);
  display: flex;
  align-items: center;
}

.ac-ln-content {
  width: 100%;
  height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.ac-ln-title a {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 52px;
}

/* Facehash Avatar */
.ac-ln-title {
  display: flex;
  align-items: center;
}

#facehash-avatar-container {
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.ac-ln-menu {
  display: flex;
  align-items: center;
  height: 52px;
}

.ac-ln-menu-items {
  display: flex;
  align-items: center;
  gap: 28px;
}

.ac-ln-menu-items-desktop {
  display: flex;
  align-items: center;
}

.ac-ln-menu-item {
  display: flex;
  align-items: center;
  list-style: none;
}

.ac-ln-menu-link {
  display: inline-block;
  line-height: 52px;
  font-size: 17px;
  letter-spacing: -0.374px;
  display: inline-flex;
  align-items: center;
  height: 52px;
}

.ac-ln-menu-link:hover {
  color: #06c;
}

.ac-ln-menu-item.is-search .ac-ln-menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  height: 24px;
  line-height: 24px;
  padding: 0 14px;
  border-radius: 999px;
  background-color: #e8e8ed;
}

.ac-ln-menu-item.is-search .ac-ln-menu-link:hover {
  background-color: #d2d2d7;
}

.ac-ln-actions,
.ac-ln-menu-tray,
.ac-ln-menucta,
.ac-ln-overlay {
  display: none;
}

@media (max-width: 768px) {
  #facehash-avatar-container {
    width: 36px;
    height: 36px;
  }

  .ac-ln-title a {
    font-size: 19px;
  }

  .ac-ln-menu-items-desktop {
    display: none !important;
  }

  .ac-ln-actions {
    display: flex !important;
    position: absolute;
    right: 14px;
    top: 0;
    height: 52px;
    align-items: center;
    gap: 12px;
    z-index: 2;
  }

  .ac-ln-action {
    display: flex;
    align-items: center;
  }

  .ac-ln-search-capsule {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 18px;
    background: #f2f2f7;
    font-size: 13px;
  }

  .ac-ln-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .ac-ln-search-text {
    margin-left: 4px;
  }

  .ac-ln-menucta {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    margin: 0;
    margin-right: -12px;
    -webkit-tap-highlight-color: transparent;
  }

  .ac-ln-menucta-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
  }

  .ac-ln-chevron-svg {
    width: 16px;
    height: 9px;
    stroke-width: 1.6px;
    overflow: visible;
  }

  .ac-ln-menu-tray {
    display: block !important;
    position: fixed;
    top: 52px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 52px);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: saturate(180%) blur(60px);
    -webkit-backdrop-filter: saturate(180%) blur(60px);
    padding: 24px 40px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s step-end;
    z-index: 1;
  }

  .ac-ln-menu.ac-ln-menu-open .ac-ln-menu-tray {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s step-start;
  }

  .ac-ln-menu-tray .ac-ln-menu-items {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .ac-ln-menu-tray .local-nav-link {
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f;
    text-decoration: none;
    line-height: 1.1;
    display: block;
    width: 100%;
    opacity: 0;
    transform: translateY(-25px);
    transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1), transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  }

  .ac-ln-menu-tray .local-nav-link.revealed {
    opacity: 1;
    transform: translateY(0);
  }

  .ac-ln-overlay {
    display: none;
  }
}

/* ==================================================
   2. INDEX PAGE
   ================================================== */

.newsroom-main {
  padding: 40px 0 80px;
  background: var(--bg-color);
}

.everydayfeed {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--content-padding-x);
}

.everydayfeed-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: var(--grid-gap);
}

.newsroom-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.newsroom-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.newsroom-card__media {
  position: relative;
  overflow: hidden;
}

.newsroom-card__media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0.92;
  transform: scale(1);
  transform-origin: center;
  transition: transform 400ms cubic-bezier(0.4, 0, 0.25, 1), opacity 1000ms cubic-bezier(0.4, 0, 0.25, 1);
}

@media (hover: hover) and (pointer: fine) {
  .newsroom-card:hover .newsroom-card__media img {
    transform: scale(1.005);
    opacity: 1;
  }
}

.newsroom-card__body {
  padding: 20px 24px 24px;
}

.newsroom-card__tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.newsroom-card__title {
  font-size: 24px;
  line-height: 1.25;
  margin: 10px 0 8px;
}

.newsroom-card__date {
  font-size: 14px;
  color: var(--text-secondary);
}

@media (min-width: 1024px) {
  .card-hero {
    grid-column: span 6;
    border-radius: var(--radius-lg);
  }

  .card-hero .newsroom-card__link {
    flex-direction: row;
  }

  .card-hero .newsroom-card__media {
    flex: 7;
    min-height: 320px;
  }

  .card-hero .newsroom-card__media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background-color: #fff;
  }

  .card-hero .newsroom-card__body {
    flex: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 32px;
  }

  .card-hero .newsroom-card__tag {
    margin-bottom: 12px;
  }

  .card-hero .newsroom-card__title {
    font-size: 32px;
    line-height: 1.22;
    margin: 0 0 18px;
  }

  .card-hero .newsroom-card__date {
    margin-top: auto;
    font-size: 17px;
    color: #6e6e73;
  }

  .card-secondary {
    grid-column: span 3;
  }

  .card-standard {
    grid-column: span 2;
  }

  .card-secondary .newsroom-card__media,
  .card-standard .newsroom-card__media {
    aspect-ratio: 16 / 9;
  }
}

@media (min-width: 735px) and (max-width: 1023px) {
  .everydayfeed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-hero,
  .card-secondary,
  .card-standard {
    grid-column: span 2;
  }

  .card-hero .newsroom-card__link {
    flex-direction: column;
  }

  .card-hero .newsroom-card__media {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 734px) {
  .everydayfeed {
    padding: 0 12px;
  }

  .everydayfeed-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .card-hero,
  .card-secondary,
  .card-standard {
    grid-column: auto;
  }

  .card-hero .newsroom-card__link {
    flex-direction: column;
  }

  .newsroom-card__body {
    padding: 16px 18px 20px;
  }

  .newsroom-card__title {
    font-size: 20px;
  }
}

/* ==================================================
   3. ARTICLE PAGE
   ================================================== */

body.page-post {
  background: #F4F2EE;
}

.page-post .container.content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.article-header {
  border-bottom: 1px solid #e5e5e5;
  margin: 0 0 32px 0;
}

.article-title {
  font-size: 2.5em;
  font-weight: 700;
  line-height: 1.2;
  color: #1d1d1f;
  margin: 0 0 4px 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

.article-meta {
  font-size: 0.9em;
  color: #86868b;
}

.article-date {
  font-weight: 500;
}

/* ==================================================
   4. Article Content Typography
   ================================================== */

.typora-content {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: #1d1d1f;
  word-wrap: break-word;
  max-width: 100%;
}

.typora-content h1,
.typora-content h2,
.typora-content h3,
.typora-content h4,
.typora-content h5,
.typora-content h6 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: #1d1d1f;
}

.typora-content h1 {
  font-size: 2em;
  font-weight: 700;
  margin-top: 0;
}

.typora-content h2 {
  font-size: 1.5em;
}

.typora-content h3 {
  font-size: 1.25em;
}

.typora-content h4 {
  font-size: 1em;
}

.typora-content h5 {
  font-size: 0.875em;
}

.typora-content h6 {
  font-size: 0.85em;
  color: #86868b;
}

.typora-content p {
  margin-top: 0;
  margin-bottom: 16px;
}

.typora-content a {
  color: #06c;
  text-decoration: none;
}

.typora-content a:hover {
  text-decoration: underline;
}

.typora-content ul {
  padding-left: 2em;
  margin-top: 0;
  margin-bottom: 16px;
  list-style: disc;
}

.typora-content ol {
  padding-left: 2em;
  margin-top: 0;
  margin-bottom: 16px;
  list-style: decimal;
}

.typora-content ul ul,
.typora-content ul ol,
.typora-content ol ol,
.typora-content ol ul {
  margin-top: 0;
  margin-bottom: 0;
}

.typora-content li {
  margin-top: 0.25em;
  list-style: inherit;
}

.typora-content li > p {
  margin-top: 16px;
}

.typora-content li + li {
  margin-top: 0.25em;
}

.typora-content blockquote {
  margin: 0 0 16px 0;
  padding: 0 1em;
  color: #86868b;
  border-left: 4px solid #e8e8e8;
  font-style: italic;
}

.typora-content blockquote > :first-child {
  margin-top: 0;
}

.typora-content blockquote > :last-child {
  margin-bottom: 0;
}

.typora-content hr {
  height: 1px;
  padding: 0;
  margin: 24px 0;
  background-color: #e8e8e8;
  border: 0;
}

.typora-content table {
  border-spacing: 0;
  border-collapse: collapse;
  margin-top: 0;
  margin-bottom: 30px;
  width: 100%;
  text-align: left;
  border: 1px solid #e8e8e8;
}

.typora-content table th {
  font-weight: 600;
  background-color: #f0f0f0;
  border: 1px solid #dedede;
  border-bottom-color: #c9c9c9;
  padding: 10px 15px;
}

.typora-content table td {
  padding: 10px 15px;
  border: 1px solid #e8e8e8;
}

.typora-content table tr {
  background-color: #fff;
}

.typora-content table tr:nth-child(even) {
  background-color: #f7f7f7;
}

.typora-content img {
  max-width: 100%;
  vertical-align: middle;
  display: block;
}

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

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

/* Mobile responsive */
@media (max-width: 768px) {
  .page-post .container.content {
    padding: 24px 16px 40px;
  }

  .article-title {
    font-size: 1.8em;
  }

  .typora-content {
    font-size: 16px;
  }

  .typora-content h1 {
    font-size: 1.75em;
  }

  .typora-content h2 {
    font-size: 1.4em;
  }

  .typora-content h3 {
    font-size: 1.2em;
  }

  .typora-content table {
    font-size: 14px;
  }

  .typora-content table th,
  .typora-content table td {
    padding: 6px 10px;
  }
}

/* ==================================================
   5. Pagination
   ================================================== */

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 40px 0 0;
}

.pagination .page-number,
.pagination .extend {
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 14px;
}

.pagination .page-number.current {
  background-color: #1d1d1f;
  color: #ffffff;
}

/* ==================================================
   6. Footer
   ================================================== */

.footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 80px 0 60px;
}

/* ==================================================
   Code Block Styling - Boris Cherny Style
   ================================================== */

/* Code blocks - Boris Cherny Style */
.typora-content figure.highlight {
  border: 1px solid #e8e8e8;
  border-radius: 3px;
  margin: 0 0 16px 0;
  overflow: hidden;
  background-color: #f8f8f8;
}

.typora-content figure.highlight pre {
  margin: 0;
  background-color: #f8f8f8;
  padding: 8px 12px;
  font-size: 15px;
  line-height: 1.5;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.typora-content figure.highlight table,
.typora-content figure.highlight td,
.typora-content figure.highlight code {
  background-color: #f8f8f8;
  border: none;
  padding: 0;
  margin: 0;
}

/* Inline code */
.typora-content code {
  background-color: #f8f8f8;
  font-size: 15px;
  border: 1px solid #e8e8e8;
  border-radius: 3px;
  padding: 1px 5px;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.typora-content pre code {
  border: none;
  padding: 0;
}

/* Syntax Highlighting - GitHub Light */
.typora-content .hljs-comment,
.typora-content .hljs-quote {
  color: #6a737d;
  font-style: italic;
}

.typora-content .hljs-keyword,
.typora-content .hljs-selector-tag,
.typora-content .hljs-subst {
  color: #d73a49;
}

.typora-content .hljs-number,
.typora-content .hljs-literal,
.typora-content .hljs-variable,
.typora-content .hljs-template-variable,
.typora-content .hljs-tag .hljs-attr {
  color: #005cc5;
}

.typora-content .hljs-string,
.typora-content .hljs-doctag {
  color: #032f62;
}

.typora-content .hljs-title,
.typora-content .hljs-section,
.typora-content .hljs-selector-id {
  color: #6f42c1;
  font-weight: bold;
}

.typora-content .hljs-type,
.typora-content .hljs-class .hljs-title {
  color: #6f42c1;
}

.typora-content .hljs-tag,
.typora-content .hljs-name,
.typora-content .hljs-attribute {
  color: #22863a;
  font-weight: normal;
}

.typora-content .hljs-regexp,
.typora-content .hljs-link {
  color: #005cc5;
}

.typora-content .hljs-symbol,
.typora-content .hljs-bullet {
  color: #005cc5;
}

.typora-content .hljs-built_in,
.typora-content .hljs-builtin-name {
  color: #005cc5;
}

.typora-content .hljs-meta {
  color: #22863a;
}

.typora-content .hljs-deletion {
  background-color: #ffeef0;
}

.typora-content .hljs-addition {
  background-color: #e6ffed;
}

.typora-content .hljs-emphasis {
  font-style: italic;
}

.typora-content .hljs-strong {
  font-weight: bold;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .typora-content figure.highlight pre,
  .typora-content .highlight pre,
  .typora-content code {
    font-size: 14px;
  }
}

/* Facehash spinner animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================================================
   Liquid Glass — Navigation Bar
   ================================================== */

.ac-ln-shell.liquid-glass-active {
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

@media (max-width: 767px) {
  .ac-ln-shell.liquid-glass-active {
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
}
