/* =========================================================
   Rhianna's Fiber Arts — Main Stylesheet
   ========================================================= */

/* --- Custom Properties --- */
:root {
  --color-bg:        #f0e6d0;
  --color-surface:   #f7eed8;
  --color-border:    #d9c9a8;
  --color-text:      #2c1f0e;
  --color-muted:     #7a6340;
  --color-accent:    #8b5e3c;
  --color-accent-dk: #6b4228;
  --color-tag-bg:    #e4d4b0;

  --font-serif:  'Playfair Display', Georgia, serif;
  --font-sans:   'Lato', system-ui, sans-serif;

  --radius:      6px;
  --max-width:   900px;
  --gap:         2rem;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-dk); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-text);
}

/* --- Layout helpers --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 2rem;
}

.site-nav a {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  transition: color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-accent);
}

/* =========================================================
   MAIN & FOOTER
   ========================================================= */
.site-main { flex: 1; padding-bottom: 4rem; }

.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.8;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 0.15s;
}

.btn:hover { background: var(--color-accent-dk); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border: 1.5px solid var(--color-accent);
}

.btn-outline:hover {
  background: var(--color-accent);
  color: #fff;
}

/* =========================================================
   TAGS
   ========================================================= */
.tag {
  display: inline-block;
  background: var(--color-tag-bg);
  color: var(--color-muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-right: 0.25rem;
}

.post-tags { margin-left: 0.75rem; }

/* =========================================================
   HERO (Home page)
   ========================================================= */
.hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 3.5rem;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.hero-image img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
}

.hero-text h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--color-muted);
  margin-bottom: 1.75rem;
  max-width: 480px;
}

/* Two-column hero when image is present */
.hero-inner:has(.hero-image) {
  grid-template-columns: 1fr 1fr;
}

/* =========================================================
   SECTION HEADINGS
   ========================================================= */
.section-heading {
  font-size: 1.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

/* =========================================================
   POST CARDS (Blog list + Home recent posts)
   ========================================================= */
.post-list {
  display: grid;
  gap: var(--gap);
}

.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  transition: box-shadow 0.2s;
}

.post-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

/* Card with image: side by side on wider screens */
@media (min-width: 600px) {
  .post-card:has(.post-card-image) {
    grid-template-columns: 240px 1fr;
  }
}

.post-card-image {
  display: block;
  overflow: hidden;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-card-image img {
  transform: scale(1.03);
}

.post-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-date {
  font-size: 0.8125rem;
  color: var(--color-muted);
  letter-spacing: 0.04em;
}

.post-card-body h2,
.post-card-body h3 {
  font-size: 1.3rem;
}

.post-card-body h2 a,
.post-card-body h3 a {
  color: var(--color-text);
}

.post-card-body h2 a:hover,
.post-card-body h3 a:hover {
  color: var(--color-accent);
}

.post-excerpt {
  color: var(--color-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.read-more {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-accent);
  margin-top: auto;
}

/* =========================================================
   HOME — recent posts section
   ========================================================= */
.home-about {
  font-size: 1.0625rem;
  line-height: 1.8;
  max-width: 640px;
  margin-bottom: 3rem;
}

.home-recent { margin-top: 0; }

.view-all {
  margin-top: 2rem;
  text-align: center;
}

/* =========================================================
   BLOG / PAGE HEADERS
   ========================================================= */
.page-header {
  margin-bottom: 2.5rem;
  padding-top: 2.5rem;
}

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.page-description {
  color: var(--color-muted);
  margin-top: 0.5rem;
  font-size: 1rem;
}

/* =========================================================
   BLOG POST PAGE
   ========================================================= */
.post {
  padding-top: 2.5rem;
}

.post-cover {
  margin-bottom: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.post-cover img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.post-meta time {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.post-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 2rem;
}

/* Post body typography */
.post-body {
  max-width: 680px;
}

.post-body h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; }
.post-body h3 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }
.post-body p  { margin-bottom: 1.25rem; }

.post-body ul,
.post-body ol {
  margin: 0 0 1.25rem 1.5rem;
}

.post-body li { margin-bottom: 0.25rem; }

.post-body blockquote {
  border-left: 3px solid var(--color-accent);
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  color: var(--color-muted);
  font-style: italic;
}

.post-body img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.post-body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* In-post gallery */
.post-gallery {
  margin-top: 3rem;
}

.post-gallery h2 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

/* Post navigation */
.post-footer {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.post-nav a {
  display: flex;
  flex-direction: column;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.post-nav a:hover { color: var(--color-accent); }

.nav-label {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-title {
  font-family: var(--font-serif);
  font-size: 1rem;
}

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

.back-to-blog {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.back-to-blog:hover { color: var(--color-accent); }

/* =========================================================
   GALLERY
   ========================================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.gallery-grid--large {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 1 / 1;
  background: var(--color-border);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(45, 41, 38, 0.55);
  display: flex;
  align-items: flex-end;
  padding: 0.75rem 1rem;
  opacity: 0;
  transition: opacity 0.25s;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay-text {
  color: #fff;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  line-height: 1.3;
}

.gallery-caption {
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-top: 0.35rem;
  text-align: center;
}

/* =========================================================
   EMPTY STATE
   ========================================================= */
.empty-state {
  color: var(--color-muted);
  font-style: italic;
  padding: 2rem 0;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 600px) {
  .site-nav { gap: 1.25rem; }
  .hero-inner { padding: 2.5rem 1.5rem; }
  .hero-inner:has(.hero-image) {
    grid-template-columns: 1fr;
  }
  .post-nav { flex-direction: column; gap: 1rem; }
  .post-nav-next { text-align: left; }
}

@media (max-width: 420px) {
  .site-title { font-size: 1.15rem; }
  .site-nav a { font-size: 0.8rem; letter-spacing: 0.04em; }
  .gallery-grid, .gallery-grid--large {
    grid-template-columns: repeat(2, 1fr);
  }
}
