/**
 * Typoria Blog Platform
 * Main Stylesheet – Formal Professional Theme
 * Colors: Black, White, Deep Blue (#1B3A5C) & Olive (#6B7F3B)
 */

/* ─── CSS Variables ─────────────────────────────────────────────────────────── */
:root {
  --primary: #1B3A5C;
  --primary-hover: #142E49;
  --secondary: #6B7F3B;
  --accent: #8B9F5A;
  --dark: #111111;
  --light: #F7F8FA;
  --gray: #5A6B7A;
  --error: #C42B2B;
  --success: #2E7D32;
  --warning: #D4880F;
  --primary-rgb: 27, 58, 92;
  --secondary-rgb: 107, 127, 59;
  --accent-rgb: 139, 159, 90;
  --border-radius: 0.75rem;
  --transition: all 0.3s ease;
}

/* ─── Global Reset & Base ───────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  color: #1e293b;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #F7F8FA;
}

/* ─── Typography ────────────────────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  outline: none;
  text-decoration: none;
  gap: 0.5rem;
  font-family: "Inter", sans-serif;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.3);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.4);
}

.btn-secondary {
  background: white;
  color: var(--dark);
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: var(--light);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #A52222;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.03);
  border: 1px solid #e8ecf0;
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 4px 10px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

.card-featured {
  position: relative;
}

.card-featured::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  z-index: 1;
}

/* ─── Form Elements ─────────────────────────────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #d1d8e0;
  border-radius: var(--border-radius);
  font-size: 0.9375rem;
  transition: var(--transition);
  background: white;
  color: var(--dark);
  font-family: "Inter", sans-serif;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.form-input::placeholder {
  color: #8894a0;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  font-family: "Inter", sans-serif;
}

.form-label .required {
  color: var(--error);
  margin-left: 2px;
}

/* ─── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  border-left: 4px solid;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: #f0fdf4;
  border-color: var(--success);
  color: #166534;
}

.alert-error {
  background: #fef2f2;
  border-color: var(--error);
  color: #7f1d1d;
}

.alert-warning {
  background: #fffbeb;
  border-color: var(--warning);
  color: #78350f;
}

.alert-info {
  background: #eef3f9;
  border-color: var(--primary);
  color: #142E49;
}

/* ─── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  font-family: "Inter", sans-serif;
}

.badge-primary {
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #78350f;
}

.badge-danger {
  background: #fee2e2;
  color: #7f1d1d;
}

.badge-gray {
  background: #eef0f3;
  color: #475569;
}

/* ─── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease;
}
.animate-fade-up {
  animation: fadeUp 0.6s ease;
}
.animate-slide-down {
  animation: slideDown 0.3s ease;
}

/* ─── Loading Skeleton ──────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #eef0f3 25%, #d6dbe2 50%, #eef0f3 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius);
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #eef0f3;
}

::-webkit-scrollbar-thumb {
  background: #9AABB8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5A6B7A;
}

/* ─── Utilities ─────────────────────────────────────────────────────────────── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

/* ─── Responsive Utilities ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hide-mobile {
    display: none !important;
  }

  h1 {
    font-size: 1.75rem;
  }
  h2 {
    font-size: 1.5rem;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .hide-tablet {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ─── Print Styles ──────────────────────────────────────────────────────────── */
@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: white;
    color: black;
  }
  a {
    text-decoration: underline;
  }
}
