/* ============================================================
   parchment.css
   The Pirate's Realm — site-wide stylesheet
   Replaces main.css as pages are converted to parchment design
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&family=Cinzel+Decorative:wght@400;700&family=Cinzel:wght@400;600&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

/* ── VARIABLES ───────────────────────────────────────── */
:root {
  --parchment:        #f2e8c8;
  --parchment-edge:   #d4c090;
  --parchment-shadow: rgba(60, 30, 5, 0.55);
  --parchment-dark:   #e6d9a8;
  --ink:              #1c1005;
  --dark-wood:        #3b1f0a;
  --blood-red:        #8b1a1a;
  --gold:             #b8860b;
  --gold-light:       #d4a017;
  --rope:             #7a5c32;
  --fog:              #c8b888;
  --nav-bg:           #1e0d03;
  --ebay-blue:        #0064d2;
  --sidebar-parch:    #ede0b8;
}

/* ── RESET ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; }

/* ── LINKS — scoped to main content to avoid collisions ── */
#main-content a { color: var(--blood-red); text-decoration: none; }
#main-content a:hover { color: var(--dark-wood); text-decoration: underline; }

/* Footer links bar uses same color */
.footer-links a { color: var(--blood-red); margin: 0 4px; }
.sb-section ul li a:hover { color: var(--blood-red); }

/* ══════════════════════════════════════════════════════
   WOODEN DESK
══════════════════════════════════════════════════════ */
html { height: 100%; }

body {
  min-height: 100%;
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  background-image: url('https://www.thepiratesrealm.com/assets/css/images/wood%20bg2.jpg');
  background-attachment: fixed;
  background-repeat: repeat;
  background-size: auto;
  background-color: #3d1f08;
}

figure figcaption {
  max-width: 100%;
}

/* ══════════════════════════════════════════════════════
   TOP NAV BAR
══════════════════════════════════════════════════════ */
#site-header {
  position: relative;
  z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--gold);
  box-shadow: 0 3px 12px rgba(0,0,0,0.6);
}

#site-title {
  text-align: center;
  padding: 14px 20px 10px;
  border-bottom: 0px solid #4a2510;
}

#site-title a {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.75rem;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  text-decoration: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

#site-title a:hover { color: #fff; text-decoration: none; }

/* ── NAV — scoped to #site-header to avoid conflicts ── */
#site-header nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

#site-header nav a {
  display: inline-block;
  color: #d6cdb4;
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  padding: 9px 18px;
  border-right: 0px solid #4a2a10;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

#site-header nav a.nav-shop {
  border: 1px solid #b8860b;
  border-radius: 3px;
  margin-left: 4px;
}

#site-header nav a.nav-shop:hover {
  background: #b8860b;
  color: #1a0f00 !important;
}

#site-header nav a:first-child { border-left: 0px solid #4a2a10; }
#site-header nav a:hover { background: var(--blood-red); color: #fff; text-decoration: none; }
#site-header nav a.active { background: var(--blood-red); color: #fff; }

/* ── NAV GROUPS ── */
/*#site-header nav a.nav-group-start {*/
 /* border-left: 2px solid #6a3a18;*/
 /* margin-left: 6px;*/
/*}

/* ══════════════════════════════════════════════════════
   PAGE FRAME
══════════════════════════════════════════════════════ */
#page-frame {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 60px;
  position: relative;
}

/* ══════════════════════════════════════════════════════
   THREE-PART PARCHMENT ASSEMBLY
══════════════════════════════════════════════════════ */
#parchment {
  position: relative;
  box-shadow:
    0  2px  4px  rgba(0,0,0,0.12),
    0  6px  16px rgba(0,0,0,0.25),
    0 18px  50px var(--parchment-shadow),
    0 30px  80px rgba(30,10,0,0.35);
  border: 0px solid var(--parchment-edge);
}

#parchment-top {
  background: url('https://www.thepiratesrealm.com/pirates-images/bg_paper_top3.png') no-repeat top center;
  background-size: 100% 100%;
  width: 100%;
  height: 54px;
  display: block;
  margin-bottom: -1px;
  position: relative;
  z-index: 2;
}

#parchment-mid {
  background: url('https://www.thepiratesrealm.com/pirates-images/bg_paper_mid3.png') repeat-y top center;
  background-size: 100% auto;
}

#parchment-bot {
  background: url('https://www.thepiratesrealm.com/pirates-images/bg_paper_bot3.png') no-repeat bottom center;
  background-size: 100% 100%;
  width: 100%;
  height: 50px;
}

#parchment-grid {
  display: grid;
  grid-template-columns: 230px 1fr;
  grid-template-areas: "sidebar main";
  gap: 0;
}

/* ── SIDEBAR ─────────────────────────────────────────── */
#sidebar {
  grid-area: sidebar;
  border-right: 2px solid var(--parchment-edge);
  position: relative;
  z-index: 2;
  box-shadow: inset -6px 0 14px rgba(100,60,10,0.10);
  padding: 20px 16px;
}

.sb-top, .sb-bot { display: none; }
.sb-mid { display: contents; }

/* ── Mobile sidebar toggle (hidden on desktop) ── */
#sidebar-toggle { display: none; }

/* ── MAIN CONTENT ────────────────────────────────────── */
#main-content {
  grid-area: main;
  padding: 28px 32px 40px;
  position: relative;
  z-index: 2;
  border-left: 3px double rgba(139,107,60,0.2);
}

/* ══════════════════════════════════════════════════════
   SIDEBAR COMPONENTS
══════════════════════════════════════════════════════ */
.sb-section { margin-bottom: 22px; }

.sb-section h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blood-red);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--fog);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.sb-section ul { list-style: none; padding: 0; }

.sb-section ul li {
  border-bottom: 1px dotted var(--fog);
  padding: 5px 0;
  font-size: 0.84rem;
}

.sb-section ul li:last-child { border-bottom: none; }
.sb-section ul li a { color: var(--dark-wood); font-family: 'Libre Baskerville', serif; padding-left: 12px; }

.sb-section p {
  font-size: 0.82rem;
  line-height: 1.65;
  color: #3a2710;
}

/* ── SIDEBAR eBay LINKS ──────────────────────────────── */
.sb-ebay-link {
  display: block;
  background: rgba(139,107,60,0.1);
  border: 1px solid rgba(100, 70, 20, 0.28);
  border-left: 3px solid var(--blood-red);
  color: var(--blood-red) !important;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 9px;
  margin-top: 5px;
  text-decoration: none !important;
  font-family: 'Libre Baskerville', serif;
}
.sb-ebay-link:hover { background: rgba(139,107,60,0.2); }
.sb-ebay-disc { font-size: 0.72rem; color: var(--rope); font-style: italic; margin-top: 4px; display: block; }

.sb-logo {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--fog);
}

.sb-logo img { max-width: 120px; }

/* ── Title row — flex on all screen sizes ── */
#title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

#title-row .page-title {
  margin-bottom: 0;
  flex: 1;
}

/* ── Logo left of H1 on all screen sizes ── */
#sidebar-logo-mobile {
  display: block;
  flex-shrink: 0;
}

#sidebar-logo-mobile img {
  width: 90px;
  height: auto;
  display: block;
}



/* ══════════════════════════════════════════════════════
   MAIN CONTENT TYPOGRAPHY
══════════════════════════════════════════════════════ */
.drop-cap::first-letter {
  font-family: 'Cinzel Decorative', serif;
  font-size: 4rem;
  font-weight: 700;
  color: var(--blood-red);
  float: left;
  line-height: 0.75;
  margin: 6px 8px -4px 0;
  text-shadow: 1px 1px 0 var(--gold);
}

.page-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.5rem;
  color: var(--blood-red);
  line-height: 1.3;
  margin-bottom: 4px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 3px;
}

.page-byline {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.0rem;
  color: black;
  line-height: 1.0;
  margin-bottom: 2px;
  border-bottom: 0px solid var(--gold);
  padding-bottom: 4px;
}

.page-sub {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  color: #000000;
  font-size: 1.3rem;
  margin-bottom: 22px;
}

h2.section-head {
  font-family: 'Cinzel', serif;
  font-size: 1.0rem;
  font-weight: 600;
  color: var(--dark-wood);
  background: linear-gradient(90deg, var(--parchment-dark) 0%, var(--parchment) 100%);
  border-left: 5px solid var(--blood-red);
  border-bottom: 1px solid var(--fog);
  padding: 8px 14px;
  margin: 28px 0 14px;
}

h3.sub-head {
  font-family: 'IM Fell English', serif;
  font-size: 1.1rem;
  color: var(--blood-red);
  border-bottom: 1px dashed var(--fog);
  padding-bottom: 3px;
  margin: 18px 0 10px;
}

h2.sub-head {
  font-family: 'IM Fell English', serif;
  font-size: 1.3rem;
  color: #000000;
  border-bottom: 1px dashed var(--fog);
  padding-bottom: 3px;
  margin: 18px 0 10px;
}

h3.thanks-head {
  font-family: 'IM Fell English', serif;
  font-size: 1.1rem;
  color: #000000;
  border-bottom: 1px dashed var(--fog);
  padding-bottom: 3px;
  margin: 18px 0 10px;
}

h2.byline {
  font-family: 'IM Fell English', serif;
  font-size: 1.4rem;
  color: black;
  border-bottom: 1px dashed var(--fog);
  padding-bottom: 3px;
  margin: 7px 0 7px;
}

.content-p {
  font-size: 0.97rem;
  margin-bottom: 14px;
  color: var(--ink);
}

.content-top{
  font-size: 1.1rem;
  margin-bottom: 14px;
  color: var(--ink);
}


.img-right { float: right; margin: 0 0 14px 20px; clear: right; }
.img-left  { float: left;  margin: 0 20px 14px 0; clear: left;  }
.as-left  { float: left; margin: 0 15px 10px 0; }
.as-left::after { content: ""; display: table; clear: both; }
.as-right { float: right; margin: 0 0 10px 15px; }
.as-right::after { content: ""; display: table; clear: both; }
.clearfix::after { content: ''; display: table; clear: both; }
.clear { clear: both; }

/* ══════════════════════════════════════════════════════
   CONTENT SECTIONS
══════════════════════════════════════════════════════ */

/* ── THANK YOU BOX ──────────────────────────────────── */
.thanks-box {
  background: transparent;
  border: 0px solid rgba(100, 70, 20, 0.28);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 0.94rem;
}

.thanks-box p + p { margin-top: 8px; }

/* ── BOOK CALLOUT ───────────────────────────────────── */
.book-callout {
  background: transparent;
  border: 1px solid rgba(100, 70, 20, 0.28);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 0.92rem;
}

.book-callout p + p { margin-top: 8px; }

/* ── ABOUT BOX ──────────────────────────────────────── */
.about-box {
  background: transparent;
  border: 1px solid rgba(100, 70, 20, 0.28);
  margin-top: 24px;
  padding: 14px 18px;
  font-size: 0.88rem;
  color: #3a2710;
}

/* ── EBAY INLINE BLOCK ──────────────────────────────── */
.ebay-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(139,107,60,0.1);
  border: 1px solid rgba(100, 70, 20, 0.28);
  border-left: 3px solid var(--blood-red);
  padding: 6px 12px;
  margin: 10px 0 16px;
  font-size: 0.88rem;
}

.ebay-inline a { color: var(--blood-red); font-weight: 600; }
.ebay-inline .disc { font-size: 0.78rem; color: var(--rope); font-style: italic; }

/* ── SEARCH BOX ─────────────────────────────────────── */
.search-box {
  background: rgba(139,107,60,0.1);
  border: 1px solid var(--fog);
  padding: 14px 16px;
  margin: 20px 0;
}

.search-box h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: var(--dark-wood);
  margin-bottom: 10px;
  letter-spacing: 0.06em;
}

.search-box form { display: flex; flex-direction: column; gap: 10px; }

.search-input-row { display: flex; gap: 8px; flex-wrap: wrap; }

.search-box input[type="text"] {
  flex: 1;
  min-width: 160px;
  padding: 7px 12px;
  border: 1px solid var(--fog);
  background: rgba(255,255,240,0.8);
  font-family: 'Libre Baskerville', serif;
  font-size: 0.88rem;
  color: var(--ink);
}

.search-box input[type="submit"] {
  padding: 7px 18px;
  background: var(--dark-wood);
  color: var(--parchment);
  border: 1px solid var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s;
}

.search-box input[type="submit"]:hover { background: var(--blood-red); }

/* ── Search radio options ── */
.search-options { border: none; padding: 0; margin: 0; }

.radio-group { display: flex; flex-wrap: wrap; gap: 14px; }

.radio-option {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.82rem;
  color: var(--dark-wood);
}

.radio-option input[type="radio"] { accent-color: var(--blood-red); }

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

/* ── FOOTER LINKS BAR ───────────────────────────────── */
.footer-links {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px dashed var(--fog);
  font-size: 0.82rem;
  color: var(--rope);
  text-align: center;
}

/* ── AFFIL NOTE ─────────────────────────────────────── */
.affil-note {
  font-size: 0.78rem;
  color: #000000;
  font-style: italic;
  text-align: center;
  margin-top: 10px;
  padding: 8px 0 0;
  border-top: 1px solid var(--fog);
}

/* ══════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════ */
#site-footer {
  text-align: center;
  padding: 22px 20px;
  color: rgba(240,220,170,0.75);
  font-size: 0.8rem;
  line-height: 1.9;
}

#site-footer a { color: var(--gold-light); }
#site-footer a:hover { color: #fff; }
/* min-width: 721px  */
@media (min-width: 721px) {
  #sidebar-logo-mobile img {
    width: 180px;
  }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — max-width: 720px
══════════════════════════════════════════════════════ */
figure.img-right img,
figure.img-left img {
  width: 220px !important;
  height: auto !important;
}

figure.img-wide img {
  width: 380px !important;
  height: auto !important;
}

.thanks-box figure.img-left img {
  width: 170px;
  height: auto;
}

@media (max-width: 720px) {
  #parchment-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "sidebar" "main";
  }

  
  
  #site-header nav a.nav-shop {
  margin-left: 0;
  margin-top: 4px;
  align-self: flex-start;
}

  figure.img-wide img {
    width: 100% !important;
    height: auto !important;
  }

  figure.img-right img,
  figure.img-left img {
    width: 100% !important;
    height: auto !important;
  }
  
  

  /* ── Nav ── */
  #site-header nav { justify-content: flex-start; }

  #site-header nav a {
    flex: 1 1 auto;
    text-align: center;
    min-width: 120px;
    font-size: 0.75rem;
    padding: 4px 5px;
  }

/*  #site-header nav a.nav-group-start {  */
 /*   border-left: 2px solid #6a3a18;*/
 /*   margin-left: 4px;*/
/*  }*/

  /* ── Sidebar ── */
  #sidebar {
    border-right: none;
    border-bottom: none;
    border-top: none;
    box-shadow: inset 0 -6px 14px rgba(100,60,10,0.1);
    padding: 0;
  }

  /* Hide desktop logo inside collapsible */
  #sidebar-content .sb-logo { display: none; }

  /* ── Mobile toggle button ── */
  #sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% - 32px);
    margin: 10px 16px 12px;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid rgba(100, 70, 20, 0.35);
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dark-wood);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
  }

  #sidebar-toggle .toggle-arrow {
    font-size: 0.7rem;
    transition: transform 0.25s ease;
  }

  #sidebar-toggle.open .toggle-arrow {
    transform: rotate(180deg);
  }

  /* ── Sidebar content: hidden until toggled ── */
  #sidebar-content {
    display: none;
    padding: 16px 16px 20px;
  }

  #sidebar-content.open { display: block; }

  #main-content { padding: 20px 18px 32px; }
  #page-frame { padding: 0 8px 40px; }
  .drop-cap::first-letter { font-size: 3rem; }
  .radio-group { flex-direction: column; gap: 8px; }
  
  figure.img-right,
  figure.img-left {
    float: none !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 20px !important;
    width: 90% !important;
    max-width: 360px !important;
    text-align: center !important;
  }

  .thanks-box figure.img-left {
    float: none !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 20px !important;
    width: 90% !important;
    max-width: 360px !important;
    text-align: center !important;
  }

}

@media (max-width: 480px) {
  #site-title a { font-size: 1.2rem; }
  .page-title { font-size: 1.2rem; }
}
