/* Esther Brunat — full layout restoration */
/* Fonts loaded via <link> in HTML head for faster parsing */

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: #2c2c2c;
  line-height: 1.75;
  background: #f7f4ef;
}

.fonts-loaded body,
body {
  font-family: "Domine", Georgia, "Times New Roman", serif;
}

img, svg, video {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a { color: #b85c28; }
a:hover { color: #8a4418; }

/* Hide WordPress chrome */
#actionbar,
#wpcom_request_access_iframe,
#wpcom_request_access_styles,
.actnbr-pub-altofocus,
.site-info,
#atatags-1301170645-68f3a2702aa0c,
[id^="atatags-"],
.jp-relatedposts,
.sharedaddy,
.sd-sharing,
.wpcnt,
.wordads-ad,
#infinite-footer,
#content #secondary,
#secondary {
  display: none !important;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

.skip-link:focus {
  position: fixed; top: 0; left: 0; z-index: 99999;
  background: #fff; padding: 1rem; clip: auto; width: auto; height: auto;
}

/* Site shell */
#page.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 3px solid #b85c28;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
}

.site-branding {
  text-align: center;
  margin-bottom: 1rem;
}

.site-branding .site-title {
  margin: 0;
  font-family: "Cabin", sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-branding .site-title a {
  color: #1a1a1a;
  text-decoration: none;
}

.site-branding .site-description {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
}

/* Navigation */
.top-navigation {
  border-top: 1px solid #ece8e2;
  padding: 0.75rem 0;
}

.top-navigation .menu,
.top-navigation ul {
  list-style: none !important;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 0.25rem;
}

.top-navigation li {
  list-style: none !important;
  position: relative;
}

.top-navigation > .menu-main-menu-container > ul > li > a,
.top-navigation > div > ul > li > a {
  display: block;
  padding: 0.5rem 0.85rem;
  font-family: "Cabin", sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #444;
  text-decoration: none;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.top-navigation li a:hover,
.top-navigation .current-menu-item > a,
.top-navigation .current_page_item > a {
  color: #b85c28;
  background: #faf6f0;
}

.top-navigation .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid #e8e4df;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  border-radius: 4px;
  padding: 0.35rem 0;
  z-index: 200;
  flex-direction: column;
}

.top-navigation li:hover > .sub-menu,
.top-navigation li:focus-within > .sub-menu {
  display: block;
}

.top-navigation .sub-menu li a {
  padding: 0.45rem 1rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

.menu-toggle { display: none; }

/* Main content area */
.site-content {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.content-area,
#primary {
  width: 100%;
  max-width: 100%;
}

/* Homepage: hide redundant title */
.home .entry-header .entry-title,
.page-id-2 .entry-header .entry-title {
  position: absolute !important;
  clip: rect(1px,1px,1px,1px);
  overflow: hidden;
  height: 1px; width: 1px;
}

.entry-header {
  margin-bottom: 1.5rem;
}

.entry-content {
  font-size: 1.05rem;
}

.entry-content > p {
  max-width: 68ch;
  margin: 1.5rem auto;
  padding: 1.5rem 1.75rem;
  background: #fff;
  border-left: 4px solid #b85c28;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border-radius: 0 4px 4px 0;
  text-align: left;
  line-height: 1.8;
}

/* ===== TILED GALLERY FIX ===== */
/* Flatten Jetpack gallery into responsive grid */
.entry-content .tiled-gallery {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 1.5rem 0 !important;
  padding: 0 !important;
}

.entry-content .tiled-gallery .gallery-row,
.entry-content .tiled-gallery .gallery-group {
  display: contents !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
}

.entry-content .tiled-gallery-item {
  display: block !important;
  overflow: hidden;
  border-radius: 4px;
  background: #e8e4df;
  line-height: 0;
}

.entry-content .tiled-gallery-item a {
  display: block;
  line-height: 0;
}

.entry-content .tiled-gallery-item img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 120px;
  object-fit: cover;
  aspect-ratio: 4/3;
  transition: transform 0.25s ease, opacity 0.25s;
}

.entry-content .tiled-gallery-item:hover img {
  transform: scale(1.03);
  opacity: 0.92;
}

.tiled-gallery-caption {
  font-size: 0.75rem;
  color: #666;
  padding: 0.35rem 0.5rem;
  background: #fff;
  line-height: 1.3;
  text-align: center;
}

/* Single post / page images */
.entry-content img,
.page-content img,
.attachment img {
  border-radius: 4px;
}

.entry-content figure,
.wp-block-image {
  margin: 1.5rem 0;
}

/* Blog archive grid */
.archive .site-main,
.category .site-main,
.search .site-main,
.blog .site-main {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.page-header {
  grid-column: 1 / -1;
  padding-bottom: 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid #e0dbd3;
}

.page-header .page-title {
  font-family: "Cabin", sans-serif;
  font-size: 1.6rem;
  font-weight: 500;
  margin: 0;
  color: #1a1a1a;
}

.site-main .grid-item {
  background: #fff;
  border: 1px solid #e8e4df;
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.site-main .grid-item:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.site-main .grid-item .entry-header-wrap {
  display: block;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
}

.site-main .grid-item .entry-title {
  display: block;
  font-family: "Cabin", sans-serif;
  font-size: 1rem;
  line-height: 1.35;
  margin: 0 0 0.4rem;
  color: #222;
}

.site-main .grid-item .posted-on {
  font-size: 0.78rem;
  color: #888;
}

.site-main .grid-item .post-thumbnail img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

/* Single post layout */
.single .site-main,
.page .site-main,
.home .site-main {
  display: block;
}

.single .entry-title,
.page .entry-title {
  font-family: "Cabin", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

.posted-on, .entry-meta {
  font-size: 0.85rem;
  color: #888;
  font-family: "Cabin", sans-serif;
}

/* Footer */
.site-footer {
  background: #2a2520;
  color: #ccc;
  margin-top: auto;
  padding: 2rem 1.5rem;
}

.site-footer-wrap {
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
}

.jetpack-social-navigation .menu {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.jetpack-social-navigation .menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #e8c4a0;
  transition: background 0.2s, color 0.2s;
}

.jetpack-social-navigation .menu a:hover {
  background: #b85c28;
  color: #fff;
}

.jetpack-social-navigation svg.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.site-footer-wrap::after {
  content: "Esther Brunat — Math teacher, traveler, follower of Christ";
  display: block;
  font-family: "Cabin", sans-serif;
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.75rem;
  letter-spacing: 0.03em;
}

/* Comments (when visible on posts) */
.comments-area {
  max-width: 68ch;
  margin: 2rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid #e0dbd3;
}

/* Widget sidebar on inner pages */
#secondary .widget {
  background: #fff;
  border: 1px solid #e8e4df;
  border-radius: 4px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.widget-title {
  font-family: "Cabin", sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.75rem;
  color: #444;
}

.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget li {
  padding: 0.3rem 0;
  border-bottom: 1px solid #f0ece6;
}

.widget li:last-child { border-bottom: none; }

/* Responsive */
@media (max-width: 768px) {
  .site-header-wrap,
  .site-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .menu-toggle {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.6rem;
    background: #faf6f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Cabin", sans-serif;
  }

  .top-navigation:not(.toggled) .menu-main-menu-container {
    display: none;
  }

  .top-navigation.toggled .menu-main-menu-container {
    display: block;
  }

  .top-navigation .menu {
    flex-direction: column;
    align-items: stretch;
  }

  .top-navigation .sub-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    background: #faf6f0;
  }

  .entry-content .tiled-gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
  }

  .entry-content > p {
    padding: 1rem 1.15rem;
  }
}

/* Contact / Collaborate page */
.contact-page-intro {
  max-width: 720px;
  margin: 0 auto 1.5rem;
  padding: 0 1.25rem;
}

.contact-page-intro p {
  margin: 0.5rem 0;
}

.contact-hero {
  max-width: 720px;
  margin: 0 auto 1.5rem;
  padding: 0 1.25rem;
}

.contact-hero img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.contact-card {
  max-width: 560px;
  margin: 2rem auto 2.5rem;
  padding: 2rem 2.25rem;
  background: #fff;
  border: 1px solid #e8e0d4;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(44, 36, 28, 0.06);
}

.contact-card h2 {
  font-family: "Cabin", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b5c4a;
  margin: 0 0 1.25rem;
}

.esther-contact-form .field {
  margin-bottom: 1.25rem;
}

.esther-contact-form label {
  display: block;
  font-family: "Cabin", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4a4a4a;
  margin-bottom: 0.4rem;
}

.esther-contact-form label .required {
  color: #b85c28;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
}

.esther-contact-form input[type="text"],
.esther-contact-form input[type="email"],
.esther-contact-form input[type="url"],
.esther-contact-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: "Domine", Georgia, serif;
  font-size: 1rem;
  color: #2c2c2c;
  background: #faf8f5;
  border: 1px solid #d9cfc2;
  border-radius: 4px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.esther-contact-form input:focus,
.esther-contact-form textarea:focus {
  outline: none;
  border-color: #b85c28;
  box-shadow: 0 0 0 3px rgba(184, 92, 40, 0.12);
}

.esther-contact-form textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}

.esther-contact-form .field-error {
  display: none;
  margin-top: 0.35rem;
  font-family: "Cabin", sans-serif;
  font-size: 0.8rem;
  color: #c0392b;
}

.esther-contact-form .field.has-error input,
.esther-contact-form .field.has-error textarea {
  border-color: #c0392b;
}

.esther-contact-form .field.has-error .field-error {
  display: block;
}

.esther-contact-form .submit-row {
  margin-top: 1.5rem;
}

.esther-contact-form button[type="submit"] {
  font-family: "Cabin", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: #b85c28;
  border: none;
  border-radius: 4px;
  padding: 0.75rem 2rem;
  cursor: pointer;
  transition: background 0.15s;
}

.esther-contact-form button[type="submit"]:hover {
  background: #8a4418;
}

.contact-success {
  max-width: 560px;
  margin: 2rem auto;
  padding: 2rem 2.25rem;
  background: #f0ebe3;
  border: 1px solid #d4c8b8;
  border-left: 4px solid #b85c28;
  border-radius: 6px;
  text-align: center;
}

.contact-success h2 {
  font-family: "Cabin", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #2c2c2c;
  margin: 0 0 0.5rem;
}

.contact-success p {
  margin: 0;
  color: #5a5a5a;
}

.contact-success a {
  font-weight: 600;
}

.contact-links {
  max-width: 720px;
  margin: 0 auto 1rem;
  padding: 0 1.25rem;
}

.contact-links a {
  word-break: break-all;
}

/* Hide broken Facebook/share tracking pixels */
img.no-grav,
img[alt="Facebook photo"],
.share-facebook img,
.pinterest_button img {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
