/* Reset and Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-gold: #ffd046;
  --color-gold-hover: #e6bb3e;
  --color-black: #000000;
  --color-white: #ffffff;
  --color-foreground: #0a0a0a;
  --color-muted-foreground: #737373;
  --color-muted: #f5f5f5;
  --color-border: #e5e5e5;
  --color-background: #ffffff;
  --font-sans: "Open Sans", system-ui, -apple-system, sans-serif;
  --font-serif: "Frank Ruhl Libre", Georgia, serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-foreground);
  background-color: var(--color-background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus styles for accessibility */
:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-background),
    0 0 0 4px var(--color-gold);
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-gold);
  color: var(--color-black);
  padding: 0.75rem 1rem;
  z-index: 100;
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* Article */
article {
  background-color: var(--color-background);
}

/* Featured Image */
.featured-image-container {
  width: 100%;
}

.featured-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
}

.featured-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Content Container */
.content-container {
  max-width: 48rem;
  margin: 0 auto;
  padding: 3rem 1rem;
}

@media (min-width: 640px) {
  .content-container {
    padding: 3rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .content-container {
    padding: 3rem 2rem;
  }
}

/* Category and Date */
.meta-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.category-link {
  background-color: var(--color-gold);
  color: var(--color-black);
  padding: 0.25rem 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.category-link:hover {
  background-color: var(--color-gold-hover);
}

.post-date {
  color: var(--color-muted-foreground);
}

/* Title */
.post-title {
  font-family: var(--font-serif);
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--color-foreground);
  text-wrap: balance;
}

@media (min-width: 640px) {
  .post-title {
    font-size: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .post-title {
    font-size: 3rem;
  }
}

/* Separator */
.separator {
  height: 1px;
  width: 4rem;
  background-color: var(--color-gold);
  margin: 2rem 0;
}

/* Prose content */
.prose {
  max-width: none;
}

.prose p {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--color-foreground);
}

.prose p + p {
  margin-top: 1.5rem;
}

/* Drop Cap */
.prose p:first-of-type.drop-cap::first-letter,
.entry-content p:first-of-type.drop-cap::first-letter {
  float: left;
  margin-right: 0.75rem;
  margin-top: 0.125rem;
  font-family: var(--font-serif);
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-gold);
}

@media (min-width: 640px) {
  .prose p:first-of-type.drop-cap::first-letter,
  .entry-content p:first-of-type.drop-cap::first-letter {
    font-size: 5rem;
  }
}

/* Blockquote */
.blockquote {
  margin: 2.5rem 0;
  padding: 1.5rem 1rem 1.5rem 1.5rem;
  border-left: 4px solid var(--color-gold);
  background-color: var(--color-muted);
}

.blockquote p {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--color-foreground);
}

@media (min-width: 640px) {
  .blockquote p {
    font-size: 1.5rem;
  }
}

.blockquote footer {
  margin-top: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted-foreground);
}

/* Subheading */
.subheading {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-foreground);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .subheading {
    font-size: 1.875rem;
  }
}

/* FAQ Section */
.faq-section {
  margin-top: 4rem;
}

.faq-heading {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-foreground);
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .faq-heading {
    font-size: 1.875rem;
  }
}

.faq-list {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: inherit;
}

.faq-button:hover {
  color: var(--color-gold);
}

.faq-question {
  padding-right: 1rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-foreground);
}

.faq-button:hover .faq-question {
  color: var(--color-gold);
}

.faq-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--color-muted-foreground);
  transition: transform 0.2s ease;
}

.faq-icon.open {
  transform: rotate(180deg);
}

.faq-answer-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.2s ease, opacity 0.2s ease;
}

.faq-answer-wrapper.open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.faq-answer-inner {
  overflow: hidden;
}

.faq-answer {
  padding-bottom: 1.25rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-muted-foreground);
}

/* Footer / Tags */
.post-footer {
  margin-top: 1.5rem;
  margin-bottom: 0;
  padding-top: 1.5rem;
  padding-bottom: 0;
  border-top: 1px solid var(--color-border);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem;
}

.footer-section-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted-foreground);
}

.footer-section-content {
  margin-top: 0.5rem;
}

.category-text-link {
  color: var(--color-foreground);
  text-decoration: underline;
  text-decoration-color: var(--color-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.category-text-link:hover {
  color: var(--color-gold);
}

.tags-section {
  flex: 1;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-link {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-foreground);
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.tag-link:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* Post Navigation */
.content-container .post-navigation {
  margin-top: 2.5rem;
  padding-top: 0;
  padding-bottom: 0;
}

.post-navigation .nav-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  border-top: 1px solid var(--color-border);
  padding-top: 2rem;
  margin: 0;
}

@media (min-width: 768px) {
  .post-navigation .nav-links {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-navigation .nav-previous {
  text-align: left;
}

.post-navigation .nav-next {
  text-align: right;
}

@media (min-width: 768px) {
  .post-navigation .nav-previous {
    text-align: left;
  }
  
  .post-navigation .nav-next {
    text-align: right;
  }
}

.post-navigation .nav-subtitle {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.post-navigation .nav-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-foreground);
  transition: color 0.2s ease;
}

@media (min-width: 640px) {
  .post-navigation .nav-title {
    font-size: 1.25rem;
  }
}

.post-navigation a {
  text-decoration: none;
  display: block;
  padding: 0.5rem 0;
}

.post-navigation a:hover .nav-title,
.post-navigation a:focus .nav-title {
  color: var(--color-gold);
}

.post-navigation a:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 4px;
  border-radius: 2px;
}
