/* Styles for the static guide pages. Mirrors the tokens in src/index.css so
   the guides read as part of the same site. */

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

:root {
  --bg: #0c0c0d;
  --ink: #f4f4f5;
  --muted: #9a9aa0;
  --faint: #6b6b70;
  --line: rgba(255, 255, 255, 0.08);
  --card: rgba(255, 255, 255, 0.04);
  --accent-green: #7fd49a;
}

html,
body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-size: 18px;
  line-height: 1.65;
}

a {
  color: var(--ink);
}

/* ---- Logo (same construction as src/components/Logo.css) ---- */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo__tile {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo__word {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.lockglyph {
  --r: 3px;
  position: relative;
  width: 18px;
  height: 18px;
}

.lockglyph__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: var(--r) solid var(--bg);
}

.lockglyph__shackle {
  position: absolute;
  top: calc(var(--r) * -0.65);
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--r) * 0.83);
  height: calc(var(--r) * 2);
  background: var(--bg);
  border-radius: 2px;
}

.lockglyph__keyhole {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(var(--r) * 1.33);
  height: calc(var(--r) * 1.33);
  border-radius: 50%;
  background: var(--bg);
}

/* ---- Nav / footer ---- */
.g-nav,
.g-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.g-nav__links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 15px;
  font-weight: 600;
}

.g-nav__links a {
  color: var(--muted);
  text-decoration: none;
}

.g-nav__links a:hover {
  color: var(--ink);
}

.g-nav__links .g-nav__download {
  color: var(--bg);
  background: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
}

.g-footer {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  padding-top: 32px;
  padding-bottom: 40px;
  font-size: 13px;
  font-weight: 500;
  color: var(--faint);
}

.g-footer { flex-wrap: wrap; }
.g-langs a {
  color: var(--faint);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.g-langs a:hover { color: inherit; }

/* ---- Download box (mid-article and end) ---- */
.g-cta {
  margin: 40px 0;
  padding: 28px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(127, 212, 154, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(127, 212, 154, 0.25);
}

.g-cta__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.g-cta__copy {
  margin: 0 0 20px;
  color: #d4d4d8;
  font-size: 16px;
}

.g-cta__badge {
  display: inline-flex;
  border-radius: 10px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

/* Apple's official badge: unmodified, at least 40px tall. */
.g-cta__badge img {
  display: block;
  height: 48px;
  width: auto;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.g-cta__badge:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}

/* ---- Shared meta: category tag + read time ---- */
.g-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.g-tag {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

/* ---- Cover art: icon on a tinted, dotted panel ---- */
.g-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--accent);
  background:
    radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 18px 18px,
    #141416;
  border: 1px solid var(--line);
}

.g-cover svg {
  width: 22%;
  max-width: 96px;
  filter: drop-shadow(0 0 24px color-mix(in srgb, var(--accent) 60%, transparent));
}

/* ---- Blog index ---- */
.g-blog,
.g-more {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 0;
}

.g-blog__head {
  max-width: 680px;
  margin-bottom: 48px;
}

.g-eyebrow {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-green);
  margin: 0 0 12px;
}

.g-blog__head h1 {
  font-size: clamp(40px, 7vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 800;
  margin: 0 0 20px;
}

.g-blog__head .g-lede {
  color: var(--muted);
  margin: 0;
}

.g-blog__label,
.g-more h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 64px 0 20px;
}

.g-more {
  padding-top: 0;
  border-top: 1px solid var(--line);
  margin-top: 72px;
}

.g-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ---- Cards ---- */
.g-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-decoration: none;
  color: var(--ink);
}

.g-card .g-cover {
  transition: border-color 0.3s, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.g-card:hover .g-cover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-3px);
}

.g-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.g-card__title {
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0;
}

.g-card:hover .g-card__title {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.g-card__excerpt {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}

.g-card__date {
  font-size: 13px;
  color: var(--faint);
}

.g-card--featured {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: 40px;
}

.g-card--featured .g-card__title {
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.g-card--featured .g-card__excerpt {
  font-size: 17px;
}

@media (max-width: 900px) {
  .g-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .g-card--featured {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .g-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .g-blog,
  .g-more {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 17px;
  }
  .g-nav,
  .g-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .g-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .g-cta {
    padding: 22px;
  }
}

/* ---- Photo covers and in-article images ---- */
.g-cover--photo {
  background: #141416;
}

.g-cover--photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Reading page ======================================================
   Notion-like: a cover banner with an overlapping page icon, a calm
   680px column with a property list under the title, and quiet blocks
   (callouts, menu-path pills, toggles). A sticky outline sits to the right
   on wide screens and folds into a toggle above the article on narrow ones. */

.g-doc {
  --read: rgba(255, 255, 255, 0.84);
  --soft: rgba(255, 255, 255, 0.055);
}

.g-cover--hero {
  aspect-ratio: auto;
  height: clamp(160px, 24vw, 300px);
  border-radius: 0;
  border-width: 1px 0;
}

.g-cover--hero svg {
  width: auto;
  height: 38%;
}

.g-doc__wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 680px);
  justify-content: center;
  gap: 64px;
}

.g-doc__icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-top: -38px;
  border-radius: 18px;
  background: #18181b;
  border: 1px solid var(--line);
  color: var(--accent);
  position: relative;
}

.g-doc__icon svg {
  width: 38px;
  height: 38px;
}

.g-doc__head {
  margin: 20px 0 28px;
}

.g-crumbs a {
  font-size: 14px;
  font-weight: 500;
  color: var(--faint);
  text-decoration: none;
}

.g-crumbs a::before {
  content: '← ';
}

.g-crumbs a:hover {
  color: var(--ink);
}

.g-doc__head h1 {
  font-size: clamp(32px, 5vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 10px 0 20px;
}

/* Property list, like a Notion page's properties under the title */
.g-props {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.g-props__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.g-props__key {
  width: 84px;
  flex: none;
  color: var(--faint);
}

/* ---- Body text ---- */
.g-article {
  font-size: 17px;
  line-height: 1.7;
  color: var(--read);
}

.g-article > p:first-child {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
}

.g-article p {
  margin: 0 0 14px;
}

.g-article h2 {
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 650;
  color: var(--ink);
  margin: 48px 0 10px;
  scroll-margin-top: 24px;
}

.g-article h3 {
  font-size: 19px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--ink);
  margin: 28px 0 6px;
}

.g-article strong {
  color: var(--ink);
  font-weight: 600;
}

.g-article a {
  color: var(--ink);
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 3px;
}

.g-article a:hover {
  text-decoration-color: var(--ink);
}

.g-article ul,
.g-article ol {
  padding-left: 1.5em;
  margin: 0 0 16px;
}

.g-article li {
  padding-left: 4px;
}

.g-article li + li {
  margin-top: 6px;
}

.g-article li::marker {
  color: var(--faint);
}

.g-article ol > li::marker {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---- Menu-path pill: **Settings → Apps → Photos** ---- */
.g-path {
  font-size: 0.88em;
  font-weight: 500;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px 7px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---- Callouts ---- */
.g-callout {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--soft);
}

.g-callout--warning {
  background: rgba(240, 194, 127, 0.08);
}

.g-callout__icon {
  font-size: 18px;
  line-height: 1.6;
}

.g-callout p:last-child {
  margin-bottom: 0;
}

/* ---- Tables ---- */
.g-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
  margin: 20px 0 24px;
  display: block;
  overflow-x: auto;
}

.g-article th,
.g-article td {
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.g-article th {
  font-weight: 600;
  color: var(--ink);
  background: var(--soft);
}

/* ---- Toggles (FAQ) ---- */
.g-toggle {
  border-bottom: 1px solid var(--line);
}

.g-toggle summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  gap: 10px;
  padding: 14px 0;
  font-weight: 600;
  color: var(--ink);
}

.g-toggle summary::-webkit-details-marker {
  display: none;
}

.g-toggle summary::before {
  content: '';
  flex: none;
  width: 0;
  height: 0;
  margin-top: 0.55em;
  border-left: 6px solid var(--muted);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.2s;
}

.g-toggle[open] summary::before {
  transform: rotate(90deg);
}

.g-toggle__body {
  padding: 0 0 14px 16px;
}

/* ---- Images ---- */
.g-article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px auto 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.g-article p:has(> img) + p > em:only-child {
  display: block;
  font-size: 14px;
  color: var(--faint);
  text-align: center;
}

/* ---- Outline ---- */
.g-toc ul,
.g-toc-mobile ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.g-toc a,
.g-toc-mobile a {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: var(--faint);
  text-decoration: none;
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--line);
}

.g-toc a:hover,
.g-toc-mobile a:hover,
.g-toc a.is-active {
  color: var(--ink);
  border-left-color: var(--accent-green);
}

.g-toc {
  display: none;
}

.g-toc__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 10px;
}

.g-toc-mobile {
  margin: 0 0 28px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--soft);
}

.g-toc-mobile summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.g-toc-mobile ul {
  margin-top: 10px;
}

@media (min-width: 1100px) {
  .g-doc__wrap {
    grid-template-columns: minmax(0, 680px) 220px;
  }
  .g-toc {
    display: block;
    position: sticky;
    top: 32px;
    align-self: start;
    margin-top: 150px;
  }
  .g-toc-mobile {
    display: none;
  }
}

@media (max-width: 600px) {
  .g-doc__wrap {
    padding: 0 16px;
  }
  .g-doc__icon {
    width: 60px;
    height: 60px;
    margin-top: -30px;
    border-radius: 14px;
  }
  .g-doc__icon svg {
    width: 30px;
    height: 30px;
  }
  .g-article {
    font-size: 16.5px;
  }
}

/* ---- Legal pages (/privacy/, /terms/, /support/) ---- */
.g-legal {
  padding-top: 48px;
}

.g-article table {
  width: 100%;
  margin: 8px 0 20px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

.g-article th,
.g-article td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.g-article th {
  color: var(--ink);
  font-weight: 600;
}

.g-article td:first-child {
  white-space: nowrap;
  color: var(--ink);
}

@media (max-width: 600px) {
  .g-legal {
    padding-top: 24px;
  }
  .g-article td:first-child {
    white-space: normal;
  }
}

.g-footer__links {
  display: flex;
  gap: 20px;
}

.g-footer__links a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.g-footer__links a:hover {
  color: var(--ink);
}
