/*
Theme Name: DAW
Author: Dmitri Wurst
Author URI: https://dmitriwurst.com/
Description: A custom theme for my website.
Version: 1.0.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* Header */
:root {
  --primary-color: #7851a9;
  --primary-hover: #a67ff9;
  --bg-dark: #1a1a1a;
  --bg-darker: #121212;
  --bg-card: #252525;
  --bg-card-hover: #2a2a2a;
  --text-primary: #f0f0f0;
  --text-secondary: #b0b0b0;
  --text-muted: #808080;
  --border-color: #333333;
  --border-light: #404040;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 14px;
}

#header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #2a2a2a;
  border-bottom: 1px solid #444;
  overflow-x: auto;
  padding: 0 2rem;
  white-space: nowrap;
  z-index: 1000;
}

#header::-webkit-scrollbar {
  height: 8px;
}

#header::-webkit-scrollbar-thumb {
  background-color: #7851a9;
  border-radius: 4px;
}

#header::-webkit-scrollbar-track {
  background-color: #2a2a2a;
}

.logo {
  font-size: 1.25rem;
  font-weight: bold;
  color: #7851a9;
  flex-shrink: 0;
}

.main-navigation a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: #ccc;
  font-family: 'Segoe UI';
  font-weight: 500;
  font-size: 1.2em;
  transition: color 0.2s;
}

.main-navigation a:hover {
  color: #7851a9;
}
ul li {
  display: inline;
}

ul {
  list-style-type: none;
}
ul li .head{
  display: inline-block;
}

ul .head{
  list-style-type: none;
}

/*General page content*/
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1e1e1e;
    color: #e0e0e0;
    min-height: calc(100vh - 2rem);
    display: grid;
    grid-template-rows: auto 1fr auto;
}

/* Homepage tiles */
.home-content {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: auto;
    max-width: 100%;
    padding: 10px;
    box-sizing: border-box;
    width: 100%;
    align-items: top;
}
.home-option {
    flex: 1 1 30%; 
    aspect-ratio: 1 / 1;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background-color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.home-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: all 0.3s ease;
    filter: brightness(60%) grayscale(10%);
}
.home-option:hover .home-image {
    filter: brightness(50%) grayscale(0%);
    transform: scale(1.02);
    transition: all 0.3s ease;
}
.overlay-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: white;
    font-weight: bold;
    padding: 10px;
    text-align: center;
    width: 100%;
}

/* Recent Posts Box */
.home-option.recent {
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    text-align: center;
    width: 100%;
    max-width: 100%;
    height: 100%;
    background-color: linear-gradient(145deg, #232323, #2c2c2c);
    padding: 15px;
	box-sizing: border-box;
}

.home-option.recent h2 {
    font-size: 2rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    align-self: center;
    margin-bottom: 15px;
}

.recent-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    flex: 1;
}

.recent-row {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card);
    padding: 12px 15px;
    border-radius: var(--border-radius-md);
    transition: background-color var(--transition-normal), transform var(--transition-fast), box-shadow var(--transition-fast);
    color: var(--text-primary);
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

.recent-row:hover {
    background-color: var(--primary-color);
    transform: translateX(2px);
    box-shadow: var(--shadow-md);
}

.recent-row:nth-child(odd) {
    background-color: var(--bg-card-hover);
}

.recent-row:nth-child(odd):hover {
  background-color: var(--primary-color);
}

.recent-main {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 12px;
    min-width: 0;
}

.recent-title {
    font-size: 1.1rem;
    font-weight: 500;
    text-align: left;
    margin-left: 5%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.recent-row:hover .recent-thumb {
    transform: scale(1.05);
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: 5%;
    flex-shrink: 0;
}

.post-meta span {
    margin: 0;
}

/* Pages */

.text {
    margin-left: 10%;
    margin-right: 10%;
    padding: 2em;
}
.writing-page {
  max-width: 800px;
  margin: 3rem auto;
  padding: 0 1rem;
  font-family: 'Georgia', serif;
}

.writing-page .page-title {
  font-size: 2.5rem;
  font-weight: normal;
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--heading-color, #fff);
}

.writing-timeline {
  margin-top: 2rem;
}

.writing-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.writing-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color, #333);
}

.writing-item:last-child {
  border-bottom: none;
}

.writing-item a {
  font-family: 'Georgia', serif;
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--link-color, #fff);
  text-decoration: none;
  transition: color 0.2s ease;
}

.writing-item a:hover {
  color: var(--accent-color, #7851a9);
}

.meta {
  display: block;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 0.9rem;
  color: var(--meta-color, #aaa);
  margin-top: 0.25rem;
}

.synopsis {
  margin-top: 0.75rem;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 1rem;
  color: var(--text-color, #ccc);
  line-height: 1.6;
  max-width: 95%;
}

.blog-link-item {
  text-align: center;
  margin-top: 3rem;
}

.blog-link-item a {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-family: 'Helvetica Neue', sans-serif;
  border: 1px solid var(--border-color, #444);
  background: transparent;
  color: var(--link-color, #fff);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.blog-link-item a:hover {
  background: var(--accent-color, #7851a9);
  color: #000;
}

/* Reader */
.writing-post-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem 5rem;
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #e0e0e0;
    background-color: transparent;
  }
  .writing-post-container a {
    color: #7851a9;
    text-decoration: none;
  }
  .writing-post-container a:hover {
    color: #a67ff9;
    text-decoration: none;
  }
  .writing-post-container.dark-mode {
    background-color: #ccc;
    color: #2e2e2e;
  }
  
  .writing-post-container .writing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
  }
  
  .writing-post-container .writing-title {
    font-size: 2.2rem;
    margin: 0;
    font-weight: 700;
  }
  
  .writing-post-container #mode-toggle {
    padding: 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
    background: #7851a9;
    border: none;
    color: #fff;
    border-radius: 4px;
    transition: background-color 0.3s;
  }
  
  .writing-post-container #mode-toggle:hover {
    background: #a67ff9;
  }
  
  .writing-post-container .writing-content {
    margin-bottom: 3rem;
    word-break: break-word;
  }
  
  .writing-post-container .comments-area {
    margin-top: 3rem;
    border-top: 1px solid #444;
    padding-top: 2rem;
    color: #ccc;
  }
  
  .writing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 1.5rem auto 0 auto;
    padding: 0 2rem;
  }

  .back-link {
    color: #bbb;
    font-size: 0.95rem;
    text-decoration: none !important;
    font-family: 'Segoe UI';
  }
.arrow {
    font-size: 1.4rem;
    line-height: 0;
  }
.link-text {
    vertical-align: 0.065rem;
  }
  .back-link:hover {
    color: #7851a9;
  }
  
  #mode-toggle {
    background: none;
    border: 1px solid #666;
    border-radius: 4px;
    color: #ccc;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, color 0.2s ease;
  }
  
  #mode-toggle:hover {
    background-color: #444;
    color: #fff;
  }

  .writing-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #222;
    border-radius: 8px;
  }
  /*Webserial homepage*/
  .webserial-main h1 {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
  }
  
  .webserial-main p {
    font-size: 1.1rem;
    color: #ccc;
  }
  
  .webserial-menu {
    margin: 1rem 0 2rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
  }
  
  .webserial-menu a {
    color: #7851a9;
    text-decoration: none;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: background-color 0.25s ease, border-color 0.25s ease;
  }
  
  .webserial-menu a:hover,
  .webserial-menu a:focus {
    background-color: #7851a9;
    color: #fff;
    border-color: #fff;
  }
  
  .webserial-synopsis {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 2rem;
  }
  
.toc-section {
  margin-top: 20px;
  padding: 0 -4em;
  border-radius: 10px;
  font-family: "Helvetica Neue", sans-serif;
  overflow: hidden;
  width: 100%;
}

.chapter-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.arc-name {
  font-size: 1.4em;
  color: #ccc;
  font-weight: 400;
  padding: 14px 12em 8px 2em;
  display: block;
  width: 100%;
  background-color: #2c2c2c;
  box-sizing: border-box;
}

.arc-name:nth-of-type(odd) {
  background-color: #2c2c2c;
}

.arc-name:nth-of-type(even) {
  background-color: #3a3a3a;
}

.chapter-item {
  padding: 10px 0 0 2em;
  transform: translate(-3em);
  display: block;
  margin-top: 0;
  padding-bottom: 7px;
  width: 100%;
  background-color: #2c2c2c;
  box-sizing: border-box;
  transition: background-color 0.3s ease;
}

.arc-name:nth-of-type(odd) ~ .arc-chapters .chapter-item:nth-of-type(odd) {
  background-color: #2c2c2c;
}

.arc-name:nth-of-type(odd) ~ .arc-chapters .chapter-item:nth-of-type(even) {
  background-color: #1f1f1f;
}

.arc-name:nth-of-type(even) ~ .arc-chapters .chapter-item:nth-of-type(odd) {
  background-color: #3a3a3a;
}

.arc-name:nth-of-type(even) ~ .arc-chapters .chapter-item:nth-of-type(even) {
  background-color: #4b4b4b;
}

.chapter-item > a {
  display: inline-block;
}

.chapter-item a {
  color: #ccc;
  text-decoration: none;
  font-weight: 400;
  padding: 5px 8em 5px 3em;
  align-items: center;
}

.chapter-item a:hover {
  text-decoration: none;
  color: #7851a9;
}

/* Chapter pages */
.chapter-nav-top,
.chapter-nav-bottom {
  margin: 2rem auto;
  max-width: 900px;
}

.home-link-bottom {
  text-align: center;
  margin-top: 1rem;
  border-radius: 6px;
  padding: 0.75rem 1.25rem;
}

.chapter-home {
  color: #ccc;
  font-size: 1rem;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.chapter-home:hover {
  color: #7851a9;
}

.chapter-buttons-row {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.chapter-button {
  color: #7851a9;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
}

.chapter-button:hover {
  color: #a67ff9;
}

/* About */
.about-page {
  max-width: 800px;
  margin: 3rem auto;
  padding: 0 1rem;
  font-family: 'Georgia', sans-serif;
}

.about-page .page-header h1{
  font-size: 2.5rem;
  text-align: center;
  font-weight: normal;
  margin-bottom: 2.5rem;
  color: var(--heading-color, #fff);
}

.about-layout {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.about-image {
  flex: 0 0 300px;
}

.about-image img {
  width: 100%;
  height: auto;
  display: block;
}

.about-text {
  flex: 1;
  font-family: 'Helvetica Neue', sans-serif;
  text-align: left;
}

.contact-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0.25rem;
  text-decoration: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: transparent;
  transition: 
    background-color 0.3s ease,
    transform 0.2s ease,
    box-shadow 0.3s ease;
}

.contact-link img {
  width: 2.25rem;
  height: 2.25rem;
  display: block;
}

.contact-link:hover {
  background: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.contact-link:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 3px;
}

/* Gallery */
.custom-photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0;

}

.photo-thumbnail {
    margin: 0;
    padding: 0;
    line-height: 0;
}

.photo-thumbnail img {
    width: auto;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    display: block;
    transition: transform 0.2s;
}
.photo-thumbnail img:hover {
    transform: scale(1.03);
}

#photo-lightbox {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

#photo-lightbox.hidden {
    display: none;
}

#photo-lightbox img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
}

#lightbox-caption {
    margin-top: 12px;
    color: #eee;
    font-size: 1rem;
    max-width: 90%;
    text-align: center;
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    z-index: 1001;
}

#lightbox-prev {
    left: 10px;
}

#lightbox-next {
    right: 10px;
}
.lightbox-nav:hover {
    color: #ccc;
}

.lightbox-comment-button {
  padding: 0.4rem;
  font-size: 1.2rem;
  cursor: pointer;
  background: #7851a9;
  border: none;
  color: #fff;
  border-radius: 4px;
  transition: background-color 0.3s;
  text-decoration: none;
  margin-top: 0.5rem;
}

.lightbox-comment-button:hover {
  background: #a67ff9;
}

.photo-single-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.photo-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--accent, #7851a9);
}

.photo-full-wrapper {
  margin: 2rem 0;
}

.photo-full {
  max-width: 100%;
  height: auto;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
  transition: filter 0.1s ease, opacity 0.3s ease;
}

.photo-full.placeholder {
  filter: blur(2px);
  opacity: 0.7;
}


.photo-caption {
  font-size: 1rem;
  color: #ccc;
  margin-top: 1rem;
}

.photo-back-link {
  margin-top: 2rem;
}

.photo-back-link a {
  color: var(--accent);
  font-weight: bold;
  text-decoration: none;
}

.photo-back-link a:hover {
  color: var(--accent-hover, #a67ff9);
}
/* Blog */
.blog-infinite-wrapper {
  display: flex;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  gap: 2rem;
  padding: 2rem;
}

.blog-content-area {
  flex: 2;
  min-width: 0;
}

.blog-sidebar {
  flex: 1;
  min-width: 250px;
  background: #2a2a2a;
  padding: 1rem;
  border-radius: 10px;
  height: fit-content;
}

.blog-sidebar h2 {
  font-size: 1.3rem;
  color: #ccc;
}

.blog-post-links {
  list-style: none;
  padding: 0;
}

.blog-post-links li {
  margin-bottom: 0.5rem;
  display: block;
}


.blog-post-links a {
  text-decoration: none;
  color: #bbb;
}

.blog-post-links a:hover {
  color: #7851a9;
}

.blog-post-full {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #444;
}

.blog-post-title {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.blog-post-title a {
  color: #fff;
  text-decoration: none;
}

.blog-post-title a:hover {
  color: #7851a9;
  text-decoration: underline;
}

.blog-post-full .meta {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 1rem;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 1em;
  margin-top: 2em;
  font-size: 1.1rem;
}

.nav-links a {
  text-decoration: none;
  color: #7851a9;
}

.nav-links .current {
  font-weight: bold;
  color: #fff;
}

.read-more-button, .content a {
  color: #7851a9;
  text-decoration: none;
}

.read-more-button:hover, .content a:hover {
  color: #a67ff9;
}

/* Media Queries */
@media (max-width: 1024px) {
  .home-content {
      flex-direction: column;
      align-items: center;
  }

  .home-option {
      width: 90%;
      margin-bottom: 10px;
  }

  .home-option.recent {
      width: 90%;
      margin-top: 10px;
  }
}
@media (max-width: 768px) {
  .home-content {
      flex-direction: column;
      align-items: center;
  }

  .home-option {
      width: 90%;
      margin-bottom: 10px;
  }

  .overlay-text {
      font-size: 18px;
  }

  .home-option.recent {
      width: 90%;
      margin-top: 10px;
  }
  .recent-row {
    flex-direction: column;  /* stack content */
    align-items: stretch;
	flex: 0 0 auto;
    padding: 10px;  
  }
  .recent-main {
    flex-direction: row;
    flex-wrap: wrap;  /* allow wrapping if needed */
    gap: 8px;
    margin-bottom: 6px;
  }
  .recent-title {
    margin-left: 0;
    flex-basis: 100%;  /* allow full width if needed */
    white-space: normal; /* wrap text instead of ellipsis */
  }
  .post-meta {
    text-align: left;
    margin-right: 0;
    font-size: 11px;
    flex-basis: 100%;
  }
	
  .writing-post-container {
    max-width: 90%;
    padding: 1rem;
  }
  .writing-post-container .writing-title {
    font-size: 1.8rem;
  }
  .writing-post-container #mode-toggle {
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
  }
  .blog-infinite-wrapper {
    flex-direction: column;
    padding: 1rem;
  }

  .blog-sidebar {
    order: 2;
    margin-top: 2rem;
  }

  .blog-content-area {
    order: 1;
  }
}
@media (max-width: 480px) {
  .home-option {
      height: 200px;
  }

  .overlay-text {
      font-size: 16px;
  }
}

/* Footer*/ 
footer {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  color: #888;
  background-color: #2a2a2a;
  border-top: 1px solid #444;
  flex-shrink: 0;
}