/* ============================================================
   TÕNU TUNNEL - Custom Theme CSS
   v3.5 - Larger mobile logo
   ============================================================ */

/* ============================================================
   CSS Variables
   ============================================================ */

:root {
  /* Layout */
  --website-background: #fff;
  --website-maxwidth: 1800px;
  --website-mainspacing: 1rem;
  
  /* Theme colors - Light mode */
  --tt-bg: #ffffff;
  --tt-bg-secondary: #f5f5f4;
  --tt-text: #222222;
  --tt-text-secondary: #464646;
  --tt-text-muted: rgba(0,0,0,0.5);
  --tt-text-faint: rgba(0,0,0,0.35);
  --tt-border: rgba(0,0,0,0.08);
  --tt-border-strong: rgba(0,0,0,0.15);
}

[data-theme="dark"] {
  --website-background: #2F2F2F;
  --tt-bg: #2F2F2F;
  --tt-bg-secondary: #3a3a3a;
  --tt-text: #f5f5f5;
  --tt-text-secondary: rgba(255,255,255,0.8);
  --tt-text-muted: rgba(255,255,255,0.55);
  --tt-text-faint: rgba(255,255,255,0.35);
  --tt-border: rgba(255,255,255,0.1);
  --tt-border-strong: rgba(255,255,255,0.18);
}

/* Screen-reader only (visually hidden, accessible to bots/readers) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Reset (from IO200 _base.css)
   ============================================================ */

html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  -webkit-tap-highlight-color: transparent;
}

body { line-height: normal; }
ol, ul { list-style: none; }
table { border-collapse: collapse; border-spacing: 0; }
a { text-decoration: none; color: inherit; }
img { display: block; }
input, button, textarea, select { font: inherit; border-radius: 0; }
:focus:not(:focus-visible) { outline: 0; }

/* ============================================================
   Base Styles
   ============================================================ */

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 1000px) {
  html:not(.glightbox-open) { scrollbar-gutter: stable; }
  body.glightbox-open:not(.gscrollbar-fixer) { scrollbar-gutter: stable; margin-right: 0; }
}

body {
  font-size: 15px;
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--tt-text-secondary);
  background: var(--website-background);
  transition: background-color 200ms ease, color 200ms ease;
}

[data-theme="dark"] body {
  color: var(--tt-text-secondary);
  background: var(--website-background);
}

/* ============================================================
   Layout Container
   ============================================================ */

div#container {
  width: 100%;
  min-height: 100dvh;
  box-sizing: border-box;
  background: var(--website-background);
  
  /* Sticky footer layout */
  display: flex;
  flex-direction: column;
}

div#container > main {
  flex: 1;
}

div#container > footer {
  margin-top: auto;
}

[data-theme="dark"] div#container {
  background: var(--website-background);
}

/* ============================================================
   Skip Link - Hidden
   ============================================================ */

a.skip-link,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Header
   ============================================================ */

header {
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  background: var(--website-background);
}

@media (min-width: 1000px) {
  header, main, footer {
    width: 100%;
    max-width: var(--website-maxwidth);
    margin-inline: auto;
    padding: 1.5rem 2rem;
    box-sizing: border-box;
  }
  main { padding-block: 0; }
}

@media (max-width: 999px) {
  div#container { padding: 0 1rem; }
  header, main, footer { width: 100%; box-sizing: border-box; }
  header { padding: 1rem 0; }
  main { margin: 1rem 0; }
  footer { margin-bottom: 1.5rem; }
}

/* Header title/logo */
header div.title-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
}

header span.website-title,
header h1.website-title {
  font-size: 1em; /* Reduced - smaller logo */
  font-weight: 600;
  color: var(--tt-text);
  display: block;
  line-height: 1;
}

header span.website-title a,
header h1.website-title a {
  display: inline-block;
  color: var(--tt-text);
}

header span.website-title a:hover {
  opacity: 0.8;
}

/* Logo image sizing - IO200 uses content:url() */
header span.website-title.has-logo a,
header h1.website-title.has-logo a {
  font-size: 0;
  line-height: 0;
}

/* Ensure logo image renders properly */
header span.website-title.has-logo,
header h1.website-title.has-logo {
  min-height: 1.2em;
  /* Scale down the logo image */
  transform: scale(0.7);
  transform-origin: left center;
}

header span.website-tagline {
  font-size: 0.75em; /* Slightly smaller tagline too */
  color: var(--tt-text-muted);
  margin-top: 0.1em;
}

/* Dark mode - invert logo if using image */
[data-theme="dark"] header span.website-title,
[data-theme="dark"] header h1.website-title,
[data-theme="dark"] header span.website-title a,
[data-theme="dark"] header h1.website-title a {
  color: var(--tt-text);
}

/* Logo inversion for dark mode - handles IO200's content:url() injection */
[data-theme="dark"] header span.website-title,
[data-theme="dark"] header h1.website-title,
[data-theme="dark"] header span.website-title a,
[data-theme="dark"] header .has-logo a {
  filter: invert(1);
}

/* Hide "Available for commissions" badge */
.availability-badge,
p:has(> .availability-indicator),
main > p:first-of-type:has(.availability-indicator),
footer ~ p,
main > p:last-of-type {
  display: none !important;
}

/* ============================================================
   Navigation
   ============================================================ */

/* Nav Theme Toggle - inline with other nav items */
.tt-theme-toggle-item {
  display: flex;
  align-items: center;
}

.tt-theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--tt-text-secondary, rgba(0,0,0,0.5));
  transition: color 150ms ease;
}

.tt-theme-toggle-btn:hover {
  color: var(--tt-text);
}

.tt-theme-toggle-btn svg {
  width: 1em;
  height: 1em;
  stroke: currentColor;
}

/* Show moon in light mode, sun in dark mode */
.tt-theme-toggle-btn .tt-icon-sun { display: none; }
.tt-theme-toggle-btn .tt-icon-moon { display: block; }

[data-theme="dark"] .tt-theme-toggle-btn .tt-icon-sun { display: block; }
[data-theme="dark"] .tt-theme-toggle-btn .tt-icon-moon { display: none; }

/* Language toggle */
.tt-lang-toggle-item {
  display: flex;
  align-items: center;
}

.tt-lang-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 0.85em;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--tt-text-muted);
  cursor: pointer;
  transition: color 150ms ease;
  text-decoration: none;
}

.tt-lang-toggle-btn:hover {
  color: var(--tt-text);
  text-decoration: none;
}

/* Admin mode - logo glow (brighter orange) */
body.is-admin header span.website-title a,
body.is-admin header h1.website-title a {
  filter: drop-shadow(0 0 8px rgba(255, 140, 80, 0.9)) drop-shadow(0 0 16px rgba(255, 140, 80, 0.6));
}

[data-theme="dark"] body.is-admin header span.website-title a,
[data-theme="dark"] body.is-admin header h1.website-title a {
  filter: invert(1) drop-shadow(0 0 8px rgba(255, 140, 80, 0.9)) drop-shadow(0 0 16px rgba(255, 140, 80, 0.6));
}

@media (min-width: 1000px) {
  header nav {
    font-size: 0.9em;
  }
  
  header nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 2em;
    list-style: none;
  }
  
  header nav ul li {
    position: relative;
  }
  
  header nav ul li .nav-item-title {
    color: var(--tt-text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 400;
    font-size: 0.9em;
    transition: color 150ms ease;
  }
  
  header nav li a:hover,
  header nav li.active > a {
    color: var(--tt-text);
  }
  
  /* Basket icon in nav */
  header nav .linktemplate-basket a {
    display: flex;
    align-items: center;
    gap: 0.25em;
  }
  
  header nav .linktemplate-basket a svg {
    width: 1em;
    height: auto;
    fill: currentColor;
  }
}

/* Mobile nav */
@media (max-width: 999px) {
  header {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='14' viewBox='0 0 20 14'%3E%3Cpath d='M0 0h20v2H0zM0 6h20v2H0zM0 12h20v2H0z' fill='%23222'/%3E%3C/svg%3E");
    background-position: center right;
    background-repeat: no-repeat;
    background-size: 20px 14px;
    padding-right: 36px;
  }
  
  [data-theme="dark"] header {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='14' viewBox='0 0 20 14'%3E%3Cpath d='M0 0h20v2H0zM0 6h20v2H0zM0 12h20v2H0z' fill='%23f5f5f5'/%3E%3C/svg%3E");
  }
  
  header.shownav {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M1.293 1.293a1 1 0 011.414 0L8 6.586l5.293-5.293a1 1 0 111.414 1.414L9.414 8l5.293 5.293a1 1 0 01-1.414 1.414L8 9.414l-5.293 5.293a1 1 0 01-1.414-1.414L6.586 8 1.293 2.707a1 1 0 010-1.414z' fill='%23222'/%3E%3C/svg%3E");
    background-size: 16px 16px;
  }
  
  [data-theme="dark"] header.shownav {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M1.293 1.293a1 1 0 011.414 0L8 6.586l5.293-5.293a1 1 0 111.414 1.414L9.414 8l5.293 5.293a1 1 0 01-1.414 1.414L8 9.414l-5.293 5.293a1 1 0 01-1.414-1.414L6.586 8 1.293 2.707a1 1 0 010-1.414z' fill='%23f5f5f5'/%3E%3C/svg%3E");
  }
  
  header span.website-title {
    font-size: 1.2em;
  }
  
  /* Keep logo scaled on mobile - larger than before */
  header span.website-title.has-logo,
  header h1.website-title.has-logo {
    transform: scale(1);
    transform-origin: left center;
  }
  
  header nav > ul {
    display: none;
    position: absolute;
    left: 0;
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--tt-bg, var(--website-background, #fff));
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    box-sizing: border-box;
  }
  
  [data-theme="dark"] header nav > ul {
    background: var(--tt-bg, #2F2F2F);
  }
  
  header.shownav nav > ul,
  header:not(.js-nav):hover nav > ul {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0;
    align-items: center;
  }

  /* Main nav links row: basket, arhiiv, kontakt */
  header nav > ul > li {
    padding: 0.6rem 0;
    order: 1;
    box-sizing: border-box;
  }

  header nav ul li .nav-item-title {
    color: var(--tt-text);
    font-size: 1em;
    font-weight: 500;
    padding: 0;
  }

  /* Main links container - spans left column */
  header nav > ul > li:not(.tt-theme-toggle-item):not(.tt-lang-toggle-item) {
    grid-column: 1;
    display: inline-flex;
    padding-right: 1.5rem;
  }

  /* First row: all main items inline */
  header nav > ul {
    grid-template-rows: auto;
  }

  header nav > ul > li:not(.tt-theme-toggle-item):not(.tt-lang-toggle-item) {
    order: 1;
  }

  /* Toggles: stacked on right edge */
  header nav > ul > li.tt-theme-toggle-item,
  header nav > ul > li.tt-lang-toggle-item {
    grid-column: 2;
    grid-row: span 1;
    padding: 0.4rem 0;
    display: flex;
    justify-content: flex-end;
    order: 10;
  }

  header nav > ul > li.tt-theme-toggle-item {
    grid-row: 1;
  }

  header nav > ul > li.tt-lang-toggle-item {
    grid-row: 2;
  }

  header nav ul li.tt-theme-toggle-item .tt-theme-toggle-btn,
  header nav ul li.tt-lang-toggle-item .tt-lang-toggle-btn {
    font-size: 1em;
    padding: 0.2rem 0;
    display: flex;
    align-items: center;
    gap: 0.4em;
  }

  header nav ul li.tt-theme-toggle-item .tt-theme-toggle-btn svg {
    width: 1em;
    height: 1em;
  }

  /* Basket link - larger hitbox */
  header nav > ul > li.linktemplate-basket a {
    display: flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.4rem 0.6rem;
    margin: -0.4rem -0.6rem;
  }
}

/* ============================================================
   Footer
   ============================================================ */

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--website-background);
}

/* Footer nav - left side */
footer nav:first-of-type ul,
footer nav ul.secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1.5em;
  list-style: none;
}

footer nav ul li a {
  font-size: 0.8em;
  font-weight: 500;
  color: var(--tt-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 150ms ease;
}

footer nav ul li a:hover {
  color: var(--tt-text);
}

/* Social media icons - right side */
footer nav:last-of-type,
footer nav:has(ul.socialmedia) {
  margin-left: auto;
}

footer ul.socialmedia {
  display: flex !important;
  align-items: center;
  gap: 1rem;
  list-style: none;
}

footer ul.socialmedia li {
  margin: 0;
  padding: 0;
}

footer ul.socialmedia a {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 150ms ease;
}

footer ul.socialmedia a:hover {
  opacity: 1;
}

footer ul.socialmedia img {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}

[data-theme="dark"] footer ul.socialmedia img {
  filter: invert(1);
}

@media (max-width: 999px) {
  footer {
    flex-direction: column;
    text-align: center;
  }
  
  footer nav:first-of-type ul,
  footer nav ul.secondary {
    justify-content: center;
  }
  
  footer nav:last-of-type,
  footer ul.socialmedia {
    margin-left: 0;
    justify-content: center;
  }
}

/* ============================================================
   Main Content Area
   ============================================================ */

main {
  background: var(--website-background);
}

main > *,
main section > *,
main div.content > * {
  margin-bottom: calc(1.8 * 0.5rem);
}

/* Headings */
main h1 { font-size: 1.6em; font-weight: 400; color: var(--tt-text); }
main h2 { font-size: 1.4em; font-weight: 600; color: var(--tt-text); }
main h3 { font-size: 1.2em; font-weight: 600; color: var(--tt-text); }
main h4 { font-size: 1.1em; font-weight: 600; color: var(--tt-text); }

main h1.desktop,
main h1.mobile {
  display: none !important;
}

/* Paragraphs */
main p,
main blockquote {
  line-height: 1.8;
}

/* Links */
main a:not(.button):not(.sitelink):not(.leaflet-control-zoom-in):not(.leaflet-control-zoom-out) {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

@media (hover: hover) and (pointer: fine) {
  main a:hover {
    color: var(--tt-text);
  }
}

/* ============================================================
   Forms
   ============================================================ */

main form {
  padding: 1.2em;
  line-height: 1.25;
}

main form input,
main form select,
main form textarea {
  font-size: 0.92em;
  padding: 0.5em 0.75em;
  border: 1px solid var(--tt-border-strong);
  background: var(--tt-bg);
  color: var(--tt-text);
  transition: border-color 150ms ease;
  /* iOS Safari dark mode fix */
  -webkit-appearance: none;
  appearance: none;
}

[data-theme="dark"] main form input,
[data-theme="dark"] main form select,
[data-theme="dark"] main form textarea {
  background-color: var(--tt-bg-secondary) !important;
  color: var(--tt-text) !important;
  border-color: var(--tt-border-strong) !important;
  color-scheme: dark;
}

main form input:focus,
main form select:focus,
main form textarea:focus {
  border-color: var(--tt-text-muted);
}

main form textarea {
  width: 100%;
  min-height: 10em;
}

main form label:not(.optionlabel) {
  display: block;
  font-weight: 600;
  color: var(--tt-text);
}

/* Filter/search inputs dark mode (phonebook) */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] select,
[data-theme="dark"] .filter-select,
[data-theme="dark"] #searchBar {
  background-color: var(--tt-bg-secondary) !important;
  color: var(--tt-text) !important;
  border-color: var(--tt-border-strong) !important;
  color-scheme: dark;
  -webkit-appearance: none;
}

/* Search bar placeholder text */
[data-theme="dark"] #searchBar::placeholder,
[data-theme="dark"] input::placeholder {
  color: var(--tt-text-muted) !important;
  opacity: 1;
}

/* Safari iOS specific fix for search input */
[data-theme="dark"] input[type="search"] {
  -webkit-text-fill-color: var(--tt-text) !important;
}

/* ============================================================
   Buttons
   ============================================================ */

.button,
input.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.6em 1.2em;
  font-size: 0.9em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tt-text);
  background: var(--tt-bg);
  border: 1px solid var(--tt-border-strong);
  cursor: pointer;
  transition: all 150ms ease;
}

.button:hover,
input.button:hover,
button.button:hover {
  background: var(--tt-bg-secondary);
  border-color: var(--tt-text-muted);
}

/* ============================================================
   Gallery Styles - Masonry.js Layout
   ============================================================ */

ul.gallery {
  list-style: none;
  margin: 0;
  padding: 0 24px;
}

@media (max-width: 599px) {
  ul.gallery {
    padding: 0 16px;
  }
}

/* Grid sizer for Masonry.js - defines column width */
ul.gallery .grid-sizer,
ul.gallery li {
  width: 100%;
}

@media (min-width: 600px) {
  ul.gallery .grid-sizer,
  ul.gallery li {
    width: calc(50% - 10px);
  }
}

@media (min-width: 1800px) {
  ul.gallery .grid-sizer,
  ul.gallery li {
    width: calc(33.333% - 14px);
  }
}

@media (min-width: 2800px) {
  ul.gallery .grid-sizer,
  ul.gallery li {
    width: calc(25% - 15px);
  }
}

/* Gallery items */
ul.gallery li {
  position: relative;
  margin-bottom: 20px;
}

ul.gallery li a {
  display: block;
  line-height: 0;
}

/* Use aspect ratio for proper sizing before image loads */
ul.gallery li .photo-wrapper {
  width: 100%;
  aspect-ratio: var(--aspectratio, 1.5);
  overflow: hidden;
  background: var(--tt-bg-secondary);
}

ul.gallery li img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Basket/favorite button - overlay top right */
ul.gallery li > button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 150ms ease;
}

ul.gallery li > button:hover {
  opacity: 1;
}

ul.gallery li > button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: white;
  stroke-width: 2;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

ul.gallery li > button:hover svg {
  fill: white;
}

ul.gallery li > button.is-active {
  opacity: 1;
}

ul.gallery li > button.is-active svg {
  fill: white;
}

ul.gallery li a {
  display: block;
  line-height: 0;
}

/* Photo item container */
ul.gallery li {
  position: relative !important;
  overflow: visible !important;
}

/* Photo favorite/basket button - IO200 injects button inside li after the <a> */
/* Force position over image in top right corner */
ul.gallery.gallery-album li > button,
ul.gallery li > button {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 100 !important;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  opacity: 0.5 !important;
  transition: opacity 150ms ease !important;
  transform: none !important;
  display: block !important;
}

ul.gallery li > button:hover {
  opacity: 1 !important;
}

/* Heart icon - white outline with stronger shadow */
ul.gallery li > button svg {
  width: 24px !important;
  height: 24px !important;
  fill: none !important;
  stroke: #fff !important;
  stroke-width: 2.5 !important;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6)) !important;
  transition: fill 150ms ease !important;
}

/* Hover - filled white heart */
ul.gallery li > button:hover svg {
  fill: #fff !important;
}

/* Active/selected state - always visible, filled */
ul.gallery li > button.is-active,
ul.gallery li > button.active,
ul.gallery li > button[class*="active"] {
  opacity: 1 !important;
}

ul.gallery li > button.is-active svg,
ul.gallery li > button.active svg,
ul.gallery li > button[class*="active"] svg {
  fill: #fff !important;
}

/* Info below image (for set galleries) */
ul.gallery li .info {
  display: block;
  padding: 0.5em 0;
  font-size: 0.9em;
  color: var(--tt-text-secondary);
}

ul.gallery li .info-title {
  font-weight: 500;
  color: var(--tt-text);
}

/* Image loading placeholder - prevents layout shift */
ul.gallery li a {
  display: block;
  line-height: 0;
  background: var(--tt-bg-secondary);
}

ul.gallery li img {
  width: 100%;
  height: auto;
  background: var(--tt-bg-secondary);
}

/* ============================================================
   Lightbox Overrides
   ============================================================ */

/* Lightbox background - slightly off-white instead of black with shadow */
.glightbox-container .goverlay {
  background: rgba(250, 250, 249, 0.97) !important;
}

[data-theme="dark"] .glightbox-container .goverlay {
  background: rgba(30, 30, 30, 0.97) !important;
}

.glightbox-container .gclose,
.glightbox-container .gnext,
.glightbox-container .gprev {
  background: transparent !important;
  box-shadow: none !important;
}

.glightbox-container .gclose svg,
.glightbox-container .gnext svg,
.glightbox-container .gprev svg {
  fill: #333 !important;
}

[data-theme="dark"] .glightbox-container .gclose svg,
[data-theme="dark"] .glightbox-container .gnext svg,
[data-theme="dark"] .glightbox-container .gprev svg {
  fill: #aaa !important;
}

/* Remove any shadows from lightbox images */
.glightbox-container .gslide-image img {
  box-shadow: none !important;
}

/* Lightbox caption container */
.glightbox-container .gslide-description,
.glightbox-container .gdesc-inner {
  background: rgba(255, 255, 255, 0.95) !important;
}

[data-theme="dark"] .glightbox-container .gslide-description,
[data-theme="dark"] .glightbox-container .gdesc-inner {
  background: rgba(20, 20, 20, 0.95) !important;
}

/* Lightbox caption - bold monospace typewriter font */
.glightbox-container .gslide-title,
.glightbox-container .gslide-desc,
.glightbox-container .gdesc-inner,
.glightbox-container .gslide-description,
.gslide-title,
.gslide-desc,
.gdesc-inner {
  font-family: 'Courier New', Courier, 'Liberation Mono', monospace !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  color: #333 !important;
}

[data-theme="dark"] .glightbox-container .gslide-title,
[data-theme="dark"] .glightbox-container .gslide-desc,
[data-theme="dark"] .glightbox-container .gdesc-inner,
[data-theme="dark"] .gslide-title,
[data-theme="dark"] .gslide-desc {
  color: #ddd !important;
}

/* IO200 lightbox (if different) */
.lightbox-title,
.lightbox-caption,
.photo-title,
.photo-caption,
.glightbox .slide-title {
  font-family: 'Courier New', Courier, 'Liberation Mono', monospace !important;
  font-weight: 700 !important;
}

/* ============================================================
   Theme Toggle (inline with view buttons)
   ============================================================ */

.toggle-separator {
  width: 1px;
  height: 20px;
  background: var(--tt-border-strong);
  margin: 0 8px;
}

.theme-icon,
.tt-theme-icon {
  display: none;
  width: 20px;
  height: 20px;
}

.theme-icon--moon,
.tt-theme-icon--moon {
  display: block;
}

[data-theme="dark"] .theme-icon--moon,
[data-theme="dark"] .tt-theme-icon--moon {
  display: none;
}

[data-theme="dark"] .theme-icon--sun,
[data-theme="dark"] .tt-theme-icon--sun {
  display: block;
}

/* ============================================================
   Special Templates
   ============================================================ */

/* Full-page templates - no max-width constraint */
body.template-hero,
body.template-sidekick,
body.template-password,
body.template-404,
body.template-locationadmin {
  --website-maxwidth: 100%;
}

/* Sticky header for gallery templates */
body.template-set header,
body.template-albums header,
body.template-album header,
body.template-photo header,
body.template-basket header,
body.template-locationadmin header {
  position: sticky;
  top: 0;
  z-index: 200;
  background-color: var(--website-background);
}

/* ============================================================
   Backlink
   ============================================================ */

div.backlink {
  margin-bottom: 1em;
}

div.backlink a {
  color: var(--tt-text-muted);
  font-size: 0.9em;
}

div.backlink a:hover {
  color: var(--tt-text);
}

/* ============================================================
   Responsive Adjustments
   ============================================================ */

@media (max-width: 999px) {
  main h1 {
    font-size: 1.4em;
    text-align: center;
    margin-block: 1rem;
  }
}

@media (max-width: 600px) {
  header span.website-title {
    font-size: 1.2em;
  }
}

/* ============================================================
   Print Styles
   ============================================================ */

@media print {
  body {
    background: white;
    color: black;
  }
  
  header nav,
  footer {
    display: none;
  }
}
