/* Ritual Stencil - styled after thebooniestattoo.com:
   black + deep red, Fjalla One uppercase headings, Open Sans body,
   blackletter wordmark, rounded red outline buttons. Fonts are OFL, served locally. */
@font-face { font-family: "Fjalla One"; src: url("fonts/FjallaOne-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("fonts/OpenSans-Variable.ttf") format("truetype"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Blackletter"; src: url("fonts/UnifrakturMaguntia-Book.ttf") format("truetype"); font-display: swap; }

:root {
  --black: #000000;
  --char: #161616;
  --char-2: #1f1f1f;
  --line: #2e2e2e;
  --red: #c70000;
  --red-bright: #eb0202;
  --white: #ffffff;
  --muted: #a8a8a8;
  --error: #ff5a4a;
  --head: "Fjalla One", "Arial Narrow", Arial, sans-serif;
  --body: "Open Sans", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; background: var(--black); }
body { color: var(--white); font-family: var(--body); font-size: 15px; line-height: 1.6; }
::selection { background: var(--red); color: var(--white); }
a { color: var(--white); }

h1, h2, legend, .btn, .site-nav, .edit__label, .admin-table th {
  font-family: var(--head);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

/* ---- header / brand ---- */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 2rem;
  background: var(--black);
  border-bottom: 1px solid var(--char-2);
}
.brand { grid-column: 2; display: flex; flex-direction: column; align-items: center; text-decoration: none; line-height: 1; }
.brand-name { font-family: var(--brand, "Blackletter"), serif; font-size: 2.6rem; color: var(--white); letter-spacing: 0.01em; }
.brand-name.small { font-size: 1.5rem; }
.brand-sub { margin-top: 0.35rem; font-size: 0.72rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--white); }
.site-nav { grid-column: 3; justify-self: end; display: flex; gap: 1.4rem; align-items: center; font-size: 0.85rem; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { color: var(--red-bright); }
.site-nav .who { color: var(--muted); text-transform: none; font-family: var(--body); letter-spacing: 0; }

/* ---- full-width bands ---- */
.band { padding: 3.2rem 1.5rem; text-align: center; }
.band-black { background: var(--black); }
.band-red { background: var(--band, var(--red)); }
.band-char { background: var(--char); }
.band h1 { font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.15; }
.band p { max-width: 640px; margin: 0.9rem auto 0; color: #e6e6e6; letter-spacing: 0.04em; font-size: 1.05rem; }
.intro { padding-bottom: 2.4rem; }
h2 { font-size: 1.25rem; margin-bottom: 1.2rem; }

/* ---- tool layout ---- */
main {
  display: grid;
  grid-template-columns: minmax(300px, 440px) 1fr;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.panel { background: var(--char); border: 1px solid var(--char-2); padding: 1.6rem; }

.drop {
  display: flex; align-items: center; justify-content: center;
  min-height: 190px; margin-bottom: 1.4rem; padding: 0.75rem;
  border: 2px dashed #444; color: var(--muted); text-align: center; cursor: pointer;
  overflow: hidden; transition: border-color 0.2s, background 0.2s;
}
.drop:hover, .drop.over { border-color: var(--red); color: var(--white); background: rgba(199, 0, 0, 0.08); }
.drop input { display: none; }
.drop img { max-width: 100%; max-height: 320px; display: block; }

fieldset { border: 0; margin: 0 0 1.2rem; }
legend { font-size: 0.85rem; color: var(--white); margin-bottom: 0.45rem; }
legend output { color: var(--red-bright); margin-left: 0.4rem; font-family: var(--body); text-transform: none; letter-spacing: 0; }
fieldset label { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 1rem 0.3rem 0; cursor: pointer; }
input[type="radio"], input[type="checkbox"], input[type="range"] { accent-color: var(--red); }
input[type="range"] { width: 100%; }
.swatch { width: 13px; height: 13px; display: inline-block; border: 1px solid #555; }
.check { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1.4rem; cursor: pointer; }

/* ---- buttons (rounded, like "SEE OUR WORK") ---- */
.btn, button {
  display: inline-block; width: 100%;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid var(--red);
  background: transparent; color: var(--red-bright);
  font-family: var(--head); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.12em;
  text-align: center; text-decoration: none; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-solid { background: var(--red); color: var(--white); }
.btn:hover:not(:disabled), button:hover:not(:disabled) { background: var(--red-bright); border-color: var(--red-bright); color: var(--white); }
button:disabled { opacity: 0.35; cursor: not-allowed; }
.band-red .btn, .band-red button { border-color: var(--white); color: var(--white); }
button.mini { width: auto; padding: 0.35rem 0.95rem; font-size: 0.75rem; }

.status { min-height: 1.4em; margin-top: 0.9rem; color: var(--muted); font-size: 0.9rem; }
.status.error, .auth-msg.error { color: var(--error); }
.note { color: var(--muted); font-size: 0.82rem; }
.note b { color: var(--white); font-weight: 600; }
.rerender-box { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.9rem; }

/* ---- result ---- */
.result { display: flex; flex-direction: column; gap: 1rem; }
.checker {
  position: relative;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #ececec 25%, transparent 25%),
    linear-gradient(-45deg, #ececec 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ececec 75%),
    linear-gradient(-45deg, transparent 75%, #ececec 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.checker img { width: 100%; display: block; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.75rem; }

.edit { display: flex; flex-direction: column; gap: 0.6rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.edit__label { font-size: 0.95rem; }
textarea, .auth-form input:not([type="hidden"]) {
  width: 100%; padding: 0.7rem 0.85rem;
  background: var(--black); border: 1px solid #3a3a3a; border-radius: 4px;
  color: var(--white); font: inherit; resize: vertical;
}
textarea::placeholder, input::placeholder { color: #777; }
textarea:focus, .auth-form input:focus { outline: none; border-color: var(--red); }

/* ---- compare ---- */
.compare-bar { display: flex; flex-direction: column; gap: 0.5rem; }
.compare-bar .check { margin-bottom: 0; }
.compare-controls { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.85rem; }
.compare-controls input[type="range"] { flex: 1; min-width: 120px; }
.compare-controls .end, .align-controls > .end { color: var(--muted); }
.compare-controls .seg { display: inline-flex; gap: 0.8rem; margin-right: 0.4rem; }
.compare-controls .seg label { display: inline-flex; gap: 0.3rem; align-items: center; cursor: pointer; }
.align-controls { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.8rem; }
.al-row { display: grid; grid-template-columns: 9.5rem 4.5rem 1fr 4.5rem; align-items: center; gap: 0.5rem; }
.al-name { color: var(--white); }
.al-end { color: var(--muted); text-align: center; white-space: nowrap; }
.align-controls button.mini { align-self: flex-start; }
.stack { position: relative; overflow: hidden; }
.stack #photo-under { width: 100%; display: block; transform-origin: 50% 50%; }
.stack.comparing #result { position: absolute; inset: 0; width: 100%; height: 100%; }
.stack.comparing.wiping::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: var(--wipe, 50%);
  width: 2px; background: var(--red-bright); pointer-events: none;
}

/* ---- gallery (red band) ---- */
.gallery-wrap { padding: 3rem 1.5rem; }
.gallery-wrap h2 { font-size: 1.4rem; }
.gallery-wrap .note { color: #ffd9d9; }
.gallery { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.card {
  display: flex; flex-direction: column; gap: 0.5rem; width: 100%;
  padding: 0; border: 0; border-radius: 0; background: var(--black); color: #ddd;
  font-family: var(--body); font-size: 0.78rem; text-transform: none; letter-spacing: 0; text-align: left;
}
.card img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; }
.card span { padding: 0 0.6rem 0.6rem; }
.band-red .card:hover { background: var(--black); color: var(--white); box-shadow: 0 0 0 2px var(--white); }

.site-footer {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  padding: 2.4rem 1rem; background: var(--char); color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em;
}

/* ---- account pages ---- */
main.auth { display: flex; justify-content: center; padding: 2.5rem 1.5rem 4rem; }
.auth-panel { width: min(100%, 480px); }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form label { display: flex; flex-direction: column; gap: 0.35rem; color: var(--muted); font-size: 0.85rem; }
.links { font-size: 0.82rem; color: var(--muted); }
.links a, .table-wrap a { color: var(--red-bright); }
.auth-msg { min-height: 1.4em; margin-top: 1rem; color: var(--muted); }
.banner { margin-bottom: 1.2rem; padding: 0.7rem 0.9rem; border-left: 3px solid var(--red); background: var(--black); }
.pending h2 { font-size: 1.6rem; margin-bottom: 0; }

/* ---- admin ---- */
.admin-wrap { max-width: 1400px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.admin-wrap > .panel { margin-bottom: 1.5rem; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { color: var(--muted); font-size: 0.8rem; }
.admin-table td a { word-break: break-all; }
.admin-table button.mini { margin: 0 0.4rem 0.3rem 0; }
.status-pending { color: var(--red-bright); font-weight: 700; }
.status-rejected, .status-disabled { color: var(--muted); text-decoration: line-through; }
.mail { border-top: 1px solid var(--line); padding: 0.8rem 0; }
.mail-subject { margin: 0.2rem 0; }
.mail pre { white-space: pre-wrap; word-break: break-all; color: var(--muted); font: inherit; font-size: 0.82rem; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: #333; }

@media (max-width: 860px) {
  .site-header { grid-template-columns: 1fr; gap: 0.8rem; padding: 1rem; }
  .brand, .site-nav, .site-menu { grid-column: 1; justify-self: center; }
  .brand { grid-row: 1; }
  .site-menu { grid-row: 2; }
  .site-nav { grid-row: 3; flex-wrap: wrap; justify-content: center; }
  main { grid-template-columns: 1fr; padding: 0 0.9rem 2rem; }
  .panel { padding: 1.2rem; }
  .band { padding: 2.2rem 1rem; }
}
@media (max-width: 600px) {
  .al-row { grid-template-columns: 4.5rem 1fr 4.5rem; }
  .al-name { grid-column: 1 / -1; }
}

/* ================= CMS-driven parts ================= */
.site-menu { grid-column: 1; grid-row: 1; justify-self: start; display: flex; gap: 1.4rem; flex-wrap: wrap;
  font-family: var(--head); text-transform: uppercase; letter-spacing: 0.09em; font-size: 0.85rem; }
.site-menu a { text-decoration: none; }
.site-menu a:hover { color: var(--red-bright); }
.brand { grid-row: 1; }
.site-nav { grid-row: 1; }
.brand-logo { display: block; max-height: 64px; max-width: 280px; }
.brand-logo.small { max-height: 40px; }
.nav-cta { border: 1.5px solid var(--red); border-radius: 999px; padding: 0.3rem 0.9rem; color: var(--red-bright) !important; }
.nav-cta:hover { background: var(--red-bright); color: var(--white) !important; }
.footer-menu { display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center; }
.footer-menu a { color: var(--muted); text-decoration: none; }
.footer-menu a:hover { color: var(--white); }
.btn-inline { width: auto; }
.hero-cta { margin-top: 1.6rem !important; }
.draft-banner { background: #ffb000; color: #000; text-align: center; padding: 0.5rem; font-size: 0.85rem; }
.draft-banner a { color: #000; font-weight: 700; }

/* page content written in the editor */
.content { max-width: 820px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; font-size: 1.05rem; line-height: 1.75; }
.content h2, .content h3, .content h4 { font-family: var(--head); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 400; margin: 2rem 0 0.8rem; }
.content h2 { font-size: 1.6rem; }
.content h3 { font-size: 1.25rem; }
.content p, .content ul, .content ol, .content blockquote, .content pre { margin-bottom: 1rem; }
.content ul, .content ol { padding-left: 1.6rem; }
.content li { margin-bottom: 0.35rem; }
.content a { color: var(--red-bright); }
.content img { max-width: 100%; height: auto; display: block; margin: 1.5rem auto; }
.content blockquote { border-left: 3px solid var(--red); padding: 0.4rem 1rem; color: var(--muted); }
.content .ql-align-center { text-align: center; }
.content .ql-align-right { text-align: right; }
.content .ql-align-justify { text-align: justify; }
.content .ql-indent-1 { padding-left: 2em; } .content .ql-indent-2 { padding-left: 4em; }

/* site editor */
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: 0.55rem 1.1rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none;
  font-family: var(--head); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.82rem; color: var(--muted); }
.tabs a.active, .tabs a:hover { border-color: var(--red); color: var(--white); background: var(--red); }
.toast { position: sticky; top: 0.6rem; z-index: 20; margin-bottom: 1rem; padding: 0.7rem 1rem;
  background: var(--white); color: #000; border-left: 4px solid #2a9d3a; font-weight: 600; }
.toast.error { border-left-color: var(--error); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.row-between h2 { margin: 0; }
.back-link { color: var(--muted); font-size: 0.9rem; }
.cms-form, .tab { display: flex; flex-direction: column; gap: 1rem; }
.cms label, .cms-form label { display: flex; flex-direction: column; gap: 0.35rem; color: var(--muted); font-size: 0.85rem; }
.cms input:not([type="color"]):not([type="file"]):not([type="radio"]):not([type="checkbox"]), .cms select, .cms textarea {
  width: 100%; padding: 0.6rem 0.75rem; background: var(--black); border: 1px solid #3a3a3a; border-radius: 4px;
  color: var(--white); font: inherit; font-size: 0.95rem; }
.cms input:focus, .cms select:focus, .cms textarea:focus { outline: none; border-color: var(--red); }
.cms input:disabled { opacity: 0.5; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.slug-row { display: flex; align-items: center; gap: 0.3rem; }
.hero-box { border: 1px solid var(--line); padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.editor-label { margin-bottom: -0.6rem; }
.form-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.5rem; }
.spaced { margin-top: 1.6rem; }
.spaced-sm { margin-top: 0.4rem; }
.btn.danger, button.danger { border-color: #555; color: var(--muted); }
.btn.danger:hover, button.danger:hover { background: var(--error) !important; border-color: var(--error) !important; color: #fff !important; }
.link-rows { display: flex; flex-direction: column; gap: 0.5rem; }
.link-row { display: grid; grid-template-columns: 1fr 2fr auto auto auto; gap: 0.5rem; align-items: center; }
.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.7rem; }
.color-field { flex-direction: row !important; align-items: center; gap: 0.6rem !important; color: var(--white) !important; }
.color-field input[type="color"] { width: 44px; height: 36px; padding: 0; border: 1px solid #444; background: none; cursor: pointer; }
.color-field .hex { width: 6.5rem !important; }
.font-preview { border: 1px solid var(--line); padding: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; background: var(--black); }
.fp-brand { font-size: 2.4rem; line-height: 1.1; }
.fp-head { font-size: 1.6rem; text-transform: uppercase; letter-spacing: 0.09em; }
.fp-body { font-size: 1rem; }
.text-group { font-family: var(--head); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 400; margin: 1.4rem 0 0.4rem; color: var(--white); }
.text-field { margin-bottom: 0.7rem; }
.text-field span { color: var(--white); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.media-item { background: var(--black); border: 1px solid var(--line); padding: 0.6rem; display: flex; flex-direction: column; gap: 0.4rem; }
.media-item img { width: 100%; aspect-ratio: 1; object-fit: contain; background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.media-item .note { word-break: break-all; }
.media-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.upload-btn { cursor: pointer; }
/* visual editor: a white "paper" area */
.cms .ql-toolbar.ql-snow { background: #f2f2f2; border-color: #3a3a3a; border-radius: 4px 4px 0 0; }
.cms .ql-container.ql-snow { background: #fff; color: #111; border-color: #3a3a3a; border-radius: 0 0 4px 4px;
  font-family: var(--body); font-size: 1rem; min-height: 320px; }
.cms .ql-editor { min-height: 320px; }
.cms .ql-editor h2, .cms .ql-editor h3 { font-family: var(--head); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 400; }
.cms .ql-snow .ql-tooltip { z-index: 5; }
.cms .ql-toolbar button { width: 28px; height: 24px; padding: 3px 5px; border: 0; border-radius: 0; background: none; }
.cms .ql-toolbar .ql-picker-label { border-radius: 0; color: #222; }
.cms .ql-toolbar button:hover:not(:disabled) { background: transparent; }
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .link-row { grid-template-columns: 1fr 1fr; }
}
