:root {
    --bg: #f8f5ef;
    --paper: #ffffff;
    --ink: #25211c;
    --muted: #6f665b;
    --line: #ddd3c7;
    --accent: #6f4e37;
    --accent-light: #efe4d8;
}

/* Home Page */

* {
    box-sizing: border-box;
}

/* Native smooth scrolling across the entire page */
/* Added principally for the Book a tour button */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

a {
    color: var(--accent);
}

.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-title {
    margin: 0;
    font-size: 1.2rem;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.main-nav a {
    text-decoration: none;
    font-size: 0.95rem;
}

.main-nav a:hover {
    text-decoration: underline;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.narrow-page {
    max-width: 760px;
}

.calendar-section {
    max-width: 825px;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--line);
    background: var(--paper);
}

.day-name {
    padding: 0.5rem;
    background: var(--accent-light);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-weight: bold;
    text-align: center;
}

.day {
    min-height: 6.5rem;
    padding: 0.4rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-size: 0.85rem;
}

.day:nth-child(7n) {
    border-right: none;
}

.day p {
    margin: 0.2rem 0 0;
}

.empty {
    background: #f1ece5;
}

.recent-posts {
    margin-top: 2.5rem;
    max-width: 760px;
}

.post-preview,
.blog-post,
.class-card {
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 1rem;
    margin-bottom: 1rem;
}

.post-preview h3,
.blog-post h3,
.class-card h3 {
    margin-top: 0;
}

.post-date,
.meeting-time {
    color: var(--muted);
    font-size: 0.9rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.contact-line {
    font-weight: bold;
}

.site-footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Tablet and phone layout */
@media (max-width: 700px) {
    .header-inner {
	align-items: flex-start;
	flex-direction: column;
    }

    .site-title {
	white-space: normal;
    }

    .calendar-section {
	max-width: none;
	overflow-x: auto;
    }

    .calendar {
	min-width: 680px;
    }
}

/* Very small screens: stack calendar days vertically */
@media (max-width: 480px) {
    .calendar {
	display: block;
	min-width: 0;
    }

    .day-name {
	display: none;
    }

    .day,
    .empty {
	min-height: auto;
	border-right: none;
    }

    .empty {
	display: none;
    }

    .day strong::before {
	content: "May ";
    }
}

.action-button {
    display: flex;
    justify-content: center;
    align-items: center;
}

.action-button button {
    font-size: 16pt; // 21pt
}

.instructions {
    display: flex;
    flex-wrap: wrap;
}

.instructions img,
.instructions p
{
    width: 50%;
    box-sizing: border-box;
}

.instructions p {
    padding: 1em 0 0 1em;
}

.calendar-section {
    margin-top: 2em;
}

.snapshot {
    width: min(18rem, 80%);
    margin: 2rem auto;
    padding: 0.75rem 0.75rem 2.5rem;

    background: #fff;
    box-shadow:
	0 0.4rem 0.8rem rgb(0 0 0 / 20%),
	0 0.1rem 0.2rem rgb(0 0 0 / 15%);

    transform: rotate(-3deg);
    transform-origin: center;
}

.snapshot-left  { transform: rotate(-3deg); }
.snapshot-right { transform: rotate(2deg); }

.snapshot img {
    display: block;
    width: 100%;
    height: auto;
}

.snapshot figcaption {
    margin-top: 0.75rem;
    text-align: center;
    font-family: cursive;
    color: #444;
}

.snapshot {
    transition: transform 180ms ease;
}

.snapshot:hover {
    transform: rotate(0deg) scale(1.02);
}

/* Book a tour button */

/* Target Section styling for demonstration */
#signup {
    margin-top: 100vh; /* Pushes section below the fold */
    padding: 60px 20px;
    background-color: #f4f4f4;
}

/* Call-To-Action Button styling */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    background-color: #0070f3; /* Brand color */
    /* changed <a> tag to <button> text-decoration: none; */
    border: none; 
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Hover and focus states for accessibility */
.cta-button:hover, 
.cta-button:focus {
    background-color: #0051b3;
    transform: translateY(-1px);
}

/* Arrow icon wrapper */
.skip-arrow {
    display: inline-block;
    margin-left: 8px;
    font-size: 21pt; /* (was px but button is in pts) Slightly larger than text for visibility */
    line-height: 1;
    animation: bounce 2s infinite;
}

/* Reduce motion for users who prefer no animations */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .skip-arrow {
        animation: none;
    }
}

/* Keyframes for a subtle, professional bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* Calendar */

/* TODO main already had body
body {
    font-family: system-ui, -apple-system, sans-serif;
    margin: 2rem;
     }
*/

/* TODO integrate these styles with media queries above */

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 900px;
    margin-bottom: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #ccc;
    max-width: 900px;
    border: 1px solid #ccc;
}

.day-header {
    background-color: #f4f4f4;
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

.day-cell {
    background-color: #fff;
    min-height: 110px;
    padding: 6px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.day-cell.other-month {
    background-color: #f8f9fa;
    color: #a0a0a0;
}

.day-cell.past {
    background-color: #f0f0f0;
    color: #999;
}

.day-number {
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.event-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
}

.event-item {
    margin-bottom: 4px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    background: #eef5ff;
    padding: 2px 4px;
    border-radius: 3px;
}

.day-cell.past .event-item {
    background: #e4e4e4;
}

.event-link {
    color: #0056b3;
    text-decoration: none;
    font-weight: 500;
}
.event-link:hover {
    text-decoration: underline;
}

.event-text-disabled {
    color: #777;
    cursor: not-allowed;
}

.event-time {
    font-size: 0.7rem;
    color: #555;
    margin-right: 3px;
}

.event-time-disabled {
    color: #777;
    margin-right: 3px;
    cursor: not-allowed;
}

.controls {
    margin-top: 1rem;
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    text-decoration: none;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    display: inline-block;
}

.btn.disabled {
    background-color: #d6d6d6;
    color: #888;
    pointer-events: none;
    cursor: default;
}

.modal-dialog {
    border: none;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Styles the native backdrop created by showModal() */
.modal-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.modal-content {
    padding: 2rem;
    background: white;
    border-radius: 12px;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
}

.actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.actions-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e293b;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Polaroid effect */

@font-face {
  font-family: "Gochi Hand";
  src: url("./Gochi_Hand.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

.polaroid-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 3rem;
  padding: 3rem 1rem;
}

.polaroid {
  /*
   * The image is 264px wide. The frame adds 12px on each side:
   * 264 + 12 + 12 = 288px.
   */
  width: 264px;
  margin: 0;
  padding: 12px;

  background: #fdfcf7;
  border: 1px solid #e4e0d6;
  border-radius: 2px;

  box-shadow:
    0 3px 5px rgb(0 0 0 / 14%),
    0 14px 24px rgb(0 0 0 / 18%);

  box-sizing: content-box;
}

.polaroid img {
  display: block;
  width: 264px;
  height: auto;
}

/*
 * This becomes the enlarged lower Polaroid border.
 * The minimum height keeps even the short caption from looking cramped.
 */
.polaroid figcaption {
  min-height: 5rem;
  padding: 1rem 0.4rem 0.5rem;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  color: #151515;

  font-family:
      "Gochi Hand",
      cursive;
  /*
    "Comic Sans MS",
    "Bradley Hand",
    "Marker Felt",
    cursive;
*/
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.polaroid-left {
  transform: rotate(-2.5deg);
}

.polaroid-right {
  transform: rotate(2deg);
}

/* For version 2 with post it note */

.snapshot-with-note {
  position: relative;
  width: fit-content;
  margin: 3rem auto 7rem;
}

.polaroid {
  position: relative;
  z-index: 1;

  width: 264px;
  margin: 0;
  padding: 12px;

  background: #fdfcf7;
  border: 1px solid #e4e0d6;
  box-shadow:
    0 3px 5px rgb(0 0 0 / 14%),
    0 14px 24px rgb(0 0 0 / 18%);

  /*transform: rotate(2deg); - polaroid-right and polaroid-left will do this */
}

.polaroid img {
  display: block;
  width: 100%;
  height: auto;
}

.polaroid figcaption {
  min-height: 3.75rem;
  padding: 0.9rem 0.4rem 0.35rem;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  font-family:
      "Gochi Hand",
      cursive;
  /*
    "Marker Felt",
    "Bradley Hand",
    "Comic Sans MS",
    cursive;
*/
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.15;
  color: #111;
}

.paper-note {
  position: absolute;
  z-index: 2;

  width: 15rem;
  right: -7rem;
  bottom: -15.5rem; /* from playing in Inspector */

  margin: 0;
  padding: 1.25rem 1.15rem 1.4rem;

  background: #fff3a6;
  color: #222;

  font-family:
      "Gochi Hand",
      cursive;
  /*
    "Marker Felt",
    "Bradley Hand",
    cursive;
*/
  font-size: 0.95rem;
  line-height: 1.35;

  box-shadow:
    0 3px 5px rgb(0 0 0 / 18%),
    0 10px 18px rgb(0 0 0 / 14%);

  transform: rotate(-3deg);
}

.paper-note::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;

  width: 2rem;
  height: 2rem;

  background:
    linear-gradient(
      135deg,
      rgb(0 0 0 / 10%),
      #f3df78 45%,
      #fff3a6 46%
    );

  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

/* version 3 - lined notepaper */

/*.polaroid:hover,
.snapshot-with-note:hover*/
.rotate-right-on-hover:hover {
    transform: rotate(0deg) scale(1.02);
}

.rotate-left-on-hover:hover {
    transform: rotate(-3deg) scale(1.02);
}

.paper-note {
  background-color: #fffef3;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 1.55rem,
      #b9d3e8 1.55rem,
      #b9d3e8 1.6rem
    );

  padding: 2rem 1rem 1rem 2rem; /* top 2rem to align the font with the line */
  line-height: 1.6rem;
}

.paper-note::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.3rem;

  width: 1px;
  background: rgb(210 90 90 / 45%);
}

.paper-note .tape {
  position: absolute;
  top: -0.65rem;
  left: 50%;

  width: 5rem;
  height: 1.35rem;

  background: rgb(245 235 190 / 72%);
  box-shadow: 0 1px 2px rgb(0 0 0 / 12%);

  transform: translateX(-50%) rotate(2deg);
}
