/* ═══════════════════════════════════════════════════════════════════════
   InnoIT. — Main Stylesheet
   Colours: #ffffff, #000000, #ff4136
   Font:    Darker Grotesque
   ═══════════════════════════════════════════════════════════════════════ */

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

:root {
  --white: #ffffff;
  --black: #000000;
  --red: #ff4136;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  --font: 'Darker Grotesque', sans-serif;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 6px 10px rgba(0, 0, 0, 0.08);
  --transition: 0.2s ease;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-weight: 500;
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--black);
}

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

/* ── Container ─────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Accent ────────────────────────────────────────────────────────── */
.accent {
  color: var(--red);
}

.text-muted {
  color: var(--gray-500);
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.5rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn--primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.btn--primary:hover {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.btn--outline {
  background: transparent;
  color: var(--black);
  border-color: var(--black);
}

.btn--outline:hover {
  background: var(--black);
  color: var(--white);
}

.btn--danger {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.btn--danger:hover {
  background: #cc0000;
  border-color: #cc0000;
}

.btn--sm {
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
}

.btn--full {
  width: 100%;
}

/* ── Flash Messages ────────────────────────────────────────────────── */
.flash {
  padding: 0.8rem 1.5rem;
  font-weight: 600;
  text-align: center;
  animation: flashIn 0.3s ease;
}

.flash--success {
  background: #e6ffe6;
  color: #0a6b0a;
  border-bottom: 2px solid #0a6b0a;
}

.flash--error {
  background: #ffe6e6;
  color: var(--red);
  border-bottom: 2px solid var(--red);
}

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

/* ═══════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 2px solid var(--black);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.header__logo-img {
  height: 40px;
  width: auto;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header__link {
  color: var(--black);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition);
}

.header__link:hover,
.header__link--active {
  color: var(--black);
  border-bottom-color: var(--red);
}

.header__link--cta {
  background: var(--red);
  color: var(--white) !important;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  border-bottom: none;
}

.header__link--cta:hover {
  background: var(--black);
}

.header__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.header__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--black);
  transition: var(--transition);
}

@media (max-width: 768px) {
  .header__nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem;
    gap: 0;
    border-bottom: 2px solid var(--black);
  }

  .header__inner.open .header__nav {
    display: flex;
  }

  .header__link {
    padding: 0.8rem 0;
    width: 100%;
    text-align: center;
  }

  .header__burger {
    display: flex;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════════════ */
.hero {
  padding: 6rem 0;
  background: var(--black);
  color: var(--white);
}

.hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}

.hero__title {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
}

.hero__subtitle {
  font-size: 1.5rem;
  font-weight: 400;
  margin: 1rem 0 2rem;
  color: var(--gray-400);
}

.hero__image img {
  max-width: 280px;
  filter: brightness(0) invert(1);
  opacity: 0.15;
}

@media (max-width: 768px) {
  .hero {
    padding: 4rem 0;
  }

  .hero__title {
    font-size: 3rem;
  }

  .hero__image {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════════════════════════ */
.section {
  padding: 4rem 0;
}

.section__title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 2rem;
  position: relative;
}

.section__title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--red);
  margin-top: 0.5rem;
}

.section__action {
  text-align: center;
  margin-top: 2.5rem;
}

/* ── Page Header ───────────────────────────────────────────────────── */
.page-header {
  padding: 3rem 0;
  background: var(--black);
  color: var(--white);
}

.page-header__title {
  font-size: 2.5rem;
  font-weight: 900;
}

/* ═══════════════════════════════════════════════════════════════════════
   POST CARDS
   ═══════════════════════════════════════════════════════════════════════ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.post-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.post-card__image {
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--gray-100);
}

.post-card__image--placeholder {
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
}

.post-card__body {
  padding: 1.5rem;
}

.post-card__category {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red);
  margin-bottom: 0.5rem;
}

.post-card__title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

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

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

.post-card__excerpt {
  color: var(--gray-600);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--gray-500);
  font-weight: 600;
}

/* Horizontal card variant */
.post-card--horizontal {
  display: flex;
}

.post-card--horizontal .post-card__image {
  width: 280px;
  min-width: 280px;
  height: auto;
  min-height: 200px;
}

@media (max-width: 768px) {
  .post-card--horizontal {
    flex-direction: column;
  }

  .post-card--horizontal .post-card__image {
    width: 100%;
    min-width: 100%;
    height: 200px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   BLOG LAYOUT
   ═══════════════════════════════════════════════════════════════════════ */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
}

.blog-posts {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Sidebar ───────────────────────────────────────────────────────── */
.sidebar-widget {
  margin-bottom: 2rem;
}

.sidebar-widget__title {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--black);
}

.sidebar-widget__list {
  list-style: none;
}

.sidebar-widget__list li a {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  color: var(--gray-700);
  font-weight: 600;
  border-bottom: 1px solid var(--gray-100);
}

.sidebar-widget__list li a:hover,
.sidebar-widget__list li a.active {
  color: var(--red);
}

.sidebar-widget__list .count {
  color: var(--gray-400);
  font-weight: 400;
}

/* ── Tags ──────────────────────────────────────────────────────────── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.tag:hover,
.tag--active {
  background: var(--red);
  color: var(--white);
}

/* ── Pagination ────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 0;
  font-weight: 700;
}

.pagination__link {
  color: var(--black);
}

.pagination__link:hover {
  color: var(--red);
}

.pagination__info {
  color: var(--gray-500);
}

/* ═══════════════════════════════════════════════════════════════════════
   ARTICLE (Single Post)
   ═══════════════════════════════════════════════════════════════════════ */
.article__hero {
  height: 400px;
  background-size: cover;
  background-position: center;
  background-color: var(--gray-100);
}

.article__container {
  max-width: 800px;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.article__category {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red);
  margin-bottom: 0.5rem;
}

.article__title {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.article__meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 2rem;
}

.article__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.article__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.article__date {
  color: var(--gray-500);
  font-weight: 500;
}

.article__footer {
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 2px solid var(--gray-200);
}

.article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.article__back {
  margin-top: 2.5rem;
}

/* ── Prose (rendered markdown) ─────────────────────────────────────── */
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-weight: 800;
  margin: 1.8em 0 0.6em;
  line-height: 1.3;
}

.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.6rem; }
.prose h3 { font-size: 1.3rem; }

.prose p {
  margin-bottom: 1.2em;
}

.prose ul, .prose ol {
  margin-bottom: 1.2em;
  padding-left: 1.5em;
}

.prose li {
  margin-bottom: 0.3em;
}

.prose blockquote {
  border-left: 4px solid var(--red);
  padding-left: 1rem;
  margin: 1.5em 0;
  color: var(--gray-600);
  font-style: italic;
}

.prose code {
  background: var(--gray-100);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9rem;
}

.prose pre {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: 1.2rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5em 0;
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.prose img {
  border-radius: var(--radius);
  margin: 1.5em 0;
}

.prose a {
  color: var(--red);
  text-decoration: underline;
}

.prose hr {
  border: none;
  border-top: 2px solid var(--gray-200);
  margin: 2em 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   ABOUT PAGE
   ═══════════════════════════════════════════════════════════════════════ */
.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.about-text h2:first-child {
  margin-top: 0;
}

.about-text p {
  color: var(--gray-700);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.about-image img {
  width: 100%;
  border-radius: var(--radius);
}

@media (max-width: 768px) {
  .about-content {
    grid-template-columns: 1fr;
  }

  .about-image {
    order: -1;
    max-width: 200px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   ERROR PAGES
   ═══════════════════════════════════════════════════════════════════════ */
.error-page {
  text-align: center;
  padding: 6rem 0;
}

.error-page__code {
  font-size: 8rem;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
}

.error-page__message {
  font-size: 1.3rem;
  color: var(--gray-600);
  margin: 1rem 0 2rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  padding: 2rem;
}

.auth-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.auth-card__header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-card__logo {
  height: 50px;
  margin-bottom: 1rem;
}

.auth-card__header h1 {
  font-size: 1.5rem;
  font-weight: 800;
}

/* ═══════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════ */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

.form-group label small {
  font-weight: 400;
  color: var(--gray-500);
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--red);
}

.form-control--lg {
  font-size: 1.3rem;
  padding: 0.7rem 1rem;
  font-weight: 700;
}

.form-control--sm {
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
}

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

.inline-form {
  display: inline;
}

/* ═══════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════ */
.footer {
  background: var(--black);
  color: var(--gray-400);
  padding: 3rem 0;
  margin-top: 2rem;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.footer__logo {
  height: 35px;
  filter: brightness(0) invert(1);
  opacity: 0.6;
}

.footer__tagline {
  font-weight: 400;
  font-size: 0.95rem;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

.footer__links a {
  color: var(--gray-400);
  font-weight: 600;
}

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

.footer__copy {
  font-size: 0.85rem;
  color: var(--gray-600);
}

/* ═══════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius);
}

.badge--success {
  background: #e6ffe6;
  color: #0a6b0a;
}

.badge--draft {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ═══════════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

.modal__content {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  margin: 1rem;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal__header h3 {
  font-weight: 800;
}

.modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-500);
}

.modal__body {
  padding: 1.5rem;
}

.modal__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
