/* Flick — Shared header styles (announcement bar + navigation) */

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

:root {
  --brand: #1C0F09;
  --bg: #FFFFFE;
  --announcement-h: 40px;
  --nav-h: 110px;
  --nav-h-scrolled: 70px;
  --header-h: calc(var(--announcement-h) + var(--nav-h));
  --header-h-scrolled: calc(var(--announcement-h) + var(--nav-h-scrolled));
  --page-px: 64px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-nav: "Jost", sans-serif;
}

@media (min-width: 1280px) { :root { --page-px: 128px; } }
@media (min-width: 1536px) { :root { --page-px: 160px; } }

/* ═══════════════════════════════════════
   ANNOUNCEMENT BAR
   ═══════════════════════════════════════ */

.announcement-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--announcement-h);
  background: var(--brand);
  color: #fff;
  font-family: var(--font-nav);
  font-weight: 300;
  font-size: 0.875rem;
  text-decoration: none;
  text-align: center;
  padding: 0 16px;
  transition: opacity 0.2s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  &:hover {
    opacity: 0.9;
  }
}

/* ═══════════════════════════════════════
   SITE NAV
   ═══════════════════════════════════════ */

.site-nav {
  position: fixed;
  top: var(--announcement-h);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg);
  height: var(--nav-h);
  transition: height 0.3s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  &.scrolled {
    height: var(--nav-h-scrolled);
  }
}

.nav-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0.3px;
  background: var(--brand);
}

.nav-line-top {
  top: 70px;
}

.nav-line-bottom {
  bottom: 0;
  transition: bottom 0.3s;
}

.site-nav.scrolled .nav-line-bottom {
  bottom: 0;
}

.nav-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0 var(--page-px);
}

.nav-spacer {
  flex: 1;
}

.nav-logo {
  display: flex;
  align-items: center;
  transition: opacity 0.2s;

  &:hover {
    opacity: 0.8;
  }

  img {
    width: 40px;
    height: auto;
    aspect-ratio: 98.56 / 47.12;
    object-fit: contain;
  }
}

@media (min-width: 640px) {
  .nav-logo img { width: 50px; }
}

@media (min-width: 768px) {
  .nav-logo img { width: 65px; }
}

@media (min-width: 1024px) {
  .nav-logo img { width: 80px; }
}

.nav-actions {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
}

.nav-btn {
  font-family: var(--font-nav);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  padding: 8px 16px;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-btn-outline {
  color: var(--brand);
  border: 0.5px solid var(--brand);
  background: transparent;

  &:hover {
    opacity: 0.7;
  }
}

.nav-btn-filled {
  background: var(--brand);
  color: #fff;

  &:hover {
    opacity: 0.9;
  }
}

/* Nav links row */
.nav-links {
  padding: 0 var(--page-px);
  margin-top: 8px;
  transition: opacity 0.3s, max-height 0.3s;
  opacity: 1;
  max-height: 40px;

  &.collapsed {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
  }
}

.nav-links-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

@media (min-width: 1024px) {
  .nav-links-inner { gap: 32px; }
}

@media (min-width: 1280px) {
  .nav-links-inner { gap: 40px; }
}

.nav-link {
  font-family: var(--font-nav);
  font-weight: 300;
  font-size: 12px;
  color: var(--brand);
  text-decoration: none;
  position: relative;
  display: inline-block;
  cursor: pointer;

  &::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0.5px;
    bottom: -2px;
    left: 0;
    background-color: var(--brand);
    transition: width 0.3s ease-in-out;
  }

  &:hover::after {
    width: 100%;
  }
}

.nav-dropdown-item {
  position: relative;
  display: inline-block;

  &::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0.5px;
    bottom: -2px;
    left: 0;
    background-color: var(--brand);
    transition: width 0.3s ease-in-out;
  }

  &:hover::after {
    width: 100%;
  }
}

/* Resources dropdown */
.nav-dropdown {
  position: relative;
  cursor: pointer;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dropdown-arrow {
  transition: transform 0.2s;
}

.nav-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 12px;
  z-index: 60;
  border: 0.3px solid var(--brand);
  background: var(--bg);
  padding: 8px 12px;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;

  /* Invisible bridge so cursor can travel from trigger to menu */
  &::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
  }
}

.nav-dropdown.active .nav-dropdown-menu {
  display: flex;
}

.nav-dropdown-item {
  font-family: var(--font-nav);
  font-weight: 300;
  font-size: 12px;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
  width: fit-content;
}

@media (min-width: 768px) {
  .nav-link, .nav-dropdown-item { font-size: 13px; }
}

@media (min-width: 1024px) {
  .nav-link, .nav-dropdown-item { font-size: 15px; }
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */

.site-footer {
  width: 100%;
  margin-top: 64px;
}

.footer-inner {
  width: 100%;
  padding-top: 48px;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-line {
  width: 100%;
  height: 0.3px;
  background: var(--brand);
}

.footer-social {
  width: 100%;
  padding: 0 var(--page-px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  height: 50px;
  align-items: center;
}

.footer-social a {
  color: var(--brand);
  transition: transform 0.3s;

  &:hover {
    transform: rotate(12deg);
  }
}

.footer-info {
  width: 100%;
  padding: 0 var(--page-px);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75rem;
  color: var(--brand);
  font-family: var(--font-nav);
  font-weight: 300;
  margin-top: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
  .footer-info {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-copyright {
  margin-bottom: 8px;
  margin-top: 8px;
}

@media (min-width: 768px) {
  .footer-copyright {
    margin-bottom: 0;
    margin-left: 8px;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

@media (min-width: 640px) {
  .footer-links { gap: 24px; }
}

@media (min-width: 768px) {
  .footer-links {
    justify-content: flex-end;
    width: auto;
  }
  .footer-social { gap: 32px; }
}

@media (min-width: 1024px) {
  .footer-social { gap: 48px; }
}

.footer-links a {
  color: var(--brand);
  text-decoration: none;
  position: relative;
  display: inline-block;

  &::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0.5px;
    bottom: -2px;
    left: 0;
    background-color: var(--brand);
    transition: width 0.3s ease-in-out;
  }

  &:hover::after {
    width: 100%;
  }
}

/* ═══════════════════════════════════════
   MOBILE — Header responsive
   ═══════════════════════════════════════ */

@media (max-width: 768px) {
  :root {
    --page-px: 24px;
  }

  .nav-main {
    padding: 0 var(--page-px);
  }

  .nav-links {
    display: none;
  }

  .nav-actions {
    gap: 8px;
  }

  .nav-btn-outline {
    display: none;
  }

  .nav-btn {
    font-size: 12px;
    padding: 6px 12px;
  }

  .nav-logo img {
    width: 50px;
  }

  .site-nav {
    height: var(--nav-h-scrolled);
  }

  .nav-line-top {
    top: 70px;
  }

  .nav-line-bottom {
    top: 70px;
  }

  .announcement-bar {
    font-size: 0.75rem;
  }
}

/* Flick Blog — Blog-specific styles */
/* Shared header/footer/nav styles are in shared/header.css */

body {
  font-family: var(--font-nav);
  line-height: 1.7;
  color: var(--brand);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════
   BLOG LISTING PAGE
   ═══════════════════════════════════════ */

.blog-listing {
  margin-top: var(--header-h);
  padding: 48px var(--page-px) 80px;
  transition: margin-top 0.3s;
}

.site-nav.scrolled ~ .blog-listing {
  margin-top: var(--header-h-scrolled);
}

.blog-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 24px;
}

@media (min-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

.blog-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0.3px solid var(--brand);
  text-decoration: none;
  color: var(--brand);
  transition: box-shadow 0.2s;

  &:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
}

.blog-card-image {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: #f5f5f5;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.blog-card-body {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-title {
  font-family: var(--font-nav);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  font-family: var(--font-nav);
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.blog-card-author {
  font-family: var(--font-nav);
  font-size: 0.75rem;
  font-weight: 300;
  margin-top: 8px;
}

/* ═══════════════════════════════════════
   BLOG POST PAGE
   ═══════════════════════════════════════ */

.blog-layout {
  margin-top: var(--header-h);
  padding: 48px 24px 80px;
  transition: margin-top 0.3s;
}

.site-nav.scrolled ~ .blog-layout {
  margin-top: var(--header-h-scrolled);
}

.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0 0 0;
}

@media (min-width: 1024px) {
  .blog-layout {
    padding-left: var(--page-px);
    padding-right: var(--page-px);
  }
}

.blog-content-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 1024px) {
  .blog-content-grid {
    display: grid;
    grid-template-columns: 160px 1fr 80px;
    gap: 48px;
    align-items: start;
  }
}

/* Sidebar */
.blog-sidebar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

@media (min-width: 1024px) {
  .blog-sidebar {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    position: sticky;
    top: var(--header-h);
    width: 160px;
  }

  .site-nav.scrolled ~ .blog-layout .blog-sidebar {
    top: var(--header-h-scrolled);
  }
}

.blog-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-nav);
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--brand);
  text-decoration: none;
  transition: opacity 0.2s;

  &:hover {
    opacity: 0.7;
  }
}

.share-section {
  padding-top: 0;
}

@media (min-width: 1024px) {
  .share-section {
    padding-top: 8px;
  }
}

.share-title {
  font-family: var(--font-nav);
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
  margin-bottom: 16px;
}

.share-links {
  display: flex;
  align-items: center;
  gap: 16px;

  a {
    color: var(--brand);
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.3s;

    &:hover {
      opacity: 1;
      transform: rotate(12deg);
    }
  }
}

/* Article */
.blog-article {
  flex: 1;
  min-width: 0;
  max-width: 900px;
  overflow-x: hidden;

  h1 {
    font-family: var(--font-nav);
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.3;
  }
}

@media (min-width: 768px) {
  .blog-article h1 {
    font-size: 1.875rem;
  }
}

@media (min-width: 1024px) {
  .blog-article {
    max-width: none;
  }
}

.blog-cover {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: #f5f5f5;
  margin-bottom: 32px;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.blog-author {
  font-family: var(--font-nav);
  font-size: 0.875rem;
  font-weight: 300;
  margin-bottom: 8px;
}

.blog-date {
  font-family: var(--font-nav);
  font-size: 0.75rem;
  font-weight: 300;
  margin-bottom: 32px;
}

/* ═══════════════════════════════════════
   BLOG POST BODY (Markdown content)
   ═══════════════════════════════════════ */

.blog-body {
  font-family: var(--font-nav);
  font-weight: 400;
  line-height: 1.7;

  p {
    margin-bottom: 16px;
  }

  h2 {
    font-size: 1.25rem;
    font-weight: 400;
    margin-top: 32px;
    margin-bottom: 16px;
  }

  h3 {
    font-size: 1.125rem;
    font-weight: 500;
    margin-top: 24px;
    margin-bottom: 12px;
  }

  ul {
    list-style: disc;
    padding-left: 24px;
    margin-bottom: 16px;
  }

  ol {
    list-style: decimal;
    padding-left: 24px;
    margin-bottom: 16px;
  }

  li {
    margin-bottom: 4px;
  }

  a {
    text-decoration: underline;
    transition: opacity 0.2s;

    &:hover {
      opacity: 0.7;
    }
  }

  blockquote {
    border-left: 2px solid var(--brand);
    padding-left: 16px;
    margin: 16px 0;
    opacity: 0.8;
    font-style: italic;
  }

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

  pre {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 16px 0;
  }

  code {
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 0.875em;
  }

  p code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
  }

  hr {
    border: none;
    border-top: 0.3px solid var(--brand);
    margin: 32px 0;
    opacity: 0.3;
  }

  em {
    font-style: italic;
  }

  strong {
    font-weight: 600;
  }
}

/* ═══════════════════════════════════════
   RESPONSIVE — Mobile
   ═══════════════════════════════════════ */

@media (max-width: 768px) {
  .blog-listing {
    padding: 24px var(--page-px) 60px;
    margin-top: var(--header-h);
  }

  .blog-layout {
    padding: 24px 20px 60px;
  }
}
