/* Friends of Shades Mountain — site stylesheet
   The palette and arrangement follow the original 2009 design.
   The page centres on wide screens and collapses to one column on phones. */

:root {
  --page-bg: #1E0E0E;      /* deep brown-black */
  --page-text: #FFFFFF;
  --muted: #999999;        /* footer text, current menu item, frame */
  --panel-bg: #FFFFFF;
  --panel-text: #444444;
  --credit-text: #666666;
  --accent: #863D23;       /* links inside the white panel */
  --accent-on-dark: #C8734F; /* the same hue, lightened for the dark background */
}

html, body {
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--page-bg);
  color: var(--page-text);
  font-family: Arial, Helvetica, sans-serif;
}

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

/* ---- Page grid: menu on the left, header, content and footer on the right ---- */

#container {
  box-sizing: border-box;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  grid-template-areas:
    ".       header"
    "sidebar content"
    ".       footer";
  column-gap: 24px;
}

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

#header {
  grid-area: header;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 24px;
  margin-bottom: 24px;
}

#headerlogo {
  grid-row: 1 / span 2;
}

#headertext {
  grid-column: 2;
  font-size: 0.6875rem;   /* 11px; was 5.5pt */
  letter-spacing: 0.2em;
  line-height: 1.6;
  margin-bottom: 4px;
}

#headertext2 {
  grid-column: 2;
  font-size: 0.875rem;    /* 14px; was 7pt */
  line-height: 1.5;
  max-width: 26em;
}

/* ---- Menu ---- */

#sidebar {
  grid-area: sidebar;
  align-self: end;
  padding-bottom: 60px;
  font-size: 0.875rem;    /* 14px; was 8pt */
  line-height: 1.9;
}

#sidebar ul {
  margin: 0;
  padding: 0;
}

li.list1 {
  list-style: none;
}

.class1 a:link,
.class1 a:visited,
.class1 a:active { text-decoration: none; color: var(--page-text); }
.class1 a:hover,
.class1 a:focus-visible { color: var(--muted); }

/* currently selected menu item */
.class1a a:link,
.class1a a:visited,
.class1a a:active,
.class1a a:hover { text-decoration: none; color: var(--muted); }

/* ---- Framed content: photograph beside a white text panel ---- */

#content {
  grid-area: content;
  display: flex;
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--muted);
}

#contentpic {
  flex: 0 1 auto;
}

/* where the text runs a little longer than the photograph, the photograph
   fills the extra height (cropping slightly at the sides) rather than leaving a gap */
#contentpic img {
  height: 100%;
  object-fit: cover;
}

/* the home page has a photograph only; let it fill the frame */
#contentpic:only-child {
  flex: 1 1 auto;
}
#contentpic:only-child img {
  width: auto;
  height: auto;
}
#content:has(> #contentpic:only-child) {
  justify-self: start;
}

#contenttext {
  flex: 1 1 240px;
  min-width: 0;
  box-sizing: border-box;
  padding: 22px 22px 18px;
  background-color: var(--panel-bg);
  color: var(--panel-text);
}

#contenttext p {
  margin: 6px 0 0;
}
#contenttext p:first-child {
  margin-top: 0;
}

.textcapstop,
.textcaps {
  font-size: 0.6875rem;   /* 11px; was 9px */
  letter-spacing: 0.2em;
  color: var(--panel-text);
}

.textbelowcaps,
.textbelowcapsdense {
  font-size: 0.875rem;    /* 14px; was 11px */
  line-height: 1.5;
  letter-spacing: 0.02em;
}
.textbelowcaps      { padding-bottom: 16px; }
.textbelowcapsdense { padding-bottom: 8px; }

.textphotocredit {
  font-size: 0.75rem;     /* 12px; was 9px */
  color: var(--credit-text);
}

/* links inside the white panel (email addresses, the PDF form) */
.class2 a,
.class3 a { text-decoration: none; color: var(--accent); }
.class3 a:hover,
.class3 a:focus-visible { text-decoration: underline; }

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

#footer {
  grid-area: footer;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  padding-top: 12px;
  font-size: 0.75rem;     /* 12px; was 6–7pt */
  color: var(--muted);
}

#footerleft   { order: 1; }
#footercenter { order: 2; }
#footerright  { order: 3; }

#footer .class2 a:link,
#footer .class2 a:visited,
#footer .class2 a:active { color: var(--accent-on-dark); }
#footer .class2 a:hover  { color: var(--muted); }

/* ---- Phones and narrow windows ---- */

@media (max-width: 760px) {
  #container {
    padding: 24px 16px 24px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "header"
      "sidebar"
      "content"
      "footer";
  }

  #header {
    margin-bottom: 20px;
  }

  #sidebar {
    align-self: start;
    padding: 0 0 16px;
  }
  #sidebar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 18px;
  }
  #sidebar li {
    padding: 4px 0;   /* larger touch targets */
  }

  #content {
    flex-direction: column;
  }
  #contentpic img,
  #contentpic:only-child img {
    width: 100%;
    height: auto;
  }
  #content:has(> #contentpic:only-child) {
    justify-self: stretch;
  }

  #footer {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  #header {
    grid-template-columns: minmax(0, 1fr);
  }
  #headerlogo { grid-row: auto; margin-bottom: 14px; }
  #headertext,
  #headertext2 { grid-column: 1; }
}
