/* ============================= */
/* ONCE THEME CUSTOMIZATION     */
/* ============================= */

:root {
  --primary-color: #000;
  --text-color: #1a1a1a;
  --light-gray: #f5f5f5;
  --border-color: #e0e0e0;
}

/* Header & Masthead */
.masthead {
  background-color: #fff !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 2rem 0 !important;
}

.masthead__inner-wrap {
  max-width: 100%;
  padding: 0 2rem;
}

.site-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-left: auto;
}

.site-nav button {
  display: none;
}

.site-nav .nav__list {
  display: flex !important;
  gap: 2rem;
  margin: 0 !important;
}

.site-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-color) !important;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.site-nav a:hover {
  opacity: 0.6;
}

/* Logo/Title */
.site-title {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.5px;
}

/* Main Content Grid */
.entries-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 3rem 0;
  width: 100%;
}

.entries-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* Archive Item Styling - Full Width */
.archive__item {
  background: #fff;
  transition: all 0.3s ease;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.archive__item-teaser {
  margin-bottom: 0;
  order: -1;
}

.archive__item-teaser img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}

.archive__item-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--text-color);
}

.archive__item-excerpt {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #666;
}

.archive__item-title a {
  color: var(--text-color) !important;
  text-decoration: none;
}

.archive__item-title a:hover {
  color: var(--primary-color) !important;
  text-decoration: underline;
}

/* Meta Information */
.archive__item-meta {
  font-size: 0.85rem;
  color: #999;
  margin-top: 0.5rem;
}

.page__meta {
  font-size: 0.85rem;
  color: #999;
}

/* Page Layout */
.page {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Home Container with Sidebar */
.home-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  max-width: 100%;
  margin: 0;
  padding: 2rem;
}

.home-main {
  flex: 1;
}

.home-sidebar {
  display: none;
}

/* Author Profile in Sidebar */
.home-sidebar .author__avatar {
  margin-bottom: 1rem;
}

.home-sidebar .author__avatar img {
  width: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.home-sidebar .author__name {
  font-size: 1.2rem;
  margin: 1rem 0 0.5rem 0;
}

.home-sidebar .author__bio {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #666;
  margin-bottom: 1rem;
}

.home-sidebar .author__urls-wrapper {
  margin-top: 1rem;
}

.home-sidebar .btn {
  width: 100%;
  padding: 0.75rem !important;
  margin-bottom: 1rem;
}

.home-sidebar .social-icons {
  list-style: none;
  padding: 0;
  margin: 0;
}

.home-sidebar .social-icons li {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.home-sidebar .social-icons a {
  color: var(--text-color);
  text-decoration: none;
}

.home-sidebar .social-icons a:hover {
  color: var(--primary-color);
}


.page__content {
  font-size: 1rem;
  line-height: 1.7;
}

/* Featured Section */
.archive__subtitle {
  font-size: 2rem;
  font-weight: 700;
  margin: 3rem 0 2rem 0;
  color: var(--text-color);
}

/* Pagination */
.pagination {
  margin: 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.pagination a,
.pagination span {
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.3s ease;
  flex: 1;
  text-align: center;
}

.pagination a:hover {
  background-color: var(--light-gray);
  border-color: var(--primary-color);
}

.pagination .current {
  background-color: var(--text-color);
  color: #fff;
  border-color: var(--text-color);
}

/* Footer */
.page__footer {
  margin-top: 4rem;
  padding: 2rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--light-gray);
}

.footer {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

/* Search Box */
.search-content {
  padding: 2rem;
  background-color: var(--light-gray);
  margin: 2rem 0;
}

/* Responsive */
@media (max-width: 768px) {
  .home-container {
    grid-template-columns: 1fr;
  }

  .home-sidebar {
    position: static;
    top: auto;
    order: 0;
  }

  .archive__item {
    grid-template-columns: 1fr;
  }

  .archive__item-teaser img {
    height: 250px;
  }

  .site-nav .nav__list {
    flex-direction: column;
    gap: 1rem;
  }

  .masthead {
    padding: 1.5rem 0 !important;
  }

  .page {
    padding: 1rem;
  }

  .archive__subtitle {
    font-size: 1.5rem;
  }
}

/* Extensions Shop */
.extensions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.extension-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.extension-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.extension-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--light-gray);
  border-radius: 8px;
}

.extension-card h3 {
  font-size: 1.3rem;
  margin: 0 0 1rem 0;
  color: var(--text-color);
}

.extension-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #666;
  margin-bottom: 1.5rem;
}

.extension-features {
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.extension-features h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-color);
  margin: 0 0 0.75rem 0;
}

.extension-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.extension-features li {
  font-size: 0.9rem;
  color: #666;
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.extension-features li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

.extension-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.extension-buttons .btn {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem !important;
  background-color: var(--primary-color);
  color: #fff !important;
  border: none;
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.extension-buttons .btn:hover {
  background-color: #333;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background-color: var(--primary-color) !important;
}

.btn-primary:hover {
  background-color: #333 !important;
}

/* Contact Form */
.contact-form-wrapper {
  margin: 3rem 0;
}

.contact-form {
  background-color: #fff;
  padding: 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  display: block;
}

.form-input,
.form-textarea {
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: inherit;
  transition: all 0.3s ease;
  background-color: #fff;
  color: var(--text-color);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 150px;
}

.form-submit {
  padding: 0.85rem 2rem;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-submit:hover {
  background-color: #333;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.form-submit:active {
  transform: translateY(0);
}

.form-note {
  font-size: 0.85rem;
  color: #999;
  margin-top: 1rem;
  margin-bottom: 0;
}

.form-status {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  color: #155724;
  display: none;
}

.form-status.hidden {
  display: none;
}

.form-status.show {
  display: block;
  animation: slideIn 0.3s ease;
}

.status-message {
  text-align: center;
}

.status-message i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.status-message p {
  font-size: 1rem;
  margin: 0.5rem 0 0 0;
  font-weight: 500;
}

/* Responsive Contact Form */
@media (max-width: 768px) {
  .contact-form {
    padding: 1.5rem;
  }

  .form-input,
  .form-textarea {
    font-size: 16px; /* Prevents zoom on mobile */
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Related Posts Alignment - Card Grid Style */
/* Related Posts - Proper Card Design */
.page__related {
  margin: 4rem 0 0 0;
  padding: 2rem;
  border-top: 2px solid var(--border-color);
  background-color: #fff;
  clear: both;
  width: 100%;
}

.page__related-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-color);
}

/* Desktop: Keep within main page content */
@media (min-width: 1025px) {
  .page__related {
    margin: 4rem 0 0 0;
    width: 100%;
  }
}

/* Tablet: Full width */
@media (min-width: 769px) and (max-width: 1024px) {
  .page__related {
    margin: 4rem 0 0 0;
  }
}

.grid__wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
  width: 100%;
}

/* Desktop: 3 columns */
@media (min-width: 1200px) {
  .grid__wrapper {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
}

/* Tablet: 2 columns */
@media (min-width: 769px) and (max-width: 1199px) {
  .grid__wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* Mobile: 1 column */
@media (max-width: 768px) {
  .page__related {
    margin: 3rem 0 0 0;
    padding: 1.5rem;
    width: 100%;
  }

  .grid__wrapper {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.grid__item {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.grid__item .archive__item {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

.grid__item .archive__item:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(-8px);
}

/* Image */
.grid__item .archive__item-teaser {
  width: 100%;
  height: 220px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #f0f0f0;
  flex-shrink: 0;
}

.grid__item .archive__item-teaser img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.grid__item .archive__item:hover .archive__item-teaser img {
  transform: scale(1.1);
}

/* Title */
.grid__item h2.archive__item-title {
  padding: 1.5rem 1.5rem 0.5rem 1.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.35;
  color: var(--text-color);
  border: none;
  flex-shrink: 0;
}

.grid__item .archive__item-title a {
  color: var(--text-color);
  text-decoration: none;
}

.grid__item .archive__item-title a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Meta - Hide */
.grid__item .page__meta {
  display: none !important;
}

/* Excerpt/Description */
.grid__item .archive__item-excerpt {
  padding: 0.75rem 1.5rem 1.5rem 1.5rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #666;
  margin: 0;
  flex-grow: 1;
  display: block !important;
  position: relative;
  padding-bottom: 5rem;
  margin-bottom: auto;
}

/* Read More Button
.grid__item .archive__item-excerpt::after {
  content: "Read more";
  position: absolute;
  bottom: 1.2rem;
  left: 1.5rem;
  right: 1.5rem;
  display: block;
  padding: 0.8rem 1.5rem;
  background-color: #888;
  color: #fff;
  text-align: center;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.3s ease;
  cursor: pointer;
  width: calc(100% - 3rem);
  box-sizing: border-box;
}

.grid__item .archive__item:hover .archive__item-excerpt::after {
  background-color: var(--primary-color);
} */

.archive__item-readmore {
  display: block;
  margin: 1rem 1.5rem 0;
  padding: 0.8rem 1.5rem;
  background-color: #000 !important; /* black background */
  color: #fff !important;            /* force white text */
  text-align: center;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.archive__item-readmore:hover {
  background-color: #111 !important;  /* slightly lighter black */
  color: #fff !important;             /* stay white on hover */
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transform: scale(1.02);
  cursor: pointer;
}


/* Responsive */
@media (max-width: 768px) {
  .grid__wrapper {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .grid__item .archive__item-teaser {
    height: 180px;
  }

  .grid__item h2.archive__item-title {
    font-size: 1.1rem;
  }

  .grid__item .archive__item-excerpt::after {
    font-size: 0.85rem;
    padding: 0.7rem 1rem;
  }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-color);
  font-weight: 700;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Sticky Sidebar */
.sidebar {
  position: static;
  top: auto;
  height: fit-content;
  border-right: 1px solid var(--border-color);
  padding-right: 2rem;
  margin-bottom: 2rem;
}

/* Tablet/Narrow Desktop: Disable sticky sidebar to prevent overlap */
@media (max-width: 1024px) {
  .sidebar {
    position: static;
    top: auto;
    border-right: 1px solid var(--border-color);
    padding-right: 2rem;
    margin-bottom: 2rem;
  }
}

/* Mobile: Disable sticky sidebar */
@media (max-width: 768px) {
  .sidebar {
    position: static;
    top: auto;
    border-right: 1px solid var(--border-color);
    padding-right: 2rem;
    margin-bottom: 2rem;
  }
}

/* Smooth transitions */
* {
  transition: color 0.2s ease, background-color 0.2s ease;
}

/* Subscribe Section (Optional) */
.subscribe-section {
  background-color: var(--light-gray);
  padding: 3rem 2rem;
  text-align: center;
  margin: 3rem 0;
  border-radius: 8px;
}

.subscribe-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.subscribe-section input {
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-right: 0.5rem;
}

.subscribe-section button {
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.3s ease;
}

.subscribe-section button:hover {
  opacity: 0.8;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.feature-card {
  background: #fff;
  padding: 2rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.3rem;
  margin: 1rem 0;
  color: var(--text-color);
}

.feature-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #666;
  margin: 0;
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.category-card {
  background: #fff;
  padding: 2rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.category-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.category-card h3 {
  font-size: 1.3rem;
  margin: 1rem 0;
  color: var(--text-color);
}

.category-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #666;
  margin: 0;
}

/* =====================================================
   POST CONTACT FORM + SUBSTACK (FINAL RESPONSIVE CSS)
   Safe for Minimal Mistakes & GitHub Pages
===================================================== */

/* SECTION BELOW POST */
.post-form-section {
  clear: both;
  width: 100%;
  margin: clamp(3rem, 6vw, 5rem) 0;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* CONTACT FORM */
.post-contact-form {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2rem);
  background-color: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-sizing: border-box;
}

/* FORM LABELS */
.post-contact-form label {
  display: block;
  margin-bottom: 1rem;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  font-weight: 500;
  color: #222;
}

/* INPUTS & TEXTAREA */
.post-contact-form input,
.post-contact-form textarea {
  width: 100%;
  padding: clamp(0.65rem, 2.5vw, 0.8rem);
  margin-top: 0.25rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  box-sizing: border-box;
  background-color: #fff;
}

/* TEXTAREA */
.post-contact-form textarea {
  min-height: clamp(110px, 25vw, 140px);
  resize: vertical;
}

/* FORCE BUTTON STYLE (THE IMPORTANT FIX) */
.post-contact-form button,
.post-contact-form button[type="submit"] {
  display: inline-block;
  appearance: none;
  -webkit-appearance: none;
  margin-top: 1.2rem;
  padding: 0.75rem 1.5rem;
  background-color: #000000 !important;
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: 500;
  border: none !important;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.2;
  text-align: center;
}

/* BUTTON HOVER (DESKTOP ONLY) */
@media (hover: hover) {
  .post-contact-form button:hover {
    background-color: #333333 !important;
  }
}

/* REMOVE FOCUS OUTLINE */
.post-contact-form button:focus {
  outline: none;
}

/* ===============================
   SUBSTACK EMBED (BELOW FORM)
================================ */

.substack-embed-wrapper {
  width: 100%;
  max-width: 480px;
  margin: 3rem auto 0;
  box-sizing: border-box;
}

/* RESPONSIVE IFRAME */
.substack-embed-wrapper iframe {
  width: 100%;
  height: 320px;
  border: 1px solid #eeeeee;
  background-color: #ffffff;
  border-radius: 12px;
}

/* MOBILE ADJUSTMENT */
@media (max-width: 480px) {
  .substack-embed-wrapper iframe {
    height: 280px;
  }
}

/* Space between social share and contact form */
.page__share,
.social-share,
.share {
  margin-bottom: 3rem;
}
