@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/AtkinsonHyperlegibleNextVF-Variable.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-family: 'Atkinson Hyperlegible Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-size: 16px;
  /* Theme colors are now injected dynamically via template */
}

/* Logo SVG styling */
.logo-svg {
  width: 96px;
  height: 78px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.logo-svg path {
  fill: currentColor;
}

/* Icon SVG styling for footer buttons */
.icon-svg {
  width: 2rem;
  height: 2rem;
  display: inline-block;
  fill: var(--color-foreground);
  transition: fill 0.2s ease;
}

.icon-svg path {
  fill: inherit;
}

.btn--feed:hover .icon-svg,
.btn--github:hover .icon-svg {
  fill: var(--color-accent);
}

/* Override logo container sizing for SVG */
.logo .logo-svg {
  height: 78px;
  width: 96px;
}

.avatar-svg {
  width: 80px;
  height: 80px;
  border-radius: 8px;
}

.avatar-svg path {
  fill: var(--color-foreground);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

html {
  font-size: var(--font-size);
}

.btn-section{
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn--remix {
  font-family: var(--font-family);
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  line-height: 1rem;
  font-weight: 500;
  height: 2.75rem;
  align-items: center;
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-foreground);
  box-sizing: border-box;
  border-radius: 4px;
  text-decoration: none;
  color: var(--color-foreground);
  white-space: nowrap;
  margin-left: auto;
}

.btn--remix img {
  margin-right: 0.5rem;
}

.btn--remix:hover {
  background-color: var(--color-success);
}


.footer {
  display: flex;
  justify-content: space-between;
  margin: 2rem auto 0;
  padding: 1rem 0 0.75rem 0;
  width: 100%;
  flex-wrap: wrap;
  border-top: .25rem solid var(--color-border);
  gap: 1rem;
  align-items: flex-start;
}

@media (max-width: 768px) {
  .footer {
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
  }
  
  .footer .btn-section {
    order: -1;
    margin-left: 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .footer .btn-section .btn--remix {
    flex: 1;
    min-width: 200px;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .footer {
    margin-top: 1.5rem;
    padding: 0.75rem 0 0.5rem 0;
    text-align: center;
  }
  
  .footer > a {
    display: inline-block;
    margin: 0 0.5rem 0.5rem 0;
    line-height: 1.5;
    padding: 0.25rem 0.5rem;
    background: var(--color-surface-transparent);
    border-radius: 4px;
  }
  
  .footer .btn-section {
    flex-direction: column;
    gap: 0.75rem;
  }
}

.footer a:not(.btn--remix) {
  display: block;
  line-height: 2.75rem;
}

.footer a:not(.btn--remix) {
  font-family: var(--font-family);
  font-style: normal;
  font-weight: normal;
  font-size: 1.1rem;
  text-decoration: none;
  border-style: none;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-background);
  color: var(--color-foreground);
  padding: 0 1rem;
  max-width: 67.5rem;
  margin: 0 auto;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 599px) {
  body {
    padding: 0 0.75rem;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0 0.5rem;
  }
  
  .header {
    margin-bottom: 1rem;
  }
  
  h1 {
    font-size: 2rem;
    line-height: 2.2rem;
    margin-bottom: 1rem;
  }
}

a {
  color: var(--color-link);
  text-decoration: none;
}

.wrapper {
  min-height: 40vh;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .wrapper {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    grid-gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
  }
}

@media (min-width: 600px) and (max-width: 767px) {
  .wrapper {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-gap: 1rem;
    padding: 0 1rem;
  }
  
  .wrapper > *:first-child:not(.content) {
    grid-column: 1;
    grid-row: 2;
  }
  
  .content {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

.wrapper > *:first-child:not(.content) {
  grid-row: 1;
  grid-column: 1;
}

.wrapper > * {
  order: 2;
}

.content {
  grid-row: 1;
  grid-column: 2;
}

@media (max-width: 599px) {
  .content:not(:only-child) {
    margin-bottom: 2rem;
  }
}

p,
label {
  font-size: 1.25rem;
}

label.small {
  display: block;
  font-weight: normal;
  font-size: 0.8rem;
}

h1 {
  color: var(--color-accent);
  font-style: normal;
  font-weight: 600;
  font-size: 3rem;
  line-height: 3.15rem;
  margin: 0 0 2rem;
}

h1 a {
  text-decoration: none;
  color: currentColor;
}

button,
input,
textarea {
  display: block;
  font: inherit;
  background: var(--color-surface);
  color: inherit;
  border: 1px solid currentColor;
  box-sizing: border-box;
  border-radius: .25rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 44px; /* Touch target size */
}

button {
  cursor: pointer;
  background: var(--color-accent);
  color: white;
  border: 2px solid var(--color-accent);
  font-weight: 500;
  min-width: 120px;
}

button:hover,
button:focus {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

input,
textarea {
  width: 100%;
  max-width: 600px;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-color: var(--color-accent);
}

textarea {
  height: 12rem;
  resize: vertical;
  min-height: 100px;
}

@media (max-width: 599px) {
  button,
  input,
  textarea {
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border-radius: 6px;
  }
  
  textarea {
    height: 8rem;
    min-height: 80px;
  }
  
  button {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  button,
  input,
  textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

label {
  color: currentColor;
  font-weight: normal;
  font-size: 1rem;
  line-height: 1.25rem;
}

h2 {
  color: var(--color-accent);
  margin-bottom: 2rem;
}

h3 {
  font-weight: bold;
  margin-bottom: 1rem;
}

p, ol, ul, form {
  margin-bottom: 1rem;
}

p.error {
  color: var(--color-accent);
}

p.error a {
  color: currentColor;
}

.header {
  justify-content: space-between;
  align-items: center;
  border-bottom: .25rem solid var(--color-border);
  padding: 1rem 0;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (min-width: 600px) {
  .header {
    flex-wrap: nowrap;
  }
}

.logo {
  font-size: 3rem;
  font-weight: 500;
  line-height: 6rem;
  margin: 0;
}

.logo a {
  display: block;
  color: inherit;
}

.logo img {
  display: inline-block;
  margin-right: .5rem;
  height: 6rem;
  width: auto;
  vertical-align: middle;
}

@media (max-width: 599px) {
  .logo {
    font-size: 2rem;
    line-height: 3rem;
  }

  .logo img {
    height: auto;
    width: 3rem;
  }
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.menu a {
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  background: var(--color-surface-transparent);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
  white-space: nowrap;
  min-height: 44px; /* Minimum touch target size */
  display: flex;
  align-items: center;
}

.menu a:hover,
.menu a:focus {
  background: var(--color-surface);
  outline: 2px solid var(--color-accent);
}

@media (max-width: 599px) {
  .menu {
    width: 100%;
    justify-content: flex-start;
    margin-top: 0.5rem;
  }
  
  .menu a {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .menu {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .menu a {
    flex: 1;
    min-width: calc(50% - 0.25rem);
    justify-content: center;
    text-align: center;
  }
}

.bookmark {
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--color-surface-dimmed);
  border-radius: 8px;
  border-left: 4px solid var(--color-accent);
}

.bookmark .headline {
  font-size: 1.25rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.bookmark .headline a {
  text-decoration: none;
  color: var(--color-link);
  word-break: break-word;
}

.bookmark .headline a:hover,
.bookmark .headline a:focus {
  text-decoration: underline;
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.bookmark .subhead {
  font-size: .875rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

@media (max-width: 599px) {
  .bookmark {
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    border-radius: 6px;
  }
  
  .bookmark .headline {
    font-size: 1.1rem;
    line-height: 1.3;
  }
  
  .bookmark .subhead {
    font-size: 0.8rem;
    line-height: 1.4;
  }
}

@media (max-width: 480px) {
  .bookmark {
    padding: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .bookmark .headline {
    font-size: 1rem;
  }
}

.bookmark .subhead,
.bookmark .bottom,
.bookmark .tags a {
  color: var(--color-dimmed);
}

.comment {
  margin-bottom: 2rem;
}

.comment .top {
  font-size: 1rem;
  line-height: 1.25rem;
}
.comment .top .timestamp:before {
  content: "• ";
}

.comment .top a {
  color: inherit;
  text-decoration: none;
}

.comment .top .timestamp {
  font-size: .75rem;
}

.bookmark .bottom span ~ span:before {
  content: "•";
}

.bookmark .tags {
  font-size: .875rem;
  line-height: 1.5;
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.bookmark .tag {
  display: inline-block;
  padding: 0.2rem 0.4rem;
  background: var(--color-surface-transparent);
  border-radius: 12px;
  white-space: nowrap;
  font-size: 0.75rem;
  margin: 0;
}

.bookmark .tag a {
  text-decoration: none;
  color: var(--color-dimmed);
}

.bookmark .tag a:hover,
.bookmark .tag a:focus {
  color: var(--color-link);
  outline: 1px solid var(--color-accent);
  outline-offset: 1px;
}

@media (max-width: 599px) {
  .bookmark .tags {
    font-size: 0.8rem;
    gap: 0.2rem;
  }
  
  .bookmark .tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.3rem;
  }
}

.bookmark .tag-op {
  line-height: 1rem;
}

.tag-add {
  color: green;
  font-size: 1.1rem;
}

.bookmark .tags .tag-remove {
  color: red;
  font-size: 1.5rem;
}

.tag-list {
  list-style: none;
}

.tag-list a {
  color: var(--color-dimmed);
  font-size: .875rem;
  line-height: 1.25rem;
}

.bio {
  display: grid;
  grid-gap: 0.3125rem;
  grid-template-columns: 7.8125rem auto;
  grid-gap: 1rem;
  margin-bottom: 1rem;
}

.bio .avatar {
  width: 7.8125rem;
}

#taggedList {
  display: flex;
  gap: .25rem;
}

#taggedList .tagged {
  display: inline-grid;
  height: 2em;
  grid-template-columns: 1.5ch auto;
  align-items: center;
  text-align: center;
  padding: calc(.25rem - 1px);
  border: 1px solid var(--color-border);
  border-radius: .5rem 0 0 .5rem;
}

#taggedList .tagged:before {
  content: '#';
}

#taggedList .tagged:hover:before {
  content: '\00d7';
}

.followers .follower {
  display: grid;
  grid-template-columns: 50% 2.5rem;
  align-items: center;
}

.followers .follower .actions {
  height: auto;
}

a.bookmark-date {
  color: inherit;
}

.bookmark-date + .bookmark-domain:before {
  content: "• ";
}

.form-group:not(:last-child) {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  cursor: pointer;
}

.form-group summary label {
  display: inline;
}

.pagination {
  font-size: .875rem;
  line-height: 1.25rem;
}

.pagination span + span:before {
  content: " • ";
}

.pagination span:not(.status) {
  color: var(--color-dimmed);
}

.search {
  margin-bottom: 1rem;
}

.admin-links {
  list-style: none;
  margin: 0 0 2rem;
  font-weight: bold;
  font-size: .875rem;
  line-height: 1.25rem;
  color: var(--color-dimmed);
  order: 1;
}

.admin-links a {
  font-weight: normal;
  color: inherit;
}

.bookmark-permalink-title {
  margin-bottom: 0;
}

.external-link {
  font-size: .625em;
  color: var(--color-dimmed);
}

.bookmark-date + .bookmark-domain:before {
  content: "• ";
}

.form-group:not(:last-child) {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  cursor: pointer;
}

.form-group summary label {
  display: inline;
}

.pagination span + span:before {
  content: " • ";
}

.network-post {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.5);
  position: relative;
 line-height: 1.8em;
}

.network-post-content * {
  font-size: .950rem;
  line-height: 1.3rem;
}

.network-post-content .invisible {
  display:none;
}

.network-post-content .ellipsis::after {
  content: '...';
}

.network-post-content .hashtag {
  text-decoration: underline;
}

.network-post-content a:hover {
  text-decoration: underline;
}

.network-post-links a:first-child::before {
  content: '🔖';
}

.network-post-links a {
  border: solid var(--color-accent) 1px;
  border-radius: 15px 15px 15px 15px;
  padding:8px;
  margin-right:10px;
}

.network-post-links a:nth-child(2)::before {
  content: '🔗';
}

.network-post-credit {
  padding: 2px;
  padding-left: 15px;
  background-color: var(--color-background);
  filter: brightness(.90);
  font-size: small;
  border-radius: 15px 15px 15px 15px;
  margin-bottom: 15px;
}
