/*
  Aligxo - Core styles
  Modern, minimal, carpenter-inspired palette.
*/

:root {
  --primary: #183C6E;
  --primary-dark: #0f2a4b;
  --accent: #c47a2c;
  --accent-soft: #f2e1cf;
  --danger: #b3261e;
  --ink: #0f1720;
  --muted: #6b7280;
  --bg: #f6f2ec;
  --surface: #ffffff;
  --border: #d6d1c8;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(15, 23, 32, 0.12);
  --max-width: 1140px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Montserrat", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(92%, var(--max-width));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  z-index: 999;
}

.skip-link:focus {
  left: 10px;
  top: 10px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 242, 236, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(24, 60, 110, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--primary);
}

.brand-logo {
  width: 150px;
  height: 60px;
}

.brand-logo.small {
  width: 75px;
  height: 32px;
}

.brand-name {
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  font-weight: 500;
  color: var(--primary-dark);
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle-bar {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--primary);
  margin: 5px 0;
  transition: transform 0.2s ease;
}

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

/* Hero */
.hero {
  background: linear-gradient(135deg, rgba(24, 60, 110, 0.12), rgba(196, 122, 44, 0.12));
  padding: 80px 0 60px;
}

.hero-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 3.4vw, 3.4rem);
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--primary-dark);
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.stat-number {
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.hero-card-content {
  padding: 18px 20px 22px;
}

.hero-card-content h3 {
  margin-bottom: 8px;
}

/* Sections */
.section {
  padding: 70px 0;
}

.section.alt {
  background: #fff8f0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 32px;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
  margin-bottom: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(15, 23, 32, 0.08);
}

.checklist,
.list {
  margin-top: 16px;
  padding-left: 18px;
}

.checklist li {
  margin-bottom: 10px;
}

.feature-grid {
  display: grid;
  gap: 16px;
}

.feature {
  background: var(--surface);
  border-radius: 14px;
  padding: 18px;
  border: 1px solid rgba(24, 60, 110, 0.08);
}

.values-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.value-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(24, 60, 110, 0.08);
}

/* Page hero */
.page-hero {
  padding: 60px 0 40px;
  background: linear-gradient(180deg, rgba(24, 60, 110, 0.12), rgba(246, 242, 236, 0.2));
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(24, 60, 110, 0.2);
}

.btn-ghost {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}

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

.btn:hover {
  transform: translateY(-2px);
}

.text-link {
  color: var(--primary);
  font-weight: 600;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
}

.chip-outline {
  background: transparent;
  border: 1px solid var(--border);
}

/* Product cards */
.product-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.product-card.muted {
  background: #f9f7f2;
  border: 1px dashed var(--border);
  box-shadow: none;
}

.product-content {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.product-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.product-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-bottom: 1px solid rgba(24, 60, 110, 0.1);
}

.product-hero-image {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Image placeholders */
.image-placeholder {
  width: 100%;
  min-height: 220px;
  background: repeating-linear-gradient(
      45deg,
      rgba(24, 60, 110, 0.08) 0,
      rgba(24, 60, 110, 0.08) 10px,
      rgba(196, 122, 44, 0.12) 10px,
      rgba(196, 122, 44, 0.12) 20px
    );
  border-bottom: 1px solid rgba(24, 60, 110, 0.1);
}

/* Gallery */
.gallery-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.gallery-item {
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(24, 60, 110, 0.1);
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  display: block;
}

.gallery-item figcaption {
  padding: 10px 14px 16px;
  color: var(--muted);
}

/* Videos */
.video-frame {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(24, 60, 110, 0.1);
  box-shadow: var(--shadow);
  background: #000;
}

.video-frame iframe,
.video-frame video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

/* Manual viewer */
.manual-viewer {
  margin-top: 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(24, 60, 110, 0.12);
  background: var(--surface);
  overflow: hidden;
  display: none;
}

.manual-viewer.is-open {
  display: block;
}

#manual:target .manual-viewer {
  display: block;
}

.manual-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(24, 60, 110, 0.1);
  background: #fdf8f2;
}

.manual-toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.manual-page {
  font-weight: 600;
  color: var(--primary-dark);
}

.manual-zoom {
  font-weight: 600;
  color: var(--muted);
}

.manual-frame {
  height: 680px;
  background: #f8f6f0;
  display: grid;
  align-items: stretch;
}

.manual-canvas-wrap {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 18px;
  display: grid;
  place-items: start center;
}

[data-manual-canvas] {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 32, 0.12);
  border: 1px solid rgba(24, 60, 110, 0.15);
}

.manual-fallback {
  padding: 16px;
  color: var(--muted);
  background: #fff;
}

/* Forms */
.contact-form,
.forum-form,
.comment-form {
  display: grid;
  gap: 16px;
}

.form-group {
  display: grid;
  gap: 8px;
}

input,
textarea {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(24, 60, 110, 0.3);
  border-color: var(--primary);
}

.form-status {
  min-height: 20px;
  color: var(--primary);
  font-weight: 600;
}

.small {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Forum */
.forum-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  align-items: start;
}

.forum-list-panel {
  gap: 20px;
}

.forum-detail-panel {
  gap: 18px;
}

.forum-header {
  display: flex;
  gap: 16px;
  align-items: center;
}

.forum-add {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 1.6rem;
  padding: 0;
}

.topic-list {
  display: grid;
  gap: 12px;
}

.topic-item {
  display: grid;
  grid-template-columns: 100px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(24, 60, 110, 0.1);
  background: #fff;
}

.topic-item.is-active {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(15, 23, 32, 0.08);
}

.topic-thumb {
  width: 100px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
  background: #f3efe8;
}

.topic-item h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.topic-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.topic-status.is-open {
  background: #e9f5ee;
  color: #1b5e3b;
}

.topic-status.is-closed {
  background: #f8e9e9;
  color: #8b1e1e;
}

.topic-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.topic-score {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.topic-open {
  white-space: nowrap;
}

.score-buttons {
  display: flex;
  gap: 8px;
}

.score-buttons button {
  border: 1px solid rgba(24, 60, 110, 0.12);
  background: #f8f6f0;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.forum-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.topic-body {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(24, 60, 110, 0.08);
}

.comment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.comment-list {
  display: grid;
  gap: 12px;
}

.comment {
  border-left: 3px solid var(--accent);
  background: #fdf8f2;
  padding: 10px 12px;
  border-radius: 10px;
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.comment-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.comment-image {
  margin-top: 8px;
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
  max-height: 240px;
}

.comment-reply {
  margin-left: 18px;
  border-left: 2px dashed rgba(24, 60, 110, 0.2);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 32, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal.is-open {
  display: flex;
}

.modal-card {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  width: min(92%, 520px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

  .topic-item {
    grid-template-columns: 80px 1fr;
  }

  .topic-score {
    grid-column: 1 / -1;
    align-items: flex-start;
  }

  .topic-open {
    grid-column: 1 / -1;
    justify-self: start;
  }
}
.auth-bar {
  margin-top: 20px;
  padding: 16px;
  border-radius: 14px;
  background: #fdf8f2;
  border: 1px solid rgba(24, 60, 110, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.auth-bar.is-hidden {
  display: none;
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.forum-panel {
  display: grid;
  gap: 16px;
}

.forum-header {
  margin-bottom: 12px;
}

.topic-list {
  display: grid;
  gap: 18px;
}

.topic-card {
  border: 1px solid rgba(24, 60, 110, 0.12);
  border-radius: 14px;
  padding: 18px;
  background: #fff;
  display: grid;
  gap: 12px;
}

.topic-actions {
  display: flex;
  justify-content: flex-end;
}

.topic-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.topic-body {
  color: #2f3845;
}

.comment-list {
  display: grid;
  gap: 12px;
}

.comment {
  border-left: 3px solid var(--accent);
  background: #fdf8f2;
  padding: 10px 12px;
  border-radius: 10px;
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.comment-form {
  margin-top: 8px;
  border-top: 1px solid rgba(24, 60, 110, 0.1);
  padding-top: 12px;
}

.note {
  color: var(--muted);
  margin-top: 12px;
}

/* Footer */
.site-footer {
  background: var(--primary-dark);
  color: #fff;
  padding: 50px 0;
}

.footer-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.footer-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.site-footer a {
  display: block;
  color: #fff;
  margin-bottom: 6px;
}

/* Responsive navigation */
@media (max-width: 900px) {
  .primary-nav {
    position: absolute;
    right: 4%;
    top: 70px;
    background: var(--surface);
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid rgba(24, 60, 110, 0.1);
    box-shadow: var(--shadow);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .primary-nav.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
  }

  .manual-frame {
    height: 520px;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 60px 0 40px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .manual-frame {
    height: 420px;
  }
}
