/* css/style.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  opacity: 0;
  transition: opacity 0.5s ease;
  background-color: #FEFBE7;
  color: #7D615B;
}

header {
  position: fixed;
  top: 0;
  width: 100%;
  height: 10vh;
  background: #FDF6E1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 1000;
  border-bottom: 1px solid #ccc;
}

header .branding {
  display: flex;
  align-items: center;
}

header .branding img {
  height: 40px;
  margin-right: 10px;
}

nav {
  position: fixed;
  top: 10vh;
  width: 100%;
  height: 5vh;
  background: #F8EDD9;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.nav-item {
  margin: 0 1rem;
  text-decoration: none;
  color: #7D615B;
  position: relative;
  transition: color 0.3s ease;
  font-weight: bold;
}

.nav-item:hover {
  color: #A0522D;
}

main {
  padding: 15vh 1rem 2rem;
}

section.hero {
  text-align: center;
  padding: 2rem 0;
}

.book-grid, .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.book-grid img, .gallery-grid img {
  width: 100%;
  display: block;
  transition: transform 0.3s ease;
  border: 3px solid #F7ECD7;
  background: #FDF6E1;
  border-radius: 5px;
}

.book-grid img:hover, .gallery-grid img:hover {
  transform: scale(1.05);
}

.toggle-switch {
  position: relative;
  width: 60px;
  height: 30px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  transition: 0.4s;
  border-radius: 30px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #fff;
  border-radius: 50%;
  top: 0;
  left: 0;
  transition: 0.4s;
  color: #7D615B;
  font-weight: bold;
}

input:checked + .toggle-slider {
  background: #A0522D;
}

/*input:checked + .toggle-slider:before {
  transform: translateX(30px);
  content: "ગુ";
}*/

input:checked + .toggle-slider::before { transform: translateX(30px); }

/* Language toggle labels */
#lang-toggle + .toggle-slider::before { content: "En"; }
#lang-toggle:checked + .toggle-slider::before { content: "ગુ"; }

/* Missing toggle labels */
#missing-toggle + .toggle-slider::before { content: "S"; }
#missing-toggle:checked + .toggle-slider::before { content: "M"; }


body.fade-out {
  opacity: 0;
}

/* Media Queries */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.2rem;
  }

  .nav-item {
    margin: 0 0.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  nav {
    flex-wrap: wrap;
    height: auto;
    padding: 0.5rem;
  }

  .nav-item {
    margin: 0.5rem;
  }
}


.about-author {
  margin: 2rem auto;
  max-width: 900px;
}

.about-author .card {
  display: flex;
  justify-content: space-between;
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease;
}

.about-author .card:hover {
  transform: translateY(-4px);
}

.author-info {
  flex: 3;
  padding-right: 1rem;
}

.author-photo img {
  border-radius: 10px;
  max-width: 120px;
  height: auto;
}

.recommended-books {
  margin: 2rem auto;
  max-width: 1100px;
}

.recommended-books h2 {
  margin-bottom: 1rem;
}

.book-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  padding: 0;
}

.book-list li {
  flex: 1 1 calc(33.333% - 1rem);
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-list img {
  width: 80%;
  max-width: 150px;
  height: auto;
  margin-bottom: 0.5rem;
  border-radius: 5px;
}

.book-list h3 {
  color: #7D615B;
  margin-bottom: 0.5rem;
}

.book-list li:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 20px rgba(0,0,0,0.2);
}


.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  padding: 1rem 0;
}

.gallery-grid img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.gallery-grid img:hover {
  transform: scale(1.05);
}


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

.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.book-card:hover {
  transform: translateY(-5px);
}

.book-card img {
  max-width: 100%;
  height: 200px;
  object-fit: cover;
  margin-bottom: 0.5rem;
}

.book-card a {
  margin-top: 0.5rem;
  text-decoration: none;
  color: #A0522D;
  font-weight: bold;
}

/* === About page: easygoing, consistent card === */
.bio-wrap {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.bio-card {
  background: #fff;                 /* matches existing cards */
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 1.5rem;
}

.bio-content {
  /* slightly larger only inside this card; keeps site-wide vibe intact */
  font-size: 1.0625rem; /* ~17px */
  line-height: 1.75;
  max-width: 68ch;      /* comfortable reading line length */
}

.bio-content h2,
.bio-content h3 {
  margin-bottom: 0.75rem;
  color: inherit;       /* keeps #7D615B */
}

.bio-content p {
  margin: 0 0 1rem;
}

.bio-photo-img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 3px solid #F7ECD7;        /* same framing as gallery/book images */
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Layout: stacked on mobile, two-column on wide screens */
@media (min-width: 900px) {
  .bio-card {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
  }
  .bio-media { flex: 1; max-width: 380px; }
  .bio-content { flex: 2; }
}

/* Consistent paragraph spacing for About page */
.bio p {
  margin-bottom: 1.5rem; /* space after each paragraph */
}

.bio h2,
.bio h3 {
  margin-top: 1.5rem; /* space before headings */
  margin-bottom: 0.75rem; /* space after headings */
}

.bio-list {
  list-style-type: disc;
  padding-left: 1.5rem;
  line-height: 1.75;
}

.bio-list li {
  margin-bottom: 1rem;
}
/* Active page highlight */
.nav-item.active,
.nav-item[aria-current="page"] {
  color: #A0522D;
  border-bottom: 3px solid #A0522D;
  padding-bottom: 2px;            /* keeps height steady */
}

/* Publications: 3-column list view (FIXED for ordered lists) */
.pub-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

.pub-col h3 { margin-bottom: 0.5rem; }

/* Do NOT force bullet style here; allow OL/UL semantics */
.pub-list {
  line-height: 1.7;
  padding-left: 1.25rem;     /* restore indentation removed by the reset */
  list-style-position: outside;
  margin: 0;
}

/* Explicit types for clarity */
.pub-col ol.pub-list { list-style-type: decimal; }
.pub-col ul.pub-list { list-style-type: disc; }

.pub-list a {
  text-decoration: none;
  color: inherit;
}

.pub-list a:hover {
  text-decoration: underline;
}

/* Stack on small screens */
@media (max-width: 900px) {
  .pub-columns { grid-template-columns: 1fr; }
}

/* --- Gallery sections --- */
.gallery-section { margin-top: 1.25rem; }
.gallery-section h3 { margin: 0.75rem 0; }

.gallery-card {
  background: #fff;
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform .2s ease, box-shadow .2s ease;
}
.gallery-card:hover { transform: translateY(-3px); box-shadow: 0 8px 16px rgba(0,0,0,0.15); }

.gallery-card img { width: 100%; border-radius: 8px; display: block; }
.img-caption { text-align: center; font-size: .92rem; color: #5A423D; margin-top: .5rem; }

/* Uniform gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* Card and image sizing */
.gallery-card {
  background:#fff; border-radius:12px; padding:.5rem;
  box-shadow:0 2px 8px rgba(0,0,0,.1);
  transition:transform .2s ease, box-shadow .2s ease;
  cursor:pointer;                     /* click hint */
}
.gallery-card:hover { transform:translateY(-3px); box-shadow:0 8px 16px rgba(0,0,0,.15); }

/* Make every thumbnail the same size */
.gallery-card img{
  width:100%;
  height:220px;            /* ← uniform height */
  aspect-ratio: 4 / 3;     /* keeps consistent box */
  object-fit:cover;        /* crop, not squish */
  border-radius:8px;
  display:block;
}

/* Caption */
.img-caption{ text-align:center; font-size:.92rem; color:#5A423D; margin-top:.5rem; }

/* Lightbox overlay */
.lightbox{
  position:fixed; inset:0; display:none; place-items:center;
  background:rgba(0,0,0,.6); z-index:9999; padding:2rem;
}
.lightbox.open{ display:grid; }
.lightbox-content{
  position:relative; margin:0; max-width:92vw; max-height:90vh;
  background:#fff; border-radius:12px; padding:1rem;
  box-shadow:0 12px 28px rgba(0,0,0,.35);
}
.lightbox-content img{
  display:block; max-width:90vw; max-height:75vh; border-radius:8px; margin:0 auto;
}
.lightbox-content figcaption{ text-align:center; margin-top:.5rem; color:#333; }
.lightbox-close{
  position:absolute; top:.5rem; right:.5rem; border:0; background:transparent;
  font-size:1.25rem; line-height:1; cursor:pointer; padding:.25rem .5rem;
}


#lightbox {
  position: fixed;
  z-index: 1001;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
}
#lightbox.active {
  display: flex;
}
#lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
/* Top banner */
.top-banner {
  width: 100%;
  margin: 1.5rem 0 0;
}
.top-banner img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;           /* optional, looks nicer */
  box-shadow: 0 8px 24px rgba(0,0,0,.18); /* optional */
}
/* Developer credit strip */
.site-credit {
  background: #f8edd9;         /* from provided swatch */
  padding: 12px 16px;
}
.site-credit .credit-wrap {
  max-width: 1200px;
  margin: 0 auto;
}
.site-credit p {
  margin: 0;
  text-align: right;            /* right-aligned text */
  color: var(--text-color, #222); /* keep consistent with site text */
  font-weight: 500;
}
.site-credit .linkedin {        /* already inline with the sentence */
  display: inline-flex;
  align-items: center;          /* centers icon to text line */
  margin-left: 8px;
  vertical-align: middle;
}
.site-credit .linkedin img {
  width: 22px;                  /* a little bigger than text */
  height: 22px;
  display: block;               /* avoids extra baseline gap */
}

header .toggle-switch + .toggle-switch { margin-left: .5rem; }

/* YouTube promo */
.yt-promo {
  display: grid;
  gap: 16px;
  align-items: center;
  margin-top: 24px;
}
@media (min-width: 900px) {
  .yt-promo { grid-template-columns: 2fr 1fr; }
}
.yt-video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;   /* responsive video */
  border: 0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.yt-channel h3 { margin: 0 0 6px; }
.yt-channel p  { margin: 0 0 12px; color: var(--text-muted, #7D615B); }
.yt-btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  text-decoration: none;
  font-weight: 600;
}
.yt-btn:hover { opacity: .85; }




/* === PDF viewer page === */
#pdf-viewer-page .viewer-title {
  margin: 0 0 .75rem;
  text-align: center;
}

#pdf-viewer-page .viewer-actions {
  margin-top: .5rem;
  text-align: center;
}

/* Tall-but-not-fullscreen iframe:
   - at least ~70% of the viewport
   - subtract room for header/nav/title
   - cap very large monitors to avoid comically tall panes */
#pdf-viewer-page .viewer-frame {
  width: 100%;
  height: clamp(70vh, calc(100svh - 20vh), 1200px);
  display: block;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

/* Mobile: give the viewer more vertical room for natural page swiping */
@media (max-width: 768px) {
  #pdf-viewer-page .viewer-frame {
    height: calc(100svh - 18vh);
  }
}


/* Action row: centered, symmetric buttons */
#pdf-viewer-page .viewer-actions {
  margin-top: .6rem;
  display: flex;
  justify-content: center;    /* center the pair so Open is left, Download is right */
  align-items: center;
  gap: .75rem;                /* equal spacing for symmetry */
  transform: translateX(-4px);/* nudge the pair a hair left per request */
}

/* Buttons – match your rounded, soft-shadow aesthetic */
#pdf-viewer-page .btn {
  display: inline-block;
  padding: .5rem .9rem;
  border-radius: 9999px;
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: transform .06s ease, box-shadow .2s ease, background-color .2s ease;
  -webkit-tap-highlight-color: transparent;
}

#pdf-viewer-page .btn:hover { 
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,.12);
}

/* Use your site’s warm palette; adjust if you keep CSS variables */
#pdf-viewer-page .btn-primary {
  background: #675141;          /* primary accent */
  color: #fff;
}
#pdf-viewer-page .btn-primary:hover { background: #3f5a38; }

#pdf-viewer-page .btn-secondary {
  background: #ffffff;
  color: #A0522D;
}
#pdf-viewer-page .btn-secondary:hover { background: #fafafa; }


/* === PDF viewer: top toolbar (Back + Title) === */
#pdf-viewer-page .viewer-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto; /* back | title | spacer */
  align-items: center;
  gap: .5rem;
  margin: 0 0 .75rem;
}

/* Keep the title perfectly centered regardless of back-button width */
#pdf-viewer-page .viewer-title {
  margin: 0;
  text-align: center;
  justify-self: center;
}

/* Round back button matches your button aesthetics */
#pdf-viewer-page .btn-back {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Ensure the icon inherits the correct color on both themes */
#pdf-viewer-page .btn-back svg path {
  fill: currentColor;
}

/* Spacer mirrors back button width so title stays centered */
#pdf-viewer-page .toolbar-spacer {
  width: 40px;
  height: 1px; /* minimal height; purely for layout */
  display: block;
}

/* Small screens: keep it touch-friendly and visible */
@media (max-width: 768px) {
  #pdf-viewer-page .btn-back { width: 44px; height: 44px; }
  #pdf-viewer-page .toolbar-spacer { width: 44px; }
}


