
/* Override a few colors to match the old site style */
:root {
  --wa-color-text-link: #4780a0;
  --wa-color-brand-on-quiet: #4780a0;
  --wa-color-brand-fill-loud: #4780a0;

  /* Header / nav color tokens — overridden in dark mode below */
  --header-bg-start: #407092;
  --header-bg-end: #6590a7;
  --sitenav-bg: #6590a7;
  --sitenav-hover: #497498;
}

html.wa-dark {
  --header-bg-start: #1e3a4f;
  --header-bg-end: #2a4d65;
  --sitenav-bg: #2a4d65;
  --sitenav-hover: #1e3a4f;
}

/* fix for a temporary bug with layering */
.fa-layers svg.svg-inline--fa {
  background: transparent;
}

html,
body {
  min-height: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
}

ol, ul {
  list-style:none;
}

wa-tab-panel wa-cluster > a,
wa-tab-panel wa-cluster > .thumb-btn {
  display: inline-flex;
  align-items: center;
  height: 100px;
  vertical-align: middle;
}

wa-page.travel {
  --menu-width: 15rem;
  --aside-width: 25rem;
}
wa-page[view='desktop'] {
  [slot*='navigation'] {
	border-inline-end: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border);
  }
}
wa-page[view='mobile'] {
  --menu-width: auto;
  --aside-width: auto;
}

[slot='aside'] {
  padding-top: 0px;
  overflow-x: hidden;
}

[slot='aside'] wa-tab-group {
  margin: auto;
  text-align: center;
  width: 22rem;
}

[slot='header'] {
  background-image: linear-gradient(to bottom, var(--header-bg-start), var(--header-bg-end));
  color: #fff;
  position: relative;
}

[slot='header'] a {
  text-decoration: none;
}

/* This is where the site nav lives */
[slot='subheader']#sitenav {
  background-color: var(--sitenav-bg);
  width:100%;
  margin:0px;
  text-align: center;
}

[slot='subheader']#sitenav a {
  display:inline-block;
  padding:5px 10px;
  color:#FFF;
  text-decoration:none;
  width: 150px;
}

[slot='subheader']#sitenav a:hover {
  background: var(--sitenav-hover);
  text-decoration:none;
}

[slot='subheader']#sitenav wa-button[appearance='plain'] {
  color: #fff;
}

html.wa-dark #search::part(base) {
  background-color: var(--sitenav-bg);
}

html.wa-dark #search::part(input) {
  background-color: transparent;
  color: #fff;
}

html.wa-dark #search:focus-within::part(base) {
  background-color: var(--wa-color-surface-raised);
}

html.wa-dark #search:focus-within::part(input) {
  background-color: var(--wa-color-surface-raised);
  color: #fff;
}

html.wa-dark #search-dropdown::part(menu) {
  background-color: var(--wa-color-surface-raised);
  color: #fff;
}

html.wa-dark wa-tab-panel img {
  filter: invert(1);
}

html.wa-dark wa-tab-panel .thumb-btn img,
html.wa-dark wa-tab-panel[name="badges"] img {
  filter: none;
}

.thumb-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: zoom-in;
}

.thumb-btn img {
  display: block;
}

#share-link {
  cursor: pointer;
}

#share-link .share-hover {
  display: none;
}

#share-link:hover .share-normal {
  display: none;
}

#share-link:hover .share-hover {
  display: inline-block;
}

wa-button.wiki-button {
  vertical-align: middle;
}

wa-button.wiki-button::part(base) {
  height: 2em;
  width: 2em;
  padding-inline: 0;
  /* font-size: 75%; */
}

[slot='subheader']#breadcrumb {
  border-block-end: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border);
}

[slot='main-header'] {
  padding: unset;
}

/* [slot='main-header'],
main,
[slot='main-footer'] {
  max-inline-size: 60rem;
  margin-inline: auto;
} */

main {
  blockquote.wiki {
	border-left: 10px solid var(--wa-color-surface-border);
	border-right: 2px solid var(--wa-color-surface-border);

	border-radius: 3px;
	display: block;
	padding: 1em;
	box-shadow: 2px 2px 15px #ccc;
    font-size: var(--wa-font-size-m);
  }

  /* Collapsible place sections (cities and nested places) */
  details.wiki {
	  border: none !important;
	  margin-bottom: 0;
	  padding: 0.25em 0;
  }

  details.wiki > summary {
	  text-align: left;
	  cursor: pointer;
	  padding: 0.25em 0;
  }

  details.wiki > summary h4,
  details.wiki > summary h5,
  .place-group > details.wiki > summary.wiki > h4.wiki,
  .place-group > details.wiki > summary.wiki > h5.wiki {
	  display: flex;
	  margin: 0;
    text-align: left !important;
	  white-space: nowrap;
  }

  /* Place group wrapper for city sections (Cairo, Abu Simbel, etc.) */
  .place-group {
	  border: 1px solid var(--wa-color-surface-border);
	  border-radius: 4px;
	  margin-top: 1.5em;
	  margin-bottom: 1em;
    overflow: hidden;
  }

  .place-group:first-of-type {
	  margin-top: 0px;
  }

  .place-group > details.wiki {
	  border: none !important;
	  margin: 0;
	  padding: 0;
  }

  .place-group > details.wiki > summary {
	  background-color: var(--wa-color-surface-raised);
    border: 4px solid var(--wa-color-brand-fill-loud);
    border-bottom: 0px !important;
	  padding: 0.5em 0.75em;
	  border-radius: 4px 4px 0 0;
  }

  .place-group > details.wiki > p,
  .place-group > details.wiki > table {
	  padding: 0 0.75em;
  }

  /* This should apply to any h4 or h5 which is a descendant of .place-group */
  .place-group h4,
  .place-group h5 {
    font-family: var(--wa-font-family-body);
    font-weight: var(--wa-font-weight-body);
    margin: 0px;
    padding: 18px;
  }
  
  .place-group > ul {
	  margin: 0;
	  padding: 0em 1em;
  }

  /* Nested place details inside list items */
  li > details.wiki {
	  padding-left: 0;
  }

  h1, h2, h3, h4, h5, h6 {
	 /* this might be a Safari 18.4 bug; check later */
	text-wrap: stable;
  }

  h2 > wa-icon {
    width: 1em;
  }

  .country-map-icon {
    height: 2em;
    width: auto;
  }

  /* Place name anchors from wa/place-*.html templates (food, wine, beer, church, museum, hotel, tourist) */
  wa-icon + a.place-name,
  wa-icon + a.place-name.ext {
    padding-left: 0.5em;
  }

  ol, ul, li {
	list-style: none;
  }

  p.wiki {
	border-block-start: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border);
	margin-top: .5em;
  }

  .toc blockquote {
	  /* 2 x number of items in the longest toc */
	  height: 16em;
	  display: flex;
	  flex-flow: column;
  }

}

html.wa-dark .country-map-icon {
  filter: invert(1);
}

/* ── Body copy tables ─────────────────────────────────────────────────────── */

main table:not(.summary_links) {
  border-collapse: collapse;
  width: 100%;
}

main table:not(.summary_links) th,
main table:not(.summary_links) td {
  padding: 0.4em 0.75em;
  text-align: left;
}

main table:not(.summary_links) th {
  background: var(--wa-color-surface-raised);
  font-weight: var(--wa-font-weight-semibold);
}

/* Row separator between consecutive body rows */
main table:not(.summary_links) tbody tr + tr > td,
main table:not(.summary_links) tbody tr + tr > th {
  border-top: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border);
}

/* Header/body separator (only when thead is present) */
main table:not(.summary_links) thead + tbody > tr:first-child > td,
main table:not(.summary_links) thead + tbody > tr:first-child > th {
  border-top: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border);
}

/* Suppress any native.css border on the first row of headerless tables */
main table:not(.summary_links):not(:has(thead)) tbody tr:first-child,
main table:not(.summary_links):not(:has(thead)) tbody tr:first-child > td,
main table:not(.summary_links):not(:has(thead)) tbody tr:first-child > th {
  border-top: 0 !important;
}

/* 2-column tables: label col 1/3, content col 2/3 */
main table:not(.summary_links):has(tr > :nth-child(2)):not(:has(tr > :nth-child(3))) {
  table-layout: fixed;
}

main table:not(.summary_links):has(tr > :nth-child(2)):not(:has(tr > :nth-child(3))) tr > :first-child {
  width: 33%;
}

[slot='navigation-header'] {
  border-block-end: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border);
}

[slot='navigation'] wa-divider {
  --spacing: 1rem;
}

[slot='footer'] {
	margin: "auto";
  padding-top: 1em;
  padding-bottom: 1em;
	text-align: center;
}

/* ── Photo zoom dialog ───────────────────────────────────────────────────────── */

#photo-zoom-dialog::part(panel) {
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
}

#photo-zoom-dialog::part(body) {
  padding-block-start: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Wikipedia summary wa-details ───────────────────────────────────────────── */
/* Remove the left padding the shadow-DOM header part adds — it crowds headings. */

wa-details.wiki-summary::part(header) {
  padding-inline-start: 0;
}

/* ── Carousel / photo caption overlay ──────────────────────────────────────── */

wa-carousel-item {
  position: relative;
}

/* Shrink-wrap around a standalone photo so the caption doesn't overrun the image.
   display:table shrinks to content width while still responding to margin:auto. */
.photo-img-wrap {
  position: relative;
  display: table;
  margin: auto;
}

.photo-img-wrap img {
  display: block;
  max-width: 100%;
}

/* Zoom button — revealed on hover, top-right corner of the image wrapper */
.photo-img-wrap .zoom-btn,
wa-carousel-item .zoom-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  line-height: 1;
}

.photo-img-wrap:hover .zoom-btn,
wa-carousel-item:hover .zoom-btn {
  opacity: 1;
}

wa-carousel-item .carousel-caption,
.photo-img-wrap .carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.3rem 0.6rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.8rem;
  text-align: center;
  pointer-events: none;
}

/* ── Video ──────────────────────────────────────────────────────────────────── */

wa-video {
  padding-bottom: .8em;
  /* wa-video's shadow styles set position: relative on :host but never an
     explicit z-index or isolation, so its internal overlay z-indexes (up to 25)
     never get their own stacking context and leak out to compete with the
     rest of the page (nav, dropdowns, etc.) instead of staying contained. */
  isolation: isolate;
}

wa-video::part(video) {
  background-color: var(--wa-color-surface-default);
}

/* html.wa-dark wa-video::part(video-title-overlay){
  color: white;
} */

wa-video::part(video-title-overlay){
  background-color: unset !important;
  background-image: unset !important;
  text-shadow: 1px 1px 3px var(--wa-color-surface-default);
  color: var(--wa-color-text-link);
}

/* ── SmugMug size constraints for wa-carousel and photoImg ──────────────────── */
/* Prevent images from scaling beyond their natural dimensions.                  */
/* Class names match the SmugMug size codes used in image URLs (e.g. -M.jpg).   */
wa-carousel, .photo-img-wrap { padding-bottom: .25em; }
wa-carousel.smug-th,  .photo-img-wrap.smug-th  { max-width:  150px; margin: auto; }
wa-carousel.smug-s,   .photo-img-wrap.smug-s   { max-width:  300px; margin: auto; }
wa-carousel.smug-m,   .photo-img-wrap.smug-m   { max-width:  450px; margin: auto; }
wa-carousel.smug-l,   .photo-img-wrap.smug-l   { max-width:  600px; margin: auto; }
wa-carousel.smug-xl,  .photo-img-wrap.smug-xl  { max-width:  768px; margin: auto; }
wa-carousel.smug-x2,  .photo-img-wrap.smug-x2  { max-width:  960px; margin: auto; }
wa-carousel.smug-x3,  .photo-img-wrap.smug-x3  { max-width: 1200px; margin: auto; }
wa-carousel.smug-x4,  .photo-img-wrap.smug-x4  { max-width: 2048px; margin: auto; }
