/* ===================================
   Маджима Никая — Книжный клуб
   Minimal, GDPR-friendly stylesheet
   No external fonts or resources
   =================================== */

/* --- Reset & Base --- */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  color: #2c1810;
  background-color: #f5f0eb;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Container --- */

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

/* --- Header --- */

.site-header {
  border-bottom: 1px solid #d4c4b0;
  padding: 1rem 0;
  background-color: #ede6dd;
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c1810;
  text-decoration: none;
  line-height: 1.3;
}

.site-title:hover {
  color: #8b5e3c;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1rem;
}

.nav-links a {
  color: #5a3e28;
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: #8b5e3c;
  text-decoration: underline;
}

/* --- Language Switcher --- */

.lang-switcher {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
}

.lang-switcher a {
  color: #8b5e3c;
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border: 1px solid #c4a882;
  border-radius: 3px;
  transition:
    background-color 0.15s,
    color 0.15s;
}

.lang-switcher a:hover {
  background-color: #8b5e3c;
  color: #fff;
}

.lang-current {
  padding: 0.2rem 0.5rem;
  background-color: #8b5e3c;
  color: #fff;
  border-radius: 3px;
  font-weight: 600;
}

/* --- Main Content --- */

main {
  flex: 1;
  padding: 2rem 0;
}

article h1 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: #2c1810;
  line-height: 1.3;
}

article h2 {
  font-size: 1.35rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #3d2415;
}

article h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #5a3e28;
}

article p {
  margin-bottom: 1rem;
}

article ul,
article ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

article li {
  margin-bottom: 0.35rem;
}

article a {
  color: #8b5e3c;
  text-decoration: underline;
  text-underline-offset: 2px;
}

article a:hover {
  color: #6b4530;
}

article hr {
  border: none;
  border-top: 1px solid #d4c4b0;
  margin: 2rem 0;
}

article strong {
  color: #2c1810;
}

article em {
  font-style: italic;
  color: #5a3e28;
}

/* --- Buttons --- */

.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  background-color: #8b5e3c;
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
  line-height: 1.4;
}

.btn:hover {
  background-color: #6b4530;
  color: #fff;
}

.btn:focus-visible {
  outline: 3px solid #c4a882;
  outline-offset: 2px;
}

.btn:disabled {
  background-color: #b8a090;
  cursor: not-allowed;
  opacity: 0.7;
}

/* --- Subscribe Page --- */

.subscribe-page h1 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: #2c1810;
}

.subscribe-page > p {
  margin-bottom: 1.5rem;
  color: #5a3e28;
}

/* --- Consent Form --- */

.consent-form {
  margin-top: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #3d2415;
}

.required {
  color: #a0522d;
}

.form-group input[type="text"],
.form-group input[type="email"] {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  color: #2c1810;
  background-color: #fff;
  border: 1px solid #c4a882;
  border-radius: 4px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus {
  outline: none;
  border-color: #8b5e3c;
  box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.2);
}

.form-group input[type="text"].input-error,
.form-group input[type="email"].input-error {
  border-color: #b33a3a;
}

.form-group input[type="text"].input-error:focus,
.form-group input[type="email"].input-error:focus {
  box-shadow: 0 0 0 3px rgba(179, 58, 58, 0.2);
}

/* --- Honeypot (hidden from humans) --- */

.form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* --- Checkboxes --- */

.checkbox-group {
  margin-bottom: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 400 !important;
  font-size: 0.9rem !important;
  color: #3d2415;
  line-height: 1.5;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  accent-color: #8b5e3c;
  cursor: pointer;
}

.checkbox-label a {
  color: #8b5e3c;
  text-decoration: underline;
}

.checkbox-label a:hover {
  color: #6b4530;
}

/* --- Field Errors --- */

.field-error {
  display: block;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: #b33a3a;
  margin-top: 0.25rem;
}

/* --- Form Messages --- */

.form-message {
  margin-top: 1rem;
  padding: 0;
  border-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.form-message:empty {
  display: none;
}

.form-message.msg-success {
  display: block;
  padding: 0.85rem 1rem;
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.form-message.msg-error {
  display: block;
  padding: 0.85rem 1rem;
  background-color: #fbe9e7;
  color: #b33a3a;
  border: 1px solid #ef9a9a;
}

/* --- Submit Button --- */

.btn-submit {
  margin-top: 0.5rem;
  width: 100%;
}

@media (min-width: 480px) {
  .btn-submit {
    width: auto;
    min-width: 200px;
  }
}

/* --- Footer --- */

.site-footer {
  border-top: 1px solid #d4c4b0;
  padding: 1.25rem 0;
  background-color: #ede6dd;
  margin-top: auto;
}

.site-footer .container {
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: #5a3e28;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #8b5e3c;
  text-decoration: underline;
}

.copyright {
  font-size: 0.8rem;
  color: #8a7565;
}

/* --- Responsive --- */

@media (max-width: 600px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .site-title {
    font-size: 1rem;
  }

  article h1,
  .subscribe-page h1 {
    font-size: 1.4rem;
  }

  article h2 {
    font-size: 1.15rem;
  }
}
