/* ============================================================
   THE BLACK DOUGLAS COFFEE HOUSE — Modern CSS Redesign v2
   Drop-in replacement for styles-site2.css
   Apply to all pages alongside the existing p7IRM01.css
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  --bg:            #0f0a04;          /* deep espresso */
  --surface:       #1c1108;          /* dark roast */
  --card:          #fdf8f2;          /* warm cream */
  --card-alt:      #f0e6d3;          /* slightly darker cream */
  --border:        #e8d8c0;          /* soft tan */
  --gold:          #c9962a;          /* warm gold */
  --gold-light:    #e0b84a;          /* lighter gold for hover */
  --gold-muted:    #8a6820;          /* muted gold for subtle accents */
  --text-dark:     #2a1f0e;          /* near-black warm */
  --text-body:     #4a3b28;          /* warm brown body text */
  --text-muted:    #7a6650;          /* muted warm grey */
  --text-light:    #c8b89a;          /* light sand for dark bg */
  --nav-bg:        #1c1108;
  --nav-text:      #e0b84a;
  --radius:        6px;
  --radius-lg:     10px;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.18);
  --shadow-md:     0 4px 18px rgba(0,0,0,0.22);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.30);
  --transition:    0.2s ease;
  --font-heading:  'Playfair Display', Georgia, serif;
  --font-body:     'Inter', Verdana, Arial, sans-serif;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(201,150,42,0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(201,150,42,0.05) 0%, transparent 55%);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-light);
  -webkit-font-smoothing: antialiased;
}

/* ── Main wrapper table ───────────────────────────────────── */
/* The site uses <table width="800" align="center"> */
body > table {
  border-collapse: collapse;
  margin: 28px auto 40px !important;
  width: 860px !important;       /* slightly wider to give images more room */
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(201,150,42,0.18);
}

/* ── Header banner row ────────────────────────────────────── */
body > table > tbody > tr:first-child > td {
  padding: 0;
  background: var(--surface);
  border-bottom: 2px solid var(--gold-muted);
}

body > table > tbody > tr:first-child > td img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70px;
  object-fit: cover;
  opacity: 0.95;
  filter: brightness(1.05) saturate(0.9);
}

/* ── Navigation bar (.topline) ────────────────────────────── */
.topline {
  background: var(--nav-bg);
  padding: 0 !important;
  vertical-align: middle !important;
  border-bottom: 1px solid rgba(201,150,42,0.25);
}

.topline div[align="right"],
.topline div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 0.72em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  /* hides the " | " pipe text nodes by blending into nav bg */
  color: var(--nav-bg);
}

.topline a:link,
.topline a:visited,
.topline a:active {
  display: inline-block;
  padding: 10px 12px;
  color: var(--nav-text) !important;
  text-decoration: none !important;
  font-size: 1em;
  letter-spacing: 0.07em;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  border-bottom: none !important;
  position: relative;
}

.topline a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: center;
}

.topline a:hover {
  color: #fff !important;
  background: rgba(201,150,42,0.1);
}

.topline a:hover::after {
  transform: scaleX(1);
}

/* ── Main content row layout ─────────────────────────────── */
/* Row 3: left cell = image gallery, right cell = .content   */
body > table > tbody > tr:nth-child(3) {
  background: var(--card);
}

/* Image column — wider so photos get more real estate */
body > table > tbody > tr:nth-child(3) > td:first-child {
  background: var(--bg);          /* dark surround makes images pop */
  padding: 0;
  vertical-align: top;
  width: 380px !important;       /* up from original 327px */
}

/* ── Image rotator plugin (.p7IRM01) ──────────────────────── */
.p7IRM01 {
  display: block;
  width: 100% !important;
  overflow: hidden;
  background: var(--bg);
}

/* Outer wrapper */
.p7IRMowrapper {
  display: block;
  width: 100%;
}

/* Image wrapper — give it a defined tall height */
.p7IRMdv {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  width: 100% !important;
  /* tall aspect: 4:3 on a 380px column ≈ 285px, we go taller */
  height: 420px !important;
}

.p7IRMwrapper {
  position: relative;
  overflow: hidden;
  width: 100% !important;
  height: 100% !important;
}

/* The actual photo — fills the tall box, no clipping of important areas */
.p7IRMimage {
  display: block !important;
  width: 100% !important;
  height: 420px !important;
  object-fit: cover !important;
  object-position: center center !important;
  border: 0 !important;
  transition: opacity 0.5s ease, transform 0.5s ease !important;
}

.p7IRMimage:hover {
  transform: scale(1.03);
}

/* Subtle gold frame around the image block */
.p7IRMdv::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid rgba(201,150,42,0.22);
  pointer-events: none;
  z-index: 10;
}

/* Image caption overlay */
.p7IRMdesc_wrapper {
  position: absolute !important;
  width: 100% !important;
  bottom: 0 !important;
  visibility: hidden;
  overflow: hidden;
  z-index: 20;
}

.p7IRMdesc {
  color: #fff !important;
  background: linear-gradient(transparent, rgba(15,10,4,0.85)) !important;
  font-family: var(--font-body) !important;
  font-size: 11px !important;
  padding: 20px 16px 12px 16px !important;
  margin: 0 !important;
  letter-spacing: 0.03em;
}

/* Image toolbar */
.p7IRMTools {
  background: rgba(15,10,4,0.92) !important;
  backdrop-filter: blur(4px);
  padding: 6px 0 !important;
  border-top: 2px solid rgba(201,150,42,0.3) !important;
}

.p7IRMTools ul {
  width: 120px !important;
}

/* ── Content area (.content) ──────────────────────────────── */
.content {
  background-color: var(--card) !important;
  color: var(--text-body) !important;
  padding: 22px 26px 20px 24px !important;
  font-family: var(--font-body) !important;
  font-size: 0.82em !important;
  line-height: 1.65em !important;
  border: none !important;
  vertical-align: top;
}

.content p {
  margin: 0 0 10px 0;
  color: var(--text-body);
}

.content p:last-child {
  margin-bottom: 0;
}

.content li {
  line-height: 1.55em !important;
  padding: 3px 0 !important;
  color: var(--text-body);
}

.content ul, .content ol {
  margin: 6px 0 10px 0;
  padding-left: 18px;
}

/* ── Content2 variant (.content2) ────────────────────────────*/
.content2 {
  background-color: var(--card) !important;
  color: var(--text-body) !important;
  padding: 16px 20px !important;
  font-size: 0.82em;
  line-height: 1.6em;
}

/* ── Headings ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-heading) !important;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 8px 0 !important;
  padding: 0;
  color: var(--text-dark) !important;
  line-height: 1.25;
}

h1 {
  font-size: 1.7em;
  color: var(--text-dark) !important;
}

h2 {
  font-size: 1.25em !important;
  font-weight: 700 !important;
  color: var(--text-dark) !important;
  font-family: var(--font-heading) !important;
  margin: 0 0 8px 0 !important;
  padding: 0 0 5px 0 !important;
  border-bottom: 2px solid var(--gold-muted);
}

h3 {
  font-size: 1em;
  color: var(--text-body) !important;
}

/* ── Links ────────────────────────────────────────────────── */
a:link, a:visited, a:active {
  color: var(--gold) !important;
  text-decoration: none !important;
  transition: color var(--transition);
}

a:hover {
  color: var(--gold-light) !important;
}

a img {
  border: 0 !important;
}

/* Content-area links */
.content a:link,
.content a:visited,
.content a:active {
  color: var(--gold-muted) !important;
  border-bottom: 1px solid rgba(138,104,32,0.35) !important;
  font-weight: 500;
}

.content a:hover {
  color: var(--gold) !important;
  border-bottom-color: var(--gold) !important;
}

/* ── Strong / Bold ────────────────────────────────────────── */
strong {
  color: var(--text-dark) !important;
  font-weight: 600;
}

.content strong {
  color: var(--text-dark) !important;
}

.source strong {
  color: var(--gold-muted) !important;
}

.bottomr strong {
  color: var(--gold-light) !important;
}

/* ── Footer rows ──────────────────────────────────────────── */
.bottom, .bottomr {
  background: var(--surface) !important;
  font-size: 0.72em !important;
  color: var(--text-light) !important;
  padding: 12px 14px !important;
  vertical-align: top !important;
  border-top: 1px solid rgba(201,150,42,0.2);
  line-height: 1.55em;
}

.bottom {
  text-align: left !important;
}

.bottomr {
  text-align: right !important;
}

.bottom p {
  margin: 0 0 3px 0 !important;
  padding: 0 !important;
}

.bottom a:link, .bottom a:visited, .bottom a:active,
.bottomr a:link, .bottomr a:visited, .bottomr a:active {
  color: var(--gold) !important;
  border-bottom: 1px dotted rgba(201,150,42,0.5) !important;
}

.bottom a:hover, .bottomr a:hover {
  color: var(--gold-light) !important;
}

.copyright {
  font-size: 0.9em !important;
  font-family: var(--font-body) !important;
  color: var(--gold-muted) !important;
  text-align: left !important;
  padding: 2px 0 !important;
  border: none !important;
  letter-spacing: 0.04em;
}

/* ── Footer row background ────────────────────────────────── */
body > table > tbody > tr:nth-child(4) {
  background: var(--surface);
}

body > table > tbody > tr:nth-child(4) td {
  background: var(--surface);
}

/* ── Spacer row (last row with spacer.gif) ────────────────── */
body > table > tbody > tr:last-child {
  display: none;
}

/* ── Inline images INSIDE .content ───────────────────────── */
/* Any images placed within the content text area */
.content img,
.content2 img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin: 12px 0;
  object-fit: cover;
}

/* ── General img rules ────────────────────────────────────── */
img {
  max-width: 100%;
  height: auto;
  position: relative; /* needed for ::after broken fallback */
  font-size: 0;       /* suppress alt text overflow on broken */
}

/* Spacer gif — fully hidden */
img[src*="spacer"] {
  display: none !important;
}

/* ── Broken image fallback ────────────────────────────────── */
img:-moz-broken,
img[src=""],
img:not([src]) {
  visibility: hidden;
}

/* CSS-only broken image hint (shown via JS .img-error class) */
img.img-error {
  display: block !important;
  visibility: visible !important;
  min-width: 120px;
  min-height: 120px;
  width: 100%;
  background: var(--card-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0;
  position: relative;
}

img.img-error::after {
  content: "☕";
  font-size: 40px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.55;
}

/* ── Table / Tableh (inner content tables) ────────────────── */
.table, .tableh {
  background-color: var(--card) !important;
  border: none !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
  line-height: 1.55em !important;
  width: 100%;
}

/* ── Exhibition / Date / Nav panels ──────────────────────────*/
.exhibition {
  padding: 8px 14px 8px 10px !important;
  font-size: 0.78em !important;
  background-color: var(--card-alt) !important;
  border-bottom: 1px solid var(--border) !important;
  line-height: 1.4em !important;
  color: var(--text-body);
}

.exhibition p {
  margin: 0 0 4px 0 !important;
}

.date {
  padding: 6px 8px 6px 12px !important;
  font-size: 0.75em !important;
  background-color: var(--card) !important;
  border-bottom: 1px solid var(--border) !important;
  border-right: 1px solid var(--border) !important;
  font-weight: 600;
  color: var(--gold-muted) !important;
  letter-spacing: 0.04em;
  line-height: 1.4em !important;
}

.nav {
  vertical-align: top !important;
  padding: 8px 0 10px 0 !important;
  font-size: 0.75em !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-muted);
}

/* ── Source section ───────────────────────────────────────── */
.source {
  padding: 10px 20px 14px 0 !important;
  color: var(--text-muted) !important;
  font-size: 0.76em !important;
  line-height: 1.5em !important;
  font-style: italic;
}

.source p {
  padding: 6px 0 !important;
}

.source strong {
  color: var(--gold-muted) !important;
  font-style: normal;
}

/* ── Bio headings (.biohdg) ───────────────────────────────── */
.biohdg h3 {
  margin-top: 18px !important;
  letter-spacing: 0.08em !important;
  font-size: 0.8em !important;
  text-transform: uppercase;
  color: var(--gold-muted) !important;
  font-family: var(--font-body) !important;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
}

/* ── Even rows ────────────────────────────────────────────── */
.even {
  padding: 4px 0 !important;
  margin: 3px !important;
}

/* ── Blackdouglas section ─────────────────────────────────── */
.blackdouglas {
  padding: 0 0 14px 0 !important;
}

/* ── Tel ──────────────────────────────────────────────────── */
.tel {
  padding: 0 !important;
  margin: 0 !important;
  text-align: left !important;
}

/* ── StatCounter — hide it ────────────────────────────────── */
.statcounter {
  display: none !important;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--gold-muted);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ── Selection ────────────────────────────────────────────── */
::selection {
  background: rgba(201,150,42,0.3);
  color: var(--text-dark);
}

/* ── Responsive ──────────────────────────────────────────────
   The site uses fixed-width tables; we reflow them on small screens */
@media screen and (max-width: 900px) {
  body > table {
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  /* Stack the two-column main row vertically */
  body > table > tbody > tr:nth-child(3) > td {
    display: block !important;
    width: 100% !important;
    float: none !important;
  }

  /* Image block goes full-width on mobile, generous height */
  body > table > tbody > tr:nth-child(3) > td:first-child {
    width: 100% !important;
  }

  .p7IRMdv {
    height: 280px !important;
  }

  .p7IRMimage {
    height: 280px !important;
  }

  .content {
    padding: 16px 18px !important;
  }

  .topline div[align="right"],
  .topline div {
    justify-content: center;
    padding: 0 6px;
  }

  .topline a:link,
  .topline a:visited {
    padding: 8px 8px;
    font-size: 0.9em;
  }
}

@media screen and (max-width: 560px) {
  body > table > tbody > tr:nth-child(4) > td {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    border-top: 1px solid rgba(201,150,42,0.15);
  }

  .bottomr {
    text-align: left !important;
  }

  h2 {
    font-size: 1.1em !important;
  }

  .p7IRMdv {
    height: 220px !important;
  }

  .p7IRMimage {
    height: 220px !important;
  }
}

/* ── END ──────────────────────────────────────────────────── */