/* Chriopter Theme - Ported from Hugo site */

/* CSS Variables */
:root {
  --bg-color: #ffffff;
  --text-color: #000;
  --border-color: #eee;
  --link-color: #000;
  --link-hover-color: #000;
  --secondary-text: #666;
}

.dark-mode {
  --bg-color: #111;
  --text-color: #fff;
  --border-color: #333;
  --link-color: #fff;
  --link-hover-color: #fff;
  --secondary-text: #999;
}

/* Moon Toggle */
.moon-toggle {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  transition: transform .3s ease, opacity .3s ease;
  pointer-events: auto;
}

.moon-toggle:hover {
  transform: scale(1.1);
}

.moon-toggle.transitioning {
  opacity: .8;
}

/* Base Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  color: var(--text-color);
  background-color: var(--bg-color);
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s ease, color .5s ease;
}

a[target=_blank]:not(.dropdown-content a):not(.nav-links a),
.post-content a[target=_blank],
article a[target=_blank] {
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
  text-decoration-thickness: 1px !important;
}

/* Header */
header {
  padding: 2rem;
  margin-bottom: 1rem;
}

header .header-content {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.header-content {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.nav-links a.active {
  font-weight: 700;
  opacity: 1;
}

@media (max-width: 768px) {
  .header-content {
    margin: 0;
  }
}

@media (max-width: 600px) {
  .header-content {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .site-title {
    text-align: center;
  }

  .site-title > div {
    align-items: center;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
}

@media (max-width: 300px) {
  .nav-links {
    justify-content: flex-start;
  }

  .nav-links a {
    width: calc(50% - 1rem);
    text-align: left;
  }
}

.site-title {
  font-size: 1.4rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: .75rem;
}

/* Navigation */
.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
}

.nav-links a,
.nav-links .dropdown-trigger {
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s ease;
}

.nav-links > a:hover,
.nav-links a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.nav-links a:hover {
  color: var(--secondary-text);
}

.nav-links .dropdown .dropdown-trigger {
  text-decoration: none !important;
  cursor: pointer;
  transform: none !important;
  transition: color .2s ease !important;
}

.nav-links .dropdown .dropdown-trigger:hover,
.nav-links .dropdown .dropdown-trigger:focus {
  text-decoration: underline !important;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transform: none !important;
}

.nav-separator {
  color: var(--secondary-text);
  user-select: none;
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-color);
  min-width: 160px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  z-index: 1000;
  margin-top: 0;
  text-align: center;
}

.dropdown-content a {
  display: block;
  padding: .5rem 1rem;
  white-space: nowrap;
  text-decoration: none;
  transition: color .2s ease;
  transform: none !important;
}

.dropdown-content a:hover {
  text-decoration: underline;
  transform: none !important;
}

.photos-page .dropdown-content {
  background-color: #111;
  border-color: #333;
}

.photos-page .dropdown-content a {
  color: #fff;
}

.photos-page .dropdown-content a:hover {
  color: #999;
}

@media (hover: hover) {
  .dropdown:hover .dropdown-content {
    display: block;
  }
}

.dropdown.active .dropdown-content {
  display: block;
}

/* Main Content */
main {
  max-width: 700px;
  margin: 0 auto;
  padding: .5rem 2rem;
}

@media (max-width: 768px) {
  main {
    margin: 0;
    padding: .5rem 1rem;
  }
}

/* Post Styles */
.post-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--text-color);
  text-decoration: none;
}

.post-date {
  color: var(--secondary-text);
  font-size: .9rem;
  margin-bottom: 2rem;
}

.post-content {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-color);
}

.post-content a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.post-content img {
  max-width: 100%;
  max-height: 400px;
  height: auto;
  display: block;
  margin: 1rem 0;
  border-radius: 8px;
  object-fit: contain;
}

/* Posts List */
.posts-list {
  padding: 0;
}

.posts-list article {
  margin-bottom: 4rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--border-color);
}

.posts-list article:last-child {
  border-bottom: none;
}

.posts-list .post-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-color);
}

.posts-list .post-title a {
  color: var(--link-color);
  text-decoration: none;
  transition: color .2s ease;
}

.posts-list .post-title a:hover {
  color: var(--link-hover-color);
}

.posts-list .post-date {
  margin: .75rem 0 2rem;
  color: var(--secondary-text);
  font-size: .95rem;
}

.posts-list .post-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-color);
}

/* Footer */
.footer-content {
  max-width: 700px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .footer-content {
    margin: 0;
  }
}

/* Home Page Styles */
.home-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 0;
  color: var(--text-color);
}

@media (max-width: 768px) {
  .home-content {
    margin: 0;
    padding: 20px;
  }
}

.posts {
  margin-bottom: 4rem;
}

.post {
  margin-bottom: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

.post-summary {
  color: var(--text-color);
  line-height: 1.6;
  margin: 1rem 0;
}

.post-summary p {
  margin: 1rem 0;
}

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

.post-summary a:hover {
  color: var(--link-hover-color);
  opacity: .7;
}

.post:last-child {
  border-bottom: none;
}

.post h2 {
  margin-bottom: .25rem;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.post time {
  display: block;
  color: var(--secondary-text);
  margin-bottom: 1.5rem;
  font-size: .95rem;
}

.home-content a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: opacity .2s ease;
}

.home-content a:hover {
  color: var(--link-hover-color);
  opacity: .7;
}

.post h2 a {
  text-decoration: none;
}

/* Link Post */
.link-post {
  margin: 1.5rem 0;
}

.link-post .link-url {
  display: block;
  font-size: 1.2rem;
  line-height: 1.4;
  margin-bottom: .5rem;
  word-break: break-word;
  color: var(--link-color);
  text-decoration: none;
}

.link-post .link-url:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.link-post time {
  margin-bottom: 0;
  margin-top: .5rem;
}

.read-more {
  display: inline-block;
  margin-top: 1rem;
  font-size: .95rem;
  text-decoration: none;
  color: var(--link-color);
}

.read-more:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

/* Photo Post */
.photo-post {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.photo-post .photo-item {
  position: relative;
  display: inline-block;
  max-width: 80%;
  margin: 1rem auto;
}

.photo-post .photo-item > img {
  max-width: 100%;
  max-height: 60vh;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  transition: transform .3s ease;
}

.photo-post a {
  text-decoration: none;
}

.photo-post a:hover img {
  transform: scale(1.02);
}

.photo-thumbs {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
}

.photo-thumb {
  width: 105px;
  height: 105px;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .25rem;
  margin: 3rem 0 1rem;
  padding: 0;
  list-style: none;
}

.pagination li {
  display: inline-block;
}

.pagination li a,
.pagination li span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  font-size: 1rem;
  text-decoration: none;
  color: var(--secondary-text);
  border-radius: 50%;
  transition: all .2s ease;
}

.pagination li a:hover {
  color: var(--text-color);
  background-color: var(--border-color);
}

.pagination li span.active {
  color: var(--bg-color);
  background-color: var(--text-color);
  font-weight: 600;
}

/* Disabled prev/next arrows */
.pagination li:first-child span:not(.active),
.pagination li:last-child span:not(.active) {
  color: var(--border-color);
}

/* Active prev/next arrows */
.pagination li:first-child a,
.pagination li:last-child a {
  color: var(--text-color);
}

.pagination li.gap span {
  min-width: 1.5rem;
  color: var(--secondary-text);
}

/* Recent Photos Section */
.recent-photos {
  margin: 0 0 4rem;
  padding: 0 0 2rem;
  border-bottom: 1px solid var(--border-color);
}

.recent-photos h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 1.5rem;
}

.recent-photos h2 a {
  color: inherit;
  text-decoration: none;
}

.recent-photos h2 a:hover {
  opacity: .7;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .photos-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .photos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
  }
}

/* Home page recent photos grid - square thumbnails */
.photos-grid .photo-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-secondary);
}

.photos-grid .photo-item a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.photos-grid .photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.photos-grid .photo-item:hover img {
  transform: scale(1.05);
}

.photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .8) 0%, transparent 100%);
  padding: .75rem .6rem;
  opacity: 0;
  transition: opacity .25s ease;
}

.photo-item:hover .photo-overlay {
  opacity: 1;
}

.photo-overlay h3 {
  color: #fff;
  font-size: .85rem;
  font-weight: 500;
  margin: 0 0 .25rem;
  line-height: 1.2;
}

.photo-overlay time {
  color: rgba(255, 255, 255, .8);
  font-size: .75rem;
  margin: 0;
}

.recent-photos .view-all {
  display: inline-block;
  font-size: .95rem;
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
}

.recent-photos .view-all:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.photo-count {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .02em;
}

/* Photos Page Specific */
.photos-page body {
  background-color: #000 !important;
  color: #eee !important;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.photos-page header {
  border-bottom-color: #333 !important;
}

.photos-page .site-title,
.photos-page .nav-links a {
  color: #eee !important;
}

.photos-page footer {
  border-top-color: #333 !important;
}

.photos-page footer a {
  color: #999 !important;
}

.photos-page main {
  max-width: none !important;
  padding: 0 !important;
}

/* Photo Grid - styles moved to photos.html.twig template for masonry layout */

/* Bits Grid */
.bits-list {
  padding: 0;
}

.bits-list h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.bits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.bit-item {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-color);
  transition: border-color .2s ease, transform .2s ease;
}

.bit-item:hover {
  border-color: var(--text-color);
  transform: translateY(-2px);
}

.bit-item h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 .5rem;
}

.bit-item p {
  font-size: .95rem;
  color: var(--secondary-text);
  margin: 0;
  line-height: 1.5;
}
