/* ============================================
   RICEANDPROTEIN.COM — Main Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg:       #FAFAF8;
  --bg2:      #F2F0EB;
  --accent:   #C4622D;
  --accent2:  #A84E22;
  --dark:     #1C1C1A;
  --text:     #1C1C1A;
  --muted:    #6B6860;
  --border:   #E2DDD6;
  --white:    #ffffff;
  --max:      1160px;
  --header-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* Footer always flush to bottom */
body { display: flex; flex-direction: column; min-height: 100vh; }
.page-wrap { flex: 1; }
.site-footer { margin-top: auto; }

/* ============================================
   HEADER
   ============================================ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--dark);
  display: flex;
  align-items: center;
}

.header-inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
}

.site-logo span {
  color: var(--accent2);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  position: relative;
}

.site-nav a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  transition: color 0.2s;
}

.site-nav a:hover { color: var(--white); }

/* Dropdown */
.nav-item { position: relative; }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 16px);
  left: 0;
  background: var(--dark);
  border: 1px solid rgba(255,255,255,0.1);
  min-width: 180px;
  padding: 8px 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s;
  list-style: none;
}

.nav-item:hover .nav-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* Bridge the gap between nav link and dropdown */
.nav-item::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
}

.nav-dropdown li a {
  display: block;
  padding: 10px 20px;
  font-size: 12px;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.7);
  transition: color 0.15s, background 0.15s;
}

.nav-dropdown li a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.05);
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: transform 0.3s;
}

/* ============================================
   HERO
   ============================================ */

.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--dark);
}

.hero__bg {
  position: absolute;
  inset: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.2) 0%,
    rgba(0,0,0,0.6) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
  padding: 0 24px;
  max-width: 800px;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero__title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 6vw, 68px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 20px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.3);
}

.hero__sub {
  font-size: clamp(15px, 2vw, 18px);
  color: rgba(255,255,255,0.88);
  margin-bottom: 40px;
  line-height: 1.6;
}

.hero__btn {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.7);
  padding: 14px 40px;
  transition: background 0.2s, border-color 0.2s;
}

.hero__btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--white);
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
  padding: 80px 24px;
}

.section--alt {
  background: var(--bg2);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.section-link {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  transition: color 0.2s;
}

.section-link:hover { color: var(--accent2); }

/* ============================================
   CARDS GRID
   ============================================ */

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

.cards-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.09);
}

.card__img {
  aspect-ratio: 16/10;
  overflow: hidden;
}

.card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card__img img {
  transform: scale(1.05);
}

.card__body {
  padding: 22px 24px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card__cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}

.card__title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 12px;
  transition: color 0.2s;
}

.card:hover .card__title { color: var(--accent); }

.card__excerpt {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__footer {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 12px;
}

/* ============================================
   FEATURED (big card left + stack right)
   ============================================ */

.featured-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
}

.featured-main .card__img {
  aspect-ratio: 4/3;
}

.featured-main .card__title {
  font-size: 26px;
}

.featured-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card--horizontal {
  flex-direction: row;
}

.card--horizontal .card__img {
  width: 120px;
  flex-shrink: 0;
  aspect-ratio: auto;
}

.card--horizontal .card__img img {
  height: 100%;
}

.card--horizontal .card__body {
  padding: 16px 18px;
}

.card--horizontal .card__title {
  font-size: 16px;
}

/* ============================================
   BLOG INDEX
   ============================================ */

.blog-header {
  padding: calc(var(--header-h) + 60px) 24px 60px;
  text-align: center;
  background: var(--dark);
  color: var(--white);
}

.blog-header__title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  margin-bottom: 12px;
}

.blog-header__sub {
  font-size: 16px;
  color: rgba(255,255,255,0.65);
}

.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 32px 24px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.category-tab {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s;
}

.category-tab:hover,
.category-tab.active {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
}

/* ============================================
   SINGLE POST
   ============================================ */

.post-hero {
  position: relative;
  height: 65vh;
  min-height: 420px;
  margin-top: var(--header-h);
  overflow: hidden;
}

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

.post-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.55) 100%);
}

.post-hero__content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 40px;
  color: var(--white);
  max-width: 860px;
  margin: 0 auto;
}

.post-hero__cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  margin-bottom: 12px;
  display: block;
}

.post-hero__title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

.post-meta {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 20px 40px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  max-width: 860px;
  margin: 0 auto;
}

.post-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.post-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  margin: 48px 0 16px;
  color: var(--text);
}

.post-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  margin: 36px 0 12px;
}

.post-body p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 24px;
}

.post-body ul, .post-body ol {
  padding-left: 24px;
  margin-bottom: 24px;
}

.post-body li {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 8px;
}

.post-body strong { font-weight: 600; }

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 24px;
  margin: 32px 0;
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-style: italic;
  color: var(--muted);
}

.post-body img {
  width: 100%;
  margin: 32px 0;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.6);
  padding: 48px 24px;
  text-align: center;
  font-size: 13px;
}

.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}

.footer-logo span { color: var(--accent2); }

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  list-style: none;
  margin: 16px 0 24px;
}

.footer-links a {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--white); }

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

/* ============================================
   UTILITY
   ============================================ */

.page-wrap {
  margin-top: var(--header-h);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 960px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-grid { grid-template-columns: 1fr; }
  .featured-stack { flex-direction: row; flex-wrap: wrap; }
  .card--horizontal { flex-direction: column; }
  .card--horizontal .card__img { width: 100%; aspect-ratio: 16/10; }
}

@media (max-width: 640px) {
  .cards-grid,
  .cards-grid--2 { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .hero__title { font-size: 32px; }
  .section { padding: 56px 16px; }
  .post-hero__content { padding: 24px 16px; }
  .post-meta { padding: 16px; flex-wrap: wrap; gap: 10px; }
  .post-body { padding: 32px 16px 60px; }
}

/* ============================================
   HOME CATEGORY PORTRAIT CARDS
   ============================================ */

.categories {
  border-top: 1px solid var(--border);
  padding: 0 48px;
  background: var(--bg);
}

.categories__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.categories__label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
}

.categories__all {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text);
  transition: opacity 0.2s;
}

.categories__all:hover { opacity: 0.5; }

.categories__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.cat-item {
  border-right: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.cat-item:last-child { border-right: none; }

.cat-item__img {
  aspect-ratio: 3/4;
  overflow: hidden;
}

.cat-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  filter: grayscale(15%);
}

.cat-item:hover .cat-item__img img { transform: scale(1.04); }

.cat-item__body {
  padding: 24px 28px 32px;
}

.cat-item__name {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  transition: color 0.2s;
}

.cat-item:hover .cat-item__name { color: var(--accent); }

.cat-item__desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 960px) {
  .categories { padding: 0 24px; }
  .categories__grid { grid-template-columns: repeat(2, 1fr); }
  .cat-item:nth-child(2) { border-right: none; }
  .cat-item:nth-child(3) { border-right: 1px solid var(--border); border-top: 1px solid var(--border); }
  .cat-item:nth-child(4) { border-top: 1px solid var(--border); border-right: none; }
}

@media (max-width: 480px) {
  .categories { padding: 0 16px; }
  .categories__grid { grid-template-columns: repeat(2, 1fr); }
  .cat-item__body { padding: 16px 16px 24px; }
  .cat-item__name { font-size: 17px; }
}

/* Mobile nav open state */
.site-nav.is-open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: var(--dark);
  padding: 24px;
  gap: 20px;
  z-index: 99;
}
