/* ==========================================================================
   Dellera Theme — Main Stylesheet
   Mobile-first: base styles target small screens.
   Larger breakpoints added via min-width media queries.
   ========================================================================== */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--color-link-hover);
}

ul, ol {
  list-style: none;
}


/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-heading);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--text-3xl); margin-bottom: 0.5em; }
h2 { font-size: var(--text-2xl); margin-bottom: 0.5em; }
h3 { font-size: var(--text-xl);  margin-bottom: 0.5em; }
h4 { font-size: var(--text-lg);  margin-bottom: 0.5em; }

p {
  margin-bottom: 1.25em;
}

blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 1.25em;
  margin: 1.5em 0;
  color: var(--color-text-muted);
  font-style: italic;
}

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

pre {
  background: var(--color-grey-100);
  padding: 1em;
  overflow-x: auto;
  border-radius: 4px;
  margin-bottom: 1.25em;
}


/* ==========================================================================
   Layout
   ========================================================================== */

.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
  background-color: var(--color-bg-alt);
}

.site-main > .container {
  background-color: var(--color-surface);
  padding-top: 1rem;
  padding-bottom: 1rem;
  min-height: 60vh;
}

@media (min-width: 48em) {
  .site-main > .container {
    padding-top: 2rem;
    padding-bottom: 2rem;
    box-shadow: 0 0 0 1px var(--color-border);
  }
}

.container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 48em) {
  .container {
    padding: 0 2rem;
  }
}

/* Narrow the container on single pages/posts so the white
   background hugs the content instead of stretching wide. */
.single .site-main > .container,
.page .site-main > .container,
.error404 .site-main > .container {
  max-width: 56rem;
}


/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  background-color: var(--color-header-bg);
  color: var(--color-header-text);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  max-width: 56rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-header-text);
}

.site-brand:hover,
.site-brand:focus {
  color: var(--color-accent-light);
}

.site-brand__logo {
  max-height: 2.5rem;
  width: auto;
}

.site-brand__text {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  line-height: var(--leading-tight);
  white-space: nowrap;
}

.site-brand__tagline {
  display: none;
  font-size: var(--text-xs);
  font-family: var(--font-body);
  font-weight: var(--weight-normal);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-grey-400);
}

@media (min-width: 48em) {
  .site-brand__logo {
    max-height: 4rem;
  }

  .site-brand__text {
    font-size: var(--text-xl);
  }

  .site-brand__tagline {
    display: block;
  }
}


/* --- Mobile nav toggle --- */

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--color-grey-600);
  border-radius: 4px;
  color: var(--color-header-text);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: var(--text-md);
  line-height: 1;
  transition: border-color 0.2s ease;
}

.nav-toggle:hover {
  border-color: var(--color-accent);
}

.nav-toggle__label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  margin-left: 0.4rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

@media (min-width: 48em) {
  .nav-toggle {
    display: none;
  }
}


/* --- Primary Navigation --- */

.primary-nav {
  display: none;
  width: 100%;
  padding-top: 0.75rem;
}

.primary-nav.is-open {
  display: block;
}

.primary-nav__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.primary-nav__item a {
  display: block;
  padding: 0.6rem 0;
  color: var(--color-header-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-grey-700);
  transition: color 0.2s ease;
}

.primary-nav__item:last-child a {
  border-bottom: none;
}

.primary-nav__item a:hover,
.primary-nav__item a:focus {
  color: var(--color-accent);
}

.primary-nav__item--shop a {
  color: var(--color-accent);
}

.primary-nav__item--shop a:hover {
  color: var(--color-accent-light);
}

@media (min-width: 48em) {
  .primary-nav {
    display: block;
    width: auto;
    padding-top: 0;
  }

  .primary-nav__list {
    flex-direction: row;
    gap: 1.5rem;
  }

  .primary-nav__item a {
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
  }

  .primary-nav__item:last-child a {
    border-bottom: 2px solid transparent;
  }

  .primary-nav__item a:hover,
  .primary-nav__item a:focus {
    border-bottom-color: var(--color-accent);
  }
}


/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 2.5rem 0 1.5rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 48em) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-grid h4 {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-accent-light);
  margin-bottom: 0.75rem;
}

.footer-grid p,
.footer-grid li {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-grey-400);
}

.footer-grid a {
  color: var(--color-grey-300);
}

.footer-grid a:hover {
  color: var(--color-accent);
}

.footer-nav__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-grey-700);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-grey-500);
}


/* ==========================================================================
   Post Cards (Blog listing)
   ========================================================================== */

.posts-grid {
  display: grid;
  gap: 1.5rem;
  padding: 2rem 0;
}

@media (min-width: 40em) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64em) {
  .posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.post-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.post-card__thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background-color: var(--color-grey-100);
}

.post-card__body {
  padding: 1.25rem;
}

.post-card__meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: 0.5rem;
}

.post-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  margin-bottom: 0.5rem;
}

.post-card__title a {
  color: var(--color-heading);
}

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

.post-card__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}

.post-card__read-more {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-accent-dark);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.post-card__read-more:hover {
  color: var(--color-accent);
}


/* ==========================================================================
   Single Post / Page Content
   ========================================================================== */

.page-header {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.page-header__title {
  font-size: var(--text-2xl);
  margin-bottom: 0.25rem;
}

@media (min-width: 48em) {
  .page-header__title {
    font-size: var(--text-3xl);
  }
}

.page-header__meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.entry-content {
  padding-bottom: 2rem;
}

.entry-content p {
  margin-bottom: 1.25em;
}

.entry-content h2 {
  margin-top: 2em;
}

.entry-content h3 {
  margin-top: 1.5em;
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 1.25em 1.5em;
}

.entry-content ul {
  list-style: disc;
}

.entry-content ol {
  list-style: decimal;
}

.entry-content li {
  margin-bottom: 0.35em;
}

.entry-content img {
  border-radius: 4px;
  margin: 1.5em 0;
}

.entry-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text);
  transition: all 0.2s ease;
}

.pagination a:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
}

.pagination .current {
  background-color: var(--color-grey-900);
  border-color: var(--color-grey-900);
  color: var(--color-white);
}


/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-align: center;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn--primary {
  background-color: var(--color-button-bg);
  color: var(--color-button-text);
}

.btn--primary:hover {
  background-color: var(--color-button-hover);
  color: var(--color-button-text);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--color-border-dark);
  color: var(--color-text);
}

.btn--outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}


/* ==========================================================================
   404 Page
   ========================================================================== */

.error-404 {
  text-align: center;
  padding: 4rem 0;
}

.error-404 h1 {
  font-size: var(--text-4xl);
  color: var(--color-grey-300);
  margin-bottom: 0.5rem;
}

.error-404 p {
  font-size: var(--text-md);
  color: var(--color-text-muted);
}

.error-404 .search-form {
  margin-top: 1.5rem;
}


/* ==========================================================================
   Search Form
   ========================================================================== */

.search-form {
  display: flex;
  max-width: 28rem;
  margin: 0 auto;
}

.search-form__input {
  flex: 1;
  padding: 0.6rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  border: 1px solid var(--color-border-dark);
  border-right: none;
  border-radius: 4px 0 0 4px;
  outline: none;
  background: var(--color-surface);
  color: var(--color-text);
}

.search-form__input:focus {
  border-color: var(--color-accent);
}

.search-form__submit {
  padding: 0.6rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  background-color: var(--color-button-bg);
  color: var(--color-button-text);
  border: 1px solid var(--color-button-bg);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-form__submit:hover {
  background-color: var(--color-button-hover);
  border-color: var(--color-button-hover);
}


/* ==========================================================================
   Utility Classes
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Feature Card Block
   ========================================================================== */

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.feature-card__media {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  flex-shrink: 0;
}

.feature-card .feature-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}

.feature-card__body {
  flex: 1;
  min-width: 0;
}

.feature-card .feature-card__heading {
  margin-top: 0;
  margin-bottom: 0.5em;
}

.feature-card__text {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
}

.feature-card__text p:last-child {
  margin-bottom: 0;
}

/* Reversed: right-align text */
.feature-card--reversed .feature-card__body {
  text-align: right;
}

@media (min-width: 48em) {
  .feature-card {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
  }

  .feature-card--reversed {
    flex-direction: row-reverse;
  }

  /* --- Layout ratios --- */
  .feature-card--layout-1-3 .feature-card__media {
    flex: 0 0 33.333%;
    max-width: 33.333%;
  }

  .feature-card--layout-1-4 .feature-card__media {
    flex: 0 0 25%;
    max-width: 25%;
  }

  /* --- Aspect ratios (override mobile 4:3 default) --- */
  .feature-card--ratio-1-1  .feature-card__media { aspect-ratio: 1 / 1; }
  .feature-card--ratio-4-3  .feature-card__media { aspect-ratio: 4 / 3; }
  .feature-card--ratio-3-2  .feature-card__media { aspect-ratio: 3 / 2; }
  .feature-card--ratio-16-9 .feature-card__media { aspect-ratio: 16 / 9; }
  .feature-card--ratio-2-3  .feature-card__media { aspect-ratio: 2 / 3; }
}


/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-center { text-align: center; }
.text-accent { color: var(--color-accent); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
