
@import url('https://fonts.googleapis.com/css2?family=Nanum+Brush+Script&family=Yeon+Sung&family=Gamja+Flower&display=swap');

:root {
  --color-primary: #4A90E2; /* Main interactive elements, button background */
  --color-primary-dark: #357ABD; /* Button hover */
  --color-text-dark: #2C3E50; /* h1, #korean-name */
  --color-text-medium: #4A4A4A; /* p, main body text */
  --color-text-light: #7F8C8D; /* #tts-btn, hanja, romaja, calligraphy h3 */
  --color-background-light: #F8F8F8; /* body background, result/calligraphy card background */
  --color-border-light: #E0E0E0; /* input border, result/calligraphy card border */
  --color-placeholder: #CCCCCC; /* input placeholder */
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  background-color: var(--color-background-light);
  background-image: radial-gradient(var(--color-border-light) 1px, transparent 1px);
  background-size: 20px 20px; /* Adjust size for subtlety */
  color: var(--color-text-medium);
  display: flex;
  flex-direction: column; /* Arrange children in a column */
  justify-content: flex-start; /* Align items to the start (top) */
  align-items: center; /* Center items horizontally */
  min-height: 100vh;
  margin: 0;
}

.container {
  max-width: 500px;
  width: 100%;
  padding: 2.5rem; /* Increased padding */
  background-color: #fff; /* Keep white for now, as it's a specific container background */
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  text-align: center;
}

h1 {
  font-family: 'Gowun Batang', serif;
  font-size: 2.5rem;
  color: var(--color-text-dark);
  margin-bottom: 1rem; /* Increased margin */
}

p {
  color: var(--color-text-medium);
  line-height: 1.7; /* Slightly increased line-height for readability */
  margin-bottom: 1rem; /* More consistent spacing */
}

.input-container {
  margin: 2rem 0; /* Increased top/bottom margin */
  text-align: left;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem; /* Increased margin */
  color: var(--color-text-medium);
}

input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
}

input[type="text"]::placeholder {
  color: var(--color-placeholder);
}

button {
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease; /* Added transform transition */
  width: 100%;
}

a.button {
  display: block; /* Make the anchor behave like a block element */
  margin-top: 1.5rem; /* Add margin to separate from the calligraphy card */
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
  text-decoration: none; /* Remove underline from anchor tag */
  width: 100%;
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

a.button:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
}

.name-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

#tts-btn {
  background-color: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-text-light);
  transition: color 0.3s ease;
  width: 36px;
  height: 36px;
}

#tts-btn:hover {
  color: var(--color-primary);
}

#tts-btn svg {
  width: 100%;
  height: 100%;
}

.action-btn {
  background-color: var(--color-background-light);
  color: var(--color-text-medium);
  border: 1px solid var(--color-border-light);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
}

#loading {
  margin-top: 2rem; /* Increased margin */
  color: var(--color-text-medium);
}

.result-card {
  margin-top: 2.5rem; /* Increased margin */
  padding: 2.5rem; /* Increased padding */
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  background-color: var(--color-background-light);
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#korean-name {
  font-family: 'Gowun Batang', serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 0;
  animation: nameAppear 0.5s ease-out forwards; /* Added animation */
}

#hanja-name {
  font-size: 1.5rem;
  color: var(--color-text-light);
  margin-top: 1rem; /* Adjusted for better separation */
  margin-bottom: 1rem; /* Adjusted for better separation */
}

#romaja-pronunciation {
  font-size: 1.2rem;
  color: var(--color-text-light);
  margin-top: 0rem; /* Removed negative margin */
  margin-bottom: 1.5rem;
}

#name-meaning {
  font-size: 1rem;
  color: var(--color-text-medium);
  text-align: left;
  line-height: 1.8;
  margin-top: 1.5rem; /* Added margin-top for separation */
}



.calligraphy-card {
  margin-top: 2.5rem; /* Increased margin */
  padding: 2.5rem; /* Increased padding */
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  background-color: var(--color-background-light);
  text-align: center;
  display: flex;
  flex-direction: row; /* Changed to row for horizontal layout */
  justify-content: space-around; /* Distribute space evenly */
  align-items: center; /* Center items vertically */
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  gap: 1.5rem; /* Added gap for better spacing between calligraphy names */
}

.calligraphy-card h3 {
  font-family: 'Gowun Batang', serif;
  margin-bottom: 1rem;
  color: var(--color-text-light);
  text-align: left;
  width: 100%; /* Ensure title takes full width */
}

.calligraphy-card p {
  font-size: 3rem;
  color: #000; /* Keep black for calligraphy names */
  margin: 0 10px; /* Adjust margin for horizontal spacing */
  cursor: pointer; /* Add pointer cursor to indicate clickability */
  transition: transform 0.2s ease-in-out; /* Smooth transition for hover effect */
}

.calligraphy-card p:hover {
  transform: scale(1.1); /* Enlarge text on hover */
}

/* Styles for the hidden practice sheet for PDF generation */
.practice-sheet {
  position: absolute;
  left: -9999px; /* Hide off-screen */
  width: 210mm; /* A4 width */
  background: #fff; /* Keep white for print background */
  padding: 20mm;
  box-sizing: border-box;
}

#practice-title {
  font-family: 'Gowun Batang', serif;
  font-size: 24px;
  color: var(--color-text-medium);
  margin-bottom: 20px;
  text-align: center;
}

.practice-grid {
  display: flex;
  flex-direction: column;
  gap: 15px; /* Space between rows */
  width: 100%;
}

.practice-row {
  display: flex;
  gap: 15px; /* Space between name groups */
  justify-content: center;
}

.name-group {
  display: flex;
}

.grid-item {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border-light);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
}

/* Dotted crosshair guides */
.grid-item::before, .grid-item::after {
  content: '';
  position: absolute;
  background-color: transparent;
}

.grid-item::before { /* Vertical line */
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  border-left: 1px dotted var(--color-border-light);
}

.grid-item::after { /* Horizontal line */
  top: 50%;
  left: 0;
  height: 1px;
  width: 100%;
  border-top: 1px dotted var(--color-border-light);
}

.grid-item.traceable {
  color: var(--color-grid-traceable);
  opacity: 0.5; /* Increased opacity for better visibility */
}















#calligraphy-name-1 {







  font-family: 'Nanum Brush Script', cursive;







}















#calligraphy-name-2 {







  font-family: 'Yeon Sung', cursive;







}















#calligraphy-name-3 {































  font-family: 'Gamja Flower', cursive;































}































#calligraphy-name-4 {















  font-family: 'Gowun Batang', serif;















}































#calligraphy-name-5 {















  font-family: 'Jua', sans-serif;















}































#calligraphy-name-6 {















  font-family: 'Stylish', cursive;















}































#calligraphy-name-7 {















  font-family: 'East Sea Dokdo', cursive;















}































#calligraphy-name-8 {















  font-family: 'Dokdo', cursive;















}







@media (max-width: 600px) {







  .container {







    padding: 1.5rem; /* Reduce padding on smaller screens */







  }







}















.hidden {































  display: none !important;































}































/* Style for the new info-card */















.info-card {















  max-width: 500px; /* Match container width */















  width: 100%;















  margin: 2rem auto; /* Center it with spacing */















  padding: 2.5rem;















  background-color: var(--color-background-light); /* Changed to consistent background variable */















  border: 1px solid var(--color-border-light); /* Added border for consistency */















  border-radius: 16px;















  box-shadow: 0 8px 32px rgba(0,0,0,0.1);















  text-align: center;















  line-height: 1.8;















}































.info-card p {















    margin-bottom: 0.5rem; /* Reduce margin for paragraphs inside info-card */















}































.info-card p a {















    text-decoration: none;















    color: var(--color-primary);















    font-weight: 600;















}































.info-card p a:hover {































    text-decoration: underline;































}































#main-content-wrapper {































  display: flex;































  flex-direction: column;































  justify-content: center; /* Center content vertically initially */































  align-items: center; /* Center content horizontally */































  min-height: 100vh; /* Takes full viewport height */































  width: 100%;































}































/* Class added to #main-content-wrapper when button is clicked */































#main-content-wrapper.push-footer-down {































  justify-content: space-between; /* Pushes first and last items to ends */































  align-items: center; /* Re-center horizontally */































}































/* Style for info-card when it's pushed down */































#main-content-wrapper.push-footer-down .info-card {































  margin-top: auto; /* Pushes the card to the bottom */































}
/* Styles for the new blog highlight card */
.blog-highlight-card {
  max-width: 500px; /* Wider than main container for blog previews */
  width: 100%;
  margin: 2rem auto; /* Center with spacing */
  padding: 2.5rem;
  background-color: var(--color-background-light);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  text-align: center;
}

.blog-highlight-card h2 {
  font-size: 2rem;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
}

.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.blog-post-preview {
  background-color: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  padding: 1rem;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s ease-in-out;
}

.blog-post-preview:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.blog-post-preview h2 {
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--color-text-dark);
}

.blog-post-preview h2 a {
  text-decoration: none;
  color: var(--color-text-dark);
}

.blog-post-preview h2 a:hover {
  text-decoration: underline;
}

.blog-post-preview .meta-description {
  font-size: 0.9rem;
  color: var(--color-text-medium);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.blog-post-preview .read-more a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.blog-post-preview .read-more a:hover {
  text-decoration: underline;
}

.korean-name-stories-btn-container {
  margin-top: 1rem;
}
.korean-name-stories-btn-container .button {
  width: auto;
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .blog-highlight-card {
    padding: 1.5rem;
    margin: 1.5rem auto;
  }
  .blog-highlight-card h2 {
    font-size: 1.6rem;
  }
  .blog-posts-grid {
    grid-template-columns: 1fr; /* Stack on smaller screens */
  }
}
