* { box-sizing: border-box; }

/* Full-height layout */
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  display: flex;                 /* flex column page */
  flex-direction: column;
  min-height: 100vh;             /* stretch to viewport */
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header { background: var(--header-bg); color: var(--header-text); box-shadow: 0 1px 0 var(--border); }
.site-header .inner, .site-main .inner, .site-footer .inner {
  max-width: var(--maxw);
  padding: 20px var(--pad);
  margin: 0 auto;
}

/* Main grows to push footer down */
.site-main { flex: 1 0 auto; display: block; }

/* Footer stays at the bottom when content is short */
.site-footer { background: var(--footer-bg); color: var(--footer-text); box-shadow: inset 0 1px 0 var(--border); margin-top: auto; }

.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; justify-content: var(--brand-align); gap: 12px; flex: 1; }
.brand .logo { max-height: 36px; }
.brand .title { font-weight: 700; font-size: 20px; color: var(--header-text); }
.nav { display: flex; gap: 16px; }
.nav a { color: var(--header-text); font-weight: 500; }

.hero { display: grid; place-items: center; padding: 48px var(--pad); background: var(--hero-bg); color: var(--hero-text); text-align: center; }
.hero .title { font-size: 32px; margin: 0 0 8px 0; }
.hero .subtitle { margin: 0 0 16px 0; opacity: 0.9; }
.hero .cta { display: inline-block; padding: 10px 16px; border-radius: 8px; background: var(--link); color: white; font-weight: 600; }

.section { display: flex; align-items: center; justify-content: center; padding: var(--space) var(--pad); }
.card {
  width: 100%;
  max-width: var(--maxw);
  background: var(--content-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  text-align: center;
}
.card h1 { margin: 0 0 12px 0; }
.card p { margin: 0.5rem 0; }

.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.powered-by { font-size: 12px; opacity: 0.7; }
.powered-by a { color: inherit; }

/* Header two-column layout with alignment toggle */
.header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.header-row .brand {
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.header-row .nav { display: inline-flex; gap: 16px; }

/* Right-aligned nav (default) */
.header-row.nav-right .nav { grid-column: 3; justify-self: end; }
/* Centered nav */
.header-row.nav-center .nav { grid-column: 2; justify-self: center; }

/* Logo link */
.brand-link { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-link:hover { text-decoration: none; }

/* Categories grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.cat-card {
  background: var(--content-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cat-title { margin: 0 0 8px 0; font-size: 18px; }
.cat-desc { margin: 0 0 12px 0; opacity: 0.9; }
.cat-cta { font-weight: 600; }

/* Sections grid */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  align-items: stretch;
}
.sec-card {
  background: var(--content-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sec-title { margin: 0 0 8px 0; font-size: 18px; }
.sec-desc { margin: 0 0 12px 0; opacity: .9; }
.sec-cta { font-weight: 600; }

/* Article list (global reset; we override on section page below) */
.article-list { list-style: none; padding: 0; margin: 16px 0; }
.article-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.article-list li:last-child { border-bottom: 0; }

/* Requests table */
.requests-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.requests-table th, .requests-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.requests-table th { font-weight: 600; }
.card.muted { opacity: .85; }

/* Enforce multi-column sections grid at larger widths */
.sections-grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
@media (min-width: 720px) { .sections-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .sections-grid { grid-template-columns: repeat(3, 1fr); } }

/* remove legacy category list spacing that might collapse grid */
.category-list, .blocks-list { display: none !important; }

/* Hero CTA */
.hero .button {
  display: inline-block;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(45deg, #0070f3 0%, #00c6ff 100%);
  transition: all 0.3s ease;
  text-decoration: none;
}
.hero .button:hover { background: linear-gradient(45deg, #00c6ff 0%, #0070f3 100%); }

/* --- Request Form Styling --- */
.request-form { max-width: 800px; margin: 40px auto; padding: 32px; background: #fff; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.request-form h1 { text-align: center; font-size: 28px; font-weight: 700; margin-bottom: 24px; color: #0a1a2f; }
.request-form label { display: block; font-weight: 600; margin: 12px 0 6px; color: #222; }
.request-form input[type="text"], .request-form textarea, .request-form input[type="file"], .request-form select {
  width: 100%; padding: 12px 14px; border: 1px solid #ccd3dc; border-radius: 8px; font-size: 15px; margin-bottom: 16px; transition: border-color 0.2s ease;
}
.request-form input[type="text"]:focus, .request-form textarea:focus, .request-form select:focus {
  outline: none; border-color: #0070f3; box-shadow: 0 0 0 2px rgba(0,112,243,0.1);
}
.request-form .upload-dropzone { padding: 16px; border: 2px dashed #ccd3dc; border-radius: 8px; text-align: center; color: #666; margin-bottom: 20px; transition: border-color 0.3s ease; }
.request-form .upload-dropzone:hover { border-color: #0070f3; color: #0070f3; }
.request-form input[type="submit"], .request-form button {
  display: inline-block; padding: 12px 28px; font-size: 16px; font-weight: 600; color: #fff; border: none; border-radius: 8px; cursor: pointer;
  background: linear-gradient(45deg, #0070f3 0%, #00c6ff 100%); transition: all 0.3s ease;
}
.request-form input[type="submit"]:hover, .request-form button:hover { background: linear-gradient(45deg, #00c6ff 0%, #0070f3 100%); }

/* ===================== */
/* Fixed header + offset */
/* ===================== */

:root { --header-h: 64px; } /* adjust if your header is taller/shorter */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
}
.site-main { padding-top: var(--header-h); }

/* ===================== */
/* Request view tweaks   */
/* ===================== */

.request-view .card { text-align: left; } /* override global center */
.request-view .card--header h1 { text-align: center; }

.request-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.request-subject { margin: 0; }
.request-meta { display: flex; align-items: center; gap: 8px; opacity: .9; }
.request-id { color: #667085; font-size: 14px; }
.request-desc { margin-top: 12px; white-space: pre-wrap; line-height: 1.55; }

.card--thread .thread { list-style: none; padding: 0; margin: 0; }
.card--thread .post + .post { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.post-head { display: flex; justify-content: space-between; gap: 8px; }
.post-time { opacity: .75; }
.post-body {
  margin-top: 8px; white-space: pre-wrap; line-height: 1.55;
  background: #f6f8fa; border: 1px solid var(--border); border-radius: 8px; padding: 12px;
}

/* Status badge */
.status-label {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1; text-transform: capitalize;
  border: 1px solid transparent;
}
.status-open    { background:#e6f0ff; color:#0450c8; border-color:#99c2ff; }
.status-pending { background:#fff4e5; color:#b36b00; border-color:#ffd699; }
.status-solved  { background:#e6ffed; color:#087443; border-color:#99e6b3; }
.status-closed  { background:#f2f2f2; color:#555;    border-color:#ddd; }

/* Status badge next to logo */
.brand { display:flex; align-items:center; gap:12px; flex:1; }
.status-embed--brand { display:inline-flex; align-items:center; margin-left:8px; }
.status-embed--brand iframe { width:250px; height:30px; border:0; }

@media (max-width: 1100px) { .status-embed--brand { transform: scale(.9); transform-origin: left center; } }
@media (max-width: 900px)  { .status-embed--brand { transform: scale(.8); } }
@media (max-width: 720px)  { .status-embed--brand { display:none; } }  /* optional: hide on phones */

/* ===================== */
/* Article & Section UI  */
/* ===================== */

/* toolbars */
.page-toolbar { margin-bottom: 10px; font-weight: 600; }
.page-toolbar a { text-decoration: none; }
.page-toolbar a:hover { text-decoration: underline; }
.page-toolbar .sep { margin: 0 6px; opacity: .6; }

/* undo global centering on these pages */
.article-view .section,
.section-view .section { justify-content: flex-start; align-items: flex-start; }

.article-view .card,
.section-view .card { text-align: left !important; }

/* reading rhythm */
.article-view .article-title { margin: 0 0 12px 0; }
.article-view .article-body { line-height: 1.65; }

/* bullets on section page (override global reset) */
.section-view .article-list { list-style: disc !important; padding-left: 1.25rem !important; margin: 16px 0; }
.section-view .article-list li { margin: 8px 0; }
.section-view .article-list a { text-decoration: none; font-weight: 600; }
.section-view .article-list a:hover { text-decoration: underline; }

/* Auto-growing request description field */
#request_description,
textarea[name="request[description]"] {
  overflow-y: hidden;
  resize: none; /* Optional: prevents manual drag-resize so auto-resize looks cleaner */
}

/* Make description textarea match Subject input styling */
#request_description,
textarea[name="request[description]"] {
  font-family: inherit;          /* this ensures perfect matching */
  font-size: inherit;            /* inherits from form styling */
  line-height: 1.6;   

  padding: 14px 16px;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  background: #ffffff;
  overflow-y: hidden;
}

/* Optional: add focus style to match inputs */
#request_description:focus,
textarea[name="request[description]"]:focus {
  border-color: #409cff;
  box-shadow: 0 0 0 3px rgba(64, 156, 255, 0.2);
  outline: none;
}

