/* =========================================================
   Azryno Blog — Public styles (black & white, mobile-first)
   Edit brand tokens in :root only.
   ========================================================= */

:root {
  --bg: #f6f6f3;
  --bg-paper: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: #2f2f2f;
  --line: #e4e4df;
  --muted: #6a6a6a;
  --max: 38rem;
  --wide: 68rem;
  --header-h: 3.5rem;
  --cta-h: 3.25rem;
  --pad: clamp(1rem, 4vw, 1.5rem);
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 90% 45% at 50% -8%, rgba(0, 0, 0, 0.045), transparent 55%),
    linear-gradient(180deg, #fafaf7 0%, var(--bg) 45%, #efefe9 100%);
  line-height: 1.65;
  padding-bottom: calc(var(--cta-h) + var(--safe-bottom) + 1.25rem);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

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

a {
  color: var(--ink);
  text-underline-offset: 0.18em;
}

a:hover {
  opacity: 0.78;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: var(--pad);
  top: 0.5rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(246, 246, 243, 0.92);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--pad);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem 1rem;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 0.15rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* ---------- Listing ---------- */
.page-wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.75rem var(--pad) 3rem;
}

.page-intro {
  max-width: 34rem;
  margin-bottom: 2rem;
  animation: rise 0.65s ease both;
}

.page-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.4rem);
  font-weight: 700;
  line-height: 1.08;
  margin: 0 0 0.65rem;
  letter-spacing: -0.025em;
}

.page-intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.8vw, 1.125rem);
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
  animation: rise 0.55s ease both;
  -webkit-tap-highlight-color: transparent;
}

.post-row:hover {
  opacity: 0.88;
}

.post-row:active {
  opacity: 0.75;
}

.post-row__thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e8e8e4;
  border-radius: 0;
}

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

.post-row__meta {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.post-row__title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4.5vw, 1.8rem);
  line-height: 1.22;
  margin: 0 0 0.45rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.post-row__excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-state {
  padding: 2.5rem 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 1.05rem;
}

@media (min-width: 720px) {
  .page-wrap {
    padding-top: 2.75rem;
    padding-bottom: 4rem;
  }

  .page-intro {
    margin-bottom: 2.75rem;
  }

  .post-row {
    grid-template-columns: 15rem minmax(0, 1fr);
    align-items: start;
    gap: 1.75rem;
    padding: 2rem 0;
  }

  .post-row__excerpt {
    -webkit-line-clamp: 2;
  }
}

@media (min-width: 960px) {
  .post-row {
    grid-template-columns: 18rem minmax(0, 1fr);
    gap: 2.25rem;
  }
}

/* ---------- Article ---------- */
.article-banner {
  width: 100%;
  overflow: hidden;
  background: #111;
  animation: fade 0.8s ease both;
  max-height: 42vh;
}

.article-banner img {
  width: 100%;
  height: 42vh;
  min-height: 12rem;
  object-fit: cover;
}

@media (min-width: 720px) {
  .article-banner {
    max-height: min(58vh, 32rem);
  }

  .article-banner img {
    height: min(58vh, 32rem);
  }
}

.article {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--pad) 3.5rem;
}

.article__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 1.25rem;
  min-height: 44px;
}

.article__back::before {
  content: "←";
  font-size: 1rem;
}

.article__meta {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.article h1.article__title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6.5vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 1.35rem;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-body {
  font-size: clamp(1.02rem, 2.6vw, 1.125rem);
  color: var(--ink-soft);
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.article-body h1,
.article-body h2,
.article-body h3 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.article-body h1 { font-size: clamp(1.4rem, 4vw, 1.75rem); }
.article-body h2 { font-size: clamp(1.25rem, 3.5vw, 1.45rem); }
.article-body h3 { font-size: clamp(1.1rem, 3vw, 1.2rem); }

.article-body p {
  margin: 0 0 1.15rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
}

.article-body li {
  margin-bottom: 0.45rem;
  padding-left: 0.15rem;
}

.article-body a {
  font-weight: 600;
}

.article-figure {
  margin: 1.5rem 0;
}

.article-figure img {
  width: 100%;
  border: 1px solid var(--line);
}

.article-figure figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}

.youtube-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 1.5rem 0;
  background: #111;
  overflow: hidden;
}

.youtube-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ref-link {
  margin: 0 0 1rem;
}

.ref-link a {
  font-weight: 600;
  border-bottom: 1px solid var(--ink);
  text-decoration: none;
  word-break: break-word;
}

.article-end {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.article-end__cta {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: flex-start;
}

.article-end__cta p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

.article-end__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.15rem;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.article-end__btn:hover {
  opacity: 0.9;
}

/* ---------- Fixed CTA bar ---------- */
.cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--cta-h);
  padding: 0.55rem var(--pad) calc(0.55rem + var(--safe-bottom));
  background: var(--ink);
  color: #fff;
  box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.14);
}

.cta-bar p {
  margin: 0;
  font-weight: 500;
  font-size: clamp(0.85rem, 2.8vw, 0.95rem);
  line-height: 1.3;
}

.cta-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.5rem 0.9rem;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.cta-bar__btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}

@media (max-width: 380px) {
  .cta-bar p {
    max-width: 55%;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-paper);
  margin-top: 1.5rem;
}

.site-footer__inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.25rem var(--pad) 1.75rem;
}

.site-footer__brand p {
  max-width: 28rem;
  color: var(--ink-soft);
  margin: 0.7rem 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin: 1.5rem 0;
}

.site-footer__links a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.site-footer__bottom {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
}

.site-footer__bottom p {
  margin: 0;
}

@media (min-width: 640px) {
  .site-footer__inner {
    padding-top: 3rem;
    padding-bottom: 2rem;
  }

  .site-footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.made-by a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

/* ---------- Motion ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* =========================================================
   Homepage — magazine / Business Insider–style layout
   ========================================================= */

.home {
  padding: 0 0 2rem;
}

.home__inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.5rem var(--pad) 2rem;
}

.home__masthead {
  margin-bottom: 1.5rem;
  max-width: 40rem;
  animation: rise 0.6s ease both;
}

.home__kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.home__masthead h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3.25rem);
  line-height: 1.05;
  margin: 0 0 0.55rem;
  letter-spacing: -0.03em;
}

.home__tagline {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.5vw, 1.1rem);
}

/* Featured strip */
.home-featured {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.home-hero {
  display: grid;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.home-hero__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e8e8e4;
}

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

.home-hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 5.5vw, 2.35rem);
  line-height: 1.15;
  margin: 0.35rem 0 0.55rem;
  letter-spacing: -0.02em;
}

.home-hero__excerpt {
  margin: 0 0 0.65rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.story-date {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-secondary {
  display: grid;
  gap: 1rem;
}

.home-card {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  align-items: start;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.home-card__media {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #e8e8e4;
}

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

.home-card__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.25;
  margin: 0 0 0.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

@media (min-width: 900px) {
  .home-featured {
    grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.7fr);
    gap: 1.75rem;
    align-items: start;
    margin-bottom: 2rem;
  }

  .home-hero {
    gap: 1.15rem;
  }

  .home-hero__media {
    aspect-ratio: 16 / 10;
  }

  .home-secondary {
    gap: 0;
  }

  .home-card {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    padding: 0 0 1rem;
    margin-bottom: 1rem;
    border-top: 0;
    border-bottom: 1px solid var(--line);
  }

  .home-card:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
  }
}

/* Main + rail */
.home-grid {
  display: grid;
  gap: 2rem;
  margin-top: 0.5rem;
}

@media (min-width: 960px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr) 18rem;
    gap: 2.5rem;
    align-items: start;
  }

  .home-rail {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
  }
}

.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--ink);
}

.home-section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.015em;
}

.home-section-head__meta {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.home-feed__list {
  display: flex;
  flex-direction: column;
}

.home-feed__item {
  display: grid;
  grid-template-columns: 6.25rem minmax(0, 1fr);
  gap: 0.9rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.home-feed__item:hover {
  opacity: 0.88;
}

.home-feed__thumb {
  aspect-ratio: 5 / 4;
  overflow: hidden;
  background: #e8e8e4;
}

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

.home-feed__content h3 {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  line-height: 1.25;
  margin: 0 0 0.35rem;
  letter-spacing: -0.015em;
}

.home-feed__content p {
  margin: 0 0 0.45rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-feed__empty {
  color: var(--muted);
  padding: 1rem 0;
}

@media (min-width: 640px) {
  .home-feed__item {
    grid-template-columns: 9.5rem minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.35rem 0;
  }
}

/* Sidebar rail */
.home-rail {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.home-rail__more {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.home-rail__more h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.home-rail__more p {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.home-rail__link {
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

/* Subscribe */
.subscribe-box {
  background: var(--ink);
  color: #fff;
  padding: 1.35rem 1.25rem;
}

.subscribe-box__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.subscribe-box__text {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

.subscribe-box__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.1rem;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.subscribe-box__btn:hover {
  opacity: 0.92;
}

/* Ad / banner slots — reserved, quality-safe */
.ad-slot {
  margin: 1.25rem 0;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ad-slot__label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
  text-align: center;
}

.ad-slot__banner {
  display: block;
  text-decoration: none;
}

.ad-slot__banner img {
  width: 100%;
  height: auto;
  margin: 0 auto;
  max-height: 12rem;
  object-fit: contain;
  background: #f0f0ec;
}

.ad-slot--leader .ad-slot__banner img,
.ad-slot--footer .ad-slot__banner img {
  max-height: 7.5rem;
}

.ad-slot--rail {
  margin: 0;
  padding: 0.75rem 0;
}

.ad-slot--rail .ad-slot__banner img {
  max-height: 20rem;
}

/* Google AdSense reserved boxes — prevent layout collapse */
.ad-slot--adsense .ad-slot__adsense {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f3ef;
}

.ad-slot--rail.ad-slot--adsense .ad-slot__adsense {
  min-height: 250px;
}

.ad-slot--mid.ad-slot--adsense .ad-slot__adsense,
.ad-slot--leader.ad-slot--adsense .ad-slot__adsense,
.ad-slot--footer.ad-slot--adsense .ad-slot__adsense {
  min-height: 100px;
}

.ad-slot .adsbygoogle {
  width: 100%;
}

@media print {
  .ad-slot,
  .subscribe-box,
  .home-rail {
    display: none !important;
  }
}

/* Print: hide chrome */
@media print {
  .site-header,
  .cta-bar,
  .article__back {
    display: none !important;
  }

  body {
    padding: 0;
    background: #fff;
  }

  .article-banner img {
    height: auto;
    max-height: 12rem;
  }
}
