/* ============================
   CUSTOM RECEIPT FONT
   ============================ */
@font-face {
  font-family: "FakeReceipt";
  src: url("fonts/FakeReceipt.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

/* ============================
   GLOBAL LAYOUT
   ============================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  /* Apply custom receipt font */
  font-family: "FakeReceipt", "Space Mono", monospace;

  letter-spacing: 0.02em;
  -webkit-font-smoothing: none;
  font-smooth: never;

  background: #e3e3e3;
}

/* Blog pages should not center vertically */
body:has(header) {
  justify-content: flex-start;
}

.page {
  padding: 1.5rem 0;
}

/* ============================
   RECEIPT CONTAINER
   ============================ */
.receipt {
  position: relative;
  width: min(360px, calc(100vw - 2rem));
  margin: 0 auto;
  background: #fffdf5;
  color: #111;
  border: 1px solid #111;
  padding: 1.75rem 1.25rem 2.25rem;

  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

/* Perforated Edges */
.receipt::before,
.receipt::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 12px;
  background-image: radial-gradient(circle at 6px -2px, transparent 6px, #fffdf5 6px);
  background-size: 12px 12px;
}

.receipt::before {
  top: -6px;
  border-bottom: 1px dashed #111;
}

.receipt::after {
  bottom: -6px;
  border-top: 1px dashed #111;
  transform: rotate(180deg);
}

/* ============================
   HEADERS & TEXT
   ============================ */
.receipt-header {
  text-align: center;
  margin-bottom: 1rem;
}

/* Profile Photo */
.profile-photo {
  width: 72px;
  height: 72px;
  border: 1px solid #111;
  display: block;
  margin: 0.2rem auto 0.4rem;
  object-fit: cover;
}

.receipt-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.name {
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  margin: 0.25rem 0 0.1rem;
  text-transform: uppercase;
}

.title,
.institution {
  margin: 0.1rem 0;
  font-size: 0.75rem;
}

.institution {
  font-weight: bold;
}

.contact-block {
  font-size: 0.7rem;
  text-align: left;
  margin-top: 0.3rem;
}

.contact-block a {
  color: inherit;
  text-decoration: underline;
}

/* ============================
   DIVIDERS
   ============================ */
.divider {
  border-bottom: 1px solid #111;
  margin: 0.6rem 0;
}

.divider.dashed {
  border-bottom-style: dashed;
}

.divider.dotted {
  border-bottom-style: dotted;
}

/* ============================
   SECTIONS
   ============================ */
.receipt-section {
  font-size: 0.72rem;
  margin-bottom: 0.8rem;
}

.receipt-section h2 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 0.3rem;
}

.list {
  list-style: none;
  padding-left: 0;
}

.list li {
  margin-bottom: 0.25rem;
}

.list-tight li {
  margin-bottom: 0.15rem;
}

.list a {
  color: #111;
  text-decoration: underline;
}

.list a:hover {
  text-decoration: none;
  font-weight: bold;
}

.strong {
  font-weight: bold;
}

.muted {
  opacity: 0.85;
  font-size: 0.7rem;
}

/* Two Columns */
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Footer Lines */
.footer-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
}

.footer-line span:last-child {
  font-weight: bold;
}

/* QR Placeholder */
.qr-placeholder {
  margin: 1rem auto 0;
  border: 1px dashed #111;
  width: 110px;
  height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.qr-placeholder .tiny {
  font-size: 0.6rem;
}

/* Tiny Text */
.tiny {
  font-size: 0.6rem;
  line-height: 1.3;
}

/* Page Footer */
.page-footer {
  text-align: center;
  margin-top: 0.4rem;
  font-size: 0.6rem;
  opacity: 0.7;
}

/* Print Optimization */
@media print {
  body {
    background: white;
  }
  .page {
    padding: 0;
  }
  .receipt {
    box-shadow: none;
  }
}

/* ============================
   MOBILE RESPONSIVENESS
   ============================ */

/* Small phones (up to 400px) */
@media (max-width: 400px) {
  .receipt {
    width: calc(100vw - 1rem);
    padding: 1.25rem 1rem 1.75rem;
    font-size: 0.9rem;
  }

  .name {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
  }

  .title,
  .institution {
    font-size: 0.7rem;
  }

  .receipt-section h2 {
    font-size: 0.65rem;
  }

  .receipt-section {
    font-size: 0.68rem;
  }

  .two-column {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .contact-block {
    font-size: 0.65rem;
  }

  .profile-photo {
    width: 64px;
    height: 64px;
  }

  .qr-placeholder {
    width: 90px;
    height: 90px;
  }
}

/* Medium phones (400px - 600px) */
@media (min-width: 401px) and (max-width: 600px) {
  .receipt {
    width: calc(100vw - 1.5rem);
  }
}

/* Blog-specific mobile styles */
body header {
  width: 100%;
  padding: 1.5rem 1rem;
  text-align: center;
  background: #fffdf5;
  border-bottom: 2px dashed #111;
  position: sticky;
  top: 0;
  z-index: 100;
}

body header h1 {
  font-size: 1.5rem;
  margin: 0.5rem 0;
}

body header p {
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

#blog {
  padding: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

#blog-list {
  padding: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.blog-post {
  background: #fffdf5;
  border: 1px solid #111;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.blog-post h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

.blog-post p {
  margin: 0.5rem 0;
  line-height: 1.6;
}

.blog-post a {
  color: #111;
  text-decoration: underline;
  font-weight: bold;
}

.blog-post .date {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.7;
}

.blog-post img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

#share-buttons {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed #111;
  text-align: center;
}

#share-buttons h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
}

#share-buttons a {
  display: inline-block;
  margin: 0 0.5rem;
}

.share-icon {
  width: 32px;
  height: 32px;
  display: block;
}

body footer {
  padding: 1rem;
  text-align: center;
  margin-top: 2rem;
}

.pagination {
  margin-bottom: 1rem;
}

.pagination a {
  color: #111;
  text-decoration: underline;
  margin: 0 0.5rem;
}

/* Mobile blog adjustments */
@media (max-width: 600px) {
  #blog {
    padding: 0.5rem;
  }

  #blog-list {
    padding: 0.5rem;
  }

  .blog-post {
    padding: 0.75rem;
    margin-bottom: 1rem;
  }

  .blog-post h3 {
    font-size: 1rem;
  }

  .blog-post p {
    font-size: 0.85rem;
  }

  body header h1 {
    font-size: 1.2rem;
  }

  body header p {
    font-size: 0.8rem;
  }

  .share-icon {
    width: 28px;
    height: 28px;
    margin: 0 0.3rem;
  }
}
