/* Libertarian Press - Flex Layout (775px max) */
/* === BASE === */
body {
  color: #000;
  background-color: #F5EDDA;
  font-family: Trebuchet MS, Arial, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
h1,h2,h3,h4,p,li,a,button,input,textarea {
  font-family: Trebuchet MS, Arial, sans-serif;
}

/* === STRUCTURE === */
.page-wrapper {
  max-width: 775px;
  margin: 0 auto;
  padding: 1rem;
  background: #F5EDDA;
}
.header-img {
  display:block;
  margin:0 auto 1rem auto;
  width:100%;
  height:auto;
  max-width:775px;
}
.main-layout {
  display:flex;
  gap:1rem;
}
.sidebar {flex:0 0 150px;}
.content {flex:1;}
.aside {flex:0 0 120px;}

/* === CENTER FLEX === */
.center-flex {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}
.authors-box,
.titles-box {
  flex: 1 1 50%;
  border: 1px solid #782257;
  border-radius: 4px;
  background-color: #FAF8F3;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}
.scroll-container {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 400px;
  padding-right: 6px;
}

/* === HEADINGS === */
h1 {color:#782257;font-size:1.8rem;margin-top:0.5rem;}
h2 {color:#782257;font-size:1.3rem;margin-bottom:0.5rem;}
a {color:#782257;text-decoration:none;}
a:hover {color:#B86D9D;text-decoration:underline;}

/* === FREE E-TEXTS === */
.free-etexts {
  margin-top:0.5rem;
  margin-bottom:1rem;
}
.free-etexts strong {
  color:#782257;
  font-size:28pt;
  font-weight:bold;
}
.free-etexts ul {
  margin:0.25rem 0 0 1.5rem;
  padding:0;
  list-style-type:disc;
}
.free-etexts li {
  font-size:24pt;
  line-height:1.4;
  margin-bottom:0.25rem;
}
.free-etexts li::marker {
  color:#782257;
  font-size:14pt;
}

/* === AUTHORS === */
.authors-box .author-toggle {
  background:none;
  border:none;
  color:#782257;
  text-align:left;
  width:100%;
  cursor:pointer;
  font-size:1rem;
  line-height:1.4;
  text-decoration:underline;
}
.authors-box .author-toggle:hover {
  color:#B86D9D;
}
.author-dropdown {
  display:none;
  border:1px solid #782257;
  background:#fff;
  border-radius:4px;
  padding:0.25rem 0.5rem;
  margin:0.25rem 0 0.5rem 0;
  max-height:150px;
  overflow:auto;
}
.author-dropdown a {
  display:block;
  font-size:0.9rem;
  line-height:1.3;
  text-indent:-1rem;
  padding-left:1.2rem;
  text-decoration:underline;
}

/* === TITLES === */
.titles-box .scroll-container a.title-link {
  display:block;
  font-size:1rem;
  line-height:1.5;
  text-decoration:underline;
  text-indent:-1rem;
  padding-left:1.2rem;
  margin-bottom:0.25rem;
  border-bottom:1px dotted rgba(120,34,87,0.2);
}
.titles-box .scroll-container a.title-link:last-child {
  border-bottom:none;
}

/* === FOOTER === */
.footer-wrapper {
  text-align:center;
  margin-top:2rem;
  font-size:0.8rem;
}
.contact-us-btn {
  background:#782257;
  color:#F4E8D0;
  border:none;
  padding:0.5rem 1rem;
  font-weight:bold;
  border-radius:4px;
  cursor:pointer;
  margin-top:1rem;
}
.contact-us-btn:hover {background:#5a1a40;}

/* CONTACT MODAL (Added 2025-10-13) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #F5EDDA;
    padding: 30px;
    border: 2px solid #782257;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

.modal-header {
    color: #782257;
    font-size: 24px;
    font-family: Georgia, serif;
    margin-bottom: 20px;
    border-bottom: 2px solid #782257;
    padding-bottom: 10px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #782257;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}

.modal-close:hover {
    color: #B86D9D;
}

.modal-form label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-family: Georgia, serif;
    color: #782257;
    font-weight: bold;
}

.modal-form input[type="text"],
.modal-form input[type="email"],
.modal-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #782257;
    border-radius: 4px;
    font-family: Trebuchet, Arial, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
}

.modal-form textarea {
    min-height: 120px;
    resize: vertical;
}

.modal-form button[type="submit"] {
    background: #782257;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-family: Georgia, serif;
    font-size: 16px;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.modal-form button[type="submit"]:hover {
    background: #B86D9D;
}

.modal-form button[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* MODAL DIVIDER */
.modal-divider {
    margin: 25px 0;
    text-align: center;
    position: relative;
}

.modal-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #782257;
}

.modal-divider span {
    background: #F5EDDA;
    padding: 0 15px;
    position: relative;
    color: #782257;
    font-family: Georgia, serif;
    font-weight: bold;
    font-size: 14px;
}

/* MODAL CONTACT INFO */
.modal-contact-info {
    margin-top: 20px;
}

.modal-contact-info h3 {
    color: #782257;
    font-size: 18px;
    font-family: Georgia, serif;
    margin-bottom: 15px;
    text-align: center;
}

.contact-details {
    background: rgba(120, 34, 87, 0.05);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid rgba(120, 34, 87, 0.2);
}

.contact-details p {
    margin: 8px 0;
    line-height: 1.6;
    font-family: Trebuchet, Arial, sans-serif;
    font-size: 14px;
}

.contact-details .company-name {
    font-size: 16px;
    margin-bottom: 12px;
}

.contact-details a {
    color: #782257;
    text-decoration: none;
    border-bottom: 1px dotted #782257;
}

.contact-details a:hover {
    color: #B86D9D;
    border-bottom-color: #B86D9D;
}

/* HONEYPOT (Anti-spam hidden field) */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === TABLE OF CONTENTS (TOC) PAGES === */
.toc-page {
    background-color: linen;
    min-height: 100vh;
}

.toc-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 40px;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.toc-logo {
    width: 400px;
    height: auto;
    max-width: 50%;
    flex-shrink: 0;
}

.btn-buy-header {
    flex-shrink: 0;
}

.buy-contact-top,
.buy-contact-bottom {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.btn-buy,
.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    vertical-align: middle;
    border: 2px solid transparent;
    box-sizing: border-box;
    min-height: 48px;
}

.btn-buy {
    background-color: #782257;
    color: #F4E8D0;
    border-color: #782257;
}

.btn-buy:hover {
    background-color: #5a1a42;
    border-color: #5a1a42;
    transform: translateY(-2px);
}

.btn-contact {
    background-color: #F4E8D0;
    color: #782257;
    border-color: #782257;
}

.btn-contact:hover {
    background-color: #e8d8b8;
}

.toc-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    line-height: 1.8;
}

.toc-main-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.toc-main-left {
    flex: 1;
}

.toc-sidebar {
    flex: 0 0 250px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    font-size: 0.9em;
    line-height: 1.6;
}

.toc-sidebar p {
    margin: 0;
}

.toc-content h1 {
    font-size: 1.5em;
    margin-bottom: 2px;
    color: #782257;
}

.toc-author {
    font-size: 1.5em;
    color: #000000;
    font-style: normal;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 4px;
}

.toc-content h2 {
    font-size: 1.3em;
    margin-top: 20px;
    margin-bottom: 15px;
    color: #782257;
}

.toc-section {
    margin-bottom: 8px;
}

.toc-prelims {
    margin-top: 0;
}

.toc-section ul {
    list-style: none;
    padding-left: 20px;
    margin-top: 0;
}

.toc-section li {
    margin-bottom: 4px;
}

.toc-footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    border-top: 2px solid #782257;
    font-family: "Times New Roman", serif;
}

.toc-footer strong {
    display: block;
    margin-bottom: 10px;
}

/* === RESPONSIVE === */
@media (max-width:768px){
  .main-layout{flex-direction:column;}
  .center-flex{flex-direction:column;}
  .authors-box,.titles-box{max-width:100%;}

  /* TOC responsive */
  .toc-container {
      padding: 10px;
  }
  .toc-content {
      padding: 20px;
  }
  .toc-header {
      flex-direction: column;
      align-items: center;
  }
  .toc-logo {
      max-width: 100%;
  }
  .toc-main-wrapper {
      flex-direction: column;
  }
  .toc-sidebar {
      flex: 1 1 auto;
      width: 100%;
  }
  .btn-buy,
  .btn-contact {
      width: 100%;
      max-width: 300px;
  }
}
