/* Dogma Cables — base layout, theme-agnostic.
   Themes are scoped to body class in themes.css and override these. */

:root {
  --bg: #f2ede3;
  --bg-alt: #ebe3d3;
  --header-bg: rgba(242, 237, 227, 0.92);
  --text: #3a2a1e;
  --text-muted: #6b5544;
  --accent: #b87333;
  --accent-strong: #8a4f1f;
  --border: rgba(58, 42, 30, 0.18);
  --shadow: rgba(58, 42, 30, 0.12);
  --wood-overlay: 0.06;
  --logo-filter: none;
  --header-height: 4.5rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at top, rgba(0, 0, 0, var(--wood-overlay)) 0%, transparent 70%),
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 3px,
      rgba(0, 0, 0, calc(var(--wood-overlay) * 0.5)) 3px,
      rgba(0, 0, 0, calc(var(--wood-overlay) * 0.5)) 4px
    ),
    repeating-linear-gradient(
      88deg,
      transparent 0px,
      transparent 80px,
      rgba(0, 0, 0, calc(var(--wood-overlay) * 0.8)) 80px,
      rgba(0, 0, 0, calc(var(--wood-overlay) * 0.8)) 81px
    );
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 1.2rem; }
h3 { font-size: 1.4rem; margin-bottom: 0.6rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent-strong);
}

/* ===== Sticky header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px var(--shadow);
}

.header-inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-logo {
  display: flex;
  align-items: center;
  border: none;
  flex-shrink: 0;
}

.header-logo:hover {
  border: none;
}

.header-logo img {
  height: 2.2rem;
  width: auto;
  filter: var(--logo-filter);
}

.main-nav {
  display: flex;
  gap: 1.8rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.main-nav a {
  color: var(--text);
  border-bottom: 2px solid transparent;
  padding: 0.3rem 0;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.main-nav a:hover {
  color: var(--accent);
  border-bottom-color: transparent;
}

.main-nav a.active {
  border-bottom-color: var(--accent);
  color: var(--accent-strong);
}

.theme-switcher {
  display: flex;
  gap: 0.3rem;
  font-family: 'Lora', serif;
  font-size: 0.85rem;
}

.theme-switcher button {
  padding: 0.35rem 0.7rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.theme-switcher button:hover {
  color: var(--text);
  border-color: var(--accent);
}

.theme-switcher button.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Mobile header */
@media (max-width: 720px) {
  .site-header {
    height: auto;
    padding: 0.6rem 0;
  }
  .header-inner {
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
  }
  .header-logo {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.3rem;
  }
  .header-logo img { height: 1.8rem; }
  .main-nav { gap: 1.2rem; font-size: 0.95rem; }
  .theme-switcher { width: 100%; justify-content: center; margin-top: 0.3rem; }
}

/* ===== Layout ===== */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 4.5rem 0;
}

section.with-divider {
  border-bottom: 1px solid var(--border);
}

/* ===== Hero (homepage) ===== */
.hero {
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
}

/* Hero with photographic background — only on index.html via .hero-image */
.hero-image {
  position: relative;
  background-image: url('../img/dogma-hero-bg.jpg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

.hero-image::before,
.hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Tema-tinted veil — picks up the body theme color */
.hero-image::before {
  background: var(--hero-veil, rgba(242, 237, 227, 0.2));
}

/* Bottom fade — blends image into the page background */
.hero-image::after {
  background: linear-gradient(180deg, transparent 15%, transparent 50%, var(--bg) 110%);
}

.hero-image .hero-inner {
  position: relative;
  z-index: 1;
}

/* Keep logo and tagline legible against the photo on darker themes */
body.theme-mid .hero-image .hero-logo,
body.theme-dark .hero-image .hero-logo {
  filter: var(--logo-filter) drop-shadow(0 2px 14px rgba(0, 0, 0, 0.6));
}

body.theme-mid .hero-image .hero-tagline,
body.theme-dark .hero-image .hero-tagline {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.hero-inner {
  max-width: 720px;
}

.hero-logo {
  max-width: 100%;
  width: 540px;
  height: auto;
  margin-bottom: 2rem;
  filter: var(--logo-filter);
}

.hero-tagline {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.hero-subtagline {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(0.85rem, 1.6vw, 1.15rem);
  color: var(--text-muted);
  margin-top: 2rem;
}

.hero-rule {
  width: 60px;
  height: 1px;
  background: var(--accent);
  border: none;
  margin: 2rem auto;
}

/* ===== Page header (sub-pages) ===== */
.page-header {
  text-align: center;
  padding: 4rem 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin-bottom: 0.5rem;
}

.page-header .subtitle {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.15rem;
}

/* ===== Quote ===== */
.quote {
  text-align: center;
  background: var(--bg-alt);
}

.quote blockquote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  line-height: 1.4;
  color: var(--text);
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.quote-attr {
  display: block;
  margin-top: 1.2rem;
  font-style: normal;
  font-family: 'Lora', serif;
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ===== About ===== */
.about p {
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
}

.about p:first-of-type::first-letter {
  font-family: 'Playfair Display', serif;
  font-size: 3.2rem;
  font-weight: 700;
  float: left;
  line-height: 0.9;
  margin: 0.2rem 0.5rem 0 0;
  color: var(--accent);
}

/* ===== Products / Cables ===== */
.products-list {
  list-style: none;
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.product-item {
  padding: 1.5rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
}

.product-item h3 {
  margin-bottom: 0.4rem;
  color: var(--text);
}

.product-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* ===== Contact form ===== */
.contact-intro {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.contact-form {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.contact-form label {
  font-family: 'Lora', serif;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  font-family: 'Lora', serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: border-color 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
  font-family: 'Lora', serif;
}

.contact-form button {
  padding: 0.9rem 2rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  justify-self: start;
  transition: background-color 0.2s ease;
}

.contact-form button:hover {
  background: var(--accent-strong);
}

.contact-direct {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.contact-direct strong {
  color: var(--text);
  font-weight: 600;
}

.form-status {
  text-align: center;
  font-size: 0.95rem;
  padding: 0.8rem;
  border-radius: 2px;
  display: none;
}

.form-status.success {
  display: block;
  background: rgba(184, 115, 51, 0.15);
  color: var(--accent-strong);
  border: 1px solid var(--accent);
}

.form-status.error {
  display: block;
  background: rgba(160, 40, 30, 0.15);
  color: #a0281e;
  border: 1px solid #a0281e;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 3rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--bg);
  border-top: 1px solid var(--border);
}

footer p {
  margin-bottom: 0.4rem;
}

footer a {
  color: var(--text-muted);
}

footer a:hover {
  color: var(--accent);
}

.footer-rule {
  width: 40px;
  height: 1px;
  background: var(--border);
  border: none;
  margin: 0 auto 1rem;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  body { font-size: 17px; }
  section { padding: 3.5rem 0; }
}
