/*
 * main.css — Global layout and component styles
 * Loaded on every page.
 *
 * @package CyberSite
 */

/* ============================================================
   ARTICLE GRID LAYOUT
   ============================================================ */
.articles-grid {
  display: grid;
  gap: 1.5rem;
}

.articles-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

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

/* Image placeholder when no featured image is set */
.article-card__image--placeholder {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-border) 100%);
}

/* ============================================================
   ARTICLES LIST (homepage "More articles" section)
   ============================================================ */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.article-list-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.25rem;
  align-items: flex-start;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.article-list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.article-list-item--no-thumb {
  grid-template-columns: 1fr;
}

.article-list-item__image {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
}

.article-list-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-list-item__body {
  min-width: 0;
}

.article-list-item__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
  flex-wrap: wrap;
}

.article-list-item__title {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
  margin-bottom: 0.375rem;
}

.article-list-item__title a {
  color: var(--color-text);
  transition: color var(--transition);
}

.article-list-item__title a:hover {
  color: var(--color-accent);
}

/* ============================================================
   SECTION HEADER (title + "View all" link)
   ============================================================ */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-dark);
  gap: 1rem;
}

.section-header__title {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.section-header__link {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-accent);
  white-space: nowrap;
}

/* ============================================================
   SINGLE POST LAYOUT (content + sidebar)
   ============================================================ */
.single-wrap {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.single-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: flex-start;
}

.single-post {
  min-width: 0; /* prevent grid blowout */
}

/* ============================================================
   ARCHIVE PAGE
   ============================================================ */
.archive-hero {
  background: var(--color-dark);
  padding: 3.5rem 0;
  margin-bottom: 0;
}

.archive-hero__inner {
  max-width: 680px;
}

.archive-hero__eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.archive-hero__title {
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.archive-hero__desc {
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  line-height: 1.6;
}

/* ============================================================
   WIDGET
   ============================================================ */
.widget__title {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

/* ============================================================
   STATIC PAGE LAYOUT (page.php)
   ============================================================ */
.page-wrap {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.page-layout {
  max-width: 780px;
  margin: 0 auto;
}

.page-content__header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
}

.page-content__title {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--color-text);
}

.page-content__body h2,
.page-content__body h3,
.page-content__body h4 {
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 700;
  color: var(--color-text);
}

.page-content__body h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.page-content__body h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.page-content__body p {
  margin-bottom: 1rem;
  line-height: 1.8;
  color: var(--color-text);
}

.page-content__body ul,
.page-content__body ol {
  list-style: disc;
  margin: 0 0 1rem 1.5rem;
  line-height: 1.8;
}

.page-content__body ol {
  list-style: decimal;
}

.page-content__body li {
  margin-bottom: 0.375rem;
}

/* ============================================================
   MAILERLITE DARK CONTEXT OVERRIDES
   Uses #mlb2-39464546 to match MailerLite's own specificity.
   ============================================================ */
.footer-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper,
.sidebar-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper {
  background-color: transparent !important;
  border: none !important;
  width: 100% !important;
  max-width: 100% !important;
}

.footer-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody,
.sidebar-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody {
  padding: 0 !important;
}

.footer-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input,
.sidebar-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input {
  background-color: rgba(255,255,255,0.07) !important;
  border-color: rgba(255,255,255,0.15) !important;
  color: #ffffff !important;
}

.footer-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input::placeholder,
.sidebar-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input::placeholder {
  color: rgba(255,255,255,0.45) !important;
}

.footer-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button,
.sidebar-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button {
  background-color: #0066ff !important;
  border-color: #0066ff !important;
}

.footer-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button:hover,
.sidebar-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button:hover {
  background-color: #0050cc !important;
  border-color: #0050cc !important;
}

.footer-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody,
.sidebar-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody {
  padding: 0 !important;
}

.footer-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent h4,
.sidebar-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent h4 {
  color: #ffffff !important;
  font-size: 1rem !important;
}

.footer-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent p,
.sidebar-newsletter #mlb2-39464546.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent p {
  color: rgba(255,255,255,0.7) !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .articles-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .single-layout {
    grid-template-columns: 1fr;
  }

  .single-sidebar {
    order: -1; /* sidebar above on mobile */
  }
}

@media (max-width: 640px) {
  .articles-grid--3,
  .articles-grid--2 {
    grid-template-columns: 1fr;
  }

  .article-list-item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .article-list-item__image {
    display: none;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
