/* ============================================================
   APDIG
   Australian Photographic Digital Imaging Guidelines
   Modern static stylesheet
   ============================================================ */


/* ------------------------------------------------------------
   Design tokens
   ------------------------------------------------------------ */

:root {
  --blue: #172633;
  --blue-dark: #0d1922;
  --blue-light: #263b4b;

  --rgb-blue: #20a9df;
  --rgb-green: #92c93d;
  --rgb-red: #ed3b2f;
  --rgb-yellow: #f5c928;

  --text: #20262b;
  --text-light: #59636b;
  --text-muted: #737d85;

  --background: #f2f4f5;
  --surface: #ffffff;
  --surface-alt: #f7f8f9;

  --border: #dce1e5;
  --border-dark: #cbd1d6;

  --link: #064d7d;
  --link-hover: #0b719f;

  --max-width: 980px;
  --reading-width: 820px;

  --radius: 6px;

  --shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 8px 30px rgba(0, 0, 0, 0.04);
}


/* ------------------------------------------------------------
   Reset / base
   ------------------------------------------------------------ */

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 30px;
}

body {
  margin: 0;
  padding: 0;

  background: var(--background);
  color: var(--text);

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  font-size: 17px;
  line-height: 1.68;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


/* ------------------------------------------------------------
   Typography
   ------------------------------------------------------------ */

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--blue);
}

h2 {
  margin-bottom: 0;

  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.025em;
}

p {
  margin-top: 0;
  margin-bottom: 1.35em;
}

strong,
b {
  color: var(--blue);
  font-weight: 700;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(32, 169, 223, 0.45);
  outline-offset: 4px;
}


/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);

  padding: 42px 20px 36px;
}

.header-inner {
  width: min(var(--max-width), 100%);
  margin: 0 auto;

  display: flex;
  flex-direction: column;
  align-items: center;
}


/* ------------------------------------------------------------
   Logo
   ------------------------------------------------------------ */

.brand {
  display: block;

  width: min(760px, 100%);

  text-decoration: none;
}

.site-logo {
  display: block;

  width: 100%;
  height: auto;

  max-height: 230px;

  object-fit: contain;
}


/* ------------------------------------------------------------
   Header metadata
   ------------------------------------------------------------ */

.header-meta {
  display: flex;
  align-items: center;
  gap: 9px;

  margin-top: 20px;

  color: var(--text-muted);

  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.header-meta a {
  color: var(--text-light);
}

.header-meta a:hover {
  color: var(--link-hover);
}

.meta-separator {
  color: var(--border-dark);
}


/* ------------------------------------------------------------
   PDF button
   ------------------------------------------------------------ */

.pdf-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;

  margin-top: 24px;
  padding: 12px 19px;

  border: 1px solid var(--blue);
  border-radius: var(--radius);

  background: var(--blue);
  color: #ffffff;

  font-size: 0.9rem;
  font-weight: 700;

  text-decoration: none;

  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.pdf-button:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #ffffff;

  transform: translateY(-1px);
}

.pdf-button small {
  padding-left: 4px;

  color: rgba(255, 255, 255, 0.65);

  font-size: 0.72rem;
  font-weight: 400;
}

.pdf-icon {
  font-size: 1.15rem;
  line-height: 1;
}


/* ------------------------------------------------------------
   Main page
   ------------------------------------------------------------ */

.page {
  width: min(var(--max-width), calc(100% - 32px));

  margin: 34px auto 70px;

  padding: 48px 60px;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: var(--radius);

  box-shadow: var(--shadow);
}


/* ------------------------------------------------------------
   Introduction
   ------------------------------------------------------------ */

.intro {
  max-width: var(--reading-width);

  margin: 0 auto 50px;

  color: var(--text-light);

  font-size: 1.03rem;
}

.intro p:last-child {
  margin-bottom: 0;
}

.detail-label {
  color: var(--link);
  font-style: italic;
}


/* ------------------------------------------------------------
   Guideline groups
   ------------------------------------------------------------ */

.guideline-group {
  max-width: var(--reading-width);

  margin: 0 auto 58px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;

  margin-bottom: 18px;

  padding-bottom: 12px;

  border-bottom: 2px solid var(--blue);
}

.section-kicker {
  color: var(--rgb-blue);

  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading h2 {
  flex: 1;
}


/* ------------------------------------------------------------
   Guideline accordion
   ------------------------------------------------------------ */

.guideline {
  margin: 0;

  border-bottom: 1px solid var(--border);
}

.guideline:first-of-type {
  border-top: 1px solid var(--border);
}


/* ------------------------------------------------------------
   Summary / clickable heading
   ------------------------------------------------------------ */

.guideline summary {
  position: relative;

  display: grid;
  grid-template-columns: 48px 1fr 28px;
  align-items: center;
  gap: 16px;

  min-height: 70px;

  padding: 15px 6px;

  cursor: pointer;

  list-style: none;

  color: var(--blue);

  font-size: 1.02rem;
  font-weight: 600;

  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.guideline summary::-webkit-details-marker {
  display: none;
}

.guideline summary::marker {
  display: none;
}

.guideline summary:hover {
  color: var(--link-hover);
  background: var(--surface-alt);
}

.guideline-number {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 38px;
  height: 38px;

  border-radius: 50%;

  background: var(--blue);
  color: #ffffff;

  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.guideline-title {
  line-height: 1.4;
}


/* ------------------------------------------------------------
   Accordion plus/minus
   ------------------------------------------------------------ */

.guideline-toggle {
  position: relative;

  display: block;

  width: 22px;
  height: 22px;
}

.guideline-toggle::before,
.guideline-toggle::after {
  content: "";

  position: absolute;

  top: 50%;
  left: 50%;

  width: 14px;
  height: 2px;

  background: var(--blue);

  transform: translate(-50%, -50%);

  transition: transform 0.15s ease;
}

.guideline-toggle::after {
  transform:
    translate(-50%, -50%)
    rotate(90deg);
}

.guideline[open] .guideline-toggle::after {
  transform:
    translate(-50%, -50%)
    rotate(0deg);
}


/* ------------------------------------------------------------
   Guideline detail
   ------------------------------------------------------------ */

.detail {
  margin: 0 50px 24px 64px;
  padding: 25px 28px;

  background: var(--surface-alt);

  border-left: 3px solid var(--border-dark);

  color: var(--text);

  font-size: 0.96rem;
}

.detail p:last-child {
  margin-bottom: 0;
}

.detail ol {
  margin: 0 0 0 1.3rem;
  padding: 0;
}

.detail li {
  margin-bottom: 1rem;
  padding-left: 0.35rem;
}

.detail li:last-child {
  margin-bottom: 0;
}


/* ------------------------------------------------------------
   Information sections
   ------------------------------------------------------------ */

.information-section {
  max-width: var(--reading-width);

  margin: 0 auto;

  padding: 28px 0;

  border-top: 1px solid var(--border);
}

.information-section h2 {
  margin-bottom: 12px;

  font-size: 1.25rem;
}

.information-section p:last-child {
  margin-bottom: 0;
}

.endorsed-section {
  padding-bottom: 5px;
}


/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */

.site-footer {
  background: var(--blue);
  color: rgba(255, 255, 255, 0.72);

  padding: 34px 20px;
}

.footer-inner {
  width: min(var(--max-width), 100%);
  margin: 0 auto;

  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
}

.footer-brand img {
  display: block;
  width: min(125px, 100%);
  height: auto;
  opacity: 0.75;
}


.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.85);

  font-size: 0.85rem;

  text-decoration: none;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-copy {
  grid-column: 1 / -1;

  margin: 0;

  color: rgba(255, 255, 255, 0.48);

  font-size: 0.75rem;
}


/* ------------------------------------------------------------
   Mobile
   ------------------------------------------------------------ */

@media (max-width: 700px) {

  body {
    font-size: 16px;
  }

  .site-header {
    padding: 25px 16px 27px;
  }

  .site-logo {
    max-height: none;
  }

  .header-meta {
    margin-top: 15px;

    font-size: 0.82rem;
  }

  .pdf-button {
    width: 100%;
    max-width: 300px;

    justify-content: center;
  }

  .page {
    width: 100%;

    margin: 0;
    padding: 35px 18px 55px;

    border: 0;
    border-radius: 0;

    box-shadow: none;
  }

  .intro {
    margin-bottom: 38px;
  }

  .guideline-group {
    margin-bottom: 45px;
  }

  .section-heading {
    gap: 10px;

    margin-bottom: 10px;
  }

  .section-kicker {
    display: none;
  }

  h2,
  .section-heading h2 {
    font-size: 1.45rem;
  }

  .guideline summary {
    grid-template-columns: 39px 1fr 22px;

    gap: 11px;

    min-height: 67px;

    padding: 12px 0;

    font-size: 0.95rem;
  }

  .guideline-number {
    width: 34px;
    height: 34px;

    font-size: 0.67rem;
  }

  .guideline-title {
    line-height: 1.35;
  }

  .detail {
    margin: 0 0 20px 39px;

    padding: 20px 18px;

    font-size: 0.93rem;
  }

  .information-section {
    padding: 24px 0;
  }

  .footer-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    justify-content: flex-start;
  }

}


/* ------------------------------------------------------------
   Very small screens
   ------------------------------------------------------------ */

@media (max-width: 400px) {

  .guideline summary {
    grid-template-columns: 34px 1fr 20px;
    gap: 9px;

    font-size: 0.91rem;
  }

  .guideline-number {
    width: 31px;
    height: 31px;
  }

  .detail {
    margin-left: 31px;
  }

  .header-meta {
    flex-wrap: wrap;
    justify-content: center;
  }

}


/* ------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }

}


/* ------------------------------------------------------------
   Print
   ------------------------------------------------------------ */

@media print {

  body {
    background: #ffffff;
    color: #000000;

    font-size: 11pt;
    line-height: 1.5;
  }

  .site-header {
    padding: 20px 0;

    border-bottom: 1px solid #999;
  }

  .site-logo {
    max-width: 500px;
  }

  .pdf-button,
  .footer-links {
    display: none;
  }

  .page {
    width: 100%;
    max-width: none;

    margin: 0;
    padding: 20px 0;

    border: 0;
    box-shadow: none;
  }

  .guideline-group {
    max-width: none;
  }

  .guideline {
    break-inside: avoid;
  }

  .guideline summary {
    cursor: default;
    color: #000000;
  }

  .guideline-toggle {
    display: none;
  }

  /*
     Force the detail text to print even when an accordion
     is closed on screen.
  */
  .guideline > .detail {
    display: block !important;

    margin-left: 50px;

    background: #ffffff;
    border-left: 2px solid #999;
  }

  .information-section {
    break-inside: avoid;
  }

  .site-footer {
    display: none;
  }

  a {
    color: #000000;
    text-decoration: none;
  }

}
