/*
 * Quark 2 — user customizations
 *
 * This file is safe to edit. It is loaded last so anything here overrides
 * theme.css without having to mark rules !important.
 */


/*  get rid of the kicker infront of the heading */
h1::before,
h2::before,
h3::before,
h4::before {
	display: none !important;
}
/* blog listing customisation - Important for zooming plugin to work!*/
article.card { overflow: visible !important; }
article.card:has(img[style*="transform"]) {
  transform: none !important;
  transition: none !important;
  box-shadow: none !important;
  position: relative;
  z-index: 999;
}
article.card:has(img[style*="transform"]) *:not(img) {
  transition: none !important;
}
/* pagination plugin customisation */
.pagination {
	flex-wrap: wrap;
}
/* increase header logo size */
header .logo img,
header .logo svg {
  height: 40px;
  /*padding-left: 50px;*/
}
img.float-right {
    float: right;
    margin: 0 0 1rem 1.5rem;
    max-width: 50%;
}

img.float-left {
    float: left;
    margin: 0 1.5rem 1rem 0;
    max-width: 50%;
}

@media (max-width: 600px) {
    img.float-right,
    img.float-left {
        float: none;
        display: block;
        margin: 0 auto 1rem;
        max-width: 100%;
    }
}

/* Contact Form wrapper */

#contact-form-wrapper {
  --cf-accent: #2563eb;
  --cf-text: #1f2937;
  --cf-muted: #6b7280;
  --cf-border: #d1d5db;
  --cf-border-hover: #9ca3af;
  --cf-bg: #fff;
  --cf-required: #dc2626;
  --cf-invalid: #dc2626;
  --cf-radius: 8px;
  --cf-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.2);
  --cf-btn-hover: brightness(0.92);

  max-width: 640px;
  margin: 2rem auto;            /* use "2rem auto" to centre */
  padding: 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--cf-text);
}

/* Form fields */
#contact-form-wrapper .form-field {
  margin-bottom: 1.25rem;
}

/* Labels */
#contact-form-wrapper .form-label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--cf-text);
}

/* Required asterisk */
#contact-form-wrapper .form-label .required {
  color: var(--cf-required);
  margin-left: 2px;
}

/* Wrappers */
#contact-form-wrapper .form-input-wrapper,
#contact-form-wrapper .form-textarea-wrapper {
  width: 100%;
}

/* Inputs and textarea */
#contact-form-wrapper .form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--cf-bg);
  color: var(--cf-text);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#contact-form-wrapper .form-input::placeholder {
  color: var(--cf-muted);
  opacity: 0.8;
}

#contact-form-wrapper .form-input:hover {
  border-color: var(--cf-border-hover);
}

/* Textarea */
#contact-form-wrapper .form-input.long {
  min-height: 180px;
  resize: vertical;
}

/* Focus */
#contact-form-wrapper .form-input:focus {
  border-color: var(--cf-accent);
  box-shadow: var(--cf-focus-ring);
  outline: none;
}

/* Submit button */
#contact-form-wrapper .button,
#contact-form-wrapper button[type="submit"],
#contact-form-wrapper input[type="submit"] {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--cf-accent);
  color: #fff;
  border: 0;
  border-radius: var(--cf-radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}

#contact-form-wrapper .button:hover,
#contact-form-wrapper button[type="submit"]:hover,
#contact-form-wrapper input[type="submit"]:hover {
  filter: var(--cf-btn-hover);
}

#contact-form-wrapper .button:active,
#contact-form-wrapper button[type="submit"]:active,
#contact-form-wrapper input[type="submit"]:active {
  transform: translateY(1px);
}

#contact-form-wrapper .button:focus-visible,
#contact-form-wrapper button[type="submit"]:focus-visible,
#contact-form-wrapper input[type="submit"]:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.4);
  outline-offset: 2px;
}

/* Validation (needs a placeholder attribute on the inputs) */
#contact-form-wrapper .form-input:not(:placeholder-shown):invalid {
  border-color: var(--cf-invalid);
}

/* Responsive */
@media (max-widtss: 800px) {
  #contact-form-wrapper {
    padding: 0 1rem;
  }
}

/* Dark mode */
html.dark #contact-form-wrapper {
  --cf-accent: #3b82f6;
  --cf-text: #d1d5db;
  --cf-label: #f3f4f6;
  --cf-muted: #9ca3af;
  --cf-border: #374151;
  --cf-border-hover: #4b5563;
  --cf-bg: rgba(255, 255, 255, 0.05);
  --cf-required: #f87171;
  --cf-invalid: #f87171;
  --cf-focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

html.dark #contact-form-wrapper .form-field .form-label {
  color: var(--cf-label);
}

html.dark #contact-form-wrapper .form-input:-webkit-autofill {
  -webkit-text-fill-color: var(--cf-text);
  box-shadow: 0 0 0 1000px #1f2937 inset;
}



/* 1. Light mode: Force normal colours */
.dark-mode-invert {
    opacity: 1 !important;
    filter: none !important;
    mix-blend-mode: normal !important;
}

/* 2. Dark mode: Only invert when the theme toggle is active */
.dark .dark-mode-invert,
[data-theme="dark"] .dark-mode-invert,
.dark-theme .dark-mode-invert {
    filter: invert(1) !important;
}

/* ===== Archives: collapsible Year > Month tree ===== */

/* Outer toggle ("Browse the archive") and "Older years" toggle */
.archives-all > summary,
.archives-older > summary {
    display: flex;
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.archives-all > summary::-webkit-details-marker,
.archives-older > summary::-webkit-details-marker,
.archives-tree .archive-year-toggle::-webkit-details-marker {
    display: none;
}

.archives-all > summary::before,
.archives-older > summary::before,
.archives-tree .archive-year-toggle::before {
    content: "\25B8"; /* ▸ */
    display: inline-block;
    flex: 0 0 auto;
    margin-right: 0.5em;
    transition: transform 0.15s ease;
}

.archives-all[open] > summary::before,
.archives-older[open] > summary::before,
.archives-tree .archive-year[open] > .archive-year-toggle::before {
    transform: rotate(90deg);
}

.archives-all > summary {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.archives-older {
    margin-top: 0.25rem;
}

.archives-older > summary {
    opacity: 0.8;
    padding: 0.1rem 0;
}

/* Year rows */
.archives-tree .archive-year {
    margin-bottom: 0.25rem;
}

.archives-tree .archive-year-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}

.archives-tree .archive-year-toggle > .archive-year-label {
    flex: 0 1 auto;
}

/* Post-count badge on the year row, pushed to the right
   (delete the margin-left line to keep it next to the year) */
.archives-tree .archive-year-toggle .menu-score {
    margin-left: auto;
}

/* Month rows */
.archives-tree .archive-months {
    margin: 0 0 0.25rem 1.1rem;
    padding: 0;
    list-style: none;
}

/* Compact rows; !important because the theme/plugin selectors that add
   spacing are unknown. Remove it if the rules win without it. */
.archives-tree .archive-months li {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

.archives-tree .archive-months li a {
    display: flex !important;
    align-items: center;
    gap: 0.4em;
    padding: 0.1rem 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
}

.archives-tree .archive-year-toggle::before {
    margin-right: 0;
    padding: 0.3em 0.6em 0.3em 0;
}
