/* =========================================================================
   W. Lewis Frame n Door site styles: REPLICA of the 2006 lewisdoor.com
   design (client request, 2026-08-25). Navy page background, centered
   white rounded card, blue photo banner with red logo, segmented red nav
   bar, red-bordered content panels, red copyright footer bar.
   Modernized only where necessary: responsive layout, readable font
   sizes, accessible form states. Previous design archived in
   /archive-modern.
   ========================================================================= */

:root {
  --page-navy: #17366b;
  --red: #b5121b;
  --red-dark: #8e0d15;
  --red-border: #a51218;
  --banner-blue: #2b5f9e;
  --text: #333333;
  --text-soft: #555555;
  --link-blue: #1a3fa8;
  --line-gray: #cccccc;
  --panel-bg: #ffffff;

  --font-stack: Verdana, Tahoma, Geneva, Arial, sans-serif;
  --shell-width: 980px;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-stack);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--page-navy);
  padding: 22px 12px;
}

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

a {
  color: var(--link-blue);
}

h1, h2, h3 {
  font-family: var(--font-stack);
  color: var(--text);
  line-height: 1.25;
  margin: 0 0 0.6em;
}
h1 { font-size: 20px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }

p { margin: 0 0 1em; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- Shell: the centered white card ---------- */
.shell {
  max-width: var(--shell-width);
  margin: 0 auto;
  background: #ffffff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

/* ---------- Banner: original site artwork, client-provided ----------
   The artwork carries its own blue outline; a slight zoom clips the
   white edge baked into the source files so that outline reads as the
   border. */
.banner {
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--banner-blue);
}
.banner img {
  width: 100%;
  height: auto;
  display: block;
  transform: scale(1.04);
}

/* ---------- Nav: segmented red buttons ---------- */
.site-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.site-nav li { flex: 1; }
.site-nav a {
  display: block;
  background: var(--red);
  color: #ffffff;
  text-decoration: none;
  text-align: center;
  text-transform: lowercase;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}
.site-nav a:hover { background: var(--red-dark); }
.site-nav a.active {
  background: var(--red-dark);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.3);
}

/* ---------- Page title bar (old "About us" / "Products" strip) ---------- */
.title-bar {
  border: 1px solid var(--red-border);
  border-radius: 5px;
  padding: 6px 12px;
  margin: 10px 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: #ffffff;
}

/* ---------- Red-bordered content panel ---------- */
.red-panel {
  border: 1px solid var(--red-border);
  border-radius: 8px;
  background: var(--panel-bg);
  padding: 18px 20px;
}

/* Red bar strip (sidebar headers, footer) */
.red-bar {
  background: var(--red);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px 4px 0 0;
}

/* ---------- Home layout ---------- */
.home-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  margin-top: 10px;
  align-items: start;
}
.home-main.red-panel { text-align: center; }
.home-main .payment-note { font-weight: 700; margin-bottom: 0; }

.sidebar-box {
  border: 1px solid var(--red-border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 14px;
}
.sidebar-box .sidebar-body { padding: 12px; }
.sidebar-products {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sidebar-products a {
  display: block;
  border: 1px solid var(--line-gray);
  background: #f6f6f6;
}
.sidebar-products img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.sidebar-more {
  display: block;
  text-align: center;
  font-size: 12px;
  margin-top: 10px;
}
/* ---------- About layout ---------- */
.about-cols {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 20px;
  align-items: start;
}
.about-story-col p { margin-bottom: 1em; }

.ba-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.ba-cell figure { margin: 0; text-align: center; }
.ba-cell img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line-gray);
}
.ba-cell figcaption {
  font-size: 12px;
  margin-top: 5px;
  color: var(--text);
}

/* ---------- Products ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.filter-btn {
  font-family: var(--font-stack);
  font-size: 12px;
  font-weight: 700;
  background: var(--red);
  color: #ffffff;
  border: 0;
  border-radius: 4px;
  padding: 5px 14px;
  cursor: pointer;
}
.filter-btn:hover { background: var(--red-dark); }
.filter-btn.active {
  background: var(--red-dark);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.3);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.product-card {
  border: 1px solid var(--line-gray);
  background: #ffffff;
  padding: 8px;
}
.product-card .product-img {
  aspect-ratio: 4 / 3;
  background: #ffffff;
}
.product-card .product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.gallery-item {
  display: block;
  border: 1px solid var(--line-gray);
  background: #ffffff;
  padding: 0;
  cursor: zoom-in;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lightbox (modern convenience kept) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 20, 40, 0.9);
  padding: 4vmin;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(92vw, 1000px);
  max-height: 86vh;
  width: auto;
  height: auto;
  border: 3px solid #ffffff;
}
.lightbox button {
  position: absolute;
  background: var(--red);
  border: 0;
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--font-stack);
  font-size: 18px;
  font-weight: 700;
  width: 42px;
  height: 42px;
  cursor: pointer;
}
.lightbox button:hover { background: var(--red-dark); }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------- Contact ---------- */
.contact-cols {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.contact-photo img {
  width: 100%;
  border: 1px solid var(--line-gray);
}
.contact-panel.red-panel { padding: 20px 24px; }
.contact-block {
  text-align: center;
  margin-bottom: 18px;
}
.contact-block .lead { font-weight: 700; }
.contact-block .company { font-weight: 700; margin-bottom: 0; }
.contact-block p { margin: 0 0 2px; }
.contact-block .group { margin-top: 12px; }
.contact-block .group-label { font-weight: 700; }
.contact-block .phone-line { font-weight: 700; }

.contact-form .form-field { margin-bottom: 12px; }
.contact-form .form-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.contact-form label {
  font-size: 13px;
  padding-top: 6px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-stack);
  font-size: 13px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid #999999;
  border-radius: 2px;
  padding: 6px 8px;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--banner-blue);
  outline-offset: 0;
}
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form .field-error {
  display: none;
  color: var(--red);
  font-size: 11px;
  margin-top: 3px;
}
.contact-form .form-field.invalid input,
.contact-form .form-field.invalid textarea { border-color: var(--red); }
.contact-form .form-field.invalid .field-error { display: block; }

.form-actions { text-align: center; margin-top: 14px; }
.submit-btn {
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 700;
  background: var(--red);
  color: #ffffff;
  border: 0;
  border-radius: 4px;
  padding: 8px 28px;
  cursor: pointer;
}
.submit-btn:hover { background: var(--red-dark); }
.submit-btn:disabled { opacity: 0.6; cursor: default; }

.form-status {
  display: none;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid;
  border-radius: 4px;
}
.form-status.success {
  display: block;
  color: #14532d;
  background: #ecfdf3;
  border-color: #86efac;
}
.form-status.failure {
  display: block;
  color: var(--red-dark);
  background: #fef2f2;
  border-color: #fca5a5;
}

/* ---------- TODO-CONFIRM highlight (kept from demo build) ---------- */
.todo-confirm {
  background: #fff7d6;
  color: #7a5b00;
  border: 1px dashed #d3a900;
  padding: 0 4px;
  font-size: 0.95em;
  font-weight: 700;
  white-space: normal;
  word-break: break-word;
}

/* ---------- Photo admin (/admin) ---------- */
.admin-login { max-width: 420px; margin: 0 auto; }
.admin-login .form-field { margin-bottom: 12px; }
.admin-login label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.admin-login input {
  width: 100%;
  font-family: var(--font-stack);
  font-size: 13px;
  border: 1px solid #999999;
  border-radius: 2px;
  padding: 6px 8px;
}
.admin-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.admin-upload { margin-bottom: 16px; }
.admin-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.admin-upload-row select,
.admin-upload-row input[type="file"] {
  font-family: var(--font-stack);
  font-size: 13px;
  padding: 5px;
  border: 1px solid #999999;
  border-radius: 2px;
  background: #ffffff;
}
.admin-hint {
  font-size: 12px;
  color: var(--text-soft);
  margin: 10px 0 0;
}
.admin-section { margin-bottom: 18px; }
.admin-section .red-bar { border-radius: 4px 4px 0 0; }
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  border: 1px solid var(--line-gray);
  border-top: 0;
  padding: 12px;
}
.admin-card {
  border: 1px solid var(--line-gray);
  background: #ffffff;
  padding: 6px;
}
.admin-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f4f4f4;
}
.admin-card-name {
  font-size: 10px;
  color: var(--text-soft);
  margin: 5px 0;
  word-break: break-all;
}
.admin-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.admin-card-actions select {
  flex: 1;
  min-width: 0;
  font-family: var(--font-stack);
  font-size: 11px;
  padding: 3px;
}
.admin-delete {
  font-family: var(--font-stack);
  font-size: 11px;
  font-weight: 700;
  background: var(--red);
  color: #ffffff;
  border: 0;
  border-radius: 3px;
  padding: 4px 8px;
  cursor: pointer;
}
.admin-delete:hover { background: var(--red-dark); }

/* ---------- Footer: red copyright bar ---------- */
.footer-bar {
  background: var(--red);
  color: #ffffff;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 5px;
  margin-top: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .home-cols { grid-template-columns: 1fr; }
  .about-cols { grid-template-columns: 1fr; }
  .contact-cols { grid-template-columns: 1fr; }
  .contact-photo { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  body { padding: 10px 6px; }
  .shell { padding: 10px; }
  .banner img {
    min-height: 84px;
    object-fit: cover;
    object-position: left center;
  }
  .site-nav ul { flex-wrap: wrap; }
  .site-nav li { flex: 1 1 31%; }
  .contact-form .form-row { grid-template-columns: 1fr; gap: 2px; }
  .contact-form label { padding-top: 0; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
